Support Forum Project Downloads FAQ Documentation About Demo Tutorials Blog Plugins
July 03, 2009, 10:30:13 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Mark your threads as "solved"
There is a new feature on the support boards that allows thread starters to mark their threads as solved for the benefit of others with similar issues.
[more]
   Home   Help Search Board rules Login Register  
Pages: [1] 2 3 4 5 ... 9   Go Down
  Send this topic  |  Print  
Author Topic: copy/ paste bbcode img URL below intermediate image v1.1  (Read 46057 times)
0 Members and 1 Guest are viewing this topic.
Stramm Topic starter
Dev Team member
Coppermine addict
****
Gender: Male
Posts: 5500



« on: September 16, 2006, 06: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


* bbcode.jpg (17.07 KB, 579x206 - viewed 2650 times.)
* bbcode.zip (1.65 KB - downloaded 663 times.)
* bbcode_1_2.zip (1.96 KB - downloaded 1391 times.)
« Last Edit: October 25, 2006, 06:41:50 pm by Stramm » Logged

my CPG sandbox: Version 1.4.18 with modpack running my Tentacle theme:
http://stramm.st.funpic.org/
barbv59
Coppermine newbie

Posts: 8


« Reply #1 on: September 29, 2006, 04:51:28 am »

So this only works for Forums? How do you install this?
Logged
Sami
Dev Team member
Coppermine addict
****
Gender: Male
Iran, Islamic Republic of Iran, Islamic Republic of

Posts: 3682


BMossavari


WWW
« Reply #2 on: September 29, 2006, 06: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
Logged

‍I don't answer to PM with support question
Please post your issue to related board
Davide Renda
Dev Team member
Coppermine addict
****
Gender: Male
France France

Posts: 1259


aka "Lontano"


WWW
« Reply #3 on: September 29, 2006, 10:18:35 pm »

I've deleted on lines 47 and 52 the buttons forms removing from both lines following code:
Code:
<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  Wink (as usual!)
« Last Edit: September 29, 2006, 10:25:19 pm by lontano » Logged

Stramm Topic starter
Dev Team member
Coppermine addict
****
Gender: Male
Posts: 5500



« Reply #4 on: September 30, 2006, 06: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.
Logged

my CPG sandbox: Version 1.4.18 with modpack running my Tentacle theme:
http://stramm.st.funpic.org/
MrBlue
Coppermine newbie

Posts: 18


« Reply #5 on: October 13, 2006, 07: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

Logged
Stramm Topic starter
Dev Team member
Coppermine addict
****
Gender: Male
Posts: 5500



« Reply #6 on: October 16, 2006, 07:29:35 am »

1. lil bug
find in codebase.php
Code:
$CURRENT_PIC_DATA['title']
replace with
Code:
$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:
$fullsize_url = get_pic_url($pic_data);  //here we grab the url to the fullsized pic
with
Code:
$fullsize_url = 'displayimage.php?pos=-'.$pic_data['pid'];
Logged

my CPG sandbox: Version 1.4.18 with modpack running my Tentacle theme:
http://stramm.st.funpic.org/
MrBlue
Coppermine newbie

Posts: 18


« Reply #7 on: October 16, 2006, 07:29:08 pm »

Thx for reply Smiley

works fine!
Logged
b4uphotos
Translator
Coppermine regular visitor
**
Posts: 59



WWW
« Reply #8 on: October 18, 2006, 09:57:16 am »

is there any how any way ?

so that we can hide the bbcode to visitors and only admin can view that
Logged
Stramm Topic starter
Dev Team member
Coppermine addict
****
Gender: Male
Posts: 5500



« Reply #9 on: October 18, 2006, 10:05:40 am »

open codebase.php and after
Code:
global $CONFIG;
add
Code:
if (!(GALLERY_ADMIN_MODE)) return $pic_data;
Logged

my CPG sandbox: Version 1.4.18 with modpack running my Tentacle theme:
http://stramm.st.funpic.org/
b4uphotos
Translator
Coppermine regular visitor
**
Posts: 59



WWW
« Reply #10 on: October 18, 2006, 03:16:57 pm »

thanks!

ITs working fine.

Thanks a lot!

With Best Regards!
Anand Maheshwari
Logged
realchaos1
Coppermine newbie

Posts: 2


« Reply #11 on: October 18, 2006, 11:31:15 pm »

i dont want the thumbnail image, any alternative?
Logged
realchaos1
Coppermine newbie

Posts: 2


« Reply #12 on: October 18, 2006, 11:48:32 pm »

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:
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:
<?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]


* gallery_330_13_125905.jpg (195.26 KB, 800x533 - viewed 937 times.)
« Last Edit: October 24, 2006, 06:13:48 pm by GauGau » Logged
Stramm Topic starter
Dev Team member
Coppermine addict
****
Gender: Male
Posts: 5500



« Reply #13 on: October 19, 2006, 07: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())
Logged

my CPG sandbox: Version 1.4.18 with modpack running my Tentacle theme:
http://stramm.st.funpic.org/
akulion
Coppermine novice
*
Posts: 21


« Reply #14 on: October 24, 2006, 01:55:50 pm »

Thanks for this plugin - just what I needed and works wonderfully Cheesy
Logged
Iced Coffee
Coppermine regular visitor
**
Posts: 88


« Reply #15 on: October 25, 2006, 06: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?


* Snap2.jpg (107.07 KB, 880x561 - viewed 825 times.)
« Last Edit: October 25, 2006, 07:34:04 am by GauGau » Logged
Iced Coffee
Coppermine regular visitor
**
Posts: 88


« Reply #16 on: October 25, 2006, 06: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.
Logged
Stramm Topic starter
Dev Team member
Coppermine addict
****
Gender: Male
Posts: 5500



« Reply #17 on: October 25, 2006, 07:36:18 am »

the plugin interfers with another one... move it up or down in the plugin manager
Logged

my CPG sandbox: Version 1.4.18 with modpack running my Tentacle theme:
http://stramm.st.funpic.org/
Stramm Topic starter
Dev Team member
Coppermine addict
****
Gender: Male
Posts: 5500



« Reply #18 on: October 25, 2006, 06: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
Logged

my CPG sandbox: Version 1.4.18 with modpack running my Tentacle theme:
http://stramm.st.funpic.org/
jesseg
Coppermine newbie

Posts: 2


« Reply #19 on: October 25, 2006, 09:23:22 pm »

The plugin works great, but the image url show "localhost" instead of my domain name...  any suggestions?
Logged
Pages: [1] 2 3 4 5 ... 9   Go Up
  Send this topic  |  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.073 seconds with 20 queries.