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

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 1 Guest are viewing this topic.

Camiii

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.  :-\

Αndré

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>&lt;a&gt;&lt;img&gt;&lt;/a&gt;</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;
}

?>

Angel_Eyez