copy/ paste bbcode img URL below intermediate image - Page 2 copy/ paste bbcode img URL below intermediate image - Page 2
 

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

Main Menu

copy/ paste bbcode img URL below intermediate image

Started by Stramm, September 16, 2006, 07:16:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jesseg

nevermind figured it out (admin config).  But can I modify the code to show the img src such as "<img src=www....>"?

Stramm

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

Iced Coffee

Quote from: Stramm on October 25, 2006, 08:36:18 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.


Quote from: Stramm on October 25, 2006, 07:40:27 PM
read this thread

Sorry, which thread, Stramm?

Joachim Müller


Iced Coffee

Quote from: GauGau on October 31, 2006, 05:00:14 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?

Stramm

Quotethe plugin interfers with another one...
looks like you have more plugins installed. This plugin has problems with another.

Quotemove 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

Iced Coffee

#26
Quote from: Stramm on November 01, 2006, 08:20:27 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).

AWJunkies

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.

boltonline

is there a way to make it so only loged in users can view the links?

Stramm

codebase.php... after
function bbcode_add_data($pic_data){ //$pic_data
global $CONFIG;


add

if(!USER_ID) return $pic_data;

boltonline

Quote from: Stramm on December 18, 2006, 09:28:59 PM
codebase.php... after
function bbcode_add_data($pic_data){ //$pic_data
global $CONFIG;


add

if(!USER_ID) return $pic_data;
thanks!

boltonline

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">

Stramm

just have a look at the code. Pretty much self explaining

in the few lines of codebase.php search for
$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
$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>';

boltonline

#33
Quote from: 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
$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
$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:
[url=LINK GOES HERE][IMG]LINK GOES HERE[/img][/url]

i need it like this:
<img src="LINK GOES HERE">

Stramm

$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

boltonline

thanks! i finally got it to work. this is what i did

under
$name_url = '[url='.$CONFIG['ecards_more_pic_target'].$fullsize_url.']'.$name.'[/url]';

add
$name_url2 = '<img src='.$CONFIG['ecards_more_pic_target'].$fullsize_url.'>';


under
$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
$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>';

lukasino

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>';


zrbarnes

#37
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

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


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.

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

donofnet

#38
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. ??? ??? ??? ???

zrbarnes