coppermine-gallery.com/forum

Support => Older/other versions => cpg1.3.x Support => Topic started by: unknown12 on May 10, 2005, 06:22:02 PM

Title: .txt files
Post by: unknown12 on May 10, 2005, 06:22:02 PM
When i add .txt files to my gallery, and go to them, i have to click again (the link that would bring up a full res image) to bring up the file. Is there any way I can intergrate this so i don't have to click the link that opens a new window?

thanks
Title: Re: .txt files
Post by: Nibbler on May 10, 2005, 06:41:23 PM
Open your displayimage.php, find:

$mime_content = get_type($CURRENT_PIC_DATA['filename']);

and add under it

if ($mime_content['extension'] == 'txt'){
$url = get_pic_url($CURRENT_PIC_DATA, 'fullsize');
header("Location: http://www.yoursite.com/coppermine/$url");
exit;
}
Title: Re: .txt files
Post by: unknown12 on May 10, 2005, 09:10:11 PM
thanks.
Title: [again] .txt files
Post by: unknown12 on May 10, 2005, 09:54:35 PM
in this (http://forum.coppermine-gallery.net/index.php?topic=17804.0) i got a code to forward to the text file. Is there anyway to get it to forward to the id of the text file, like 0.txt 1.txt etc?

thanks.
Title: Re: [again] .txt files
Post by: unknown12 on May 11, 2005, 04:40:05 PM
bump
Title: Re: [again] .txt files
Post by: Hein Traag on May 11, 2005, 08:22:23 PM
You might want to ask this question in the thread where you got that code. Opening up a new thread only serves to make the forum messy.
And bumping like this is something you better not do if you expect people to help out.
Title: Re: [again] .txt files
Post by: unknown12 on May 11, 2005, 08:30:29 PM
thanks for the tip. But the other thread is "solved"
Title: Re: [again] .txt files
Post by: Hein Traag on May 11, 2005, 08:31:51 PM
But not closed. Post the question there and a mod can always "unsolve" it if need be.
Title: Re: .txt files
Post by: Joachim Müller on May 12, 2005, 09:05:20 AM
merged the two threads that were mentioned above.
Title: Re: .txt files
Post by: unknown12 on May 12, 2005, 09:25:35 PM
thanks.
Title: Re: .txt files
Post by: Nibbler on May 13, 2005, 05:05:43 PM
I don't understand what you are asking, can you elaborate/provide an example ?
Title: Re: .txt files
Post by: unknown12 on May 13, 2005, 05:10:10 PM
in the code you gave me $url is the link to the file. How can i have a var that contains the pos of the file?

thanks.
Title: Re: .txt files
Post by: Nibbler on May 13, 2005, 05:29:39 PM
I don't think you can.