forum.coppermine-gallery.net

Support => cpg1.4 plugins => cpg1.4.x Support => Older/other versions => cpg1.4 plugin contributions => Topic started by: Stramm on September 16, 2006, 07:16:10 pm

Title: copy/ paste bbcode img URL below intermediate image
Post by: Stramm on September 16, 2006, 07:16:10 pm
This plug-in shows copy/ paste ready bbcode for bulletin boards below the intermediate image. It links to the fullsized image either with a text link (title) or the image thumb. You will have to allow hotlinking if you want to use it over domains! The copy button only works within IE. Unfortunately firefox security settings do not allow that without modifying prefs.js. So the script displays a warning if a firefox user hits the copy button to copy the text manually.

10/25/2006: new version 1.2, fixes the lil glitch mentioned here http://forum.coppermine-gallery.net/index.php?topic=36302.msg175557#msg175557


[Edit GauGau 2010-03-03]
This plugin has been added to the subversion repository: http://coppermine.svn.sourceforge.net/viewvc/coppermine/branches/cpg1.4.x/plugins/bbcode_below_intermediate

It has been updated as well to reflect the version checking routines in the plugin manager that are meant to make sure that galleries don't break because of plugins installed that aren't meant for that particular version of the gallery.

Download: https://sourceforge.net/projects/coppermine/files/Plugins/1.4.x/cpg1.4.x_plugin_bbcode-below-intermediate_v1.3.zip/download
[/Edit]
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: barbv59 on September 29, 2006, 05:51:28 am
So this only works for Forums? How do you install this?
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Sami on September 29, 2006, 07:43:53 am
This will give you a bbcode version of fie URL and Title you can use it anywhere that accept bbcode
and you should unpack the bbcod.zip under your plugins folder and use plugin manager (config=>general) to install it
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Davide Renda on September 29, 2006, 11:18:35 pm
I've deleted on lines 47 and 52 the buttons forms removing from both lines following code:
Code: [Select]
<input type="button" value="Copy" onclick=\'copy_clip("'.$img_url.'")\'>

Firefox users are more and more and that error message may generate useless panic among users...!!

Apart from this, great plugin Stramm  ;) (as usual!)
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on September 30, 2006, 07:04:59 am
You're free to modify the code as you want. This is just a note to Firefox users that due to the browsers security settings it's not possible to use the copy button.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: MrBlue on October 13, 2006, 08:25:17 pm
Fine PlugIn, but i have one problem:

in the bb_code Text-Link there appears "No Title"! But the picture Have a title!

I havn't install other PlugIn's.

And the second point:
I would have the link to the picture-info-site (not directly to the fullsize image) What must i change?

Thanks for answer!

Greetings
MrBlue

Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on October 16, 2006, 08:29:35 am
1. lil bug
find in codebase.php
Code: [Select]
$CURRENT_PIC_DATA['title']replace with
Code: [Select]
$pic_data['title']
2. the path to the pic is stored in the var $fullsize_url
if you want a different one, you have to modify it... eg. replace
Code: [Select]
$fullsize_url = get_pic_url($pic_data);  //here we grab the url to the fullsized picwith
Code: [Select]
$fullsize_url = 'displayimage.php?pos=-'.$pic_data['pid'];
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: MrBlue on October 16, 2006, 08:29:08 pm
Thx for reply :)

works fine!
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: b4uphotos on October 18, 2006, 10:57:16 am
is there any how any way ?

so that we can hide the bbcode to visitors and only admin can view that
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on October 18, 2006, 11:05:40 am
open codebase.php and after
Code: [Select]
global $CONFIG;add
Code: [Select]
if (!(GALLERY_ADMIN_MODE)) return $pic_data;
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: b4uphotos on October 18, 2006, 04:16:57 pm
thanks!

ITs working fine.

Thanks a lot!

With Best Regards!
Anand Maheshwari
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: realchaos1 on October 19, 2006, 12:31:15 am
i dont want the thumbnail image, any alternative?
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: realchaos1 on October 19, 2006, 12:48:32 am
wait i take back what i said, i modified it so it works... works great now BUT...

ONLY I can see this plugin... none of my members can...

*edit* figured it out, I put

Code: [Select]
if (!(GALLERY_ADMIN_MODE)) return $pic_data;
in when suggested above, i deleted that and now members can see it.

I attempted to insert onClick="highlight(this);" to allow automatic selecting when someone clicks the text area, but it doesnt work for some reason...

here is a copy of my codebase.php,

demo: http://nissanpacific.com/gallery/displayimage.php?album=17&pos=9

Code: [Select]
<?php
if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');

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


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


//here we define a var that holds the copy to clipboard javascript 
//unfortunately the Firefox security settings do not allow clipboard copy to work without modifying prefs... 
//therefore only a msg pops up if a user uses netscape/ firefox and presses the copy button
$script_data = <<< EOT

<script language="javascript" type="text/javascript">
<!--
function copy_clip(bb_text)
{
 if (window.clipboardData) 
   {
    window.clipboardData.setData("Text", bb_text);
   }
   else if (window.netscape) 
   { 
    alert("Not possible");
   }
   return false;
}
//-->
</script>
EOT;

$fullsize_url get_pic_url($pic_data);  //here we grab the url to the fullsized pic
$thumb_url get_pic_url($pic_data'thumb'); //thumb url

$pic_data['title'] ? $name $pic_data['title'] : $name 'No Title'//chcking if the pic has a title, if not we set it to 'No title'

//here we define the actual bbcode coppermine path + the path to the pic $img_url is for the version that displays the thumb, $name_url is for a txt link with the ikmage title
$img_url '[url='.$CONFIG['ecards_more_pic_target'].$fullsize_url.'][IMG]'.$CONFIG['ecards_more_pic_target'].$fullsize_url.'[/IMG][/url]';
$name_url '<img src="'.$CONFIG['ecards_more_pic_target'].$fullsize_url.'" />';


//this just brings everything in form... we create a table etc.
$bbcode_data '<table align="center" width="'.$CONFIG['picture_width'].'">'.$script_data.'<tr>';
$bbcode_data .= '<td>BBCode/Forum (Copy/Paste)</td>';
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="40" style="overflow:off;" onClick="highlight(this);">'.$img_url.'</textarea></td>';

$bbcode_data .= '</tr><tr>';

$bbcode_data .= '<td>HTML/Myspace (Copy/Paste)</td>';
$bbcode_data .= '<td><textarea name="bbcode" rows="3" cols="40" onClick="highlight(this);">'.$name_url.'</textarea></td>';

$bbcode_data .= '</tr></table>';

//finally we add the created stuff to the picture data and return it to coppermine
$pic_data['html'] = $pic_data['html'].$bbcode_data

return $pic_data
}
?>


[  u  r  l  = http://nissanpacific.com/gallery/albums/formulad/gallery_330_13_125905.jpg ]  [  I  M  G  ] http://nissanpacific.com/gallery/albums/formulad/gallery_330_13_125905.jpg [ / i m g ] [ / u r l ]
[edit GauGau]Replaced hotlinked advertizing pic with attachment (not related to this thread).[/edit]
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on October 19, 2006, 08:57:36 am
not related to the plugin, just a javascript problem
(you can't call a function that hasn't been defined -> write the function highlight())
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: akulion on October 24, 2006, 02:55:50 pm
Thanks for this plugin - just what I needed and works wonderfully :D
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Iced Coffee on October 25, 2006, 07:03:28 am
Please help with this:
[edit GauGau] Replaced hot-linked image with attachment [/edit]

The rows are doubled, I don't know why. Can anyone help to solve this?
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Iced Coffee on October 25, 2006, 07:07:42 am
And can we modify this so the picture will be linked to the picture page, not the full-size image? I want my member to use this code to post pictures on other forum but when clicked they will go to my gallery.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on October 25, 2006, 08:36:18 am
the plugin interfers with another one... move it up or down in the plugin manager
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on October 25, 2006, 07:40:27 pm
And can we modify this so the picture will be linked to the picture page, not the full-size image? I want my member to use this code to post pictures on other forum but when clicked they will go to my gallery.

read this thread
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: jesseg on October 25, 2006, 10:23:22 pm
The plugin works great, but the image url show "localhost" instead of my domain name...  any suggestions?
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: jesseg on October 25, 2006, 11:03:59 pm
nevermind figured it out (admin config).  But can I modify the code to show the img src such as "<img src=www....>"?
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on October 26, 2006, 09:28:43 am
yes, you need to set the url to your gallery in Coppermines config. That's part of the setup. Read the docs...

To change the bbcode you have to edit codebase.php... Have a look at it. If you know your way around in html you should be able to modify the code to your needs
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Iced Coffee on October 31, 2006, 01:57:41 am
the plugin interfers with another one... move it up or down in the plugin manager

I don't understand, can you explain more? Thanks.


read this thread

Sorry, which thread, Stramm?
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Joachim Müller on October 31, 2006, 05:00:14 am
This very thread that you're reading at the moment.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Iced Coffee on November 01, 2006, 08:13:23 am
This very thread that you're reading at the moment.

Sorry I am so dumb. I found it now.

But what about my first question?
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on November 01, 2006, 08:20:27 am
Quote
the plugin interfers with another one...
looks like you have more plugins installed. This plugin has problems with another.

Quote
move it up or down in the plugin manager
open the plugin manager as you've done when you installed the plugin. Then look out for little up/ down arrows on the right side of all the installed plugins. Click these lil arrows to move the plugin in question up or down in the plugin manager. This will change the execution priority and solve your issues
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Iced Coffee on November 02, 2006, 04:55:10 am
looks like you have more plugins installed. This plugin has problems with another.
open the plugin manager as you've done when you installed the plugin. Then look out for little up/ down arrows on the right side of all the installed plugins. Click these lil arrows to move the plugin in question up or down in the plugin manager. This will change the execution priority and solve your issues

Thanks a lot Stramm. The problem is solved for both Pic Poster v1.0 and Copy /Paste BB Code image url v1.1 I am using. I found out that these plugins should be everywhere except for the end of the list and we can avoid this problem. Just move it up one level (regardless which one is at the end).
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: AWJunkies on December 08, 2006, 09:08:25 am
So is this my mod basically from year+ ago but as a plugin? I will try to find the link if you can add my code as a blug in. It aloud for more options for forums etc. I even added a section for admins can view all sections or users can view in there albums only for complete album bbcode. I have that mod on here as well from a year ago. I will bring them all back and put them in plugin form to make it easier then modifying peoples files.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: boltonline on December 18, 2006, 08:54:44 pm
is there a way to make it so only loged in users can view the links?
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on December 18, 2006, 09:28:59 pm
codebase.php... after
Code: [Select]
function bbcode_add_data($pic_data){ //$pic_data
global $CONFIG;

add

Code: [Select]
if(!USER_ID) return $pic_data;
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: boltonline on December 18, 2006, 11:35:38 pm
codebase.php... after
Code: [Select]
function bbcode_add_data($pic_data){ //$pic_data
global $CONFIG;

add

Code: [Select]
if(!USER_ID) return $pic_data;
thanks!
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: boltonline on December 26, 2006, 09:31:13 pm
how would this plugin be modified to add a third line with the code to directly input to a blog or something like myspace where the link has to be <img src="LINK GOES HERE">
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on December 28, 2006, 07:14:22 am
just have a look at the code. Pretty much self explaining

in the few lines of codebase.php search for
Code: [Select]
$bbcode_data .= '<td>[url]title[/url]</td>';
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="40">'.$name_url.'</textarea><input type="button" value="Copy" onclick=\'copy_clip("'.$name_url.'")\'></td>';

and below add
Code: [Select]
$bbcode_data .= '</tr><tr>';

$bbcode_data .= '<td>to blog</td>';
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="40">'.replace_this_with_the_link_to_your_blog.'</textarea><input type="button" value="Copy" onclick=\'copy_clip("'.$replace_this_with_the_link_to_your_blog.'")\'></td>';
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: boltonline on December 29, 2006, 04:49:06 pm
just have a look at the code. Pretty much self explaining

in the few lines of codebase.php search for
Code: [Select]
$bbcode_data .= '<td>[url]title[/url]</td>';
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="40">'.$name_url.'</textarea><input type="button" value="Copy" onclick=\'copy_clip("'.$name_url.'")\'></td>';

and below add
Code: [Select]
$bbcode_data .= '</tr><tr>';

$bbcode_data .= '<td>to blog</td>';
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="40">'.replace_this_with_the_link_to_your_blog.'</textarea><input type="button" value="Copy" onclick=\'copy_clip("'.$replace_this_with_the_link_to_your_blog.'")\'></td>';

well thats what i tried but it didnt work becuase its coming out like:
Code: [Select]
[url=LINK GOES HERE][IMG]LINK GOES HERE[/img][/url]
i need it like this:
Code: [Select]
<img src="LINK GOES HERE">
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on December 29, 2006, 05:26:05 pm
$name_url

look at that var, then define a new one that fullfills your needs and use it instead of $name_url in the code you added
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: boltonline on December 29, 2006, 06:06:12 pm
thanks! i finally got it to work. this is what i did

under
Code: [Select]
$name_url = '[url='.$CONFIG['ecards_more_pic_target'].$fullsize_url.']'.$name.'[/url]';
add
Code: [Select]
$name_url2 = '<img src='.$CONFIG['ecards_more_pic_target'].$fullsize_url.'>';

under
Code: [Select]
$bbcode_data .= '<td>[url][img][/url]</td>';
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="40" style="overflow:off;">'.$img_url.'</textarea><input type="button" value="Copy" onclick=\'copy_clip("'.$img_url.'")\'></td>';

add
Code: [Select]
$bbcode_data .= '</tr><tr>';

$bbcode_data .= '<td>to blog</td>';
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="40">'.$name_url2.'</textarea><input type="button" value="Copy" onclick=\'copy_clip("'.$name_url2.'")\'></td>';
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: lukasino on January 22, 2007, 11:42:10 am
If you want add Code to WWW with Thumb.

Add
Quote
      $img_url2 = '<a href='.$CONFIG['ecards_more_pic_target'].$fullsize_url.'><img src=http://youlink.com /'.$thumb_url.'/></a>';
Where http://youlink.com is adres to your website

Find:
Quote
   $bbcode_data .= '</tr></table>';

Before add:
Quote
   $bbcode_data .= '<td></td>';

   $bbcode_data .= '<td><textarea name="bbcode" rows="2" cols="30" style="overflow:off;">'.$img_url2.'</textarea><input type="button" value="Copy to WWW" onclick=\'copy_clip("'.$img_url.'")\'></td>';

Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: zrbarnes on February 23, 2007, 09:11:31 am
I don't really know where to post this, so hopefully this is the best place. I modified your BB code plugin so that it would display html tag links instead, and combined it with the javascript toggle display div to make it visible only when you click on a link that sits below the picture. I also removed the copy code, because it didn't support FF.

You can also easily comment out if you don't want any of the particular sizes to be displayed.

The only problem that I have is that once you click the link, you can't make it invisible again until the page reloads, because the css in

Code: [Select]
<div id="hotlinking" style="display: none; margin: 0px 20px 0px 20px;">
needs to be actually inserted into the head of the document or into an externally linked css file as:

Code: [Select]
div#hotlinking {
display: none;
margin: 0px 20px 0px 20px;
}

If anyone knows how to get around this, let me know. In the meantime, its not that big of a deal. Its more of a personal preference.

Code: [Select]
<?php
/**************************************************
  CPG BB Code Plugin for Coppermine Photo Gallery 
  Modified by Zachary Barnes of UselessHacks.com
Now creates html tags instead of BB
  *************************************************
  Copyright (c) 2006 Thomas Lange <stramm@gmx.net>
  *************************************************
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  *************************************************
  Coppermine version: 1.4.9
  BB Code Plugin version: 1.2
  $Revision: 1.0 $
  $Author: stramm $
***************************************************/


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

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


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

//Javascript to hide hotlinking information along with div arrangement, taken from a common toggling script floating around the net
$script_data = <<< EOT

<script language="javascript" type="text/javascript">
<!--
function toggleLayer(whichLayer)
{
if (document.getElementById)
{
// this is the way the standards work
var style2 = document.getElementById(whichLayer).style;
style2.display = style2.display? "":"block";
}
else if (document.all)
{
// this is the way old msie versions work
var style2 = document.all[whichLayer].style;
style2.display = style2.display? "":"block";
}
else if (document.layers)
{
// this is the way nn4 works
var style2 = document.layers[whichLayer].style;
style2.display = style2.display? "":"block";
}
}
//-->
</script>

<a href="javascript:toggleLayer('hotlinking');" title="View Hotlinking Information">View Hotlinking Information</a>
<div id="hotlinking" style="display: none; margin: 0px 20px 0px 20px;">

EOT;
    
    
$thumb_url get_pic_url($pic_data'thumb');  //here we grab the url to the thumb url
$int_url get_pic_url($pic_data'normal');  //intermediate pic
$full_url get_pic_url($pic_data'fullsize');            //fullsized pic
$pic_data['title'] ? $name $pic_data['title'] : $name 'No&nbsp;Title'//checking if the pic has a title, if not we set it to 'No title'

//Generating the file paths for each picture size

$tn_url '&lt;a&nbsp;href="'.$CONFIG['ecards_more_pic_target'].$int_url.'"&gt;&lt;img&nbsp;src="'.$CONFIG['ecards_more_pic_target'].$thumb_url.'"&nbsp;alt="'.$name.'"&nbsp;/&gt;&lt;/a&gt;';
$im_url '&lt;a&nbsp;href="'.$CONFIG['ecards_more_pic_target'].$full_url.'"&gt;&lt;img&nbsp;src="'.$CONFIG['ecards_more_pic_target'].$int_url.'"&nbsp;alt="'.$name.'"&nbsp;/&gt;&lt;/a&gt;';
$fs_url '&lt;img&nbsp;src="'.$CONFIG['ecards_more_pic_target'].$full_url.'"&nbsp;alt="'.$name.'"&nbsp;/&gt;';

//this just brings everything in form... we create a table etc., 

$bbcode_data $script_data;
$bbcode_data .= '<table align="center" width="'.$CONFIG['picture_width'].'">';

//thumbnail image code with link to intermediate image
$textarea_prop 'name="bbcode" rows="1" cols="50" style="overflow:off; white-space:nowrap" readonly="readonly"';

$bbcode_data .= '<tr><td>Thumbnail:</td></tr>';
$bbcode_data .= '<tr><td><textarea '.$textarea_prop.'>'.$tn_url.'</textarea></td></tr>';

//intermediate image code with link to fullsize image
$bbcode_data .= '<tr><td>Intermediate:</td></tr>';
$bbcode_data .= '<tr><td><textarea '.$textarea_prop.'>'.$im_url.'</textarea></td></tr>';

//fullsize image code
$bbcode_data .= '<tr><td>Fullsize:</td></tr>';
$bbcode_data .= '<tr><td><textarea '.$textarea_prop.'>'.$fs_url.'</textarea></td></tr>';

//closing table and visiblity div
$bbcode_data .= '</table></div>';



//finally we add the created stuff to the picture data and return it to coppermine
$pic_data['html'] = $pic_data['html'].$bbcode_data

return $pic_data
}

?>


EDIT: Fixed a few bugs. Now trying to find a replacement for 'wrap="off"' that validates under xhtml.

EDIT: The good news is that the above code is now XHTML valid.

Apparently, everyone is looking for a wrap=off equivalent that validates under xhtml, but it doesn't exists. So to keep all the text on one line, I've used "&nbsp;" for all of the spaces, effectively linking everything together. Unfortunately, in FF, if your picture title has a space in it, it will chop it up to two lines. IE6 works fine, and keeps everything on the same line.

So, you could increase the rows to 'rows="2"', or you could remove the 'alt="$name"' attribute, but I'm sticking with it like it is unless anyone has any work-arounds or suggestions.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: donofnet on March 17, 2007, 02:58:14 pm
when i modified the plugin so that thumb links to the image page, it stopped working for blog code, how can i make it to work so that the bb thumb links to image page and it also shows the correct code for blogs and myspace etc. ??? ??? ??? ???
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: zrbarnes on March 21, 2007, 05:26:42 am
Are you starting with my version or the original?
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: donofnet on March 23, 2007, 06:14:33 pm
Are you starting with my version or the original?

the thing is your modified plugin shows only img code and original plugin shown only bbcode i wish to display both of them, and important point to remember is the thumbnail must link to intermediate image page, i got it to work to display img code and bb code but can't make it to link bb thumb to intermediate page.

please tell me how to do that.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: donofnet on March 25, 2007, 08:53:32 am
Please anyone help me out
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on March 31, 2007, 09:04:22 am
please read the thread to find examples on how to modify the bbcode plugin code to fit your needs
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Alcor on April 13, 2007, 12:49:47 pm
Hello!

How can I hide the copy/paste bbcode if an album is private for guests but not for the users, and I don't want that they can use it in forums? I added this but it doesn't work.

Code: [Select]
function bbcode_add_data($pic_data){ //$pic_data
global $CONFIG, $ALBUM_DATA;
$a_data = $ALBUM_DATA['visibility'];
...

and...

Code: [Select]
<a href="javascript:toggleLayer('hotlinking');" title="View Hotlinking Information">View Hotlinking Information</a>
<div id="hotlinking" style="display: none; margin: 0px 20px 0px 20px;">

EOT;
if($a_data != 2){

more code...

//closing table and visiblity div
$bbcode_data .= '</table></div>';
}


//finally we add the created stuff to the picture data and return it to coppermine
$pic_data['html'] = $pic_data['html'].$bbcode_data;

return $pic_data;
 
}

If I change if($a_data != 2) by if($pic_data['aid'] != n) -n is the private album id- then it works, but I must to know the album id.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: CD69 on April 26, 2007, 11:10:57 pm
Stramm sweet mod. I have everything where I want it but I can't figure out where in the code to open the [url] and [img] code dialog box so that it will display all the code.

I have edited the plugin to just display the img tag and would like to see it all in stead of having to scroll.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on May 02, 2007, 09:16:41 am
what about setting the textarea to have ~3 rows??
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: CD69 on May 14, 2007, 11:16:41 pm
Thank you Stramm, you always point me in the right direction (not sure how I missed it)  :-\
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: phill104 on June 15, 2007, 01:33:50 am
Hi Stramm. Great mod.

How do I modify this to change the top button to use the intermediate image instead of the thumbnail?

*Edit

I've just sussed it. It was as simple as changing this line from this

Code: [Select]
$thumb_url = get_pic_url($pic_data, 'thumb'); //thumb url
to this

Code: [Select]
$thumb_url = get_pic_url($pic_data, 'normal'); //normal url
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: MastiMasti on June 23, 2007, 07:28:29 am
 :) work fine

I used with THEME name "blue_dragon"  doesn't work well for me DUE TO THEME

now I switch my theme to  "zymic_xstatic" and this MOD work pretty good  :)

thanks
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: virtuosimedia on August 02, 2007, 07:43:57 pm
Hi, I'm new here and I'm not sure if this is the best place for this question, so I apologize if it is in the wrong place. I searched the forums and haven't been able to find anything that would help me do this (at least that I understood). What I want to do is modify this plugin (codebase.php specifically) to display a link rather than a bulletin board code. I've been able to do this with a static link, but I'm not sure how to do it with the following link:

Code: [Select]
<a href="{ECARD_TGT}" class="navmenu_pic" title="{ECARD_TITLE}">Send Ecard</a>
The bracketed items (ECARD_TGT and ECARD_TITLE) don't translate when the link is clicked and I suspect that I have to include something additionally into codebase.php to get it to recognize them and act upon them, but I'm unsure of what would actually accomplish this. I've experimented with a few different things, but I really don't know enough to do it on my own unless I get lucky somehow.

Basically, my end goal is just to have a more visible link to send an ecard below the image (in addition to the link in the navbar). If anyone has a suggestion, using either this plugin or a different method, I'd love to hear it. Thank you.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on August 03, 2007, 07:20:53 am
Of course that wouldn't work. Neither the placeholder {ECARD_TGT} nor {ECARD_TITLE} are defind. So the script doesn't know it should replace them and even if it would, then it has no clue what to insert there.

To add a line of code that allows you to send an ecard of the shown image you'll need to add something like this...

Code: [Select]
echo "<a href=\"ecard.php?pid={$pic_data['pid']}\">Send Ecard</a>";
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: virtuosimedia on August 03, 2007, 08:02:59 pm
Thank you Stramm, I appreciate it. I'm having a little trouble getting it to work, though. I'm afraid I'm a bit of a beginner when it comes to this. If you wouldn't mind, could you please clarify where exactly I'm supposed to place it, if I should remove anything else, and what my file should look like in the end?
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on August 05, 2007, 09:20:08 pm
eg.
in codebase.php right after
Code: [Select]
$bbcode_data = '<table align="center" width="'.$CONFIG['picture_width'].'">'.$script_data.'<tr>';
add in a new line
Code: [Select]
$bbcode_data .= "<td colspan=\"2\" align=\"center\"><a href=\"ecard.php?pid={$pic_data['pid']}\">Send Ecard</a></td></tr><tr>";
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: virtuosimedia on August 07, 2007, 11:27:39 pm
Thank you for that. I was able to get it to work perfectly. For anyone else out there who wants to use this plugin to create a more graphic "send ecard" button below the image, here is an example of the code. (I removed the BBcode because I didn't need that, I just wanted the ecard link).

Code: [Select]
//this just brings everything in form... we create a table etc.
        $bbcode_data = '<table align="center" width="'.$CONFIG['picture_width'].'">'.$script_data.'<tr>';
$bbcode_data .= '</tr><tr>';
$bbcode_data .= "<td colspan=\"2\" align=\"center\"><a href=\"ecard.php?pid={$pic_data['pid']}\"><img border=0 src=\"sendecard.jpg\" ></a></td></tr><tr>";
$bbcode_data .= '</tr><tr>';
$bbcode_data .= '</tr></table>';

I saw a few people looking for that, so hopefully this will be helpful. Note: replace the image listed with your own image url. If you don't want an image, replace it with text.

Thank you Stramm.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: skidpics on September 02, 2007, 05:03:45 pm
I don't really know where to post this, so hopefully this is the best place. I modified your BB code plugin so that it would display html tag links instead, and combined it with the javascript toggle display div to make it visible only when you click on a link that sits below the picture. I also removed the copy code, because it didn't support FF.


Awesome alternative to the original version.  How would you add a credit link to  be generated with each url tag such as "Visit skidpics.com for images galore"

-- Skidpics
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: skidpics on September 06, 2007, 07:32:03 am
Awesome alternative to the original version.  How would you add a credit link to  be generated with each url tag such as "Visit skidpics.com for images galore"

-- Skidpics

Figured it out.. Just add the linking information on lines 141, 143 and 145, after &nbsp;/&gt;&lt;/a&gt; of each entry..  An example would be: 
&nbsp;/&gt;&lt;/a&gt;<br><a href="http://skidpics.com" class="style1">Browse or host your pictures on skidpics.com </a></p>';
   

Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: skidpics on September 06, 2007, 07:37:48 am
Now, how would I incorporate another background linkage for let say a Myspace profile background for the large picture?

How could I get it to output with this format???

I would have to have the format something like this on output:
<style type="text/css">
body {
background-image:url('http://theimageurl');
background-attachment: fixed;
background-position:top left;
background-repeat:no-repeat;
border-width:0px ;
border-style: inset;
}
</style>
<div
<a href="http://skidpics.com" class="style1">Browse or host your pictures on skidpics.com </a></p>
</div>
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: skidpics on September 06, 2007, 07:39:05 am
Now, how would I incorporate another background linkage for let say a Myspace profile background for the large picture?

How could I get it to output with this format???

I would have to have the format something like this on output:
<style type="text/css">
body {
background-image:url('http://theimageurl');
background-attachment: fixed;
background-position:top left;
background-repeat:no-repeat;
border-width:0px ;
border-style: inset;
}
</style>
<div
<a href="http://skidpics.com" class="style1">Browse or host your pictures on skidpics.com </a></p>
</div>


If I can get the general idea, then I will report the working results once completed..
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: PirateZipp on September 07, 2007, 12:46:31 am
Hey... i just wandt to add my ver of this plugin...
it got a more cool look i think.. maby you can use it stamm..

But i must say/"ask" i will like the fields to be out of the white and down in the gray.. can som 1 help me with that?

:D
Title: Re: target picture normal size in site not orignal picture
Post by: MastiMasti on September 07, 2007, 10:20:20 pm
Dear Stramm
I am trying to  change code for forum
 when user hit it will target picture page not full size
here is code which is regulat
Code: [Select]
[url=http://bollywoodfunda.com/albums/Mona_Lisa/Mona_Lisa_26.jpg][IMG]http://bollywoodfunda.com/albums/Mona_Lisa/thumb_Mona_Lisa_26.jpg[/IMG][/url]
but I want something like this

Code: [Select]
[url=http://www.bollywoodfunda.com/displayimage.php?pos=-11373][IMG]http://bollywoodfunda.com/albums/Mona_Lisa/thumb_Mona_Lisa_26.jpg[/IMG][/url]
so this is picture link http://www.bollywoodfunda.com/displayimage.php?pos=-11373 I want user to get target  to POS=-xxxxx number

how I can edit CODEBASE to target that
is there anyway  or not?
thanks








found it now thanks

here is  QUOTE from ur message



2. the path to the pic is stored in the var $fullsize_url
if you want a different one, you have to modify it... eg. replace
Code: [Select]
$fullsize_url = get_pic_url($pic_data);  //here we grab the url to the fullsized picwith
Code: [Select]
$fullsize_url = 'displayimage.php?pos=-'.$pic_data['pid'];



thanks  :)
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: gonzojenny on September 11, 2007, 07:06:11 am
ok...so I installed the plug in and it works ...kind of

I was able to get the img src for the html and the bbcode out...but now it is giving me permission errors when I try to copyt he code into another forum..

any ideas?
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Joachim Müller on September 11, 2007, 08:15:12 am
Then you probably have hotlink protection set up. For details, post a link to your gallery.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: gonzojenny on September 11, 2007, 08:18:39 am
no..hotlinking is allowed...always has been...

when I went to switch the codebase to the one that gives me the html code instead of bbc code it lasted about 20 minutes then my entire directory went offline...I had no access whatsoever to the directory anymore...none of my machines did

it was when I installed the one from the forums here that has this in the configuration

>--Modified by Zachary Barnes of UselessHacks.com'

almost like my gallery was hacked...was giving me 403 permission denied errors on the whole directory

I eventually had to remove and uninstall the entire directory and reinstall it to get it to go back to normal and able to be viewed again...
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Joachim Müller on September 11, 2007, 08:32:25 am
it was when I installed the one from the forums here that has this in the configuration

>--Modified by Zachary Barnes of UselessHacks.com'
What are you refering to? Post a link to your source. The original plugin posted in this thread is by Stramm and contains no reference to Zachary Barnes as far as I can see.

If you want help, you should do as supporters suggest:
post a link to your gallery
Any particular reason for not doing as I suggested?
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: gonzojenny on September 11, 2007, 08:42:01 am
this is the one I am talking about that I installed that caused the upset

I don't really know where to post this, so hopefully this is the best place. I modified your BB code plugin so that it would display html tag links instead, and combined it with the javascript toggle display div to make it visible only when you click on a link that sits below the picture. I also removed the copy code, because it didn't support FF.

You can also easily comment out if you don't want any of the particular sizes to be displayed.

The only problem that I have is that once you click the link, you can't make it invisible again until the page reloads, because the css in

Code: [Select]
<div id="hotlinking" style="display: none; margin: 0px 20px 0px 20px;">
needs to be actually inserted into the head of the document or into an externally linked css file as:

Code: [Select]
div#hotlinking {
display: none;
margin: 0px 20px 0px 20px;
}

If anyone knows how to get around this, let me know. In the meantime, its not that big of a deal. Its more of a personal preference.

Code: [Select]
<?php
/**************************************************
  CPG BB Code Plugin for Coppermine Photo Gallery 
  Modified by Zachary Barnes of UselessHacks.com
Now creates html tags instead of BB
  *************************************************
  Copyright (c) 2006 Thomas Lange <stramm@gmx.net>
  *************************************************
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  *************************************************
  Coppermine version: 1.4.9
  BB Code Plugin version: 1.2
  $Revision: 1.0 $
  $Author: stramm $
***************************************************/


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

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


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

//Javascript to hide hotlinking information along with div arrangement, taken from a common toggling script floating around the net
$script_data = <<< EOT

<script language="javascript" type="text/javascript">
<!--
function toggleLayer(whichLayer)
{
if (document.getElementById)
{
// this is the way the standards work
var style2 = document.getElementById(whichLayer).style;
style2.display = style2.display? "":"block";
}
else if (document.all)
{
// this is the way old msie versions work
var style2 = document.all[whichLayer].style;
style2.display = style2.display? "":"block";
}
else if (document.layers)
{
// this is the way nn4 works
var style2 = document.layers[whichLayer].style;
style2.display = style2.display? "":"block";
}
}
//-->
</script>

<a href="javascript:toggleLayer('hotlinking');" title="View Hotlinking Information">View Hotlinking Information</a>
<div id="hotlinking" style="display: none; margin: 0px 20px 0px 20px;">

EOT;
    
    
$thumb_url get_pic_url($pic_data'thumb');  //here we grab the url to the thumb url
$int_url get_pic_url($pic_data'normal');  //intermediate pic
$full_url get_pic_url($pic_data'fullsize');            //fullsized pic
$pic_data['title'] ? $name $pic_data['title'] : $name 'No&nbsp;Title'//checking if the pic has a title, if not we set it to 'No title'

//Generating the file paths for each picture size

$tn_url '&lt;a&nbsp;href="'.$CONFIG['ecards_more_pic_target'].$int_url.'"&gt;&lt;img&nbsp;src="'.$CONFIG['ecards_more_pic_target'].$thumb_url.'"&nbsp;alt="'.$name.'"&nbsp;/&gt;&lt;/a&gt;';
$im_url '&lt;a&nbsp;href="'.$CONFIG['ecards_more_pic_target'].$full_url.'"&gt;&lt;img&nbsp;src="'.$CONFIG['ecards_more_pic_target'].$int_url.'"&nbsp;alt="'.$name.'"&nbsp;/&gt;&lt;/a&gt;';
$fs_url '&lt;img&nbsp;src="'.$CONFIG['ecards_more_pic_target'].$full_url.'"&nbsp;alt="'.$name.'"&nbsp;/&gt;';

//this just brings everything in form... we create a table etc., 

$bbcode_data $script_data;
$bbcode_data .= '<table align="center" width="'.$CONFIG['picture_width'].'">';

//thumbnail image code with link to intermediate image
$textarea_prop 'name="bbcode" rows="1" cols="50" style="overflow:off; white-space:nowrap" readonly="readonly"';

$bbcode_data .= '<tr><td>Thumbnail:</td></tr>';
$bbcode_data .= '<tr><td><textarea '.$textarea_prop.'>'.$tn_url.'</textarea></td></tr>';

//intermediate image code with link to fullsize image
$bbcode_data .= '<tr><td>Intermediate:</td></tr>';
$bbcode_data .= '<tr><td><textarea '.$textarea_prop.'>'.$im_url.'</textarea></td></tr>';

//fullsize image code
$bbcode_data .= '<tr><td>Fullsize:</td></tr>';
$bbcode_data .= '<tr><td><textarea '.$textarea_prop.'>'.$fs_url.'</textarea></td></tr>';

//closing table and visiblity div
$bbcode_data .= '</table></div>';



//finally we add the created stuff to the picture data and return it to coppermine
$pic_data['html'] = $pic_data['html'].$bbcode_data

return $pic_data
}

?>


EDIT: Fixed a few bugs. Now trying to find a replacement for 'wrap="off"' that validates under xhtml.

EDIT: The good news is that the above code is now XHTML valid.

Apparently, everyone is looking for a wrap=off equivalent that validates under xhtml, but it doesn't exists. So to keep all the text on one line, I've used "&nbsp;" for all of the spaces, effectively linking everything together. Unfortunately, in FF, if your picture title has a space in it, it will chop it up to two lines. IE6 works fine, and keeps everything on the same line.

So, you could increase the rows to 'rows="2"', or you could remove the 'alt="$name"' attribute, but I'm sticking with it like it is unless anyone has any work-arounds or suggestions.

if you download the batch files under his name on the particular posting...you will see that he modified stramms php codebase and had put his name in the "created by" up top

after the installation of his version of the image sourcing things went to hell in a handbasket and excuse me if I happened to forget to add this to my last bit of asking for assistance

you have no idea how annoyed I was when I had to lose over 10,000 uploaded images because the only way to get back into the gallery was to remove it from my server and put it back...simple oversight
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Joachim Müller on September 11, 2007, 09:02:58 am
if you download the batch files under his name on the particular posting...you will see that he modified stramms php codebase and had put his name in the "created by" up top
Why didn't you use the original one posted by Stramm? The one you refer to is just an unsupported contribution. There's no guarantee that it works as expected.

you have no idea how annoyed I was when I had to lose over 10,000 uploaded images because the only way to get back into the gallery was to remove it from my server and put it back...simple oversight
That's complete, utter nonsense. It wouldn't have been necessary to perform a fresh install. Simply undoing the damage would have been enough. Why didn't you ask how to remove the damage instead of starting all over and then (after making that mistake) complaining?

If you want help, you should do as supporters suggest.
I will not allow you to clutter this thread with invalid rants. Do as I suggested and post a link to your gallery or stop wasting everybody's time and stop posting.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: gonzojenny on September 11, 2007, 09:14:52 am
Why didn't you use the original one posted by Stramm? The one you refer to is just an unsupported contribution. There's no guarantee that it works as expected.
That's complete, utter nonsense. It wouldn't have been necessary to perform a fresh install. Simply undoing the damage would have been enough. Why didn't you ask how to remove the damage instead of starting all over and then (after making that mistake) complaining?
I will not allow you to clutter this thread with invalid rants. Do as I suggested and post a link to your gallery or stop wasting everybody's time and stop posting.


not wasting anyones time here but mine it seems

the link to my gallery since you feel you need it; http://www.gonzojenny.com/images (http://www.gonzojenny.com/images) but it is offline at the moment

and I did try to fix the problem by putting all the code back the way that it was before the plugin install and it didnt work...tried numerous times to remove all instances of the codebase for the last 4 hours BEFORE coming here to register and ask for assistance....searching for some tidbit of answers thru THIS forum and many thread strings and I found no help...

the reason i used the modified version is because it gave the img src codes that I need instead of the bbcodes which I cant use for what the gallery is intended for

and now after the fifth hour has passed I have found the problem and it is working

thank you anyway   
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: lukasino on October 03, 2007, 01:08:05 am
Hello,

How add bbcode before Image?

second question, i'm change this scripts to link and i have problem

Link:
   $bbcode_data .= '<td><a href="#" onclick=" window.open('http://tapeciarz.mobile.net.pl/imageuploader-partner.xhtml?sid=5&theme=clean&img=','','width=600,height=400,'); ">Otwórz okno</a></td>';

parse error please help
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on October 03, 2007, 10:05:30 am
when you have a look at the code you'll see that $pic_data['html'] represents the html of the intermediate image where    $bbcode_data holds all the bbcode html. So you'd just have to change
Code: [Select]
$pic_data['html'] = $pic_data['html'].$bbcode_data;in
Code: [Select]
$pic_data['html'] = $bbcode_data.$pic_data['html'];
The parse error... of course you'll get one. If you use strings in php they have to be in single or double quotes. If you use eg. single quotes, then you can't use these within the string as you do. You need to escape the single quotes within the string using \

eg. (just a part)
Code: [Select]
img=\','',\'width=600,height=400,\');
If you're unsure with php sysntax http://www.php.net will be able to help you.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: lukasino on October 03, 2007, 10:15:18 am
when you have a look at the code you'll see that $pic_data['html'] represents the html of the intermediate image where    $bbcode_data holds all the bbcode html. So you'd just have to change
Code: [Select]
$pic_data['html'] = $pic_data['html'].$bbcode_data;in
Code: [Select]
$pic_data['html'] = $bbcode_data.$pic_data['html'];
work thank very much :)
Quote
The parse error... of course you'll get one. If you use strings in php they have to be in single or double quotes. If you use eg. single quotes, then you can't use these within the string as you do. You need to escape the single quotes within the string using \

eg. (just a part)
Code: [Select]
img=\','',\'width=600,height=400,\');
don't work (parseerror)

now i have

Code: [Select]
$bbcode_data .= '<td><a href="http://tapeciarz.mobile.net.pl/imageuploader-partner.xhtml?sid=302&theme=clean&img=http://tapetypulpitu.pl/'.$fullsize_url.'" target="_blank">Wyslij na telefon</a></td>';
and works but how add to this window.open?

edited Stramm: added quotes to make it readable
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on October 03, 2007, 10:51:09 am
php syntaxwise it looks OK... to add the javascript window open... search the web... if you need single quotes within the string, then escape them as I told you.
not valid: 'a'string'
valid: 'a\'string'
valid: "a'string"
not valid: "a"string"
valid: 'a"string\'is\'this'

got it?
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Amazulu on October 03, 2007, 03:50:35 pm
Awesome mod! Thank you very much Stramm (and also thanks to PirateZipp for your version, which looks very cool). You can see this in action at www.nikongear.com - click on the PHOTOS link in the main menu.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: christi78 on October 10, 2007, 04:58:14 pm
Is there any way to only select by Category so I can display different code for fullsize pics for one Category and thumbs in the bbcode for others? I thought it would be something like if ($_GET["cat"] == 'X' ) XXXXXXX    } else if { if ($_GET["cat"] == 'X1' ) XXXXXXXX but I have tried this and can not get it to work correctly. Does anyone have a modification or know how to do this????? Thanks in advance for any help given
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on October 10, 2007, 06:10:10 pm
I think I already answered that question before... nevertheless, it's easy doable by album, if you want to go for cats... I think you'll have to do an additional query. The album id is stored in an array

the following code would not show the bbcode for the given albums in the forbidden array
Code: [Select]
$forbidden = array(2,3,4,5,6,7,8);
if (in_array($pic_data['aid'],$forbidden)) {
return $pic_data;
}

you'll have to place it tight after
Code: [Select]
global $CONFIG;
that should give you a rough idea on how to get things rolling
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: christi78 on October 10, 2007, 06:38:59 pm
Stramm thanks for a little insight as to not being able to do this by Cat. Album is just fine. I know how to make it not work for selected albums thanks for the most part to you :) however I would like to display different bbcode under say albums 2345 then what I display under albums 6789  and so on. would I choose from the array list if a if then else statement??? Thanks for your help in getting my in the right direction. :)
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on October 10, 2007, 07:18:00 pm
there are hundreds of possibilities on how to do what you want... everyting depends on how 'different' your output for the single albums is. Is it just an additional line, is it totally different...

so you can stay eg with the above example
Code: [Select]
$forbidden = array(2,4,6,8);
if (in_array($pic_data['aid'],$forbidden)) {
$bbcode_data = 'bbcode for albums 2,4,6 and 8';
} else {
$bbcode_data = 'different stuff for all the other albums';
}
$pic_data['html'] = $pic_data['html'].$bbcode_data;
return $pic_data;

you also could use the switch satement or ....
Code: [Select]
switch ($pic_data['aid']) {
case 0:
    $bbcode_data = 'bbcode for album 0';
    break;
case 1:
    $bbcode_data = 'bbcode for album 1';
    break;
case 2:
    $bbcode_data = 'bbcode for album 2';
    break;
default:
    $bbcode_data = 'bbcode for all other albums';
}

$pic_data['html'] = $pic_data['html'].$bbcode_data;
return $pic_data;
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: christi78 on October 11, 2007, 03:20:05 pm
Just wanted to say thanks you Stramm got everything to work and learned alot in the proccess :) Thanks again.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Thrick on October 13, 2007, 08:22:13 am
Thank you Stramm for all the time you've spent helping everyone.  With all your input, I was able to configure your plugin to exactly how I like it.

Instead of coming here with a question, I come with a (somewhat) solution. :P

In my image gallery, I have not only images, but movies, audio, and misc. files (.zip, .rar, etc.).  I only wanted to have the bbcode show for images, and not for any other file.  I'm not fluent in php, but I was able to figure this out on my own.

Find
Code: [Select]
global $CONFIG;
After, add
Code: [Select]
$bbcode_content = cpg_get_type($pic_data['filename']);
if($bbcode_content['content']=='audio') return $pic_data;
if($bbcode_content['content']=='movie') return $pic_data;
if($bbcode_content['content']=='document') return $pic_data;

If that is considered a hack job and there's a better way of handling that, let me know. :P

Thank you again Stramm.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: MastiMasti on October 14, 2007, 07:46:58 am
If you want add Code to WWW with Thumb.

Add Where http://youlink.com is adres to your website

Find:
Before add:


can it be open in new page???
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: jw0ollard on October 29, 2007, 04:57:14 pm
I encountered a problem with this plugin and the "Chaotic" style.  The Chaotic style attaches a "frame" around the intermediate images, and thus this plugin was inserting the BBcode table between the image and frame.

After figuring out CPG a little (which was very hard as I found almost zero plugin-writing documentation--I hope someone is working on this!!), I changed the plugin to this:
Code: [Select]
<?php/*****Snipped Copyright for copy/paste purposes :) ******/

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

// Add a filter
$thisplugin->add_filter('page_html','bbcode_add_data');

function bbcode_add_data($page_html){ 
global $CONFIG, $CURRENT_PIC_DATA;

$fullsize_url = get_pic_url($CURRENT_PIC_DATA);  //here we grab the url to the fullsized pic
$thumb_url = get_pic_url($CURRENT_PIC_DATA, 'thumb'); //thumb url

$CURRENT_PIC_DATA['title'] ? $name = $CURRENT_PIC_DATA['title'] : $name = 'No Title'; //checking if the pic has a title, if not we set it to 'No title'

//here we define the actual bbcode coppermine path + the path to the pic $img_url is for the version that displays the thumb, $name_url is for a txt link with the ikmage title
$img_url = '[url='.$CONFIG['ecards_more_pic_target'].$fullsize_url.'][IMG]'.$CONFIG['ecards_more_pic_target'].$thumb_url.'[/IMG][/url]';
$name_url = '[url='.$CONFIG['ecards_more_pic_target'].$fullsize_url.']'.$name.'[/url]';


//this just brings everything in form... we create a table etc.
$bbcode_data = '<table align="center" width="'.$CONFIG['picture_width'].'">'.$script_data.'<tr>';
$bbcode_data .= '<td></td>';
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="40" style="overflow:off;">'.$img_url.'</textarea></td>';

$bbcode_data .= '</tr><tr>';

$bbcode_data .= '<td></td>';
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="40">'.$name_url.'</textarea></td>';

$bbcode_data .= '</tr></table>';

$search = 'LR.gif"></td>
         </tr>
       </table>';
$replace = $search.$bbcode_data;
   
$page_html = str_replace($search,$replace,$page_html);

return $page_html;

}
?>

If you see anything that's not right with this, can someone please say something?  I know next to nothing about Coppermine and I'm not sure what difference there is--if any--between $CURRENT_PIC_DATA and the $pic_data you used in the original plugin.

And that brings me to my next point: I'll have to go back and check now, but I believe I have found some kind of error.  I was testing this on a photo with a space in the title, e.g. "Jim Bob", and I noticed that the 2nd URL code looked like this:

Code: [Select]
[url="http://localhost/path/to/image"]Jim And then stopped at the space.

Is this some problem with $CURRENT_PIC_DATA or does this exist in the original plugin?  Like I said, I have to go back and check now, but I'm too lazy to do it right now (I was working at another computer). Chances are I'll do it before someone replies, so I'll probably be replying again shortly.

Anyway, this isn't much a problem for me as it may be for everyone using this plugin,  since I probably won't be using that BBcode box anyway... just the 1st one, and then adding my own.

EDIT: ^^ That space problem doesn't actually exist..  For whatever reason the URL breaks to a new line, and you can only see the whole thing if you scroll with your scroll wheel, instead of there being a scroll bar that shows you there is more to the URL.

Thanks for a great mod!
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: skidpics on December 11, 2007, 11:49:44 pm
Love the plugin.

I use it for forums and stuff.  Might of found a problem, unless a album setting is off.  The plugin has been working fine, and works fine for albums except user albums.  I just created a user album, and hotlinked one of the images to post in myspace, but the image will not appear from the user gallery, but it will from the general albums.

Here is a copy of the coding, from both intermediate links..

General Gallery:
&lt;a href=&quot;http://skidpics.com/gallery/albums/userpics/4/Big-Eye_Squirrel_Fish.jpg&quot;&gt;&lt;img src=&quot;http://skidpics.com/gallery/albums/userpics/4/normal_Big-Eye_Squirrel_Fish.jpg&quot; alt=&quot;Big-Eye Squirrel Fish&quot; /&gt;&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://skidpics.com&quot; class=&quot;style1&quot;&gt;Browse or host your pictures on skidpics.com &lt;/a&gt;&lt;/p&gt;

User Gallery:
&lt;a href=&quot;http://skidpics.com/gallery/albums/userpics/10001/72/katvond7c.jpg&quot;&gt;&lt;img src=&quot;http://skidpics.com/gallery/albums/userpics/10001/72/normal_katvond7c.jpg&quot; alt=&quot;katvond7c&quot; /&gt;&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://skidpics.com&quot; class=&quot;style1&quot;&gt;Browse or host your pictures on skidpics.com &lt;/a&gt;&lt;/p&gt;

the first part shows the image with the link back coding, the second part (from the user gallery) just shows title and link back code to gallery.  I will attach a screen show of what I mean.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on December 12, 2007, 09:02:23 am
tested and can't replicate your issues. Please post a link to your gallery and verify your code changes.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: skidpics on December 12, 2007, 04:01:13 pm
Hmmm - just tested it again, and working now..  interesting..

Thanks for checking it out - might of been a server issue...?...
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: itsanna on January 14, 2008, 02:53:51 am
Help, this is a massive link, is there any way to shorten it at all??

url=http://adorablebudgies.co.uk/g/albums/mypics/aa5b.JPG]IMG]http://adorablebudgies.co.uk/g/albums/mypics/thumb_aa5b.JPG[/IMG[/url

(I omitted the open/close brackets to show it)

Also, the link as it is shows a thumbnail size image, like this: [Edit GauGau] Replaced hotlinked image with attachment [/Edit]

Can anybody tell me exactly which bits I need to change in codebase.php to make it fetch the larger sized picture instead please?

I understand a little of what's in there and managed to remove the title link and box for that, but not fluent enough to work this bit out myself properly.

Much appreciate any help with this :)

Anna
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: classic66coupe on January 14, 2008, 03:31:44 am
Very nice plugin !

I made a few small modifications: added an a href link along with the BB code, changing the JavaScript to simply select an input instead of text area on click, added CSS padding, and used the filename if the title is empty.

Sample (http://"http://www.stangdriver.com/photogallery/)
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: itsanna on January 14, 2008, 03:36:54 am
Nice cars :)

The link looks a lot better like that too.

Anna
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: indianwidescreens on January 22, 2008, 10:33:02 pm
Hi

I installed this plugin and here my site link

http://1280x800.indianwidescreens.com/displayimage.php?album=random&cat=4&pos=-214

But it is linking like this

(http://1280x800.indianwidescreens.com/albums/widescreenwallpapers/saloni/thumb_salonimdfyui38si01280.jpg) (http://1280x800.indianwidescreens.com/albums/widescreenwallpapers/saloni/salonimdfyui38si01280.jpg)

I need like this ( i need url to be the full page link itself )

(http://1280x800.indianwidescreens.com/albums/widescreenwallpapers/saloni/thumb_salonimdfyui38si01280.jpg) (http://1280x800.indianwidescreens.com/displayimage.php?album=random&cat=4&pos=-214)

please let me know how to do it

Thanks in advance!
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on January 23, 2008, 08:04:04 am
Do not PM me for support
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: indianwidescreens on January 23, 2008, 11:53:43 am
oh sorry :(

can u please tell me here? ???
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on January 23, 2008, 04:13:02 pm
has been asked and answered within this thread
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: indianwidescreens on January 24, 2008, 07:34:59 pm
has been asked and answered within this thread

Thank u stramm i got it here

http://forum.coppermine-gallery.net/index.php?topic=36302.msg222727#msg222727
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: TigerClaw on January 28, 2008, 12:11:52 am
Very nice plugin !

I made a few small modifications: added an a href link along with the BB code, changing the JavaScript to simply select an input instead of text area on click, added CSS padding, and used the filename if the title is empty.

Sample (http://"http://www.stangdriver.com/photogallery/)

Nice, can we see your code?  ;)
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: mywedding on February 06, 2008, 12:27:35 am
many many thanks for this mod, i  :-* u, all

byeeeeeee dears
eg.
in codebase.php right after
Code: [Select]
$bbcode_data = '<table align="center" width="'.$CONFIG['picture_width'].'">'.$script_data.'<tr>';
add in a new line
Code: [Select]
$bbcode_data .= "<td colspan=\"2\" align=\"center\"><a href=\"ecard.php?pid={$pic_data['pid']}\">Send Ecard</a></td></tr><tr>";

Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: bl4kdev1l on February 08, 2008, 06:10:57 pm
Is there a chance that this plugin can give me html code istead of bbcode ?

Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on February 08, 2008, 07:15:10 pm
explained within this thread
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Aeronautic on February 22, 2008, 05:01:52 am
No offense to Stramm, but I thought I'd share my edit of the warning message to Netscape/Firefox users.

I corrected a couple of typos and tried to make it friendly and a little more informative.

Quote
Sorry, but due to your Firefox or Netscape security settings it may not possible to use the copy button. Please manually select the code by first clicking once into the text area. Then press ctrl+a to select all. Then press ctrl+c to copy. Then simply press ctrl+v to paste.

Since the javascript checks for Netscape I thought I'd include that in the message.

Looking forward to putting this plug-in to work. Stramm, thanks for all your efforts!

Mod:

No doubt I'm an idiot, but I was trying to get the "credit" line to work below the thumb link as mentioned in the thread and coded here:

http://forum.coppermine-gallery.net/index.php?topic=36302.msg222486#msg222486

I've read the entire thread at least 3 times.

That post above makes no sense since my codebase file is only 78 lines long and it references lines in the hundreds.

I also don't have those code strings.

I'm using Stramm's V 1.2

To add a line with a link and formatted text below the thumbnail I tried this:

Code: [Select]
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="40" style="overflow:off;">'.$img_url.','[br][size=35][b][url=http://www.aeronauticpictures.com/royalty-free-stock-footage/]Stock Footage[/url] from AeronauticPictures.com[/b][/size]'</textarea><input type="button" value="Copy" onclick=\'copy_clip("'.$img_url.','[br][size=35][b][url=http://www.aeronauticpictures.com/royalty-free-stock-footage/]Stock Footage[/url] from AeronauticPictures.com[/b][/size]'"
and I got parse errors.

Also tried it this way first with same result:

Code: [Select]
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="40" style="overflow:off;">'.$img_url.[br][size=35][b][url=http://www.aeronauticpictures.com/royalty-free-stock-footage/]Stock Footage[/url] from AeronauticPictures.com[/b][/size]'</textarea><input type="button" value="Copy" onclick=\'copy_clip("'.$img_url.'"
A misplaced ' or " or syntax error or massive case of moron. I can't figure it out.   :-[

Any help would be much appreciated.

Thank you!

Mod:

Okay, getting closer. Yes, the font size was way too big. And would not display with an SMF forum w/out the "pt" call for size. Fixed that. And got the credit to show now without the parse errors but too stupid re: javascript to figure out how to include it in the button capture. Here is code now:

Code: [Select]
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="40" style="overflow:off;">'.$img_url.'[br][br][size=13pt][b][url=http://www.aeronauticpictures.com/royalty-free-stock-footage/]Stock Footage[/url] from AeronauticPictures.com[/b][/size]</textarea><input type="button" value="Copy" onclick=\'copy_clip("'.$img_url.'")\'></td>';
Solved:

Code: [Select]
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="40" style="overflow:off;">'.$img_url.'[br][br][size=13pt][b][url=http://www.aeronauticpictures.com/royalty-free-stock-footage/]Stock Footage[/url] from AeronauticPictures.com[/b][/size]</textarea><input type="button" value="Copy" onclick=\'copy_clip("'.$img_url.'[br][br][size=13pt][b][url=http://www.aeronauticpictures.com/royalty-free-stock-footage/]Stock Footage[/url] from AeronauticPictures.com[/b][/size]")\'></td>';
Mod: Arrrrrgh.

Works fine it seems in IE. Won't even display the correct string for manual copy in FF or Netscape. Soooo. I changed the rows to:

Code: [Select]
<textarea name="bbcode" rows="2"
In both text areas and added the error message about select all (see top of this post) because 3 clicks would not select all in FF.

Over and out.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: skidpics on February 28, 2008, 01:28:43 pm
this goes with another thread concerning the same, but different link issue.
A brief description of the problem.  I have my domain photospider.net domain marked forwarded to hosting on another yahoo domain. The url shows the original hosted domain in the bbcode..  How do I alter the code in the plugin to display the actual domain it came from instead of the landing domain?

How do I get this:

<a href="http://skidpics.com/coppermine/albums/userpics/10003/normal_11%7E2.jpg"><img src="http://skidpics.com/coppermine/albums/userpics/10003/thumb_11%7E2.jpg" alt="No Title" /></a><br><a

into this:

<a href="http://photospider.net/albums/userpics/10003/normal_11%7E2.jpg"><img src="http://photospider.net/albums/userpics/10003/thumb_11%7E2.jpg" alt="No Title" /></a><br><a

I am assuming this is what needs to be edit to fix the link issue: 
$tn_url = '&lt;a&nbsp;href="'.$CONFIG['ecards_more_pic_target'].$int_url.'"&gt;&lt;img&nbsp;src="'.$CONFIG['ecards_more_pic_target'].$thumb_url.'"&nbsp;alt="'.$name.'"

Any help would be appreciated.  This is an awesome plugin!

-- Skidpics
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Nibbler on February 28, 2008, 01:49:56 pm
Why don't you just change the url to your gallery in config?
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: skidpics on February 28, 2008, 11:44:47 pm
Why don't you just change the url to your gallery in config?

That fixed the link problem.. . but now the image doesn't show the bbcode nor in ecards..

is the problem the masked domain?

Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Nibbler on February 29, 2008, 12:23:25 am
I see. By 'domain mask' you actually mean 'stupid frame'. Frames suck. Use a redirect/rewrite or DNS instead. This is not related to this mod however. To just hack in a different path change

Code: [Select]
href="'.$CONFIG['ecards_more_pic_target'].$int_url.'"
to

Code: [Select]
href="http://photospider.net/'.$int_url.'"
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: skidpics on February 29, 2008, 12:32:58 am
I see. By 'domain mask' you actually mean 'stupid frame'. Frames suck. Use a redirect/rewrite or DNS instead. This is not related to this mod however. To just hack in a different path change

Code: [Select]
href="'.$CONFIG['ecards_more_pic_target'].$int_url.'"
to

Code: [Select]
href="http://photospider.net/'.$int_url.'"

Unfortunately, that doesn't do the trick either.  no pics on bbcode or ecards with that.  that actually does the same thing in the url as changing the config option

Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Nibbler on February 29, 2008, 12:40:21 am
You can't do what you want using just a frame.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: skidpics on February 29, 2008, 12:43:14 am
You can't do what you want using just a frame.

Well, since yahoo is so limited in the way it does things.  I will just switch servers that will allow the support of add on domains.  I have been having problems with their limited issues anyway.  Thanks for the help and I will get it switched over.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: keithsnell1 on March 02, 2008, 06:22:30 am
Can you describe how to modify this plugin so that the bbcode img URL will display in the file information area under the image?  Maybe right below (or in place of) the URL that links to the image display page? 

I'd like to have a "clean" frame around the image, and so would prefer to have the link display in the file info section if possible.

Thank you in advance,

Keith
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: jortiz13 on March 04, 2008, 09:41:22 pm
Hi was following this post but I didn't see the fill code for like myspace. the bbcode in the plogin files doen't have it.
Can it be added to the bbcode plugin? like that when the plugin is install it has the hotlinks for myspace.

this will be a great mod and it will be helpful for many people.
Title: Member and the superintendent can demonstrate bbcode..
Post by: hgl on April 07, 2008, 12:23:59 pm
How limits only has the superintendent and records member to see own
image bbcode..?

And other visitors and the member will forbid to demonstrate
bbcode...
Title: Re: Member and the superintendent can demonstrate bbcode..
Post by: Stramm on April 07, 2008, 12:33:51 pm
Please rephrase your question!
Title: Re: Member and the superintendent can demonstrate bbcode..
Post by: hgl on April 07, 2008, 01:50:01 pm
SORRY.  I not too understand English..

About:http://forum.coppermine-gallery.net/index.php/topic,36302.0.html

open codebase.php and after
Quote
global $CONFIG;


Question...
1. Only has user to be able to watch own code?
2. Other users forbid to watch?
3. The superintendent may watch the complete user the code?
Title: Re: Member and the superintendent can demonstrate bbcode..
Post by: hgl on April 07, 2008, 01:53:53 pm
Emphasis...

Only the users themselves can watch their own code
Other users would prohibit viewing ..
The managers of all the users can watch the code?



Thanks a lot!!
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: hgl on April 07, 2008, 03:51:53 pm
Dear Sir
Sorry to make you confuse for above questions
However, My question is
How to limite the users can not see other users link but the manager can see all of the users link?

I am looking forward to receive your reply soon


Thanks a lot!!
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Joachim Müller on April 07, 2008, 05:34:18 pm
You as gallery admin should have the skills to find out the URL without the need of such a plugin - simply perform a right-click, properties and perform a highlight/copy job. If you really need the changes you demand, you're welcome to code them in and let us know the outcome.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on April 07, 2008, 06:44:19 pm
codebase.php ... right after
Code: [Select]
global $CONFIG;
add
Code: [Select]
if(!GALLERY_ADMIN_MODE) return $pic_data;

should do the trick
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: hgl on April 07, 2008, 07:18:13 pm
Dear Sir

Many thanks of your reply
Now I can see the all users link
Another thing is can you tell me how to let the users can see their own link but not allow to see other users link

I am look forward to receiving your reply soon

Cheers
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: hgl on April 10, 2008, 07:00:10 pm
Please help me... ???


How to show the  bbcode just only in own photo album?

just like the users can  editor their own photo album.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on April 10, 2008, 09:25:49 pm
usage as above
Code: [Select]
if (!($pic_data['owner_id'] == USER_ID || GALLERY_ADMIN_MODE)) {
return $pic_data;
}
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: hgl on April 10, 2008, 10:38:50 pm
usage as above
Code: [Select]
if (!($pic_data['owner_id'] == USER_ID || GALLERY_ADMIN_MODE)) {
return $pic_data;
}


thanks!!
ITs working fine..
Thanks a lot!! :D
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Hot Rides on April 30, 2008, 06:12:58 pm
Wonderful work once again Stramm!
I was able to easily modify this as well to fit my needs. Thank you for helping everyone else as it kept me from having to ask and wait, lol.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: skmdd on May 04, 2008, 07:05:20 am
eg.
in codebase.php right after
Code: [Select]
$bbcode_data = '<table align="center" width="'.$CONFIG['picture_width'].'">'.$script_data.'<tr>';
add in a new line
Code: [Select]
$bbcode_data .= "<td colspan=\"2\" align=\"center\"><a href=\"ecard.php?pid={$pic_data['pid']}\">Send Ecard</a></td></tr><tr>";

Could you also suggest change to display link for slideshow?
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: skmdd on May 04, 2008, 07:23:11 am
The bbcode image URL appear inside the image border. Is there a way to get the code out of the image border?
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on May 04, 2008, 01:16:18 pm
You'll have to use another plugin hook then.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: bugattibuilder on July 06, 2008, 08:08:59 pm
I am using this mod for some time now, and I really like it.

However, would it be possible to alter the code in such a way, that it behaves like this:

-pressing the copy button will generate the code for displaying the intermediate image, linking to the large image. (simple till so far) BUT...

-when the larger image is smaller than the intermediate would be (normally 400 pixels), there is no intermediate. Instead of generating code for the intermediate, generate the code for the original picture. (which could link to itself, or no link at all)


Optionally, this could be split in 2 different "code" buttons, but users could then mess up the forum layout, by accidentally posting 2048 pixel wide pictures... i like to prevent that. (for which I did not succeed yet, I have trouble generating the neccesary code for the "original" option)
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: phill104 on July 06, 2008, 08:54:13 pm

-pressing the copy button will generate the code for displaying the intermediate image, linking to the large image. (simple till so far)

Change this line from this

Code: [Select]
$thumb_url = get_pic_url($pic_data, 'thumb'); //thumb url
to this

Code: [Select]
$thumb_url = get_pic_url($pic_data, 'normal'); //normal url
For smaller images the smaller image will still work as an intermediate.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: bugattibuilder on July 07, 2008, 08:23:00 am
Tested this with a 240x240 px picture, but this generates a red cross (empty placeholder) for the picture.

The code generated is: (I crippled the url tags

url=http://www.domain.com/photo/albums/userpics/10003/1384/picture240px.jpg](http://www.domain.com/photo/albums/userpics/10003/1384/[b]normal_picture240px.jpg[/b])[/url

Which is OK for pictures over 400 px (my intermediate size). However, for smaller pictures it should read:

url=http://www.domain.com/photo/albums/userpics/10003/1384/picture240px.jpg](http://www.domain.com/photo/albums/userpics/10003/1384/[b]picture240px.jpg[/b])[/url

Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on July 07, 2008, 08:40:37 am
two possibilities...
1. you do all the checks as in function theme_html_picture(). As result you know whether to use the fullsized or not.
2. you just check if a normal_ file exists. If yes, do what you intend to do, if not, do something else

http://php.net/manual/de/function.file-exists.php
Code: [Select]
$normal_url = get_pic_url($pic_data, 'normal'); //normal url
if (file_exists($normal_url)) {
//do something
} else {
//doesn't exist, do something else
}

Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: bugattibuilder on July 07, 2008, 10:04:21 am
I am going to try. It is my first attempt at PHP, so could take a while, I will post my results.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on July 07, 2008, 10:32:27 am
on a second thought... using URLs with file_exists may not necessarily work in all environments as expected. So it's better to use the server path

Code: [Select]
this is the path to the fullsized
$CONFIG['fullpath'].$pic_data['filepath'].$pic_data['filename']

and the intermediate
$CONFIG['fullpath'].$pic_data['filepath'].$CONFIG['normal_pfx'].$pic_data['filename']
us it eg. like
Code: [Select]
//does the normal file exist??
if (file_exists($CONFIG['fullpath'].$pic_data['filepath'].$CONFIG['normal_pfx'].$pic_data['filename'])) {
//do something eg. display bbcode for the intermediate image
$fullsize_url = get_pic_url($pic_data, 'normal');
} else {
//intermediate doesn't exist, do something else eg. print bbcode for fullsized image
$fullsize_url = get_pic_url($pic_data);
}

if you replace in codebase.php
Code: [Select]
$fullsize_url = get_pic_url($pic_data);  //here we grab the url to the fullsized pic
with the above, then the plugin prints the intermediate URL if that file exists, otherwise the fullsized... haven't tested it
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Jacob2122002 on July 11, 2008, 04:37:47 pm
Works great but whenever I look at a picture it stretches the page all the way across my screen? So I have to scroll to the right all the way until I see the picture.

Is that because of my screen resolution or is there a way to fix it?
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Nibbler on July 11, 2008, 06:04:24 pm
Post a link. Make sure you don't have debug mode enabled.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Jacob2122002 on July 11, 2008, 08:41:04 pm
Post a link. Make sure you don't have debug mode enabled.


Nope, debug mode isn't on.

(its just a personal photo album)

http://jacobs-space.com/copperminenew/index.php
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Nibbler on July 11, 2008, 08:44:22 pm
Caused by this:

Code: [Select]
<table align="center" width="9999">
I don't know where that came from; it's not a part of the plugin.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Jacob2122002 on July 11, 2008, 08:53:48 pm
Caused by this:

Code: [Select]
<table align="center" width="9999">
I don't know where that came from; it's not a part of the plugin.


I'm kinda new at this stuff....how would I take that out lol? And would I take out that whole line of code or just the width part?
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Nibbler on July 11, 2008, 10:12:50 pm
The whole line. First though, update your gallery to latest. 1.4.18. Then check in the plugin's codebase.php for that line.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Jacob2122002 on July 12, 2008, 03:14:32 am
Code: [Select]
//this just brings everything in form... we create a table etc.
$bbcode_data = '<table align="center" width="'.$CONFIG['picture_width'].'">'.$script_data.'<tr>';
$bbcode_data .= '<td>[url][img][/url]</td>';

That is the lines I see. But there's not 9999 it just says "$CONFIG" ?
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Nibbler on July 12, 2008, 12:58:12 pm
That would indicate you have set 'Max width or height of an intermediate picture/video' to 9999 in config. Set it to something sensible instead.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Jacob2122002 on July 13, 2008, 11:38:51 am
That would indicate you have set 'Max width or height of an intermediate picture/video' to 9999 in config. Set it to something sensible instead.


Thank you so much  ;D It's working now. I would of never though haha

Thank you again for the help  :D :D :D
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: mooxe on August 05, 2008, 05:20:50 am
Hi Guys,

A couple questions...

I am trying to place the code after the image title & description. I can place it above or below the image, thats all I can figure out though.

Am also trying to change the textarea to be one line vice however many it takes the URL to fit in a 40col wide area, without expanding the columns. I managed to do it on my other site (http://www.closecombatseries.net/imagehost/) but cant figure out the coppermine code. So for example, when a user clicks the text he simply scrolls left or right not up and down.

MOOXE
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: uglycars on September 13, 2008, 06:26:37 pm
how do I enable hotlinking to get this plugin to work?

Sorry, I'm a newb.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: uglycars on September 16, 2008, 05:37:03 am
anyone??!!
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on September 16, 2008, 07:26:05 am
That's a question related to your server setup. No one here even knows what OS you're running so it's hard to give you advice. Usually you ask your webhost for questions related to your server. Hotlinking on *nix systems can be setup in a htaccess file or in the apache config file (if you're using the apache webserver - httpd.conf).
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: mc0676 on October 01, 2008, 10:11:20 am
He Stramm, i've a problem with your plugin.
How u can see here:
http://www.vwgolfcommunity.com/cpg/displayimage.php?album=311&pos=2

The code are not central with the image.

What do u think i need to do to solve this problem ?
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: DonRN on October 27, 2008, 08:43:41 am
I have been working on this script and have read every post here, but am still having some problems. I almost have it set up the way I'd like, but need a bit of help with some final coding issues

You can find a current example http://www.lifeinmybackyard.com/photoalbums/displayimage.php?album=2&pos=0 (http://www.lifeinmybackyard.com/photoalbums/displayimage.php?album=2&pos=0)

The code I am using has been modified using some of the many suggestions and examples on this thread. As you can see, the copy buttons are gone and the copy code is wrong. Is there any way to maintain this appearance and fix these to items?

I'm sure it is an easy fix for someone with the right knowledge.

Thanks in advance,
DonRN

Code: [Select]
<?php
/**************************************************
  CPG BB Code Plugin for Coppermine Photo Gallery
  *************************************************
  Copyright (c) 2006 Thomas Lange <stramm@gmx.net>
  *************************************************
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  *************************************************
  Coppermine version: 1.4.9
  BB Code Plugin version: 1.2
  $Revision: 1.0 $
  $Author: stramm $
***************************************************/


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

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


function 
bbcode_add_data($pic_data){ //$pic_data
global $CONFIG;
if(!
USER_ID) return $pic_data;

//here we define a var that holds the copy to clipboard javascript 
//unfortunately the Firefox security settings do not allow clipboard copy to work without modifying prefs... 
//therefore only a msg pops up if a user uses netscape/ firefox and presses the copy button
$script_data = <<< EOT

<script language="javascript" type="text/javascript">
<!--
function copy_clip(bb_text)
{
 if (window.clipboardData) 
   {
    window.clipboardData.setData("Text", bb_text);
   }
   else if (window.netscape) 
   { 
    alert("Due to Firefox secutrity settings it is not possible to use the copy button. Please manually copy the bb code with 3 fast left clicks into the textara. Then press ctrl+c");
   }
   return false;
}
//-->
</script>
EOT;

$fullsize_url get_pic_url($pic_data);  //here we grab the url to the fullsized pic
$thumb_url get_pic_url($pic_data'thumb'); //thumb url

$pic_data['title'] ? $name $pic_data['title'] : $name 'No Title'//chcking if the pic has a title, if not we set it to 'No title'

//here we define the actual bbcode coppermine path + the path to the pic $img_url is for the version that displays the thumb, $name_url is for a txt link with the ikmage title
$img_url '[url='.$CONFIG['ecards_more_pic_target'].$fullsize_url.'][IMG]'.$CONFIG['ecards_more_pic_target'].$thumb_url.'[/IMG][/url]';
$name_url '[url='.$CONFIG['ecards_more_pic_target'].$fullsize_url.']'.$name.'[/url]';
$img_dir_url $CONFIG['ecards_more_pic_target'].$fullsize_url;
$img_dir_url_forum '[IMG]'.$CONFIG['ecards_more_pic_target'].$fullsize_url.'[/IMG]';

//this just brings everything in form... we create a table etc.
$bbcode_data '<table align="center" width="'.$CONFIG['picture_width'].'">'.$script_data.'<tr>';
$bbcode_data .= '<td><label for="ftl">Thumbnail for forums:</label><input type="text" id="ftl" value=\''.$img_url.'></td>';
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="50" style="overflow:off;">'.$img_url.'</textarea><input type="button" value="Copy" onclick=\'copy_clip("'.$img_url.'")\'></td>';

$bbcode_data .= '</tr><tr>';

$bbcode_data .= '<td><label for="ff">Fullsize for forums:</label><input type="text" id="ff" value=\''.$img_dir_url_forum.'></td>';
$bbcode_data .= '<td><textarea name="bbcode" rows="3" cols="50">'.$name_url.'</textarea><input type="button" value="Copy" onclick=\'copy_clip("'.$name_url.'")\'></td>';

$bbcode_data .= '</tr><tr>';

$bbcode_data .= '<td><label for="idl">Direct link to image:</label><input type="text" id="idl" value=\''.$img_dir_url.'></td>';
$bbcode_data .= '<td><textarea name="bbcode" rows="3" cols="50">'.$img_dir_url.'</textarea><input type="button" value="Copy" onclick=\'copy_clip("'.$img_dir_url.'")\'></td>';
$bbcode_data .= '</tr></table>';

//finally we add the created stuff to the picture data and return it to coppermine
$pic_data['html'] = $pic_data['html'].$bbcode_data

return $pic_data
}
?>

Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: DonRN on October 28, 2008, 05:27:13 am
Okay, I have continued to work on this while awaiting a response, which is no problem as I see it as time for me to learn a bit more about the coding.

Anyway, I have managed to get it almost the way I would like but still have one problem as illustrated by the attached image. The problem area is outlined in red. The copy button works properly, but the complete information that should appear in the text area doesn't show. I'm sure it's a coding issue caused by my limited knowledge, but would like to fix it so it displays properly. I have also attached a zip of the file as it is loaded on my site for you to look at.

This plugin is exactly what I have been looking for so any help at all to get it to display properly would be greatly appreciated.

Thanks,
DonRN
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on October 28, 2008, 06:17:19 pm
From the first view I just can see that you do not close the value attribute properly

Should look eg. similar to
Code: [Select]
value=\''.$img_dir_url_forum.'\'>
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: DonRN on October 29, 2008, 01:49:44 am
Making that change gave me a parse error.

Any other suggestions?

Please and Thank You
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: DonRN on October 29, 2008, 02:22:46 am
With this code:

Code: [Select]
<?php
/**************************************************
  CPG BB Code Plugin for Coppermine Photo Gallery
  *************************************************
  Copyright (c) 2006 Thomas Lange <stramm@gmx.net>
  *************************************************
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  *************************************************
  Coppermine version: 1.4.9
  BB Code Plugin version: 1.2
  $Revision: 1.0 $
  $Author: stramm $
***************************************************/


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

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


function 
bbcode_add_data($pic_data){ //$pic_data
global $CONFIG;
if(!
USER_ID) return $pic_data;

//here we define a var that holds the copy to clipboard javascript 
//unfortunately the Firefox security settings do not allow clipboard copy to work without modifying prefs... 
//therefore only a msg pops up if a user uses netscape/ firefox and presses the copy button
$script_data = <<< EOT

<script language="javascript" type="text/javascript">
<!--
function copy_clip(bb_text)
{
 if (window.clipboardData) 
   {
    window.clipboardData.setData("Text", bb_text);
   }
   else if (window.netscape) 
   { 
    alert("Due to Firefox secutrity settings it is not possible to use the copy button. Please manually copy the bb code with 3 fast left clicks into the textara. Then press ctrl+c");
   }
   return false;
}
//-->
</script>
EOT;

$fullsize_url get_pic_url($pic_data);  //here we grab the url to the fullsized pic
$thumb_url get_pic_url($pic_data'thumb'); //thumb url

$pic_data['title'] ? $name $pic_data['title'] : $name 'No Title'//chcking if the pic has a title, if not we set it to 'No title'

//here we define the actual bbcode coppermine path + the path to the pic $img_url is for the version that displays the thumb, $name_url is for a txt link with the ikmage title

$img_url '[url='.$CONFIG['ecards_more_pic_target'].$fullsize_url.'][IMG]'.$CONFIG['ecards_more_pic_target'].$thumb_url.'[/IMG][/url]';
$name_url '[url='.$CONFIG['ecards_more_pic_target'].$fullsize_url.']'.$name.'[/url]';
$img_dir_url $CONFIG['ecards_more_pic_target'].$fullsize_url;
$img_dir_url_forum '[IMG]'.$CONFIG['ecards_more_pic_target'].$fullsize_url.'[/IMG]';

//this just brings everything in form... we create a table etc.

$bbcode_data '<table align="center" width="'.$CONFIG['picture_width'].'">'.$script_data.'<tr>';
$bbcode_data .= '<td>Thumbnail Size</td>';
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="40" style="overflow:off;">'.$img_url.'</textarea><input type="button" value="Copy" onclick=\'copy_clip("'.$img_url.'")\'></td>';

$bbcode_data .= '</tr><tr>';

$bbcode_data .= '<td>Full Size</td>';
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="40">'.$img_dir_url_forum.'</textarea><input type="button" value="Copy" onclick=\'copy_clip("'.$img_dir_url_forum.'")\'></td>';

$bbcode_data .= '</tr><tr>';

$bbcode_data .= '<td>Direct Link</td>';
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="40">'.$img_dir_url.'</textarea><input type="button" value="Copy" onclick=\'copy_clip("'.$img_dir_url.'")\'></td>';

$bbcode_data .= '</tr></table>';


//finally we add the created stuff to the picture data and return it to coppermine
$pic_data['html'] = $pic_data['html'].$bbcode_data

return $pic_data
}
?>

I get the results in the image attached. How can I fix the second text area to show the code for the image and not just the [IMG] tag?

Thanks
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on October 29, 2008, 12:40:01 pm
Can't suggest more except checking your css (seems to be theme related for me) as you haven't posted a link to your gallery.


My above post was meant for the lines similar to
Code: [Select]
$bbcode_data .= '<td><label for="ftl">Thumbnail for forums:</label><input type="text" id="ftl" value=\''.$img_url.'></td>';
This is definitely wrong syntax and should be corrected the way I told you
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: DonRN on October 30, 2008, 12:30:05 am
The link to my gallery and an image displaying the problem is as follows:

http://www.lifeinmybackyard.com/photoalbums/displayimage.php?album=6&pos=27 (http://www.lifeinmybackyard.com/photoalbums/displayimage.php?album=6&pos=27)

I have changed the code to:
Code: [Select]
$bbcode_data .= '<td>Full Size</td>';
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="40">'.$img_dir_url_forum.'</textarea><input type="button" value="Copy" onclick=\'copy_clip("'.$img_dir_url_forum.'")\'></td>';

Thanks
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: DonRN on November 01, 2008, 09:19:25 pm
I have tried every possible solution offered in this thread without my problem being solved. Can someone help me figure out why the actual url does not show up on the "Full Size" line?

The link to my gallery displaying my problem (the second line to copy) is:

http://lifeinmybackyard.com/photoalbums/displayimage.php?album=6&pos=28

The code I have is:
Code: [Select]
//here we define the actual bbcode coppermine path + the path to the pic $img_url is for the version that displays the thumb, $name_url is for a txt link with the ikmage title

$img_url = '[url='.$CONFIG['ecards_more_pic_target'].$fullsize_url.'][IMG]'.$CONFIG['ecards_more_pic_target'].$thumb_url.'[/IMG][/url]';
$name_url = '[url='.$CONFIG['ecards_more_pic_target'].$fullsize_url.']'.$name.'[/url]';
$img_dir_url = $CONFIG['ecards_more_pic_target'].$fullsize_url;
$img_dir_url_forum = '[IMG]'.$CONFIG['ecards_more_pic_target'].$fullsize_url.'[/IMG]';

//this just brings everything in form... we create a table etc.

$bbcode_data = '<table align="center" width="'.$CONFIG['picture_width'].'">'.$script_data.'<tr>';
$bbcode_data .= '<td>Thumbnail Size</td>';
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="40" style="overflow:off;">'.$img_url.'</textarea><input type="button" value="Copy" onclick=\'copy_clip("'.$img_url.'")\'></td>';

$bbcode_data .= '</tr><tr>';

$bbcode_data .= '<td>Full Size</td>';
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="40">'.$img_dir_url_forum.'</textarea><input type="button" value="Copy" onclick=\'copy_clip("'.$img_dir_url_forum.'")\'></td>';

$bbcode_data .= '</tr><tr>';

$bbcode_data .= '<td>Direct Link</td>';
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="40">'.$img_dir_url.'</textarea><input type="button" value="Copy" onclick=\'copy_clip("'.$img_dir_url.'")\'></td>';

$bbcode_data .= '</tr></table>';


I'm sorry if I am being a pest, but I don't know much about php and don't know how to fix this.

Thanks
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Nibbler on November 01, 2008, 10:59:13 pm
Looks fine to me. You just need to scroll the box to see the full code.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Troyl on November 18, 2008, 01:34:37 am
i have used the code DonRN posted since it was just what i needed but it still didnt fix one of my problems

heres the link to my site. http://www.venommustangs.com/pics/cpg1410/displayimage.php?album=random&cat=0&pos=-823
as you can see you have to stroll along way to even see the pic

any idea? or is it just my theme?
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on November 18, 2008, 08:12:36 am
That's the drawback of a solution that puts the url visible in one line.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Troyl on November 18, 2008, 08:57:25 am
so it cant be fixxed? ur side and DonRN look good :( i dont care about seeing the url on 1 line all i do is hit the copy buttion anyway.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on November 18, 2008, 09:01:44 am
just don't use 'overflow' so that the line can break
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Troyl on November 18, 2008, 09:59:48 pm
i found out my problem i have to replace '.$CONFIG['picture_width'].' with auto and it fixed my problem
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: fabioski on January 10, 2009, 04:36:56 am
I preferr to link the thumb and title to the intermediate page (like this
(http://skimaps.skiforum.it/skimaps/albums/userpics/10003/thumb_Alta_Badia.jpg) (http://skimaps.skiforum.it/skimaps/displayimage.php?album=1&pos=3)
) not to the big file (like this:
(http://skimaps.skiforum.it/skimaps/albums/userpics/10003/thumb_Alta_Badia.jpg) (http://skimaps.skiforum.it/skimaps/albums/userpics/10003/Alta_Badia.jpg)
)
How can I modify the MOD?
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on January 10, 2009, 10:37:41 am
has been answered within this thread
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: youki517 on February 21, 2009, 03:08:37 pm
Very fine PlugIn, but i have one problem:
how to use this plug-in to the thumbnails below, thank you!
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: flapane on February 23, 2009, 05:19:53 pm
Hi
I modified the code in this way
Code: [Select]
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="40" style="overflow:off;">'.$img_url.' [SIZE="1"]Click on a photo for various data and zoom[/SIZE]</textarea></td>';
If I paste it in a bb, the text will appear at the right of the photo.
Any way to put it UNDER the photo?
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Jixzer on February 24, 2009, 05:05:58 pm
This looks like a great plugin, but before I use it, I have a pretty simple question that I didn't see asked.  I have the JS/FLV movie player mod added to my gallery. 

Example: http://www.freakingamers.com/gallery/displayimage.php?album=8&pos=0

Will this mod be able to tell the difference between an flv/mov/avi and all it's associated code and a standard image?

Thanks.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Jixzer on February 25, 2009, 01:52:33 am
I installed the plugin and as I suspected, it does not tell the difference between a picture and a video. For my vids, it simply shows the default thumbnail.  I modded the plugin to show the full size image versus a thumbnail.  I'd like the data to be as accessible as possible and would rather they see the full product in the intended thread rather than having to link away.

Is there anyway to modify this plugin to recognize the difference between a picture and a video and include all the data required to embed a playable video in the forums rather than a link to the gallery?

Basically, the data that will need to be included is this (example):

<embed src="mediaplayer.swf" width='424' height='340' allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"
flashvars="file=albums/userpics/10002/ABKinAction.flv&image=images/thumb_movie.jpg"></embed>

If a bbcode needs to be added, that's fine.

Thanks.
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Jixzer on February 25, 2009, 04:25:23 am
I guess I'm just impatient.  I looked over the code, and though I'm no programmer, I set up a BBcode that would work on my site and implemented it into the plugin given.  Also, I only really wanted this so that users could embed their gallery entries into the forums.  Here's what I did:

Code: [Select]
<?php
/**************************************************
  CPG BB Code Plugin for Coppermine Photo Gallery 
  Modified by Zachary Barnes of UselessHacks.com
Now creates html tags instead of BB
  *************************************************
  Copyright (c) 2006 Thomas Lange <stramm@gmx.net>
  *************************************************
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  *************************************************
  Coppermine version: 1.4.9
  BB Code Plugin version: 1.2
  $Revision: 1.0 $
  $Author: stramm $
***************************************************/


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

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


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

//Javascript to hide hotlinking information along with div arrangement, taken from a common toggling script floating around the net
$script_data = <<< EOT

<script language="javascript" type="text/javascript">
<!--
function toggleLayer(whichLayer)
{
if (document.getElementById)
{
// this is the way the standards work
var style2 = document.getElementById(whichLayer).style;
style2.display = style2.display? "":"block";
}
else if (document.all)
{
// this is the way old msie versions work
var style2 = document.all[whichLayer].style;
style2.display = style2.display? "":"block";
}
else if (document.layers)
{
// this is the way nn4 works
var style2 = document.layers[whichLayer].style;
style2.display = style2.display? "":"block";
}
}
//-->
</script>

<br><a href="javascript:toggleLayer('hotlinking');" title="View Hotlinking Information">View Hotlinking Information</a>
<div id="hotlinking" style="display: none; margin: 0px 20px 0px 20px;">

EOT;
    
    
$thumb_url get_pic_url($pic_data'thumb');  //here we grab the url to the thumb url
$int_url get_pic_url($pic_data'normal');  //intermediate pic
$full_url get_pic_url($pic_data'fullsize');            //fullsized pic
$pic_data['title'] ? $name $pic_data['title'] : $name 'No&nbsp;Title'//checking if the pic has a title, if not we set it to 'No title'

//Generating the file paths for each picture size

$fs_url '&#38;#91;img&#38;#93;'.$CONFIG['ecards_more_pic_target'].$full_url.'&#38;#91;&#38;#47;img&#38;#93;';
$ve_url '&#38;#91;flv&#38;#93;'.$CONFIG['ecards_more_pic_target'].$full_url.'&#38;#91;&#38;#47;flv&#38;#93;';
//this just brings everything in form... we create a table etc., 

$bbcode_data $script_data;
$bbcode_data .= '<table align="center" width="600">';

//thumbnail image code with link to intermediate image
$textarea_prop 'name="bbcode" rows="1" cols="75" style="overflow:off; white-space:nowrap" readonly="readonly"';

//fullsize image code
$bbcode_data .= '<tr><td>Fullsize:</td></tr>';
$bbcode_data .= '<tr><td><textarea '.$textarea_prop.'>'.$fs_url.'</textarea></td></tr>';

//video embed code
$bbcode_data .= '<tr><td>Video Embed Code:</td></tr>';
$bbcode_data .= '<tr><td><textarea '.$textarea_prop.'>'.$ve_url.'</textarea></td></tr>';

//closing table and visiblity div
$bbcode_data .= '</table></div>';



//finally we add the created stuff to the picture data and return it to coppermine
$pic_data['html'] = $pic_data['html'].$bbcode_data

return $pic_data
}

?>


Basically, I removed the entire thumbnail string and added an extra variable specifically for my FLV files.  As I allow more video formats, I'll increase the options.  Granted, it's not the most flexible, but it's easy and functional for my users.  :)
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Jixzer on February 25, 2009, 04:26:16 am
Oh, sorry, for an example you can go to http://www.freakingamers.com/gallery/
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: tapety_net on February 28, 2009, 04:38:42 pm
Hello,

I need modification of bbcode, not like plugin but copy/paste in theme.php in specific place,on intermediate page, below CAPTION, i need:
1. title
2. caption
3. bbcode
4. vote......

Code: [Select]
// HTML template for intermediate image display
$template_display_media = <<<EOT
...
...
...
<!-- BEGIN title -->
                                <tr>
                                        <td class="tableb"><center><b>
                                                {TITLE}
                                        </b></center></td>
                                </tr>
<!-- END title -->
<!-- BEGIN caption -->
                                <tr>
                                        <td class="tableb"><center>
                                                {CAPTION}
                                                {BBCODE} --------------------- how to make this <<<<<<<<<<<<<<<<<
                                        </center></td>
                                </tr>
<!-- END caption -->
                        </table>
<!-- END img_desc -->
                </td>
        </tr>
EOT;
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: xfantasy on March 21, 2009, 05:42:55 am
Hello guys , i was modify this code for my consuming. I hope that some one gona like...

Code: [Select]
if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');

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


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

$script_data = <<< EOT

EOT;

$thumb_url = get_pic_url($pic_data, 'thumb');  //here we grab the url to the thumb url
$full_url = 'displayimage.php?pos=-'.$pic_data['pid']; //fullsized pic
$pic_data['title'] ? $name = $pic_data['title'] : $name = 'No&nbsp;Title'; //checking if the pic has a title, if not we set it to 'No title'

//here we define the actual bbcode coppermine path + the path to the pic $img_url is for the version that displays the thumb, $name_url is for a txt link with the ikmage title
    $thu_url = '[url='.$CONFIG['ecards_more_pic_target'].$full_url.'][IMG]'.$CONFIG['ecards_more_pic_target'].$thumb_url.'[/IMG][/url]';
    $im_url = '&lt;a&nbsp;href="'.$CONFIG['ecards_more_pic_target'].$full_url.'"&gt;&lt;img&nbsp;src="'.$CONFIG['ecards_more_pic_target'].$thumb_url.'"&nbsp;alt="'.$name.'"&nbsp;/&gt;&lt;/a&gt;';

//this just brings everything in form... we create a table etc.
$bbcode_data = '<table align="center" width="'.$CONFIG['picture_width'].'">'.$script_data.'<tr>';

$bbcode_data .= '<td>Grab Thumbnail For Forum :</td>';
    $bbcode_data .= '<tr><td><textarea name="bbcode" rows="1" cols="50" wrap="off" style="overflow:hidden;height:15px;" onfocus="this.select();" onclick="this.select();">'.$textarea_prop.''.$thu_url.'</textarea></td></tr>';
$bbcode_data .= '</tr><tr>';
$bbcode_data .= '<td>Grab Thumbnail For Blog :</td>';
    $bbcode_data .= '<tr><td><textarea name="bbcode" rows="1" cols="50" wrap="off" style="overflow:hidden;height:15px;" onfocus="this.select();" onclick="this.select();">'.$textarea_prop.''.$im_url.'</textarea></td></tr>';

$bbcode_data .= '</tr></table>';

//finally we add the created stuff to the picture data and return it to coppermine
$pic_data['html'] = $pic_data['html'].$bbcode_data;

return $pic_data;
}
?>

Any comment or suggestion well be helpful  ;)
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Fabricio Ferrero on March 21, 2009, 09:25:43 am
Any comment or suggestion well be helpful  ;)

If so:

Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: xfantasy on March 21, 2009, 11:06:25 am
ok

code description :

1. code showing thumbnail links to add image in forum or blog (my requirement of gallery)
2. when visitor press on it link is highlited ,rigth click copy
3. thumbnail hotlink redirect visitors to gallery where image is posted ( displayimage.php?pos=- )

i just wont to add that i don't know coding , but i was reading topic from beginning. after some time
and mixing couple code of other users i find way to sort proper code what i was looking for.

P.S. i have problem with coper_ad, can any one help me? ???
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Joachim Müller on March 23, 2009, 07:06:33 pm
P.S. i have problem with coper_ad, can any one help me? ???
Definitely not in this thread. Respect board rules!
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: bb3 on March 26, 2009, 01:59:53 pm
hi there

is there any way of changing the location of bbcode? I want to place it outside the image border.
I want to place it outside the black area. thanks in advance!

here's a link
http://redlens.org/gallery/displayimage.php?album=lastup&cat=0&pos=1
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: bb3 on March 27, 2009, 03:17:56 am
hi there

is there any way of changing the location of bbcode? I want to place it outside the image border.
I want to place it outside the black area. thanks in advance!

here's a link
http://redlens.org/gallery/displayimage.php?album=lastup&cat=0&pos=1

Please ignore my query. I found the solution

Find
Code: [Select]
$pic_data['html'] = $pic_data['html'].$bbcode_data
Change to
Code: [Select]
$pic_data['menu'] = $pic_data['menu'].$bbcode_data
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: crow5716 on May 31, 2009, 01:20:20 am
so what value can you use if you are not in an image view. but rather in the album view. how can i pull in the url to my text boxes. just read through this whole post. but $img_url, $pic_url, and $thumb_url are all coming up blank.

here's a link to the page i'm trying to do this on. pretend it's not ugly i haven't skinned it yet

http://bouncingtrucks.com/gallery/thumbnails.php?album=2 (http://bouncingtrucks.com/gallery/thumbnails.php?album=2)

i want it to look like the gallery i have now, but i'm trying to do it through coppermine now

here's my current gallery

http://bouncingtrucks.com/Trucks_Chevy_1.html (http://bouncingtrucks.com/Trucks_Chevy_1.html)

thanks

-crow
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: fotografi on August 29, 2009, 02:59:55 am
Any idea how to add these fields in the File information area, under "Favorites:   Add to Favorites"?!

Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: Stramm on August 29, 2009, 08:17:00 pm
search the plugins board for an alternative plugin
Title: Re: copy/ paste bbcode img URL below intermediate image v1.1
Post by: lurkalot on August 30, 2009, 12:59:04 pm
Any idea how to add these fields in the File information area, under "Favorites:   Add to Favorites"?!



yep, use this plugin. HTML Embedding Plugin (http://forum.coppermine-gallery.net/index.php/topic,46121.0.html)
Title: Re: copy/ paste bbcode img URL below intermediate image
Post by: ligerzero on February 08, 2010, 04:39:52 am
hi there. im trying to get an flv embedded on my site, but Jixzer one is broken

the outcome comes out like ths

&#91;flv&#93;http://www.ligerzero.net/coppermine_test/albums/uploads/Videos/motorsports/YouTube-_Hyla_Breese_near_miss_.mp4&#91;&#47;flv&#93;

anyone help pls? thanks
Title: Re: copy/ paste bbcode img URL below intermediate image
Post by: aftab1003 on February 17, 2010, 12:29:34 pm
thanks for the plugin

i install it and works fine with direct link ( hot link )

is there any way to genrate the bbcode with thumnail, or any size with link to intermed image page not to direct image link ( no hot link )

thanks in advance
Title: Re: copy/ paste bbcode img URL below intermediate image
Post by: Jinjo52 on August 15, 2010, 10:20:48 pm
Got a Problem with my bbcode when i want to link my images i am not able to see them on communitys i says then " Externes Bild kann nicht angezeigt werden"
bute the image code shpuld be right here you got: (http://www.jpic.eu/) (http://www.jpic.eu/albums/gbpics/Freitag/Fr003.jpg) does anbody know what is wrong or is it because of disallowed hotlinking?how to activate that a few weeks before the links where functional.
Regards Phil
Title: Re: copy/ paste bbcode img URL below intermediate image
Post by: Jinjo52 on August 15, 2010, 11:31:47 pm
Got a Problem with my bbcode when i want to link my images i am not able to see them on communitys i says then " Externes Bild kann nicht angezeigt werden"
bute the image code shpuld be right here you got: (http://www.jpic.eu/) (http://www.jpic.eu/albums/gbpics/Freitag/Fr003.jpg) does anbody know what is wrong or is it because of disallowed hotlinking?how to activate that a few weeks before the links where functional.
Regards Phil


Sry got already fixed it i took html embed and modified the code that its running for all communitys thanks anyway for the opertunity to use coppermine for free and realy nice treads i found here .
weiter so Webbi.
Title: Re: copy/ paste bbcode img URL below intermediate image
Post by: CoppermineUser99 on July 14, 2011, 01:58:28 am
First, I would like to say thanks for creating this module and for helping to provide tech support for it.

Is there a way to have the BBCode appear in a popup javascript window (instead of appearing under the intermediate photo)?

Will I have to create a new php page and pass variables to it? Will I have to use any include statements to get any global variables?

(I am sure I can find the actual code to make a window open using javascript on the web somewhere. My concern is how I would pass the variables - and which ones I will have to pass - to the popup window.)

Thanks in advance, and I apologize if this has already been covered. I searched for it in this thread but didn't see it.
Title: Re: copy/ paste bbcode img URL below intermediate image
Post by: phill104 on July 14, 2011, 02:30:23 pm
Unfortunately, support for CPG 1.4.x ended last year. You should upgrade to the new 1.5.x line where this plugin is also available. Also there is the superb EnlargeIT plugin whis displays images in a nice JS popup with and has a bbcode button included in the popup.
Title: Re: copy/ paste bbcode img URL below intermediate image
Post by: alexor on August 12, 2011, 04:40:58 pm
Where can i find this plugin for  1.5.*** ?
Was using search, but didn't find it
Title: Re: copy/ paste bbcode img URL below intermediate image
Post by: flapane on March 14, 2014, 11:37:22 pm
The thread should be moved to 1.5 section.

I noticed that googlebot was indexing the output of the plugin, thus indexing the bbcode/forum links and displaying them as the MAIN content of the search results.
I'm not sure about it, but it may lead to a loss of visitors, as the visitor won't find the content indexed by google interesting.

So I edited the final part of the script by adding googleoff/on tags.
Code: [Select]
//this just brings everything in form... we create a table etc.
$bbcode_data = '<!--googleoff: index--><table align="center" width="'.$CONFIG['picture_width'].'">'.$script_data.'<tr>';
$bbcode_data .= '<td>BBCode/Forum (Copy/Paste)</td>';
$bbcode_data .= '<td><textarea name="bbcode" readonly="readonly" onfocus="this.select();" onclick="this.select();" rows="1" cols="50" style="overflow:off;">'.$img_url.'
[SIZE="1"]'.$name.' [i](Click on the photo for EXIF info)[/i][/SIZE]</textarea></td>';

$bbcode_data .= '</tr><tr>';

$bbcode_data .= '<td>HTML code (Copy/Paste)</td>';
$bbcode_data .= '<td><textarea name="bbcode" readonly="readonly" onfocus="this.select();" onclick="this.select();" rows="1" cols="50"><a href="'.$CONFIG['ecards_more_pic_target'].$fullsize_url.'">'.$name_url.'</a></textarea></td>';

$bbcode_data .= '</tr></table><!--googleon: index-->';
Title: Re: copy/ paste bbcode img URL below intermediate image
Post by: miditech on May 09, 2016, 07:43:40 am
Thanks for the reply and i am searching for the question..
now it's work fine ..

Thanks a lot again!