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 [3]   Go Down

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

0 Members and 1 Guest are viewing this topic.

Camiii

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Album Share Codes (create BBCodes, HTML embed codes, etc. of an entire album)
« Reply #40 on: September 14, 2017, 07:15:26 pm »

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

Αndré

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

Open codebase.php and replace everthing with this:
Code: [Select]
<?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;
}

?>
Logged
Pages: 1 2 [3]   Go Up
 

Page created in 0.162 seconds with 21 queries.