bbcode URL below intermediate image - Page 2 bbcode URL below intermediate image - Page 2
 

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

bbcode URL below intermediate image

Started by Stramm, July 29, 2006, 01:17:11 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

clothahump

Stramm, this is for you, took me a while to sort it out but it works, Just need to find some way to shorten the resulting code as it spreads the page.

<?php
if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');

// Add a filter
$thisplugin->add_filter('file_data','imglnk_add_data');


function 
imglnk_add_data($pic_data){ //$pic_data
global $CONFIG;
$fullsize_url get_pic_url($pic_data);
      
$thumb_url get_pic_url($pic_data);
//you can grab intermediate and thumb URL to just comment out what you need and add the var below
$thumb_url get_pic_url($pic_data'thumb');
$normal_url get_pic_url($pic_data'normal');

$pic_data['html'] = $pic_data['html'].'<br>[url='.$CONFIG['ecards_more_pic_target'].$fullsize_url.'][IMG]'.$CONFIG['ecards_more_pic_target'].$thumb_url.'[/IMG][/url]<br>'
return $pic_data
}
?>

Stramm

Why not just add a linebreak </ br> between fullsized and thumb URL?

clothahump

That results with the thumb showing but the link code to the full sized image remains as viewable code on the page.
Had we better discuss this in another thread before we get told off again?

Stramm


green4gfx

#24
it is posible to get the thumb whit the filepath ?
i mean the position link in the gallery

// wenn ich das link plug in instaliere wird die code abfrage von Captcha nich mehr angezeigt !!!
[

MastiMasti


(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwafakadard.com%2Fcopperminealbums%2Fuserpics%2F10001%2FHimesh-Reshammiya.jpg&hash=76e111f7f38431a4f980a618e193ad7fdd4b6a29)


Hey I just send to you PM  about this

I am having a problem

I am getting this link


http://wafakadard.com/copperminealbums/userpics/10001/Himesh-Reshammiya.jpg
I am gettign IMG code right but  not "/"

http://wafakadard.com/coppermine/albums/userpics/10001/Himesh-Reshammiya.jpg

I am missing this "/" between gallery name and ALBUM

so how can I fix that?????

Stramm

no PMs unless requested

your problem isn't a plugin prblem. You just need to properly setup your gallery. Eg. mail confirmations / links in mails shouldn't work also

-> config - general - URL of your coppermine gallery folder
as suggested in the instructions a slash needs to follow the path

MastiMasti

thanks for quick reply

problem fix now  :) with your help

thanks  :)

ds

Hi there,

I've slightly modified this plugin to fit my needs and I thought I should post my findings here for anyone that may have a similar problem aswell as for Stramm to have a look at it and maybe give me some pointers.

Before I post my code, let me talk you through my scenario:

- I only wish to display the url of the intermediate picture below it. (that's no problem at all by editing the codebase.php)


Once I had done that I noticed something:

- If an image was too small to have an intermediate image created, the link wouldn't work!


So here is my updated solution. I check if the intermediate image exists and if it doesn't it shows the image path to the original image (which is the fullsize_url). On top of that I put the code into a text field to avoid lengthy urls to break the page layout and added a little javascript to autohighlight the whole code once clicked so it can easily be copied to the clipboard.

I've added info to the code to it's simple to see what I've done. I hope this comes in helpful to some users.


Here is the codebase.php code:


<?php
if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');

// Add a filter
$thisplugin->add_filter('file_data','imglnk_add_data');


function 
imglnk_add_data($pic_data){ //$pic_data
global $CONFIG;

//you can grab intermediate and thumb URL to just comment out what you need and add the var below

// this is the fullsize image url
$fullsize_url get_pic_url($pic_data); 

// this is the thumbnail URL 
// Edited out as not needed in standard
//$thumb_url = get_pic_url($pic_data, 'thumb'); 

// this is the intermediate picture
$normal_url get_pic_url($pic_data'normal'); 

//
// start check for small images (if no intermediate created)
// if intermediate pic exists, show it
if (file_exists($normal_url)) { 

$pic_data['html'] = $pic_data['html'].'<div align="center"><form name="links"><br /><b>To post this image in forums, please click and copy the code below:</b><br /><br /><input name="normal" class="textinput" value="[IMG]'.$CONFIG['ecards_more_pic_target'].$normal_url.'[/IMG]" size="80" type="text" onClick="javascript:this.form.normal.focus();this.form.normal.select();"><br /></form></div>'

} else { // if the image was too small for intermediate picture to have been created, show original full url

$pic_data['html'] = $pic_data['html'].'<div align="center"><form name="links"><br /><b>To post this image in forums, please click and copy the code below:</b><br /><br /><input name="normal" class="textinput" value="[IMG]'.$CONFIG['ecards_more_pic_target'].$fullsize_url.'[/IMG]" size="80" type="text" onClick="javascript:this.form.normal.focus();this.form.normal.select();"><br /></form></div>';

}

// end check
//

return $pic_data//page output
}
?>




Many thanks to Stramm for his work on all these great plugins. :)


Deadfire

My questions are only about this screen shot here:

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fimg82.imageshack.us%2Fimg82%2F6232%2Funtitleddl4.png&hash=23e389cd07a66ff24c4f9016a5e829ebee271cb9)

1. Why would this pop up happen when I have used a copy button many times before on firefox and nothing of this sort appeared.

2. It seems to have "security" spelt wrong

3. Where in the world can I remove this and/or change it?

ds

Hi Deadfire,

I think this is the wrong topic for your plugin. The one you mean is this one: http://forum.coppermine-gallery.net/index.php?topic=36302.0
The one here doesn't use the copy buttons ;-)

The first post  in the above topic explains the security settings for Firefox.

Deadfire

Heh, it appears that I am in the wrong thread thanks for the notice DS

Disregard as well then

Joachim Müller

@Stramm: as far as I can see, copy/ paste bbcode img URL below intermediate image v1.1 is an update to this plugin.
If this is correct, this thread should be moved from the contributions board to the regular plugin board imo, as it doesn't make sense to keep outdated plugins in the contrib folder - chances are high that the older version will be used simply because users are not aware that the is a newer version available.

Joachim

Stramm