forum.coppermine-gallery.net
Support => cpg1.4 plugins => cpg1.4.x Support => Older/other versions => cpg1.4 plugin contributions => Topic started by: Stramm 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]
-
So this only works for Forums? How do you install this?
-
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
-
I've deleted on lines 47 and 52 the buttons forms removing from both lines following code:
<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!)
-
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.
-
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
-
1. lil bug
find in codebase.php
$CURRENT_PIC_DATA['title']
replace with
$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
$fullsize_url = get_pic_url($pic_data); //here we grab the url to the fullsized pic
with
$fullsize_url = 'displayimage.php?pos=-'.$pic_data['pid'];
-
Thx for reply :)
works fine!
-
is there any how any way ?
so that we can hide the bbcode to visitors and only admin can view that
-
open codebase.php and after
global $CONFIG;
add
if (!(GALLERY_ADMIN_MODE)) return $pic_data;
-
thanks!
ITs working fine.
Thanks a lot!
With Best Regards!
Anand Maheshwari
-
i dont want the thumbnail image, any alternative?
-
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
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
<?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]
-
not related to the plugin, just a javascript problem
(you can't call a function that hasn't been defined -> write the function highlight())
-
Thanks for this plugin - just what I needed and works wonderfully :D
-
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?
-
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.
-
the plugin interfers with another one... move it up or down in the plugin manager
-
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
-
The plugin works great, but the image url show "localhost" instead of my domain name... any suggestions?
-
nevermind figured it out (admin config). But can I modify the code to show the img src such as "<img src=www....>"?
-
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
-
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?
-
This very thread that you're reading at the moment.
-
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?
-
the plugin interfers with another one...
looks like you have more plugins installed. This plugin has problems with another.
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
-
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).
-
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.
-
is there a way to make it so only loged in users can view the links?
-
codebase.php... after
function bbcode_add_data($pic_data){ //$pic_data
global $CONFIG;
add
if(!USER_ID) return $pic_data;
-
codebase.php... after
function bbcode_add_data($pic_data){ //$pic_data
global $CONFIG;
add
if(!USER_ID) return $pic_data;
thanks!
-
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">
-
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>';
-
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">
-
$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
-
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>';
-
If you want add Code to WWW with Thumb.
Add
$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:
$bbcode_data .= '</tr></table>';
Before add:
$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>';
-
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 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 = '<a href="'.$CONFIG['ecards_more_pic_target'].$int_url.'"><img src="'.$CONFIG['ecards_more_pic_target'].$thumb_url.'" alt="'.$name.'" /></a>';
$im_url = '<a href="'.$CONFIG['ecards_more_pic_target'].$full_url.'"><img src="'.$CONFIG['ecards_more_pic_target'].$int_url.'" alt="'.$name.'" /></a>';
$fs_url = '<img src="'.$CONFIG['ecards_more_pic_target'].$full_url.'" alt="'.$name.'" />';
//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 " " 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.
-
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. ??? ??? ??? ???
-
Are you starting with my version or the original?
-
Are you starting with my version or the original?
the thing is your modified plugin shows only img code and original plugin shown only bbcode i wish to display both of them, and important point to remember is the thumbnail must link to intermediate image page, i got it to work to display img code and bb code but can't make it to link bb thumb to intermediate page.
please tell me how to do that.
-
Please anyone help me out
-
please read the thread to find examples on how to modify the bbcode plugin code to fit your needs
-
Hello!
How can I hide the copy/paste bbcode if an album is private for guests but not for the users, and I don't want that they can use it in forums? I added this but it doesn't work.
function bbcode_add_data($pic_data){ //$pic_data
global $CONFIG, $ALBUM_DATA;
$a_data = $ALBUM_DATA['visibility'];
...
and...
<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;
if($a_data != 2){
more code...
//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;
}
If I change if($a_data != 2) by if($pic_data['aid'] != n) -n is the private album id- then it works, but I must to know the album id.
-
Stramm sweet mod. I have everything where I want it but I can't figure out where in the code to open the [url] and [img] code dialog box so that it will display all the code.
I have edited the plugin to just display the img tag and would like to see it all in stead of having to scroll.
-
what about setting the textarea to have ~3 rows??
-
Thank you Stramm, you always point me in the right direction (not sure how I missed it) :-\
-
Hi Stramm. Great mod.
How do I modify this to change the top button to use the intermediate image instead of the thumbnail?
*Edit
I've just sussed it. It was as simple as changing this line from this
$thumb_url = get_pic_url($pic_data, 'thumb'); //thumb url
to this
$thumb_url = get_pic_url($pic_data, 'normal'); //normal url
-
:) work fine
I used with THEME name "blue_dragon" doesn't work well for me DUE TO THEME
now I switch my theme to "zymic_xstatic" and this MOD work pretty good :)
thanks
-
Hi, I'm new here and I'm not sure if this is the best place for this question, so I apologize if it is in the wrong place. I searched the forums and haven't been able to find anything that would help me do this (at least that I understood). What I want to do is modify this plugin (codebase.php specifically) to display a link rather than a bulletin board code. I've been able to do this with a static link, but I'm not sure how to do it with the following link:
<a href="{ECARD_TGT}" class="navmenu_pic" title="{ECARD_TITLE}">Send Ecard</a>
The bracketed items (ECARD_TGT and ECARD_TITLE) don't translate when the link is clicked and I suspect that I have to include something additionally into codebase.php to get it to recognize them and act upon them, but I'm unsure of what would actually accomplish this. I've experimented with a few different things, but I really don't know enough to do it on my own unless I get lucky somehow.
Basically, my end goal is just to have a more visible link to send an ecard below the image (in addition to the link in the navbar). If anyone has a suggestion, using either this plugin or a different method, I'd love to hear it. Thank you.
-
Of course that wouldn't work. Neither the placeholder {ECARD_TGT} nor {ECARD_TITLE} are defind. So the script doesn't know it should replace them and even if it would, then it has no clue what to insert there.
To add a line of code that allows you to send an ecard of the shown image you'll need to add something like this...
echo "<a href=\"ecard.php?pid={$pic_data['pid']}\">Send Ecard</a>";
-
Thank you Stramm, I appreciate it. I'm having a little trouble getting it to work, though. I'm afraid I'm a bit of a beginner when it comes to this. If you wouldn't mind, could you please clarify where exactly I'm supposed to place it, if I should remove anything else, and what my file should look like in the end?
-
eg.
in codebase.php right after
$bbcode_data = '<table align="center" width="'.$CONFIG['picture_width'].'">'.$script_data.'<tr>';
add in a new line
$bbcode_data .= "<td colspan=\"2\" align=\"center\"><a href=\"ecard.php?pid={$pic_data['pid']}\">Send Ecard</a></td></tr><tr>";
-
Thank you for that. I was able to get it to work perfectly. For anyone else out there who wants to use this plugin to create a more graphic "send ecard" button below the image, here is an example of the code. (I removed the BBcode because I didn't need that, I just wanted the ecard link).
//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 .= '</tr><tr>';
$bbcode_data .= "<td colspan=\"2\" align=\"center\"><a href=\"ecard.php?pid={$pic_data['pid']}\"><img border=0 src=\"sendecard.jpg\" ></a></td></tr><tr>";
$bbcode_data .= '</tr><tr>';
$bbcode_data .= '</tr></table>';
I saw a few people looking for that, so hopefully this will be helpful. Note: replace the image listed with your own image url. If you don't want an image, replace it with text.
Thank you Stramm.
-
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.
Awesome alternative to the original version. How would you add a credit link to be generated with each url tag such as "Visit skidpics.com for images galore"
-- Skidpics
-
Awesome alternative to the original version. How would you add a credit link to be generated with each url tag such as "Visit skidpics.com for images galore"
-- Skidpics
Figured it out.. Just add the linking information on lines 141, 143 and 145, after /></a> of each entry.. An example would be:
/></a><br><a href="http://skidpics.com" class="style1">Browse or host your pictures on skidpics.com </a></p>';
-
Now, how would I incorporate another background linkage for let say a Myspace profile background for the large picture?
How could I get it to output with this format???
I would have to have the format something like this on output:
<style type="text/css">
body {
background-image:url('http://theimageurl');
background-attachment: fixed;
background-position:top left;
background-repeat:no-repeat;
border-width:0px ;
border-style: inset;
}
</style>
<div
<a href="http://skidpics.com" class="style1">Browse or host your pictures on skidpics.com </a></p>
</div>
-
Now, how would I incorporate another background linkage for let say a Myspace profile background for the large picture?
How could I get it to output with this format???
I would have to have the format something like this on output:
<style type="text/css">
body {
background-image:url('http://theimageurl');
background-attachment: fixed;
background-position:top left;
background-repeat:no-repeat;
border-width:0px ;
border-style: inset;
}
</style>
<div
<a href="http://skidpics.com" class="style1">Browse or host your pictures on skidpics.com </a></p>
</div>
If I can get the general idea, then I will report the working results once completed..
-
Hey... i just wandt to add my ver of this plugin...
it got a more cool look i think.. maby you can use it stamm..
But i must say/"ask" i will like the fields to be out of the white and down in the gray.. can som 1 help me with that?
:D
-
Dear Stramm
I am trying to change code for forum
when user hit it will target picture page not full size
here is code which is regulat
[url=http://bollywoodfunda.com/albums/Mona_Lisa/Mona_Lisa_26.jpg][IMG]http://bollywoodfunda.com/albums/Mona_Lisa/thumb_Mona_Lisa_26.jpg[/IMG][/url]
but I want something like this
[url=http://www.bollywoodfunda.com/displayimage.php?pos=-11373][IMG]http://bollywoodfunda.com/albums/Mona_Lisa/thumb_Mona_Lisa_26.jpg[/IMG][/url]
so this is picture link http://www.bollywoodfunda.com/displayimage.php?pos=-11373 I want user to get target to POS=-xxxxx number
how I can edit CODEBASE to target that
is there anyway or not?
thanks
found it now thanks
here is QUOTE from ur message
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
$fullsize_url = get_pic_url($pic_data); //here we grab the url to the fullsized pic
with
$fullsize_url = 'displayimage.php?pos=-'.$pic_data['pid'];
thanks :)
-
ok...so I installed the plug in and it works ...kind of
I was able to get the img src for the html and the bbcode out...but now it is giving me permission errors when I try to copyt he code into another forum..
any ideas?
-
Then you probably have hotlink protection set up. For details, post a link to your gallery.
-
no..hotlinking is allowed...always has been...
when I went to switch the codebase to the one that gives me the html code instead of bbc code it lasted about 20 minutes then my entire directory went offline...I had no access whatsoever to the directory anymore...none of my machines did
it was when I installed the one from the forums here that has this in the configuration
>--Modified by Zachary Barnes of UselessHacks.com'
almost like my gallery was hacked...was giving me 403 permission denied errors on the whole directory
I eventually had to remove and uninstall the entire directory and reinstall it to get it to go back to normal and able to be viewed again...
-
it was when I installed the one from the forums here that has this in the configuration
>--Modified by Zachary Barnes of UselessHacks.com'
What are you refering to? Post a link to your source. The original plugin posted in this thread is by Stramm and contains no reference to Zachary Barnes as far as I can see.
If you want help, you should do as supporters suggest:post a link to your gallery
Any particular reason for not doing as I suggested?
-
this is the one I am talking about that I installed that caused the upset
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 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 = '<a href="'.$CONFIG['ecards_more_pic_target'].$int_url.'"><img src="'.$CONFIG['ecards_more_pic_target'].$thumb_url.'" alt="'.$name.'" /></a>';
$im_url = '<a href="'.$CONFIG['ecards_more_pic_target'].$full_url.'"><img src="'.$CONFIG['ecards_more_pic_target'].$int_url.'" alt="'.$name.'" /></a>';
$fs_url = '<img src="'.$CONFIG['ecards_more_pic_target'].$full_url.'" alt="'.$name.'" />';
//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 " " 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.
if you download the batch files under his name on the particular posting...you will see that he modified stramms php codebase and had put his name in the "created by" up top
after the installation of his version of the image sourcing things went to hell in a handbasket and excuse me if I happened to forget to add this to my last bit of asking for assistance
you have no idea how annoyed I was when I had to lose over 10,000 uploaded images because the only way to get back into the gallery was to remove it from my server and put it back...simple oversight
-
if you download the batch files under his name on the particular posting...you will see that he modified stramms php codebase and had put his name in the "created by" up top
Why didn't you use the original one posted by Stramm? The one you refer to is just an unsupported contribution. There's no guarantee that it works as expected.
you have no idea how annoyed I was when I had to lose over 10,000 uploaded images because the only way to get back into the gallery was to remove it from my server and put it back...simple oversight
That's complete, utter nonsense. It wouldn't have been necessary to perform a fresh install. Simply undoing the damage would have been enough. Why didn't you ask how to remove the damage instead of starting all over and then (after making that mistake) complaining?
If you want help, you should do as supporters suggest.
I will not allow you to clutter this thread with invalid rants. Do as I suggested and post a link to your gallery or stop wasting everybody's time and stop posting.
-
Why didn't you use the original one posted by Stramm? The one you refer to is just an unsupported contribution. There's no guarantee that it works as expected.
That's complete, utter nonsense. It wouldn't have been necessary to perform a fresh install. Simply undoing the damage would have been enough. Why didn't you ask how to remove the damage instead of starting all over and then (after making that mistake) complaining?
I will not allow you to clutter this thread with invalid rants. Do as I suggested and post a link to your gallery or stop wasting everybody's time and stop posting.
not wasting anyones time here but mine it seems
the link to my gallery since you feel you need it; http://www.gonzojenny.com/images (http://www.gonzojenny.com/images) but it is offline at the moment
and I did try to fix the problem by putting all the code back the way that it was before the plugin install and it didnt work...tried numerous times to remove all instances of the codebase for the last 4 hours BEFORE coming here to register and ask for assistance....searching for some tidbit of answers thru THIS forum and many thread strings and I found no help...
the reason i used the modified version is because it gave the img src codes that I need instead of the bbcodes which I cant use for what the gallery is intended for
and now after the fifth hour has passed I have found the problem and it is working
thank you anyway
-
Hello,
How add bbcode before Image?
second question, i'm change this scripts to link and i have problem
Link:
$bbcode_data .= '<td><a href="#" onclick=" window.open('http://tapeciarz.mobile.net.pl/imageuploader-partner.xhtml?sid=5&theme=clean&img=','','width=600,height=400,'); ">Otwórz okno</a></td>';
parse error please help
-
when you have a look at the code you'll see that $pic_data['html'] represents the html of the intermediate image where $bbcode_data holds all the bbcode html. So you'd just have to change
$pic_data['html'] = $pic_data['html'].$bbcode_data;
in
$pic_data['html'] = $bbcode_data.$pic_data['html'];
The parse error... of course you'll get one. If you use strings in php they have to be in single or double quotes. If you use eg. single quotes, then you can't use these within the string as you do. You need to escape the single quotes within the string using \
eg. (just a part)
img=\','',\'width=600,height=400,\');
If you're unsure with php sysntax http://www.php.net will be able to help you.
-
when you have a look at the code you'll see that $pic_data['html'] represents the html of the intermediate image where $bbcode_data holds all the bbcode html. So you'd just have to change
$pic_data['html'] = $pic_data['html'].$bbcode_data;
in
$pic_data['html'] = $bbcode_data.$pic_data['html'];
work thank very much :)
The parse error... of course you'll get one. If you use strings in php they have to be in single or double quotes. If you use eg. single quotes, then you can't use these within the string as you do. You need to escape the single quotes within the string using \
eg. (just a part)
img=\','',\'width=600,height=400,\');
don't work (parseerror)
now i have
$bbcode_data .= '<td><a href="http://tapeciarz.mobile.net.pl/imageuploader-partner.xhtml?sid=302&theme=clean&img=http://tapetypulpitu.pl/'.$fullsize_url.'" target="_blank">Wyslij na telefon</a></td>';
and works but how add to this window.open?
edited Stramm: added quotes to make it readable
-
php syntaxwise it looks OK... to add the javascript window open... search the web... if you need single quotes within the string, then escape them as I told you.
not valid: 'a'string'
valid: 'a\'string'
valid: "a'string"
not valid: "a"string"
valid: 'a"string\'is\'this'
got it?
-
Awesome mod! Thank you very much Stramm (and also thanks to PirateZipp for your version, which looks very cool). You can see this in action at www.nikongear.com - click on the PHOTOS link in the main menu.
-
Is there any way to only select by Category so I can display different code for fullsize pics for one Category and thumbs in the bbcode for others? I thought it would be something like if ($_GET["cat"] == 'X' ) XXXXXXX } else if { if ($_GET["cat"] == 'X1' ) XXXXXXXX but I have tried this and can not get it to work correctly. Does anyone have a modification or know how to do this????? Thanks in advance for any help given
-
I think I already answered that question before... nevertheless, it's easy doable by album, if you want to go for cats... I think you'll have to do an additional query. The album id is stored in an array
the following code would not show the bbcode for the given albums in the forbidden array
$forbidden = array(2,3,4,5,6,7,8);
if (in_array($pic_data['aid'],$forbidden)) {
return $pic_data;
}
you'll have to place it tight after
global $CONFIG;
that should give you a rough idea on how to get things rolling
-
Stramm thanks for a little insight as to not being able to do this by Cat. Album is just fine. I know how to make it not work for selected albums thanks for the most part to you :) however I would like to display different bbcode under say albums 2345 then what I display under albums 6789 and so on. would I choose from the array list if a if then else statement??? Thanks for your help in getting my in the right direction. :)
-
there are hundreds of possibilities on how to do what you want... everyting depends on how 'different' your output for the single albums is. Is it just an additional line, is it totally different...
so you can stay eg with the above example
$forbidden = array(2,4,6,8);
if (in_array($pic_data['aid'],$forbidden)) {
$bbcode_data = 'bbcode for albums 2,4,6 and 8';
} else {
$bbcode_data = 'different stuff for all the other albums';
}
$pic_data['html'] = $pic_data['html'].$bbcode_data;
return $pic_data;
you also could use the switch satement or ....
switch ($pic_data['aid']) {
case 0:
$bbcode_data = 'bbcode for album 0';
break;
case 1:
$bbcode_data = 'bbcode for album 1';
break;
case 2:
$bbcode_data = 'bbcode for album 2';
break;
default:
$bbcode_data = 'bbcode for all other albums';
}
$pic_data['html'] = $pic_data['html'].$bbcode_data;
return $pic_data;
-
Just wanted to say thanks you Stramm got everything to work and learned alot in the proccess :) Thanks again.
-
Thank you Stramm for all the time you've spent helping everyone. With all your input, I was able to configure your plugin to exactly how I like it.
Instead of coming here with a question, I come with a (somewhat) solution. :P
In my image gallery, I have not only images, but movies, audio, and misc. files (.zip, .rar, etc.). I only wanted to have the bbcode show for images, and not for any other file. I'm not fluent in php, but I was able to figure this out on my own.
Find
global $CONFIG;
After, add
$bbcode_content = cpg_get_type($pic_data['filename']);
if($bbcode_content['content']=='audio') return $pic_data;
if($bbcode_content['content']=='movie') return $pic_data;
if($bbcode_content['content']=='document') return $pic_data;
If that is considered a hack job and there's a better way of handling that, let me know. :P
Thank you again Stramm.
-
If you want add Code to WWW with Thumb.
Add Where http://youlink.com is adres to your website
Find:
Before add:
can it be open in new page???
-
I encountered a problem with this plugin and the "Chaotic" style. The Chaotic style attaches a "frame" around the intermediate images, and thus this plugin was inserting the BBcode table between the image and frame.
After figuring out CPG a little (which was very hard as I found almost zero plugin-writing documentation--I hope someone is working on this!!), I changed the plugin to this: <?php/*****Snipped Copyright for copy/paste purposes :) ******/
if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');
// Add a filter
$thisplugin->add_filter('page_html','bbcode_add_data');
function bbcode_add_data($page_html){
global $CONFIG, $CURRENT_PIC_DATA;
$fullsize_url = get_pic_url($CURRENT_PIC_DATA); //here we grab the url to the fullsized pic
$thumb_url = get_pic_url($CURRENT_PIC_DATA, 'thumb'); //thumb url
$CURRENT_PIC_DATA['title'] ? $name = $CURRENT_PIC_DATA['title'] : $name = 'No Title'; //checking 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]';
//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></td>';
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="40" style="overflow:off;">'.$img_url.'</textarea></td>';
$bbcode_data .= '</tr><tr>';
$bbcode_data .= '<td></td>';
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="40">'.$name_url.'</textarea></td>';
$bbcode_data .= '</tr></table>';
$search = 'LR.gif"></td>
</tr>
</table>';
$replace = $search.$bbcode_data;
$page_html = str_replace($search,$replace,$page_html);
return $page_html;
}
?>
If you see anything that's not right with this, can someone please say something? I know next to nothing about Coppermine and I'm not sure what difference there is--if any--between $CURRENT_PIC_DATA and the $pic_data you used in the original plugin.
And that brings me to my next point: I'll have to go back and check now, but I believe I have found some kind of error. I was testing this on a photo with a space in the title, e.g. "Jim Bob", and I noticed that the 2nd URL code looked like this:
[url="http://localhost/path/to/image"]Jim
And then stopped at the space.
Is this some problem with $CURRENT_PIC_DATA or does this exist in the original plugin? Like I said, I have to go back and check now, but I'm too lazy to do it right now (I was working at another computer). Chances are I'll do it before someone replies, so I'll probably be replying again shortly.
Anyway, this isn't much a problem for me as it may be for everyone using this plugin, since I probably won't be using that BBcode box anyway... just the 1st one, and then adding my own.
EDIT: ^^ That space problem doesn't actually exist.. For whatever reason the URL breaks to a new line, and you can only see the whole thing if you scroll with your scroll wheel, instead of there being a scroll bar that shows you there is more to the URL.
Thanks for a great mod!
-
Love the plugin.
I use it for forums and stuff. Might of found a problem, unless a album setting is off. The plugin has been working fine, and works fine for albums except user albums. I just created a user album, and hotlinked one of the images to post in myspace, but the image will not appear from the user gallery, but it will from the general albums.
Here is a copy of the coding, from both intermediate links..
General Gallery:
<a href="http://skidpics.com/gallery/albums/userpics/4/Big-Eye_Squirrel_Fish.jpg"><img src="http://skidpics.com/gallery/albums/userpics/4/normal_Big-Eye_Squirrel_Fish.jpg" alt="Big-Eye Squirrel Fish" /></a><br><a href="http://skidpics.com" class="style1">Browse or host your pictures on skidpics.com </a></p>
User Gallery:
<a href="http://skidpics.com/gallery/albums/userpics/10001/72/katvond7c.jpg"><img src="http://skidpics.com/gallery/albums/userpics/10001/72/normal_katvond7c.jpg" alt="katvond7c" /></a><br><a href="http://skidpics.com" class="style1">Browse or host your pictures on skidpics.com </a></p>
the first part shows the image with the link back coding, the second part (from the user gallery) just shows title and link back code to gallery. I will attach a screen show of what I mean.
-
tested and can't replicate your issues. Please post a link to your gallery and verify your code changes.
-
Hmmm - just tested it again, and working now.. interesting..
Thanks for checking it out - might of been a server issue...?...
-
Help, this is a massive link, is there any way to shorten it at all??
url=http://adorablebudgies.co.uk/g/albums/mypics/aa5b.JPG]IMG]http://adorablebudgies.co.uk/g/albums/mypics/thumb_aa5b.JPG[/IMG[/url
(I omitted the open/close brackets to show it)
Also, the link as it is shows a thumbnail size image, like this: [Edit GauGau] Replaced hotlinked image with attachment [/Edit]
Can anybody tell me exactly which bits I need to change in codebase.php to make it fetch the larger sized picture instead please?
I understand a little of what's in there and managed to remove the title link and box for that, but not fluent enough to work this bit out myself properly.
Much appreciate any help with this :)
Anna
-
Very nice plugin !
I made a few small modifications: added an a href link along with the BB code, changing the JavaScript to simply select an input instead of text area on click, added CSS padding, and used the filename if the title is empty.
Sample (http://"http://www.stangdriver.com/photogallery/)
-
Nice cars :)
The link looks a lot better like that too.
Anna
-
Hi
I installed this plugin and here my site link
http://1280x800.indianwidescreens.com/displayimage.php?album=random&cat=4&pos=-214
But it is linking like this
(http://1280x800.indianwidescreens.com/albums/widescreenwallpapers/saloni/thumb_salonimdfyui38si01280.jpg) (http://1280x800.indianwidescreens.com/albums/widescreenwallpapers/saloni/salonimdfyui38si01280.jpg)
I need like this ( i need url to be the full page link itself )
(http://1280x800.indianwidescreens.com/albums/widescreenwallpapers/saloni/thumb_salonimdfyui38si01280.jpg) (http://1280x800.indianwidescreens.com/displayimage.php?album=random&cat=4&pos=-214)
please let me know how to do it
Thanks in advance!
-
Do not PM me for support
-
oh sorry :(
can u please tell me here? ???
-
has been asked and answered within this thread
-
has been asked and answered within this thread
Thank u stramm i got it here
http://forum.coppermine-gallery.net/index.php?topic=36302.msg222727#msg222727
-
Very nice plugin !
I made a few small modifications: added an a href link along with the BB code, changing the JavaScript to simply select an input instead of text area on click, added CSS padding, and used the filename if the title is empty.
Sample (http://"http://www.stangdriver.com/photogallery/)
Nice, can we see your code? ;)
-
many many thanks for this mod, i :-* u, all
byeeeeeee dearseg.
in codebase.php right after
$bbcode_data = '<table align="center" width="'.$CONFIG['picture_width'].'">'.$script_data.'<tr>';
add in a new line
$bbcode_data .= "<td colspan=\"2\" align=\"center\"><a href=\"ecard.php?pid={$pic_data['pid']}\">Send Ecard</a></td></tr><tr>";
-
Is there a chance that this plugin can give me html code istead of bbcode ?
-
explained within this thread
-
No offense to Stramm, but I thought I'd share my edit of the warning message to Netscape/Firefox users.
I corrected a couple of typos and tried to make it friendly and a little more informative.
Sorry, but due to your Firefox or Netscape security settings it may not possible to use the copy button. Please manually select the code by first clicking once into the text area. Then press ctrl+a to select all. Then press ctrl+c to copy. Then simply press ctrl+v to paste.
Since the javascript checks for Netscape I thought I'd include that in the message.
Looking forward to putting this plug-in to work. Stramm, thanks for all your efforts!
Mod:
No doubt I'm an idiot, but I was trying to get the "credit" line to work below the thumb link as mentioned in the thread and coded here:
http://forum.coppermine-gallery.net/index.php?topic=36302.msg222486#msg222486
I've read the entire thread at least 3 times.
That post above makes no sense since my codebase file is only 78 lines long and it references lines in the hundreds.
I also don't have those code strings.
I'm using Stramm's V 1.2
To add a line with a link and formatted text below the thumbnail I tried this:
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="40" style="overflow:off;">'.$img_url.','[br][size=35][b][url=http://www.aeronauticpictures.com/royalty-free-stock-footage/]Stock Footage[/url] from AeronauticPictures.com[/b][/size]'</textarea><input type="button" value="Copy" onclick=\'copy_clip("'.$img_url.','[br][size=35][b][url=http://www.aeronauticpictures.com/royalty-free-stock-footage/]Stock Footage[/url] from AeronauticPictures.com[/b][/size]'"
and I got parse errors.
Also tried it this way first with same result:
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="40" style="overflow:off;">'.$img_url.[br][size=35][b][url=http://www.aeronauticpictures.com/royalty-free-stock-footage/]Stock Footage[/url] from AeronauticPictures.com[/b][/size]'</textarea><input type="button" value="Copy" onclick=\'copy_clip("'.$img_url.'"
A misplaced ' or " or syntax error or massive case of moron. I can't figure it out. :-[
Any help would be much appreciated.
Thank you!
Mod:
Okay, getting closer. Yes, the font size was way too big. And would not display with an SMF forum w/out the "pt" call for size. Fixed that. And got the credit to show now without the parse errors but too stupid re: javascript to figure out how to include it in the button capture. Here is code now:
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="40" style="overflow:off;">'.$img_url.'[br][br][size=13pt][b][url=http://www.aeronauticpictures.com/royalty-free-stock-footage/]Stock Footage[/url] from AeronauticPictures.com[/b][/size]</textarea><input type="button" value="Copy" onclick=\'copy_clip("'.$img_url.'")\'></td>';
Solved:
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="40" style="overflow:off;">'.$img_url.'[br][br][size=13pt][b][url=http://www.aeronauticpictures.com/royalty-free-stock-footage/]Stock Footage[/url] from AeronauticPictures.com[/b][/size]</textarea><input type="button" value="Copy" onclick=\'copy_clip("'.$img_url.'[br][br][size=13pt][b][url=http://www.aeronauticpictures.com/royalty-free-stock-footage/]Stock Footage[/url] from AeronauticPictures.com[/b][/size]")\'></td>';
Mod: Arrrrrgh.
Works fine it seems in IE. Won't even display the correct string for manual copy in FF or Netscape. Soooo. I changed the rows to:
<textarea name="bbcode" rows="2"
In both text areas and added the error message about select all (see top of this post) because 3 clicks would not select all in FF.
Over and out.
-
this goes with another thread concerning the same, but different link issue.
A brief description of the problem. I have my domain photospider.net domain marked forwarded to hosting on another yahoo domain. The url shows the original hosted domain in the bbcode.. How do I alter the code in the plugin to display the actual domain it came from instead of the landing domain?
How do I get this:
<a href="http://skidpics.com/coppermine/albums/userpics/10003/normal_11%7E2.jpg"><img src="http://skidpics.com/coppermine/albums/userpics/10003/thumb_11%7E2.jpg" alt="No Title" /></a><br><a
into this:
<a href="http://photospider.net/albums/userpics/10003/normal_11%7E2.jpg"><img src="http://photospider.net/albums/userpics/10003/thumb_11%7E2.jpg" alt="No Title" /></a><br><a
I am assuming this is what needs to be edit to fix the link issue:
$tn_url = '<a href="'.$CONFIG['ecards_more_pic_target'].$int_url.'"><img src="'.$CONFIG['ecards_more_pic_target'].$thumb_url.'" alt="'.$name.'"
Any help would be appreciated. This is an awesome plugin!
-- Skidpics
-
Why don't you just change the url to your gallery in config?
-
Why don't you just change the url to your gallery in config?
That fixed the link problem.. . but now the image doesn't show the bbcode nor in ecards..
is the problem the masked domain?
-
I see. By 'domain mask' you actually mean 'stupid frame'. Frames suck. Use a redirect/rewrite or DNS instead. This is not related to this mod however. To just hack in a different path change
href="'.$CONFIG['ecards_more_pic_target'].$int_url.'"
to
href="http://photospider.net/'.$int_url.'"
-
I see. By 'domain mask' you actually mean 'stupid frame'. Frames suck. Use a redirect/rewrite or DNS instead. This is not related to this mod however. To just hack in a different path change
href="'.$CONFIG['ecards_more_pic_target'].$int_url.'"
to
href="http://photospider.net/'.$int_url.'"
Unfortunately, that doesn't do the trick either. no pics on bbcode or ecards with that. that actually does the same thing in the url as changing the config option
-
You can't do what you want using just a frame.
-
You can't do what you want using just a frame.
Well, since yahoo is so limited in the way it does things. I will just switch servers that will allow the support of add on domains. I have been having problems with their limited issues anyway. Thanks for the help and I will get it switched over.
-
Can you describe how to modify this plugin so that the bbcode img URL will display in the file information area under the image? Maybe right below (or in place of) the URL that links to the image display page?
I'd like to have a "clean" frame around the image, and so would prefer to have the link display in the file info section if possible.
Thank you in advance,
Keith
-
Hi was following this post but I didn't see the fill code for like myspace. the bbcode in the plogin files doen't have it.
Can it be added to the bbcode plugin? like that when the plugin is install it has the hotlinks for myspace.
this will be a great mod and it will be helpful for many people.
-
How limits only has the superintendent and records member to see own
image bbcode..?
And other visitors and the member will forbid to demonstrate
bbcode...
-
Please rephrase your question!
-
SORRY. I not too understand English..
About:http://forum.coppermine-gallery.net/index.php/topic,36302.0.html
open codebase.php and after
global $CONFIG;
Question...
1. Only has user to be able to watch own code?
2. Other users forbid to watch?
3. The superintendent may watch the complete user the code?
-
Emphasis...
Only the users themselves can watch their own code
Other users would prohibit viewing ..
The managers of all the users can watch the code?
Thanks a lot!!
-
Dear Sir
Sorry to make you confuse for above questions
However, My question is
How to limite the users can not see other users link but the manager can see all of the users link?
I am looking forward to receive your reply soon
Thanks a lot!!
-
You as gallery admin should have the skills to find out the URL without the need of such a plugin - simply perform a right-click, properties and perform a highlight/copy job. If you really need the changes you demand, you're welcome to code them in and let us know the outcome.
-
codebase.php ... right after
global $CONFIG;
add
if(!GALLERY_ADMIN_MODE) return $pic_data;
should do the trick
-
Dear Sir
Many thanks of your reply
Now I can see the all users link
Another thing is can you tell me how to let the users can see their own link but not allow to see other users link
I am look forward to receiving your reply soon
Cheers
-
Please help me... ???
How to show the bbcode just only in own photo album?
just like the users can editor their own photo album.
-
usage as above
if (!($pic_data['owner_id'] == USER_ID || GALLERY_ADMIN_MODE)) {
return $pic_data;
}
-
usage as above
if (!($pic_data['owner_id'] == USER_ID || GALLERY_ADMIN_MODE)) {
return $pic_data;
}
thanks!!
ITs working fine..
Thanks a lot!! :D
-
Wonderful work once again Stramm!
I was able to easily modify this as well to fit my needs. Thank you for helping everyone else as it kept me from having to ask and wait, lol.
-
eg.
in codebase.php right after
$bbcode_data = '<table align="center" width="'.$CONFIG['picture_width'].'">'.$script_data.'<tr>';
add in a new line
$bbcode_data .= "<td colspan=\"2\" align=\"center\"><a href=\"ecard.php?pid={$pic_data['pid']}\">Send Ecard</a></td></tr><tr>";
Could you also suggest change to display link for slideshow?
-
The bbcode image URL appear inside the image border. Is there a way to get the code out of the image border?
-
You'll have to use another plugin hook then.
-
I am using this mod for some time now, and I really like it.
However, would it be possible to alter the code in such a way, that it behaves like this:
-pressing the copy button will generate the code for displaying the intermediate image, linking to the large image. (simple till so far) BUT...
-when the larger image is smaller than the intermediate would be (normally 400 pixels), there is no intermediate. Instead of generating code for the intermediate, generate the code for the original picture. (which could link to itself, or no link at all)
Optionally, this could be split in 2 different "code" buttons, but users could then mess up the forum layout, by accidentally posting 2048 pixel wide pictures... i like to prevent that. (for which I did not succeed yet, I have trouble generating the neccesary code for the "original" option)
-
-pressing the copy button will generate the code for displaying the intermediate image, linking to the large image. (simple till so far)
Change this line from this
$thumb_url = get_pic_url($pic_data, 'thumb'); //thumb url
to this
$thumb_url = get_pic_url($pic_data, 'normal'); //normal url
For smaller images the smaller image will still work as an intermediate.
-
Tested this with a 240x240 px picture, but this generates a red cross (empty placeholder) for the picture.
The code generated is: (I crippled the url tags
url=http://www.domain.com/photo/albums/userpics/10003/1384/picture240px.jpg](http://www.domain.com/photo/albums/userpics/10003/1384/[b]normal_picture240px.jpg[/b])[/url
Which is OK for pictures over 400 px (my intermediate size). However, for smaller pictures it should read:
url=http://www.domain.com/photo/albums/userpics/10003/1384/picture240px.jpg](http://www.domain.com/photo/albums/userpics/10003/1384/[b]picture240px.jpg[/b])[/url
-
two possibilities...
1. you do all the checks as in function theme_html_picture(). As result you know whether to use the fullsized or not.
2. you just check if a normal_ file exists. If yes, do what you intend to do, if not, do something else
http://php.net/manual/de/function.file-exists.php
$normal_url = get_pic_url($pic_data, 'normal'); //normal url
if (file_exists($normal_url)) {
//do something
} else {
//doesn't exist, do something else
}
-
I am going to try. It is my first attempt at PHP, so could take a while, I will post my results.
-
on a second thought... using URLs with file_exists may not necessarily work in all environments as expected. So it's better to use the server path
this is the path to the fullsized
$CONFIG['fullpath'].$pic_data['filepath'].$pic_data['filename']
and the intermediate
$CONFIG['fullpath'].$pic_data['filepath'].$CONFIG['normal_pfx'].$pic_data['filename']
us it eg. like
//does the normal file exist??
if (file_exists($CONFIG['fullpath'].$pic_data['filepath'].$CONFIG['normal_pfx'].$pic_data['filename'])) {
//do something eg. display bbcode for the intermediate image
$fullsize_url = get_pic_url($pic_data, 'normal');
} else {
//intermediate doesn't exist, do something else eg. print bbcode for fullsized image
$fullsize_url = get_pic_url($pic_data);
}
if you replace in codebase.php
$fullsize_url = get_pic_url($pic_data); //here we grab the url to the fullsized pic
with the above, then the plugin prints the intermediate URL if that file exists, otherwise the fullsized... haven't tested it
-
Works great but whenever I look at a picture it stretches the page all the way across my screen? So I have to scroll to the right all the way until I see the picture.
Is that because of my screen resolution or is there a way to fix it?
-
Post a link. Make sure you don't have debug mode enabled.
-
Post a link. Make sure you don't have debug mode enabled.
Nope, debug mode isn't on.
(its just a personal photo album)
http://jacobs-space.com/copperminenew/index.php
-
Caused by this:
<table align="center" width="9999">
I don't know where that came from; it's not a part of the plugin.
-
Caused by this:
<table align="center" width="9999">
I don't know where that came from; it's not a part of the plugin.
I'm kinda new at this stuff....how would I take that out lol? And would I take out that whole line of code or just the width part?
-
The whole line. First though, update your gallery to latest. 1.4.18. Then check in the plugin's codebase.php for that line.
-
//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>[url][img][/url]</td>';
That is the lines I see. But there's not 9999 it just says "$CONFIG" ?
-
That would indicate you have set 'Max width or height of an intermediate picture/video' to 9999 in config. Set it to something sensible instead.
-
That would indicate you have set 'Max width or height of an intermediate picture/video' to 9999 in config. Set it to something sensible instead.
Thank you so much ;D It's working now. I would of never though haha
Thank you again for the help :D :D :D
-
Hi Guys,
A couple questions...
I am trying to place the code after the image title & description. I can place it above or below the image, thats all I can figure out though.
Am also trying to change the textarea to be one line vice however many it takes the URL to fit in a 40col wide area, without expanding the columns. I managed to do it on my other site (http://www.closecombatseries.net/imagehost/) but cant figure out the coppermine code. So for example, when a user clicks the text he simply scrolls left or right not up and down.
MOOXE
-
how do I enable hotlinking to get this plugin to work?
Sorry, I'm a newb.
-
anyone??!!
-
That's a question related to your server setup. No one here even knows what OS you're running so it's hard to give you advice. Usually you ask your webhost for questions related to your server. Hotlinking on *nix systems can be setup in a htaccess file or in the apache config file (if you're using the apache webserver - httpd.conf).
-
He Stramm, i've a problem with your plugin.
How u can see here:
http://www.vwgolfcommunity.com/cpg/displayimage.php?album=311&pos=2
The code are not central with the image.
What do u think i need to do to solve this problem ?
-
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 (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
<?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;
}
?>
-
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
-
From the first view I just can see that you do not close the value attribute properly
Should look eg. similar to
value=\''.$img_dir_url_forum.'\'>
-
Making that change gave me a parse error.
Any other suggestions?
Please and Thank You
-
With this code:
<?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
-
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
$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
-
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 (http://www.lifeinmybackyard.com/photoalbums/displayimage.php?album=6&pos=27)
I have changed the code to:
$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
-
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:
//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
-
Looks fine to me. You just need to scroll the box to see the full code.
-
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?
-
That's the drawback of a solution that puts the url visible in one line.
-
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.
-
just don't use 'overflow' so that the line can break
-
i found out my problem i have to replace '.$CONFIG['picture_width'].' with auto and it fixed my problem
-
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) (http://skimaps.skiforum.it/skimaps/displayimage.php?album=1&pos=3)
) not to the big file (like this:
(http://skimaps.skiforum.it/skimaps/albums/userpics/10003/thumb_Alta_Badia.jpg) (http://skimaps.skiforum.it/skimaps/albums/userpics/10003/Alta_Badia.jpg)
)
How can I modify the MOD?
-
has been answered within this thread
-
Very fine PlugIn, but i have one problem:
how to use this plug-in to the thumbnails below, thank you!
-
Hi
I modified the code in this way
$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?
-
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.
-
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.
-
I guess I'm just impatient. I looked over the code, and though I'm no programmer, I set up a BBcode that would work on my site and implemented it into the plugin given. Also, I only really wanted this so that users could embed their gallery entries into the forums. Here's what I did:
<?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>
<br><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 Title'; //checking if the pic has a title, if not we set it to 'No title'
//Generating the file paths for each picture size
$fs_url = '&#91;img&#93;'.$CONFIG['ecards_more_pic_target'].$full_url.'&#91;&#47;img&#93;';
$ve_url = '&#91;flv&#93;'.$CONFIG['ecards_more_pic_target'].$full_url.'&#91;&#47;flv&#93;';
//this just brings everything in form... we create a table etc.,
$bbcode_data = $script_data;
$bbcode_data .= '<table align="center" width="600">';
//thumbnail image code with link to intermediate image
$textarea_prop = 'name="bbcode" rows="1" cols="75" style="overflow:off; white-space:nowrap" readonly="readonly"';
//fullsize image code
$bbcode_data .= '<tr><td>Fullsize:</td></tr>';
$bbcode_data .= '<tr><td><textarea '.$textarea_prop.'>'.$fs_url.'</textarea></td></tr>';
//video embed code
$bbcode_data .= '<tr><td>Video Embed Code:</td></tr>';
$bbcode_data .= '<tr><td><textarea '.$textarea_prop.'>'.$ve_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;
}
?>
Basically, I removed the entire thumbnail string and added an extra variable specifically for my FLV files. As I allow more video formats, I'll increase the options. Granted, it's not the most flexible, but it's easy and functional for my users. :)
-
Oh, sorry, for an example you can go to http://www.freakingamers.com/gallery/
-
Hello,
I need modification of bbcode, not like plugin but copy/paste in theme.php in specific place,on intermediate page, below CAPTION, i need:
1. title
2. caption
3. bbcode
4. vote......
// HTML template for intermediate image display
$template_display_media = <<<EOT
...
...
...
<!-- BEGIN title -->
<tr>
<td class="tableb"><center><b>
{TITLE}
</b></center></td>
</tr>
<!-- END title -->
<!-- BEGIN caption -->
<tr>
<td class="tableb"><center>
{CAPTION}
{BBCODE} --------------------- how to make this <<<<<<<<<<<<<<<<<
</center></td>
</tr>
<!-- END caption -->
</table>
<!-- END img_desc -->
</td>
</tr>
EOT;
-
Hello guys , i was modify this code for my consuming. I hope that some one gona like...
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;
$script_data = <<< EOT
EOT;
$thumb_url = get_pic_url($pic_data, 'thumb'); //here we grab the url to the thumb url
$full_url = 'displayimage.php?pos=-'.$pic_data['pid']; //fullsized pic
$pic_data['title'] ? $name = $pic_data['title'] : $name = 'No Title'; //checking 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
$thu_url = '[url='.$CONFIG['ecards_more_pic_target'].$full_url.'][IMG]'.$CONFIG['ecards_more_pic_target'].$thumb_url.'[/IMG][/url]';
$im_url = '<a href="'.$CONFIG['ecards_more_pic_target'].$full_url.'"><img src="'.$CONFIG['ecards_more_pic_target'].$thumb_url.'" alt="'.$name.'" /></a>';
//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>Grab Thumbnail For Forum :</td>';
$bbcode_data .= '<tr><td><textarea name="bbcode" rows="1" cols="50" wrap="off" style="overflow:hidden;height:15px;" onfocus="this.select();" onclick="this.select();">'.$textarea_prop.''.$thu_url.'</textarea></td></tr>';
$bbcode_data .= '</tr><tr>';
$bbcode_data .= '<td>Grab Thumbnail For Blog :</td>';
$bbcode_data .= '<tr><td><textarea name="bbcode" rows="1" cols="50" wrap="off" style="overflow:hidden;height:15px;" onfocus="this.select();" onclick="this.select();">'.$textarea_prop.''.$im_url.'</textarea></td></tr>';
$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;
}
?>
Any comment or suggestion well be helpful ;)
-
Any comment or suggestion well be helpful ;)
If so:
- Post details about the modification and benefit of using your modificated mod.
- Attach a screenshoot if useful.
- Post a link to a live demo of it.
-
ok
code description :
1. code showing thumbnail links to add image in forum or blog (my requirement of gallery)
2. when visitor press on it link is highlited ,rigth click copy
3. thumbnail hotlink redirect visitors to gallery where image is posted ( displayimage.php?pos=- )
i just wont to add that i don't know coding , but i was reading topic from beginning. after some time
and mixing couple code of other users i find way to sort proper code what i was looking for.
P.S. i have problem with coper_ad, can any one help me? ???
-
P.S. i have problem with coper_ad, can any one help me? ???
Definitely not in this thread. Respect board rules!
-
hi there
is there any way of changing the location of bbcode? I want to place it outside the image border.
I want to place it outside the black area. thanks in advance!
here's a link
http://redlens.org/gallery/displayimage.php?album=lastup&cat=0&pos=1
-
hi there
is there any way of changing the location of bbcode? I want to place it outside the image border.
I want to place it outside the black area. thanks in advance!
here's a link
http://redlens.org/gallery/displayimage.php?album=lastup&cat=0&pos=1
Please ignore my query. I found the solution
Find
$pic_data['html'] = $pic_data['html'].$bbcode_data
Change to
$pic_data['menu'] = $pic_data['menu'].$bbcode_data
-
so what value can you use if you are not in an image view. but rather in the album view. how can i pull in the url to my text boxes. just read through this whole post. but $img_url, $pic_url, and $thumb_url are all coming up blank.
here's a link to the page i'm trying to do this on. pretend it's not ugly i haven't skinned it yet
http://bouncingtrucks.com/gallery/thumbnails.php?album=2 (http://bouncingtrucks.com/gallery/thumbnails.php?album=2)
i want it to look like the gallery i have now, but i'm trying to do it through coppermine now
here's my current gallery
http://bouncingtrucks.com/Trucks_Chevy_1.html (http://bouncingtrucks.com/Trucks_Chevy_1.html)
thanks
-crow
-
Any idea how to add these fields in the File information area, under "Favorites: Add to Favorites"?!
-
search the plugins board for an alternative plugin
-
Any idea how to add these fields in the File information area, under "Favorites: Add to Favorites"?!
yep, use this plugin. HTML Embedding Plugin (http://forum.coppermine-gallery.net/index.php/topic,46121.0.html)
-
hi there. im trying to get an flv embedded on my site, but Jixzer one is broken
the outcome comes out like ths
[flv]http://www.ligerzero.net/coppermine_test/albums/uploads/Videos/motorsports/YouTube-_Hyla_Breese_near_miss_.mp4[/flv]
anyone help pls? thanks
-
thanks for the plugin
i install it and works fine with direct link ( hot link )
is there any way to genrate the bbcode with thumnail, or any size with link to intermed image page not to direct image link ( no hot link )
thanks in advance
-
Got a Problem with my bbcode when i want to link my images i am not able to see them on communitys i says then " Externes Bild kann nicht angezeigt werden"
bute the image code shpuld be right here you got: (http://www.jpic.eu/) (http://www.jpic.eu/albums/gbpics/Freitag/Fr003.jpg) does anbody know what is wrong or is it because of disallowed hotlinking?how to activate that a few weeks before the links where functional.
Regards Phil
-
Got a Problem with my bbcode when i want to link my images i am not able to see them on communitys i says then " Externes Bild kann nicht angezeigt werden"
bute the image code shpuld be right here you got: (http://www.jpic.eu/) (http://www.jpic.eu/albums/gbpics/Freitag/Fr003.jpg) does anbody know what is wrong or is it because of disallowed hotlinking?how to activate that a few weeks before the links where functional.
Regards Phil
Sry got already fixed it i took html embed and modified the code that its running for all communitys thanks anyway for the opertunity to use coppermine for free and realy nice treads i found here .
weiter so Webbi.
-
First, I would like to say thanks for creating this module and for helping to provide tech support for it.
Is there a way to have the BBCode appear in a popup javascript window (instead of appearing under the intermediate photo)?
Will I have to create a new php page and pass variables to it? Will I have to use any include statements to get any global variables?
(I am sure I can find the actual code to make a window open using javascript on the web somewhere. My concern is how I would pass the variables - and which ones I will have to pass - to the popup window.)
Thanks in advance, and I apologize if this has already been covered. I searched for it in this thread but didn't see it.
-
Unfortunately, support for CPG 1.4.x ended last year. You should upgrade to the new 1.5.x line where this plugin is also available. Also there is the superb EnlargeIT plugin whis displays images in a nice JS popup with and has a bbcode button included in the popup.
-
Where can i find this plugin for 1.5.*** ?
Was using search, but didn't find it
-
The thread should be moved to 1.5 section.
I noticed that googlebot was indexing the output of the plugin, thus indexing the bbcode/forum links and displaying them as the MAIN content of the search results.
I'm not sure about it, but it may lead to a loss of visitors, as the visitor won't find the content indexed by google interesting.
So I edited the final part of the script by adding googleoff/on tags.
//this just brings everything in form... we create a table etc.
$bbcode_data = '<!--googleoff: index--><table align="center" width="'.$CONFIG['picture_width'].'">'.$script_data.'<tr>';
$bbcode_data .= '<td>BBCode/Forum (Copy/Paste)</td>';
$bbcode_data .= '<td><textarea name="bbcode" readonly="readonly" onfocus="this.select();" onclick="this.select();" rows="1" cols="50" style="overflow:off;">'.$img_url.'
[SIZE="1"]'.$name.' [i](Click on the photo for EXIF info)[/i][/SIZE]</textarea></td>';
$bbcode_data .= '</tr><tr>';
$bbcode_data .= '<td>HTML code (Copy/Paste)</td>';
$bbcode_data .= '<td><textarea name="bbcode" readonly="readonly" onfocus="this.select();" onclick="this.select();" rows="1" cols="50"><a href="'.$CONFIG['ecards_more_pic_target'].$fullsize_url.'">'.$name_url.'</a></textarea></td>';
$bbcode_data .= '</tr></table><!--googleon: index-->';
-
Thanks for the reply and i am searching for the question..
now it's work fine ..
Thanks a lot again!