Author Topic: Separate "top images" pages for indicidual categories  (Read 11040 times)

0 Members and 1 Guest are viewing this topic.

Offline crappytheclown

  • Newbie
  • *
  • Posts: 16
    • View Profile
Separate "top images" pages for indicidual categories
« on: January 24, 2006, 01:39:57 AM »
I have 2 categories (and completly diff, fonts and wallpapers http://www.crappytheclown.roxr.com) but on the top images I hate it when the fonts image shows up because its not related to the wallpapers.

Is there a mod or can someone come up with a solution to making the top.php only show images from category.

Another thing I need is how to keep the images from the fonts category from showing up at all in the random images block?

thanks in advance!!


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
Re: Separate "top images" pages for indicidual categories
« Reply #1 on: January 24, 2006, 01:50:36 AM »
In top.php find:
Code: [Select]
$cat_match_sql = ($cat_id && check_permission("auth_viewcat", $cat_id)) ? "AND i.cat_id = '$cat_id' " : "";Insert below:
Code: [Select]
$cat_match_sql .= " AND i.cat_id NOT IN (XX, XX, XX)";Replace XX with list of category IDs  you dont want to see.

For random image thing, in includes/functions.php find:
Code: [Select]
  $cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN");Insert below:
Code: [Select]
  $cat_id_sql .= (($cat_id_sql) ? "," : "")."XX,XX,XX";Same deal, replace XX with list of category IDs you dont want to show. Note, this will affect the category random images as well.
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 mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: Separate "top images" pages for indicidual categories
« Reply #2 on: January 24, 2006, 01:58:47 AM »
... or completely simply ...

I was messing with top.php today and found very nice "not published" feature. we can show top images not fof all images, but for a specific category, by adding cat_id=XX in the address, like this: top.php?cat_id=XX where XX is nuber of category.

mawenzi
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline crappytheclown

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Separate "top images" pages for indicidual categories
« Reply #3 on: January 24, 2006, 02:52:49 AM »
i applied these codes and made the functions.php code look lik so
Code: [Select]
$cat_id_sql = (($cat_id_sql) ? "," : "")."9,10,11,12,13,14";
i use the random images on my index page as described here= http://www.4homepages.de/forum/index.php?topic=4259.0

When i refresh my home page a few times, the font images still appear.  Should this new functions code also work for the random images block or is there something more i have to edit?

PS The code for top.php works fine and the code for the random cat image probably works which why I think there is something more I have to edit so no random font images appear on my home page.


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
Re: Separate "top images" pages for indicidual categories
« Reply #4 on: January 24, 2006, 03:13:43 AM »
the code for the random cat image probably works which why I think there is something more I have to edit so no random font images appear on my home page.
Then my guess would be you either added that line above not below or added in a wrong place...make sure its inside get_random_image_cache() function.
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 crappytheclown

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Separate "top images" pages for indicidual categories
« Reply #5 on: January 24, 2006, 03:27:18 AM »
the code for the random cat image probably works which why I think there is something more I have to edit so no random font images appear on my home page.
Then my guess would be you either added that line above not below or added in a wrong place...make sure its inside get_random_image_cache() function.

Code: [Select]
function get_random_image_cache() {
  global $site_db, $cat_cache, $total_images;

  $random_image_cache = array();
  $cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN");
  $cat_id_sql = (($cat_id_sql) ? "," : "")."9,10,11,12,13,14";

  if (SHOW_RANDOM_CAT_IMAGE) {
    $sql = "SELECT DISTINCT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.ima


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
Re: Separate "top images" pages for indicidual categories
« Reply #6 on: January 24, 2006, 05:11:45 AM »
The only misstake I see is my misstake...:oops: missing dot:
Quote
  $cat_id_sql .= (($cat_id_sql) ? "," : "")."9,10,11,12,13,14";
Still, think this should do the trick.
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 crappytheclown

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Separate "top images" pages for indicidual categories
« Reply #7 on: January 24, 2006, 05:38:58 AM »
nope still doesnt work

Code: [Select]
function get_random_image_cache() {
  global $site_db, $cat_cache, $total_images;

  $random_image_cache = array();
  $cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN");
  $cat_id_sql .= (($cat_id_sql) ? "," : "")."10, 11, 12, 13, 14";


I no it must be frustrating.... this is the first topic Ive seen you have trouble with the coding.  most other topics that i search to find answers to give a straightfoward answer in one post that works.  Im sorry if Im causing you trouble.


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
Re: Separate "top images" pages for indicidual categories
« Reply #8 on: January 24, 2006, 05:45:39 AM »
So, what you are trying to say, that you still see images from categories with ID 10, 11, 12, 13 and 14 ?

Can I see it in action?
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 crappytheclown

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Separate "top images" pages for indicidual categories
« Reply #9 on: January 24, 2006, 06:33:13 AM »
So, what you are trying to say, that you still see images from categories with ID 10, 11, 12, 13 and 14 ?

Can I see it in action?

yes that is correct... http://www.crappytheclown.roxr.com/   just keep on refreshing until you see an image from Graffiti, Fancy,Simple,Odd, or Brand Name categories.  you will no when you see such images when you see a change in layout (it widens) because the font images are 200px wide while all the other thumbs are 150px wide.
here a screenshot of what I'm talking about http://www.crappytheclown.roxr.com/images1/scrner.JPG


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
Re: Separate "top images" pages for indicidual categories
« Reply #10 on: January 24, 2006, 06:53:46 AM »
the only "random image block" fresh 4images has is one random thumbnail on left side under user box. But, my guess is you were referring to the random images that are displayed instead of "new images", on your site, correct? If so, then without knowing your code that generates these random images on your home page, no one would be able to help you ;). But the idea to fix that would be the same as I've posted for includes/functions.php
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 crappytheclown

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Separate "top images" pages for indicidual categories
« Reply #11 on: January 24, 2006, 11:09:10 PM »
i applied these codes and made the functions.php code look lik so
Code: [Select]
$cat_id_sql = (($cat_id_sql) ? "," : "")."9,10,11,12,13,14";
i use the random images on my index page as described here= http://www.4homepages.de/forum/index.php?topic=4259.0

When i refresh my home page a few times, the font images still appear.  Should this new functions code also work for the random images block or is there something more i have to edit?

PS The code for top.php works fine and the code for the random cat image probably works which why I think there is something more I have to edit so no random font images appear on my home page.

I posted the link to the topic and the code is exactly the same as in that topic.. but it still wont work...


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
Re: Separate "top images" pages for indicidual categories
« Reply #12 on: January 25, 2006, 12:59:03 AM »
oopss...:oops:
* V@no banging his head of the table

Find in that code:
Code: [Select]
       WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id IN (".get_auth_cat_sql("auth_viewcat").")Replace it with:
Code: [Select]
       WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id NOT IN (".get_auth_cat_sql("auth_viewcat", "NOTIN").",XX,XX,XX)and you already know the drill - replace XX with category IDs ;)
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 crappytheclown

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Separate "top images" pages for indicidual categories
« Reply #13 on: January 25, 2006, 02:18:31 AM »
ahhh!!!! halejulia!!!!! it works!!!thank you..!!!!!