Support Forum Project Downloads FAQ Documentation About Demo Tutorials Blog Plugins
November 21, 2009, 07:46:33 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: cpg1.5.2 beta released
The brand new cpg1.5.x series that comes with a lot of new features finally has reached the release stage: a first public beta release cpg1.5.2 has been released that is mainly aimed at translators, testers and community members that have contributed in the past. The beta release is not meant to be used in a production environment, but only on testbeds and for evaluation purposes. There is currently no support for cpg1.5.x yet!
[more]
   Home   Help Search Board rules Login Register  
Pages: 1 [2] 3 4 5 6 ... 9   Go Down
  Send this topic  |  Print  
Author Topic: copy/ paste bbcode img URL below intermediate image v1.1  (Read 61416 times)
0 Members and 1 Guest are viewing this topic.
jesseg
Coppermine newbie

Posts: 2


« Reply #20 on: October 25, 2006, 10: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....>"?
Logged
Stramm Topic starter
Dev Team member
****
Gender: Male
Posts: 5622



« Reply #21 on: October 26, 2006, 08: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
Logged

my CPG sandbox: Version 1.4.18 with modpack running my Tentacle theme:
http://stramm.st.funpic.org/
Iced Coffee
Coppermine regular visitor
**
Posts: 92


« Reply #22 on: October 31, 2006, 12: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?
Logged
Joachim Müller
Administrator
*****
Gender: Male
Germany Germany

Posts: 45051


aka "GauGau"


WWW
« Reply #23 on: October 31, 2006, 04:00:14 am »

This very thread that you're reading at the moment.
Logged
Iced Coffee
Coppermine regular visitor
**
Posts: 92


« Reply #24 on: November 01, 2006, 07: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?
Logged
Stramm Topic starter
Dev Team member
****
Gender: Male
Posts: 5622



« Reply #25 on: November 01, 2006, 07: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
Logged

my CPG sandbox: Version 1.4.18 with modpack running my Tentacle theme:
http://stramm.st.funpic.org/
Iced Coffee
Coppermine regular visitor
**
Posts: 92


« Reply #26 on: November 02, 2006, 03: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).
« Last Edit: November 02, 2006, 04:01:35 am by Iced Coffee » Logged
AWJunkies
Contributor
***
Gender: Male
Posts: 130


« Reply #27 on: December 08, 2006, 08: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.
Logged
boltonline
Coppermine novice
*
Posts: 41


« Reply #28 on: December 18, 2006, 07:54:44 pm »

is there a way to make it so only loged in users can view the links?
Logged
Stramm Topic starter
Dev Team member
****
Gender: Male
Posts: 5622



« Reply #29 on: December 18, 2006, 08:28:59 pm »

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

add

Code:
if(!USER_ID) return $pic_data;
Logged

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


« Reply #30 on: December 18, 2006, 10:35:38 pm »

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

add

Code:
if(!USER_ID) return $pic_data;
thanks!
Logged
boltonline
Coppermine novice
*
Posts: 41


« Reply #31 on: December 26, 2006, 08: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">
Logged
Stramm Topic starter
Dev Team member
****
Gender: Male
Posts: 5622



« Reply #32 on: December 28, 2006, 06:14:22 am »

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

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

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


« Reply #33 on: December 29, 2006, 03:49:06 pm »

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

in the few lines of codebase.php search for
Code:
$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:
$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:
[url=LINK GOES HERE][IMG]LINK GOES HERE[/img][/url]

i need it like this:
Code:
<img src="LINK GOES HERE">
« Last Edit: December 29, 2006, 04:08:05 pm by boltonline » Logged
Stramm Topic starter
Dev Team member
****
Gender: Male
Posts: 5622



« Reply #34 on: December 29, 2006, 04: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
Logged

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


« Reply #35 on: December 29, 2006, 05:06:12 pm »

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

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

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


under
Code:
$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:
$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>';
Logged
lukasino
Coppermine novice
*
Posts: 28


« Reply #36 on: January 22, 2007, 10: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>';

Logged
zrbarnes
Coppermine newbie

Posts: 2


« Reply #37 on: February 23, 2007, 08: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:
<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:
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:
<?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.


* before_expanding.gif (16.12 KB, 548x163 - viewed 511 times.)

* expanded.gif (23.09 KB, 568x337 - viewed 610 times.)
* imgcode.zip (2.02 KB - downloaded 276 times.)
« Last Edit: February 25, 2007, 02:23:44 am by zrbarnes » Logged
donofnet
Coppermine newbie

Posts: 9


« Reply #38 on: March 17, 2007, 01: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. Huh Huh Huh Huh
« Last Edit: March 17, 2007, 02:19:17 pm by donofnet » Logged
zrbarnes
Coppermine newbie

Posts: 2


« Reply #39 on: March 21, 2007, 04:26:42 am »

Are you starting with my version or the original?
Logged
Pages: 1 [2] 3 4 5 6 ... 9   Go Up
  Send this topic  |  Print  
 
Jump to:  

Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC
Page created in 0.096 seconds with 17 queries.