pic_count is unused ? pic_count is unused ?
 

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

Main Menu

pic_count is unused ?

Started by robert9, May 31, 2005, 06:47:08 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

robert9

Maybe it is my bad english that i cant find something about the field pic-count in table cpg_albums; it seems this field is not used? So why it is here?
I will take a look inside the code now; maybe find something to improve. ;-)


robert9

For my installation it seems there is a field pic_count in table cpg_albums that is not used; beacuse i integrate vb and some other cms, i need the number of pics in a field, so i have not to count it every time i need this number. For this i write this little cron-job for vb to count the pics one time a week.
Save it to a file in include/cron; go to vb admin; add a new cron_job with the filename.


<?php
// Count pics from cpg_pictures for pic_count in cpg_albums

error_reporting(E_ALL & ~E_NOTICE);

if (!
is_object($DB_site))
{
exit;
}

$aus=$DB_site->query("SELECT aid from cpg_albums ORDER BY aid DESC");
        while ( 
$au=$DB_site->fetch_array($aus) ) {
            echo 
"work on album"$au[aid]. " ... ";
            
                
$galcnt $DB_site->query_first("SELECT COUNT(*) AS du
                                                FROM cpg_pictures
                                                WHERE aid = '
$au[aid]'");
                
$anzahl $galcnt['du'];
                echo 
"Anzahl: " $anzahl "<br />";
  
           
$DB_site->query("UPDATE cpg_albums set pic_count = '$anzahl' where aid = '$au[aid]'");
        }
?>

Nibbler

Yes, pic_count and a few others are unused and are not in new installations as of 1.4.1

Joachim Müller

merged the two threads made by robert9 that deal with the same thing into this one (see above postings). Please don't double-post in the future.