forum.coppermine-gallery.net

Support => cpg1.5 plugins => cpg1.5.x Support => cpg1.5 plugin contributions => Topic started by: Αndré on June 29, 2010, 03:49:03 pm

Title: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: Αndré on June 29, 2010, 03:49:03 pm
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.
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: Joachim Müller on July 08, 2010, 02:57:44 pm
Package download: https://sourceforge.net/projects/coppermine/files/Plugins/1.5.x/cpg1.5.x_plugin_album-share-codes_v0.1.zip/download
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: Akuma2000 on October 15, 2010, 03:07:49 pm
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] )
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: Αndré on October 15, 2010, 03:30:35 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] )
Is this the correct plugin by the way?
No. This plugin creates such codes for whole albums, that's why it's called
Quote
Album 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.
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: Casper79 on November 22, 2010, 12:28:19 pm
Is there any chance, that only the admin could see this BB-Codes?

Greetings
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: Αndré on November 22, 2010, 01:27:20 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
Code: [Select]
$thisplugin->add_filter('post_breadcrumb','asc_codes');and replace with
Code: [Select]
if (GALLERY_ADMIN_MODE) {
    $thisplugin->add_filter('post_breadcrumb','asc_codes');
}
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: Casper79 on November 22, 2010, 01:54:01 pm
Thanks again for your help.
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:
Code: [Select]
[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:
(http://www.portman-natalie.de/gallery/images/thumbs/thumb_nopic.png) (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
Code: [Select]
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?
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: Αndré on November 22, 2010, 02:00:54 pm
Replace
Code: [Select]
$CURRENT_PIC_DATAwith
Code: [Select]
$row
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: Casper79 on November 22, 2010, 02:09:28 pm
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
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: Αndré on November 22, 2010, 02:17:07 pm
That (http://forum.coppermine-gallery.net/index.php/topic,65779.msg338226.html#msg338226) still applies.
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: Casper79 on November 22, 2010, 02:21:51 pm
I know, it is still changed in the codebase.php:
Code: [Select]
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>';
        }
    }
}
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: Αndré on November 22, 2010, 02:27:20 pm
Please double-check if you have committed that change to your gallery. GALLERY_ADMIN_MODE should never be true for guests!
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: Casper79 on November 22, 2010, 02:36:11 pm
And where can I change this  ???
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: Αndré on November 22, 2010, 02:42:33 pm
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.
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: Casper79 on November 22, 2010, 03:07:17 pm
I still don't know what you mean  ???  ::)
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: Αndré on November 22, 2010, 03:11:29 pm
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.
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: Casper79 on November 22, 2010, 03:17:02 pm
Here is the codebase.php as .txt
http://www.portman-natalie.de/gallery/plugins/album_share_codes/codebase.txt
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: Αndré on November 22, 2010, 03:27:56 pm
Sorry. Seems that that constant isn't defined at that moment. Try to replace
Code: [Select]
if ($superCage->get->testInt('album')) {with
Code: [Select]
if ($superCage->get->testInt('album') && GALLERY_ADMIN_MODE) {
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: Casper79 on November 22, 2010, 03:33:25 pm
That works great!
Thank you very much  :)
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: Αndré on November 22, 2010, 03:36:13 pm
Sorry again that I haven't checked earlier the value of GALLERY_ADMIN_MODE.
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: Casper79 on November 22, 2010, 03:36:55 pm
No problem  ;)
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: Αndré on November 30, 2010, 07:42:05 pm
Attached version 1.1 to initial release. It's compatible with cpg1.5.10 and higher.
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: Casper79 on December 04, 2010, 09:15:07 am
Hi - me again  ::)

How can I change the code, that when someone click on the thumb he will get the fullsize photo shown?

Greetings
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: Αndré on December 04, 2010, 10:13:22 am
Open codebase.php, find
Code: [Select]
$url = $CONFIG['ecards_more_pic_target'].'displayimage.php?pid='.$row['pid'];and replace with
Code: [Select]
$url = $CONFIG['ecards_more_pic_target'].'displayimage.php?pid='.$row['pid'].'&fullsize=1';
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: Casper79 on December 04, 2010, 04:45:55 pm
Thank you!  :D
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: chuvag on December 27, 2010, 07:26:06 am
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...
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: 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
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: chuvag on December 27, 2010, 04:03:29 pm
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.
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: lurkalot on December 27, 2010, 04:40:36 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
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: chuvag on December 27, 2010, 06:13:16 pm
Damn :) Feel myself like blind ;)
Thanks for help
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: cpguser1 on May 15, 2011, 09:13:31 am
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]
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: Αndré on May 15, 2011, 10:14:14 am
Open codebase.php, find
Code: [Select]
$thumb = $CONFIG['ecards_more_pic_target'].get_pic_url($row, 'thumb');and replace with
Code: [Select]
$thumb = $CONFIG['ecards_more_pic_target'].get_pic_url($row, 'fullsize');
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: cpguser1 on May 15, 2011, 01:01:31 pm
Thanks a lot Αndré bro... This worked perfectly as per my liking. :)
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: cpguser1 on May 21, 2011, 02:44:24 pm
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 ?  :-[  :-[ :-[
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: cpguser1 on May 22, 2011, 06:16:55 am
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. :)
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: EdoFede on July 05, 2011, 01:10:18 pm
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:
Code: [Select]
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.  :)
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: sajeevs on February 11, 2014, 07:23:45 pm
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
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: Αndré on February 12, 2014, 09:30:11 am
What's the actual question? This plugin doesn't produce such an output.
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: DeathCom on October 13, 2016, 08:13:13 am
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.
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: Αndré on June 30, 2017, 02:43:19 pm
Open codebase.php, find
Code: [Select]
$content1 .= '[url='.$url.'][img]'.$thumb.'[/img][/url]'."\n";and replace with
Code: [Select]
$content1 .= '[url='.$url.'][img]'.$thumb.'[/img][/url]';
Title: Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
Post by: Camiii on September 14, 2017, 07:15:26 pm
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.  :-\