Advanced search  

News:

cpg1.5.46 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.44 or older update to this latest version as soon as possible.
[more]

Pages: 1 ... 4 5 6 7 [8] 9 10   Go Down

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

0 Members and 1 Guest are viewing this topic.

DonRN

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

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
}
?>

Logged

DonRN

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

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 6006
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #142 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.'\'>
Logged
my CPG sandbox: Version 1.4.18 with modpack running my Tentacle theme:
http://stramm.st.funpic.org/

DonRN

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #143 on: October 29, 2008, 01:49:44 am »

Making that change gave me a parse error.

Any other suggestions?

Please and Thank You
Logged

DonRN

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

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 6006
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #145 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
Logged
my CPG sandbox: Version 1.4.18 with modpack running my Tentacle theme:
http://stramm.st.funpic.org/

DonRN

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

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
Logged

DonRN

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

Nibbler

  • Guest
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #148 on: November 01, 2008, 10:59:13 pm »

Looks fine to me. You just need to scroll the box to see the full code.
Logged

Troyl

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

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 6006
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #150 on: November 18, 2008, 08:12:36 am »

That's the drawback of a solution that puts the url visible in one line.
Logged
my CPG sandbox: Version 1.4.18 with modpack running my Tentacle theme:
http://stramm.st.funpic.org/

Troyl

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

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 6006
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #152 on: November 18, 2008, 09:01:44 am »

just don't use 'overflow' so that the line can break
Logged
my CPG sandbox: Version 1.4.18 with modpack running my Tentacle theme:
http://stramm.st.funpic.org/

Troyl

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

fabioski

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #154 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)
) not to the big file (like this:
(http://skimaps.skiforum.it/skimaps/albums/userpics/10003/thumb_Alta_Badia.jpg)
)
How can I modify the MOD?
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 6006
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #155 on: January 10, 2009, 10:37:41 am »

has been answered within this thread
Logged
my CPG sandbox: Version 1.4.18 with modpack running my Tentacle theme:
http://stramm.st.funpic.org/

youki517

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

flapane

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: it
  • Offline Offline
  • Gender: Male
  • Posts: 249
    • Flavio's page
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #157 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?

Jixzer

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

Jixzer

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

Page created in 0.031 seconds with 21 queries.