Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1] 2 3 4 5 ... 10   Go Down

Author Topic: copy/ paste bbcode img URL below intermediate image  (Read 298849 times)

0 Members and 1 Guest are viewing this topic.

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
copy/ paste bbcode img URL below intermediate image
« 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]
« Last Edit: March 03, 2010, 09:57:58 am by Joachim Müller »
Logged

barbv59

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #1 on: September 29, 2006, 05:51:28 am »

So this only works for Forums? How do you install this?
Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #2 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
Logged
‍I don't answer to PM with support question
Please post your issue to related board

Davide Renda

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1427
  • aka "Lontano"
    • www.daviderenda.eu
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #3 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!)
« Last Edit: September 29, 2006, 11:25:19 pm by lontano »
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #4 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.

MrBlue

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #5 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

Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #6 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'];

MrBlue

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #7 on: October 16, 2006, 08:29:08 pm »

Thx for reply :)

works fine!
Logged

b4uphotos

  • Translator
  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 59
    • B4U India
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #8 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
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #9 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;

b4uphotos

  • Translator
  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 59
    • B4U India
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #10 on: October 18, 2006, 04:16:57 pm »

thanks!

ITs working fine.

Thanks a lot!

With Best Regards!
Anand Maheshwari
Logged

realchaos1

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #11 on: October 19, 2006, 12:31:15 am »

i dont want the thumbnail image, any alternative?
Logged

realchaos1

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #12 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]
« Last Edit: October 24, 2006, 07:13:48 pm by GauGau »
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #13 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())

akulion

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #14 on: October 24, 2006, 02:55:50 pm »

Thanks for this plugin - just what I needed and works wonderfully :D
Logged

Iced Coffee

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 128
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #15 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?
« Last Edit: October 25, 2006, 08:34:04 am by GauGau »
Logged

Iced Coffee

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 128
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #16 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.
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #17 on: October 25, 2006, 08:36:18 am »

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

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #18 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

jesseg

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #19 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?
Logged
Pages: [1] 2 3 4 5 ... 10   Go Up
 

Page created in 0.029 seconds with 19 queries.