Link to other Sites Ideas Link to other Sites Ideas
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Link to other Sites Ideas

Started by skyer2000, July 21, 2004, 11:17:51 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

skyer2000

I've searched through topics and have seen every attempt to make it so that coppermine could link to another mirror instead of the albums folder, was shot down. This is a HUGE limitation that no one seems to care about. Since my website is based around media, having everything on the same server is pretty crazy. So, i tried some ideas and actually got VERY close to one of them working.

I uploaded a dummy file to the albums folder "dummy.jpg". Then I went into phpmyadmin, went to the pictures database, and edited the information. For the picture URL I changed it to what I wanted (http://differentdomain.com/) and the filename (realfile.wmv). I then went back into the album view, it recongized it was a .wmv file, but didn't play. So i viewed the source, and the ONLY thing holding it back from working was a /album/ infront of the URL. If that /album/ was not there, it would work perfectly.

Is there something I can edit so that the /album/ has to be manually added, or if i can just plain take that out and add it back through phpmyadmin to all the files? Anyways I hope you guys consider this post more than you have with the others, I really think I'm close to getting this to work.

Joachim Müller

it's not that easy I'm afraid - of course you could get rid of the "albums" thingy in the url, but how is coppermine supposed to generate intermediate files and thumbnails on a remote server? You would have to manually create them on the remote server, and you would have to modify the coppermine database entries manually each time you want to add an image to your gallery. The point of using coppermine is that it generates the additional views for your files on the fly. If you want to do everything manually, then there's no need for you to use coppermine anyway, you could code your gallery with plain html (just a collection of links to remote servers).
Your idea has been discussed in the past mayn times over - I won't repeat this discussion. If you manage to come up with some code that does what you want it to do, then fine. You're welcome to post your hacks as well. But there's no support for this general idea, as it leads nowhere the dev team wants to go.

GauGau

skyer2000

I actually believe it would be kind of easy. Again i'm not professional at the code or anything, but it just seems to make sense to me this way.

Somehow manipulate it so that when it posts into the mysql database, it posts everything "/albums/gallery/pictures" and not just "/gallery/pictures". Then back at when it displays the image, have it pull up the full path instead of automatically adding "/albums" in front of it. So in the code it will be <img src="/albums/gallery/pictures/pic.jpg">.

This way, when you go back through phpmyadmin and edit the url, it will not add albums in front of it. And for the pictures that are hosted on the server, they will not have to be touched. So you still have the automation, and you have the ability of linking to other sites.

So this is what I think has to happen
-A variable has to be changed so that when it submits to the database, it adds "/albums/" infront of it
-And a variable needs to be changed so when you view the picture, you don't have "/albums/albums/gallery"

So to me, the non-php coder, this seems to make sense. What do you think?

Joachim Müller

like I said, it doesn't work that way. You're welcome to try, go ahead and code the modifications. We (the dev coppermine team) will not.

GauGau

skyer2000

#4
Alright, please bare with me a little longer. If it doesn't work that way, then how does it? What goes on to make it so that the /albums/ has to be automatically in front of the URL? It makes more sense to me that the /albums/ is placed in front automatically in effort to save database room (to eliminate having /albums/ in every single entry makes it smaller). Are you sure it's just not a spacesaver thing? If not, can you please give me a little rundown on how it posts with /albums/ in front and why?

Tarique Sani

Look at the function add_picture adds the picture to the database, function get_pic_url gets the URL of the picture - may be this is where you should be looking. If you can manage to convince this function to return the URL of the image then you are in business. 

Do post your mod if you manage one
SANIsoft PHP applications for E Biz

skyer2000

When looking through code i found this in includes/functions.inc.php

// Return the url for a picture, allows to have pictures spreaded over multiple servers
function get_pic_url(&$pic_row, $mode)
{
        global $CONFIG,$THEME_DIR;

        static $pic_prefix = array();
        static $url_prefix = array();

        if (!count($pic_prefix)) {
                $pic_prefix = array(
                        'thumb' => $CONFIG['thumb_pfx'],
                        'normal' => $CONFIG['normal_pfx'],
                        'fullsize' => ''
                );

                $url_prefix = array(
                        0 => $CONFIG['fullpath'],
                );
        }

        $mime_content = get_type($pic_row['filename']);
        $filepathname = null;


When it says "multiple servers" does it mean exactly what I want? Or am i interpretting it incorrectly?

Tarique Sani

Please read the code, figure out, and post your solution :)
SANIsoft PHP applications for E Biz

skyer2000

Been looking through the code, still no luck. (remember i'm just a newbie when it comes to php). I did however come up with another possible solution and was wondering what you guys thought.

Make the document something that once you click the thumbnail to view it, it automatically executes a script or something of that matter that pops a window above to a desired location. So sort of like a pop-up advertisement... but... different.

skyer2000

#9
Checked into it some more, here's what i've come up with....

Make it so that you upload a html file that contains a simple redirect script to the movie you want.

So I went into the database and added (html , text/html , document) in the filetypes database, it recognizes its a html file and even has a thumbnail for it. However, whatever html file i upload, then later click on it in the album, it says that it cannot be found. The really weird thing about it is even when i manually type in its location, it says not found. In the ftp program however, it can find the file and has the code i want (i've tried different code to see if that was the problem).

If I can get it to open the html file, we're in business.

skyer2000

GOT IT WORKING NOW

Finally! Had to do a little workaround but now the gallery can link to other sites EASILY. While not embedded it still functions exactly how I need it too. For some reason html was not showing up, so i gave up even trying with that. So i enabled php extensions to work, put regular html redirect code in the php file, uploaded it, and walla. Click on the image like you would with any other document and it redirects you to any page you specify (whether it be video, image, audio, or just another website). I don't know if you would even consider this a mod, but it truly helps out for people that have content way to large to fit all on their server.

Here's an example of the redirect code in the php file i uploaded

<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.yoursite.com/file.wmv">

I added the custom thumbnail, worked perfect. Want me to post this as a hack or somethin?

Tarique Sani

Yes post the hack here... We will move it to its proper place in Hacks / Mods
SANIsoft PHP applications for E Biz

Joachim Müller

as skyer2000 seems reluctant to resolve this thread, I will do so: http://forum.coppermine-gallery.net/index.php?topic=8287

GauGau