This is plugin has been created by request (http://forum.coppermine-gallery.net/index.php/topic,57432.msg326986.html#msg326986) of marish.
It adds a text field on the thumbnails page, pre-populated with BBCode of all files of the particular album. So you can easily copy & paste it to e.g. a board.
Package download: https://sourceforge.net/projects/coppermine/files/Plugins/1.5.x/cpg1.5.x_plugin_album-share-codes_v0.1.zip/download
I installed this, but it doesn't work.
The copy field only shows on the left top of the album.
So not under each image.
Is this the correct plugin by the way?
I need a field under each image, where visitors can copy the link of that image, so they can paste it on forums, websites etc.
(in BB code for example: [IMG ] htt p:// www . gallery . com / picture.jpg [ / IMG] )
Quote from: Akuma2000 on October 15, 2010, 03:07:49 PM
I need a field under each image, where visitors can copy the link of that image, so they can paste it on forums, websites etc.
(in BB code for example: [IMG ] htt p:// www . gallery . com / picture.jpg [ / IMG] )
Quote from: Akuma2000 on October 15, 2010, 03:07:49 PM
Is this the correct plugin by the way?
No. This plugin creates such codes for whole albums, that's why it's called
QuoteAlbum Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
The BBCode control plugin adds such copy & paste BBCode to the file information div for each picture.
Is there any chance, that only the admin could see this BB-Codes?
Greetings
Quote from: Casper79 on November 22, 2010, 12:28:19 PM
Is there any chance, that only the admin could see this BB-Codes?
Download version 0.1 (
not the svn snapshot, as it's not compatible with cpg1.5.8), open
codebase.php, find
$thisplugin->add_filter('post_breadcrumb','asc_codes');
and replace with
if (GALLERY_ADMIN_MODE) {
$thisplugin->add_filter('post_breadcrumb','asc_codes');
}
Thanks again for your help.
Quote from: Αndré on November 22, 2010, 01:27:20 PM
Download version 0.1 (not the svn snapshot, as it's not compatible with cpg1.5.8)
I've downloaded this version and installed it.
The BB-Code are shown, but I can't use them.
It shows me this codes:
[url=http://www.portman-natalie.de/gallery/displayimage.php?pid=35][img]http://www.portman-natalie.de/gallery/images/thumbs/thumb_nopic.png[/img][/url]
Example:
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.portman-natalie.de%2Fgallery%2Fimages%2Fthumbs%2Fthumb_nopic.png&hash=90c958c3db07882f451e5362f25c6a3d59eb9269) (http://www.portman-natalie.de/gallery/displayimage.php?pid=35)
Link to my gallery: http://www.portman-natalie.de/gallery/
(latest version installed)
And here the codebase.php
if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');
if (GALLERY_ADMIN_MODE) {
$thisplugin->add_filter('post_breadcrumb','asc_codes');
}
function asc_codes() {
$superCage = Inspekt::makeSuperCage();
if ($superCage->get->testInt('album')) {
global $CONFIG;
$aid = $superCage->get->getInt('album');
$result = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_PICTURES']} WHERE aid = '$aid'");
if (mysql_num_rows($result) > 0) {
while($row = mysql_fetch_assoc($result)) {
$url = $CONFIG['ecards_more_pic_target'].'displayimage.php?pid='.$row['pid'];
$thumb = '[img]'.$CONFIG['ecards_more_pic_target'].get_pic_url($CURRENT_PIC_DATA, 'thumb').'[/img]';
$content1 .= '[url='.$url.']'.$thumb.'[/url]'."\n";
}
echo '<tt>[url][img][/url]</tt>: <br /><textarea onfocus="this.select();" onclick="this.select();" class="textinput" rows="1" cols="64" wrap="off" style="overflow:hidden; height:15px;">'.$content1.'</textarea>';
}
}
}
Where is the error?
Replace
$CURRENT_PIC_DATA
with
$row
Thanks again ;D
The Thums are now shown :)
But the BB-Codes are also shown to any visitors.
You can see it here: http://www.portman-natalie.de/gallery/thumbnails.php?album=69
That (http://forum.coppermine-gallery.net/index.php/topic,65779.msg338226.html#msg338226) still applies.
I know, it is still changed in the codebase.php:
if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');
if (GALLERY_ADMIN_MODE) {
$thisplugin->add_filter('post_breadcrumb','asc_codes');
}
function asc_codes() {
$superCage = Inspekt::makeSuperCage();
if ($superCage->get->testInt('album')) {
global $CONFIG;
$aid = $superCage->get->getInt('album');
$result = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_PICTURES']} WHERE aid = '$aid'");
if (mysql_num_rows($result) > 0) {
while($row = mysql_fetch_assoc($result)) {
$url = $CONFIG['ecards_more_pic_target'].'displayimage.php?pid='.$row['pid'];
$thumb = '[img]'.$CONFIG['ecards_more_pic_target'].get_pic_url($row, 'normal').'[/img]';
$content1 .= '[url='.$url.']'.$thumb.'[/url]'." ";
}
echo '<tt>[url][img][/url]</tt>: <br /><textarea onfocus="this.select();" onclick="this.select();" class="textinput" rows="1" cols="64" wrap="off" style="overflow:hidden; height:15px;">'.$content1.'</textarea>';
}
}
}
Please double-check if you have committed that change to your gallery. GALLERY_ADMIN_MODE should never be true for guests!
And where can I change this ???
You don't need to change that. Coppermine automatically detects if a user is in gallery admin mode or not. You can only verify that you have committed that change to your gallery.
I still don't know what you mean ??? ::)
Check if you really uploaded that change (http://forum.coppermine-gallery.net/index.php/topic,65779.msg338226.html#msg338226) to your gallery. I doubt that this is the case.
Here is the codebase.php as .txt
http://www.portman-natalie.de/gallery/plugins/album_share_codes/codebase.txt
Sorry. Seems that that constant isn't defined at that moment. Try to replace
if ($superCage->get->testInt('album')) {
with
if ($superCage->get->testInt('album') && GALLERY_ADMIN_MODE) {
That works great!
Thank you very much :)
Sorry again that I haven't checked earlier the value of GALLERY_ADMIN_MODE.
No problem ;)
Attached version 1.1 to initial release. It's compatible with cpg1.5.10 and higher.
Hi - me again ::)
How can I change the code, that when someone click on the thumb he will get the fullsize photo shown?
Greetings
Open codebase.php, find
$url = $CONFIG['ecards_more_pic_target'].'displayimage.php?pid='.$row['pid'];
and replace with
$url = $CONFIG['ecards_more_pic_target'].'displayimage.php?pid='.$row['pid'].'&fullsize=1';
Thank you! :D
Thanks for plugin, it works great!
But is it possible to do some add-on (or maybe fork) which enables per-picture (plus to codes for entire album) Share Codes? It can be very handy if you have huge albums and/or want to share only new fotos added to the album.
Similar plugins for 1.4.x (tablitz and copy/paste bbcode img url) still not ported to 1.5.x...
Not sure if the plugin your are using will run with this one installed at the same time, but this will give you BBCodes below each intermediate pic. http://forum.coppermine-gallery.net/index.php/topic,57432.0.html
Quote from: lurkalot on December 27, 2010, 10:55:09 AM
Not sure if the plugin your are using will run with this one installed at the same time, but this will give you BBCodes below each intermediate pic. http://forum.coppermine-gallery.net/index.php/topic,57432.0.html
Is my English so bad?
I think you misunderstood me (and topic starter). I need plugin which enebles share codes (per-image bb-codes which you can copy-paste to post in any forum/community to share fotos). I don't need new bb-codes for commets or something.
Quote from: chuvag on December 27, 2010, 04:03:29 PM
Is my English so bad?
I think you misunderstood me (and topic starter). I need plugin which enebles share codes (per-image bb-codes which you can copy-paste to post in any forum/community to share fotos). I don't need new bb-codes for commets or something.
That's what it does. ??? It puts a BBCode below each intermediate pic. You can copy and paste to display the images in your forum posts. ;) read about it here, http://forum.coppermine-gallery.net/index.php/topic,57432.0.html
Damn :) Feel myself like blind ;)
Thanks for help
Sorry for bumping an old topic. But Is it possible to get full image code using this plugin I mean I want image code for full size image hotlinking on forums. :) Like As [img]www.foo.com/foo.jpg[ /img]
Open codebase.php, find
$thumb = $CONFIG['ecards_more_pic_target'].get_pic_url($row, 'thumb');
and replace with
$thumb = $CONFIG['ecards_more_pic_target'].get_pic_url($row, 'fullsize');
Thanks a lot Αndré bro... This worked perfectly as per my liking. :)
Sorry for bringing up this again. Sorry for sounding like a studious student asking questions to teacher every now and then, but can you let me know whether it is possible to get both the codes, thumbnails & full size images ? :-[ :-[ :-[
Found out myself. :)
I created the content 3 rule and put thumb instead of fullsize and then called it below as you did for content 1 and content 2 rules and it worked perfectly. :) Thanks a lot for this wonderful plugin. :) Very useful for me certainly. :)
Hello.
I've made some mods on the base plugin:
- Image ordered by position field
- Additional tags with intermediate images
- Link at fullsize images instead of album view intermediate images
In addition, I've included the "gallery_admin_mode" code.
If someone is interested, here is the code:
if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');
if (GALLERY_ADMIN_MODE) {
$thisplugin->add_action('post_breadcrumb', 'album_share_codes_main');
}
function album_share_codes_main() {
$superCage = Inspekt::makeSuperCage();
if ($superCage->get->testInt('album')) {
global $CONFIG;
$aid = $superCage->get->getInt('album');
$result = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_PICTURES']} WHERE aid = '$aid' ORDER BY position, pid");
if (mysql_num_rows($result) > 0) {
while($row = mysql_fetch_assoc($result)) {
$url = $CONFIG['ecards_more_pic_target'].'displayimage.php?pid='.$row['pid'].'&fullsize=1';
$thumb = $CONFIG['ecards_more_pic_target'].get_pic_url($row, 'thumb');
$mid = $CONFIG['ecards_more_pic_target'].get_pic_url($row, 'normal');
$content1 .= '[url='.$url.'][img]'.$thumb.'[/img][/url]'."\n\n";
$content2 .= '[url='.$url.'][img]'.$mid.'[/img][/url]'."\n\n";
$content3 .= '<a href="'.$url.'"><img src="'.$thumb.' /></a>'."\n\n";
$content4 .= '<a href="'.$url.'"><img src="'.$mid.' /></a>'."\n\n";
}
starttable(-1, 'Share codes for <i>all files</i> in this album');
echo <<<EOT
<tr>
<td class="tableb">
<tt>BBcode TAG (128px)</tt>: <textarea onfocus="this.select();" onclick="this.select();" class="textinput" rows="1" cols="64" wrap="off" style="overflow:hidden; height:15px;">{$content1}</textarea>
<br />
<tt>BBcode TAG (400px)</tt>: <textarea onfocus="this.select();" onclick="this.select();" class="textinput" rows="1" cols="64" wrap="off" style="overflow:hidden; height:15px;">{$content2}</textarea>
<br />
<tt>HTML TAG (128px)</tt>: <textarea onfocus="this.select();" onclick="this.select();" class="textinput" rows="1" cols="64" wrap="off" style="overflow:hidden; height:15px;">{$content3}</textarea>
<br />
<tt>HTML TAG (400px)</tt>: <textarea onfocus="this.select();" onclick="this.select();" class="textinput" rows="1" cols="64" wrap="off" style="overflow:hidden; height:15px;">{$content4}</textarea>
</td>
</tr>
EOT;
endtable();
}
}
}
Bye,
Edoardo. :)
I want to embed an entire album i will attach a file that will tell which way it looks like when we embed it in another webpage or another website etc.. pls check the attached file
What's the actual question? This plugin doesn't produce such an output.
I have one simple question, is there a way to get this to generate the BB code so that it puts all the images on the same line? It seems to put in a break after each image link. This makes it so when posted all the images just get stacked vertically in a forum. Of course users can fix this by manually deleting the breaks, but the average forum poster is lazy :)
Thanks for this plugin Αndré!
Sorry for bringing up this old topic.
Open codebase.php, find
$content1 .= '[url='.$url.'][img]'.$thumb.'[/img][/url]'."\n";
and replace with
$content1 .= '[url='.$url.'][img]'.$thumb.'[/img][/url]';
Is it possible to add the sharing codes after the album, instead of after the breadcrumbs? I tried finding a way of doing it, but I wasn't sure what function to call. :-\
Open codebase.php and replace everthing with this:
<?php
/**************************************************
Coppermine 1.5.x Plugin - album_share_codes
*************************************************
Copyright (c) 2010 eenemeenemuu
*************************************************
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 3 of the License, or
(at your option) any later version.
********************************************
$HeadURL: https://svn.code.sf.net/p/coppermine/code/branches/cpg1.5.x/plugins/album_share_codes/codebase.php $
$Revision: 8065 $
$LastChangedBy: eenemeenemuu $
$Date: 2010-11-22 14:13:47 +0100 (Mo, 22. Nov 2010) $
**************************************************/
if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');
$thisplugin->add_filter('theme_thumbnails_footer', 'album_share_codes_main');
function album_share_codes_main($footer) {
$superCage = Inspekt::makeSuperCage();
if ($superCage->get->testInt('album')) {
global $CONFIG;
$aid = $superCage->get->getInt('album');
$result = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_PICTURES']} WHERE aid = '$aid'");
if (mysql_num_rows($result) > 0) {
while($row = mysql_fetch_assoc($result)) {
$url = $CONFIG['ecards_more_pic_target'].'displayimage.php?pid='.$row['pid'];
$thumb = $CONFIG['ecards_more_pic_target'].get_pic_url($row, 'thumb');
$content1 .= '[url='.$url.'][img]'.$thumb.'[/img][/url]'."\n";
$content2 .= '<a href="'.$url.'"><img src="'.$thumb.' /></a>'."\n";
}
starttable(-1, 'Share codes for <i>all files</i> in this album');
$text = <<<EOT
<tr>
<td class="tableb">
<tt>[url][img][/url]</tt>: <textarea onfocus="this.select();" onclick="this.select();" class="textinput" rows="1" cols="64" wrap="off" style="overflow:hidden; height:15px;">{$content1}</textarea>
<br />
<tt><a><img></a></tt>: <textarea onfocus="this.select();" onclick="this.select();" class="textinput" rows="1" cols="64" wrap="off" style="overflow:hidden; height:15px;">{$content2}</textarea>
</td>
</tr>
EOT;
endtable();
}
}
return $footer.$text;
}
?>
Is there a way to make this compatible with 1.6?