Support > cpg1.5 plugin contributions

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

<< < (2/9) > >>

Α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?

--- End quote ---

Download version 0.1 (not the svn snapshot, as it's not compatible with cpg1.5.8), open codebase.php, find

--- Code: ---$thisplugin->add_filter('post_breadcrumb','asc_codes');
--- End code ---
and replace with

--- Code: ---if (GALLERY_ADMIN_MODE) {
    $thisplugin->add_filter('post_breadcrumb','asc_codes');
}
--- End code ---

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)

--- End quote ---
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: ---[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]
--- End code ---
Example:
(https://forum.coppermine-gallery.net/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

--- Code: ---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>';
        }
    }
}
--- End code ---
Where is the error?

Αndré:
Replace

--- Code: ---$CURRENT_PIC_DATA
--- End code ---
with

--- Code: ---$row
--- End code ---

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é:
That still applies.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version