Author Topic: New Pics in Category  (Read 34394 times)

0 Members and 1 Guest are viewing this topic.

Offline gti-the-sexy

  • Newbie
  • *
  • Posts: 33
    • View Profile
New Pics in Category
« Reply #30 on: January 23, 2003, 01:35:10 PM »
how could I list the "new added images" for all categories, not for one by one category

for example last 20 added images list for all "4images"

thanks to SLL and Christ :)

Offline SLL

  • Hero Member
  • *****
  • Posts: 585
    • View Profile
New Pics in Category
« Reply #31 on: January 23, 2003, 02:01:49 PM »
just remove if ($images_in_category) {
   echo "Found <b>$images_in_category</b> new images in category <b>$category_name</b>&nbsp;&nbsp;&nbsp;$category_link ...view category </a><br>";}


At the very end you could write something like echo "Total: $total_images_found found";

Offline ChrisTTian

  • Newbie
  • *
  • Posts: 29
    • View Profile
New Pics in Category
« Reply #32 on: January 23, 2003, 05:44:47 PM »
gti-the-sexy

glad that my pm was some help for you ;-)

christian

Offline gti-the-sexy

  • Newbie
  • *
  • Posts: 33
    • View Profile
New Pics in Category
« Reply #33 on: January 24, 2003, 12:13:59 AM »
ok then my last question :)

this code gives me last x images for x times
but I want it to give me last x images for 1 time :)

Code: [Select]

<?php 

define
&#40;'ROOT_PATH', './'&#41;; 
include&#40;ROOT_PATH.'global.php'&#41;; 
require&#40;ROOT_PATH.'includes/sessions.php'&#41;; 
$user_access get_permission&#40;&#41;; 
$cat_id_sql get_auth_cat_sql&#40;"auth_viewcat", "NOTIN"&#41;; 
$number_of_news 5

$sql "SELECT i.image_name, i.image_id, i.image_date, c.cat_name, u.user_name 
        FROM "
.IMAGES_TABLE." i, ".CATEGORIES_TABLE." c, ".USERS_TABLE." u 
        WHERE i.image_active = 1 AND i.cat_id NOT IN &#40;
$cat_id_sql&#41; AND i.cat_id = c.cat_id AND i.user_id = u.user_id $cat_match_sql 
        ORDER BY i.image_date DESC 
        LIMIT 
$number_of_news"
$result $site_db->query&#40;$sql&#41;; 
$new_images_list = array&#40;&#41;; 
$i 1
while &
#40;$row = $site_db->fetch_array&#40;$result&#41;&#41; &#123; 
  
$new_images_list[$i&#93; = $row; 
  
$i++; 
&
#125; 
$site_db->free_result&#40;&#41;; 


for &#40;$i = 1; $i <= $number_of_news; $i++&#41; &#123; 
  
if &#40;isset&#40;$new_images_list[$i&#93;&#41;&#41; &#123; 

$result $site_db->query&#40;$sql&#41;; 
 
while &#40;$row = $site_db->fetch_array&#40;$result&#41;&#41; &#123;  
 
$image_id = &#40;$row['image_id'&#93;&#41;;
 
$image_name = &#40;$row['image_name'&#93;&#41;;
$image_link = &#40;"<a href=\"" . ROOT_PATH . "details.php?image_id=" . $image_id . "\">"&#41;;
$image_date format_date&#40;$config['date_format'&#93;." ".$config['time_format'&#93;,$new_images_list[$i&#93;['image_date'&#93;&#41;; 
$news = &#40;"&#58;&#58; <b>" . $new_images_list[$i&#93;['image_name'&#93; . "</b> &#40; <b>" . $new_images_list[$i&#93;['cat_name'&#93; . " </b>&#41; <br>" &#41;; 


echo "<ul><b>$image_name</b> &nbsp;&nbsp;&nbsp;$image_link ...view image </a></ul>";

  &
#125; 
&#125;
&#125; 
?>



this code gives me last 5 images for 5 times :)
I WANT TO LIST LAST 5 IMAGES FOR 1 TIME

please help me with this code , without any other codes

Offline SLL

  • Hero Member
  • *****
  • Posts: 585
    • View Profile
New Pics in Category
« Reply #34 on: January 24, 2003, 08:53:10 AM »
Quote from: gti-the-sexy
please help me with this code , without any other codes

you shouldn't remove sql query, do exactly, what I told you above

Offline gti-the-sexy

  • Newbie
  • *
  • Posts: 33
    • View Profile
New Pics in Category
« Reply #35 on: January 24, 2003, 11:25:54 AM »
of course I did, but it removes only "xxx found in xxx category" sentence and list the new X images for X categories

I dont want to list categories by categories

ONLY LIST LAST X IMAGES FOR ALL 4IMAGES

thanks for help

Offline Slammer

  • Newbie
  • *
  • Posts: 21
    • View Profile
    • http://www.mobile-snapshots.com
New Pics in Category
« Reply #36 on: June 11, 2003, 02:09:09 PM »
hello,

i got the get_new_pics.php working, but now i want to 'load' it in my home.html. i did this through the following code:

<?php include("get_new_pics.php"); ?>

but when i load my page, it gives the following error:

Fatal error: Cannot redeclare addslashes_array() (previously declared in /blablabla/global.php:32) in /blablabla/global.php on line 32

can someone help me with this? when i load the get_new_pics.php from where it's at, it works, but it doesn't when i try loading it up through home.html...

grtz
http://www.mobile-snapshots.com
made a great snapshot with your mobile? upload it now!

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
New Pics in Category
« Reply #37 on: June 11, 2003, 02:12:39 PM »
if u want include it into template that way, then u can comment those lines:
Code: [Select]
define('ROOT_PATH', './');
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
$user_access = get_permission();
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 Slammer

  • Newbie
  • *
  • Posts: 21
    • View Profile
    • http://www.mobile-snapshots.com
New Pics in Category
« Reply #38 on: June 11, 2003, 02:55:57 PM »
thnx for your reply V@no, but where should i insert this code? in the home.html?
because this code is already in my get_new_pics.php
http://mobile-snapshots.com/Gallery/get_new_pics.php
http://www.mobile-snapshots.com
made a great snapshot with your mobile? upload it now!

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
New Pics in Category
« Reply #39 on: June 11, 2003, 08:37:00 PM »
Quote from: Slammer
thnx for your reply V@no, but where should i insert this code? in the home.html?
because this code is already in my get_new_pics.php
http://mobile-snapshots.com/Gallery/get_new_pics.php

hum? insert? I didnt say insert, I said comment (delete, erase, destroy) ;)
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 Slammer

  • Newbie
  • *
  • Posts: 21
    • View Profile
    • http://www.mobile-snapshots.com
New Pics in Category
« Reply #40 on: June 11, 2003, 08:46:16 PM »
:cry:
it gives me another error after i commented (sorry, didn't know that it ment deleting :lol: ) the codes.
it now says:

Fatal error: Call to a member function on a non-object in /blablabla/get_new_pics.php on line 20

is there any other way to include this in a site?
thnx.
http://www.mobile-snapshots.com
made a great snapshot with your mobile? upload it now!

Offline Fugaziman

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
    • http://www.1024x768wallpapers.com
???
« Reply #41 on: June 11, 2003, 10:41:55 PM »
I just noticed this post and couldn't help noticing it's very similar to a Mod post I made a little while ago.  :?:

http://www.4homepages.de/forum/viewtopic.php?t=5654

My mode does not do any extra Database Calls (slowing your page load time)

You can see it in action on my web page - Left side.
Just thought it may help.
I'll go now  :D
Please take time to visit us at ...
http://www.1024x768wallpapers.com
And don't forget to leave a comment or message.

Offline Koosje

  • Newbie
  • *
  • Posts: 13
    • View Profile
Listing without thumbnails
« Reply #42 on: July 27, 2007, 10:14:11 AM »
How is it possible to have a listing without thumbnails extra besides the one with thumbnails? This as a short overview of all or searched pics.