Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album) Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
 

News:

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

Main Menu

Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)

Started by Αndré, June 29, 2010, 03:49:03 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Αndré

This is plugin has been created by request 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.


Akuma2000

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] )

Αndré

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.

Casper79

Is there any chance, that only the admin could see this BB-Codes?

Greetings

Αndré

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');
}

Casper79

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)

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?

Αndré


Casper79

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

Αndré


Casper79

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>';
        }
    }
}

Αndré

Please double-check if you have committed that change to your gallery. GALLERY_ADMIN_MODE should never be true for guests!


Αndré

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.

Casper79


Αndré

Check if you really uploaded that change to your gallery. I doubt that this is the case.


Αndré

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) {

Casper79


Αndré

Sorry again that I haven't checked earlier the value of GALLERY_ADMIN_MODE.