Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Cool CPG Nuke hack(s)  (Read 13435 times)

0 Members and 1 Guest are viewing this topic.

DJMaze

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 831
    • Dragonfly CMS
Cool CPG Nuke hack(s)
« on: November 03, 2003, 05:06:11 am »

open your Nuke mainfile.php and scroll down to:
Code: [Select]
function adminblock() {
In that function insert above "themesidebox($title, $content);"
The following lines:
Code: [Select]
   $num = $db->sql_numrows($db->sql_query("SELECT * FROM cpg_pictures WHERE approved='NO'"));
    $content .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"modules.php?name=coppermine&file=editpics&mode=upload_approval\">Approve images</a>: $num<br>";

Change "cpg_pictures" in the name of your CPG pictures table.
Save and upload file, then you will see how many Picture uploads have to be approved in the Administration "Waiting content" block.

Don't forget to post yours in here
Logged
There are 2 kinds of users in this world: satisfied and complainers.
Why do we never hear something from the satisfied users?
http://coppermine-gallery.net/forum/index.php?topic=24315.0

sigi

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 68
    • http://www.allygally.de
Cool CPG Nuke hack(s)
« Reply #1 on: November 03, 2003, 07:46:19 am »

made a Nuke-Block that shows categories with their sub-cats and number of pics :

Code: [Select]
<?php

/************************************************************************/
/* PHP-NUKE&#58; Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright &#40;c&#41; 2002 by Francisco Burzi                                */
/* http&#58;//phpnuke.org                                                   */
/*                                                                      */
/* 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 2 of the License.       */
/************************************************************************/
/* Block_Gallery_Categories                                             */
/*                                                                      */
/* zeigt alle Kategorien der Coppermine-Galerie an, die eine bestimmte  */
/* Kategorie als "Parent" eingetragen haben                             */
/*                                                                      */
/* shows all Categories where "Parent" is set to a specific Number      */
/************************************************************************/
/*                                                                      */
/* written by Siegfried Schlossser &#40;sigi&#41;                               */
/* for PhpNuke-Community &#40;http&#58;//www.phpnuke-community.de&#41;              */
/* email me at sigi@sigiberlin.de                                       */
/*                                                                      */
/************************************************************************/




if &#40;eregi&#40;"block-Gallery_Categories.php", $PHP_SELF&#41;&#41; &#123;
    
Header&#40;"Location&#58; index.php"&#41;;
    
die&#40;&#41;;
&#125;


global $currentlang,$piccount;

switch&
#40;$currentlang&#41;
&#123;
 
case "english"&#58;
 
define&#40;"_KATTITEL1","Pictures"&#41;;
 
define&#40;"_KATTITEL2","Wallpaper"&#41;;
 
define&#40;"_GALLINK","go to gallery"&#41;;
 
define&#40;"_NOPICS","no pictures..."&#41;;
 
define&#40;"_STATSUP","update stats"&#41;;
 
define&#40;"_STATSSUM","total"&#41;;
 
break;

 default&
#58;
 
define&#40;"_KATTITEL1","Bilder"&#41;;
 
define&#40;"_KATTITEL2","Wallpaper"&#41;;
 
define&#40;"_GALLINK","Zur Galerie"&#41;;
 
define&#40;"_NOPICS","keine Bilder..."&#41;;
 
define&#40;"_STATSUP","Stats updaten"&#41;;
 
define&#40;"_STATSSUM","Summe"&#41;;
 
break;



&
#125;

function GetCat&#40;$c&#41;
&#123;
global $prefix,$dbi,$piccount;

###################################################
#
# change the following line if you didn't add the
# PhpNuke $prefix to your cpg tables ...
#
###################################################


$result sql_query&#40;"SELECT cid, namee, pic_count FROM ".$prefix."_cpg_categories  where parent = '".$c."' ORDER BY namee ", $dbi&#41;;

        
if &#40;sql_num_rows&#40;$result,$dbi&#41; <= 0&#41; &#123;
        
$content _NOPICS;
                return 
false;
        &
#125;

        
while &#40;$row = sql_fetch_array&#40;$result,$dbi&#41;&#41; &#123;

                
$content .="<td><a href=\"modules.php?name=coppermine&cat=".$row["cid"&#93;."\">" .$row['namee'&#93; . "</a></td><td align=\"right\" valign=\"bottom\"><b> ".$row["pic_count"&#93;."&nbsp;</b></td></tr>\n";
                
$piccount=$piccount+$row["pic_count"&#93;;
        
&#125;

 
return $content;
&
#125;

$content.="<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"border&#58; 0px; margin-bottom&#58; 5px;\">\n";
$content.="<tr>";

################# vvvvvv hier den Namen eingeben /put the Category Name here
$content.="<td><b>"._KATTITEL1."</td><td>&nbsp;</td></tr>\n";

################# v hier die Nummer der Kategorie eingeben / put the Catid of the Parent category here
$content.=GetCat&#40;"2"&#41;;

$content .="<tr><td>"._STATSSUM."&#58;</td><td align=\"right\" valign=\"bottom\"><b> ".$piccount."&nbsp;</b></td></tr>\n";

$content.="</table>";



######## und eine zweite Kategorie ...
$content.="<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"border&#58; 0px; margin-bottom&#58; 5px;\">\n";
$content.="<tr>";
$content.="<td><b>"._KATTITEL2."</td><td>&nbsp;</td></tr>\n";
$piccount=0;
$content.=GetCat&#40;"9"&#41;;

$content .="<tr><td>"._STATSSUM."&#58;</td><td align=\"right\" valign=\"bottom\"><b> ".$piccount."&nbsp;</b></td></tr>\n";
$content.="</table>";

$content .= "<center><a href=\"modules.php?name=coppermine\">"._GALLINK."</a></center>";


?>


See it working at my gallery ...

ahh, btw: its for Nuke 5.5, but should work with higher versions also .-.-.-
Logged
Siegfried Schlosser

Berlin, Germany

had a big Coppermine gallery with more than 250.000 pics  at
www.allygally.de, but due to juristical problems that is closed now ....
Now trying Coppermine 1.4.x at http://walexis.pytalhost.de/
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 18 queries.