Advanced search  

News:

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

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

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

0 Members and 1 Guest are viewing this topic.

jesseg

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #20 on: October 25, 2006, 11: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

  • 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 #21 on: October 26, 2006, 09: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

Iced Coffee

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 128
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #22 on: October 31, 2006, 01: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

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #23 on: October 31, 2006, 05:00:14 am »

This very thread that you're reading at the moment.
Logged

Iced Coffee

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 128
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #24 on: November 01, 2006, 08: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

  • 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 #25 on: November 01, 2006, 08: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

Iced Coffee

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 128
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #26 on: November 02, 2006, 04: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, 05:01:35 am by Iced Coffee »
Logged

AWJunkies

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #27 on: December 08, 2006, 09: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
  • *
  • Offline Offline
  • Posts: 41
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #28 on: December 18, 2006, 08:54:44 pm »

is there a way to make it so only loged in users can view the links?
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 #29 on: December 18, 2006, 09:28:59 pm »

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

add

Code: [Select]
if(!USER_ID) return $pic_data;

boltonline

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 41
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #30 on: December 18, 2006, 11:35:38 pm »

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

add

Code: [Select]
if(!USER_ID) return $pic_data;
thanks!
Logged

boltonline

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 41
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #31 on: December 26, 2006, 09: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

  • 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 #32 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
Code: [Select]
$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: [Select]
$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

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 41
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #33 on: December 29, 2006, 04:49:06 pm »

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

in the few lines of codebase.php search for
Code: [Select]
$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: [Select]
$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: [Select]
[url=LINK GOES HERE][IMG]LINK GOES HERE[/img][/url]
i need it like this:
Code: [Select]
<img src="LINK GOES HERE">
« Last Edit: December 29, 2006, 05:08:05 pm by boltonline »
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 #34 on: December 29, 2006, 05: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

boltonline

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 41
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #35 on: December 29, 2006, 06:06:12 pm »

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

under
Code: [Select]
$name_url = '[url='.$CONFIG['ecards_more_pic_target'].$fullsize_url.']'.$name.'[/url]';
add
Code: [Select]
$name_url2 = '<img src='.$CONFIG['ecards_more_pic_target'].$fullsize_url.'>';

under
Code: [Select]
$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: [Select]
$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
  • *
  • Offline Offline
  • Posts: 31
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #36 on: January 22, 2007, 11: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
  • Offline Offline
  • Posts: 2
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #37 on: February 23, 2007, 09: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: [Select]
<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: [Select]
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: [Select]
<?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.
« Last Edit: February 25, 2007, 03:23:44 am by zrbarnes »
Logged

donofnet

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #38 on: March 17, 2007, 02: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. ??? ??? ??? ???
« Last Edit: March 17, 2007, 03:19:17 pm by donofnet »
Logged

zrbarnes

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: copy/ paste bbcode img URL below intermediate image v1.1
« Reply #39 on: March 21, 2007, 05:26:42 am »

Are you starting with my version or the original?
Logged
Pages: 1 [2] 3 4 5 6 ... 10   Go Up
 

Page created in 0.033 seconds with 20 queries.