Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: List catagories, albums and pictures block  (Read 5056 times)

0 Members and 1 Guest are viewing this topic.

danp

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
List catagories, albums and pictures block
« on: December 14, 2003, 06:01:42 am »

I'm no programmer.  I was using phpnuke but got sick of all the little bugs and recently switched to postnuke.  I have this block that is for phpnuke, it lists the catagories, albums, and number of pictures in a gallery.  How do I get it working in postnuke?  Whats the difference?  I tried pasting it into a php block but the site wouldn't work.  Like I said, I'm no programmer and I can't find much info on this.  Anyone know?  Or does anyone have a block like this that works for postnuke?

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

$result4 sql_query&#40;"SELECT aid, title, pos FROM cpg_albums WHERE category = 0 ORDER BY pos ", $dbi&#41;;
while &#40;$row4 = sql_fetch_array&#40;$result4, $dbi&#41;&#41; 
&#123;
        
$aid $row4["aid"&#93;;
        
$result5 sql_query&#40;"SELECT pid FROM cpg_pictures WHERE aid = '$aid' ", $dbi&#41;;
        
$albumRows sql_num_rows&#40;$result5, $dbi&#41;;

        
$content .="<tr><td><a href=\"modules.php?name=coppermine&file=thumbnails&album=".$row4["aid"&#93;."\">" .$row4['title'&#93; . "</a></td><td align=\"right\"> ".$albumRows."&nbsp;</td></tr>\n";
&#125;        


$result sql_query&#40;"SELECT cid, namee, pic_count, pos FROM cpg_categories where parent = '".$c."' ORDER BY pos ", $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;
                
if &#40;$row["cid"&#93; != 1&#41; // make sure it's not "user albums"
                
&#123;                
                    
$content .="<td><a href=\"modules.php?name=coppermine&cat=".$row["cid"&#93;."\"><b>" .$row['namee'&#93; . "</b></a></td></tr>\n";
                    
$piccount=$piccount+$row["pic_count"&#93;;
                
&#125;

                //albums
                
$cid $row["cid"&#93;;                    //get num of albums in category
                
$result2 sql_query&#40;"SELECT aid, title, pos FROM cpg_albums where category = '$cid' ORDER BY pos ", $dbi&#41;;

                
while &#40;$row2 = sql_fetch_array&#40;$result2,$dbi&#41;&#41; 
                
&#123;
                        
$aid $row2["aid"&#93;;        //correct count of pics in album
                        
$result3 sql_query&#40;"SELECT pid FROM cpg_pictures WHERE aid = '$aid' ", $dbi&#41;;
                        
$albumRows sql_num_rows&#40;$result3, $dbi&#41;;

                        
$content .="<tr><td><a href=\"modules.php?name=coppermine&file=thumbnails&album=".$row2["aid"&#93;."\">&nbsp;" .$row2['title'&#93; . "</a></td><td align=\"right\"> ".$albumRows."&nbsp;</td></tr>\n";
                
&#125;
        
        
&#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>";
################# v hier die Nummer der Kategorie eingeben / put the Catid of the Parent category here
$content.=GetCat&#40;"0"&#41;;
$content.="</table>";

/*
global $admin;
if &#40;is_admin&#40;$admin&#41;&#41;
# wenn Du bist Admin, Du darfst die Statistik updaten &#58;-&#41;
# you are admin&#58; then you may update the stats &#58;-&#41;
&#123;
$content .= "<center><a href=\"modules.php?name=coppermine&file=updatestats\">"._STATSUP."</a></center>";
&#125;
*/

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

?>

Logged

DJMaze

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 831
    • Dragonfly CMS
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
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 18 queries.