Support > cpg1.5 plugin contributions

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

<< < (9/9)

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:

--- Code: ---<?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;
}

?>
--- End code ---

Angel_Eyez:
Is there a way to make this compatible with 1.6?

Navigation

[0] Message Index

[*] Previous page

Go to full version