Advanced search  

News:

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

Pages: [1] 2   Go Down

Author Topic: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)  (Read 23434 times)

0 Members and 1 Guest are viewing this topic.

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15277

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.
« Last Edit: November 30, 2010, 08:30:29 PM by Αndré »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Logged

Akuma2000

  • Coppermine newbie
  • Offline Offline
  • Posts: 4

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15277

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.
Logged

Casper79

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 25

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

Greetings
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15277

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

Casper79

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 25

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)

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15277

Replace
Code: [Select]
$CURRENT_PIC_DATAwith
Code: [Select]
$row
Logged

Casper79

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 25

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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15277

That still applies.
Logged

Casper79

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 25

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15277

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

Casper79

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 25

And where can I change this  ???
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15277

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.
Logged

Casper79

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 25

I still don't know what you mean  ???  ::)
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15277

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

Casper79

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 25
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15277

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

Casper79

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 25

That works great!
Thank you very much  :)
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15277

Sorry again that I haven't checked earlier the value of GALLERY_ADMIN_MODE.
Logged
Pages: [1] 2   Go Up
 

Page created in 0.079 seconds with 20 queries.