Author Topic: total images?  (Read 4812 times)

0 Members and 1 Guest are viewing this topic.

Offline Jasondavis

  • Full Member
  • ***
  • Posts: 157
    • View Profile
total images?
« on: February 01, 2003, 10:35:40 PM »
Is there a way to display the Total number of images in my Gallery on my main site, totaly seperate from the gallery? I have a link that says Gallery I would like to have a thing next to it that says (190 images) and have it update itseld as I add pics

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
total images?
« Reply #1 on: February 01, 2003, 10:54:42 PM »
try this:
Code: [Select]
<?php
define
&#40;'ROOT_PATH', './4images/'&#41;;// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie'
include&#40;ROOT_PATH.'config.php'&#41;;
include&#40;ROOT_PATH.'includes/db_mysql.php'&#41;;
include&#40;ROOT_PATH.'includes/constants.php'&#41;;
$site_db = new Db&#40;$db_host, $db_user, $db_password, $db_name&#41;;
$sql "SELECT COUNT&#40;*&#41; as total_images
        FROM "
.IMAGES_TABLE." a, ".CATEGORIES_TABLE." b 
        WHERE a.image_active=1 
        AND a.cat_id = b.cat_id 
        AND b.auth_viewcat="
.AUTH_ALL.
        AND b.auth_viewimage="
.AUTH_ALL."
        "
;
$row $site_db->query_firstrow&#40;$sql&#41;;
$total_images $row['total_images'&#93;;
echo $total_images;
?>
change ./4images/ to your 4images dir.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Jasondavis

  • Full Member
  • ***
  • Posts: 157
    • View Profile
thanks
« Reply #2 on: February 02, 2003, 12:25:26 AM »
Hi I tried it, my index usses SSI so I saved the code u posted as a .php file and included it with severside includes. That almost works, my problem is it dislays the number "0" but im my gallery I have 202

Offline Jasondavis

  • Full Member
  • ***
  • Posts: 157
    • View Profile
any help with my total pic count?
« Reply #3 on: February 04, 2003, 06:02:45 AM »
Hi any ideas from anyone? All that is displayed is 0 when I do this!
I would love any help thank you
-Jason

Offline Jasondavis

  • Full Member
  • ***
  • Posts: 157
    • View Profile
help!
« Reply #4 on: February 08, 2003, 01:45:44 AM »
to the top^