Author Topic: Random Images of one category  (Read 12068 times)

0 Members and 1 Guest are viewing this topic.

Offline Bomba

  • Full Member
  • ***
  • Posts: 202
    • View Profile
Random Images of one category
« on: February 25, 2003, 10:49:25 PM »
hello i want to create a private category where only users with permission can submit their pics and i would like to have in the index.php a line of 6 random pics from that category. i would use this random pics above the last submited images on the index.php.

is this possible? it would be great. thanks

Offline Bomba

  • Full Member
  • ***
  • Posts: 202
    • View Profile
Random Images of one category
« Reply #1 on: February 25, 2003, 10:53:42 PM »
and also when people enter that category is it possible to show the usernames with the permission to submit the pics.

it would be something like this:

CATEGORY OF HONOUR:
featuring the users: username1; username2; username3; ... and this would work as links to their profile pages.

thanks

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: Random Images of one category
« Reply #2 on: February 26, 2003, 12:07:51 AM »
Quote from: Bomba
hello i want to create a private category where only users with permission can submit their pics and i would like to have in the index.php a line of 6 random pics from that category. i would use this random pics above the last submited images on the index.php.

is this possible? it would be great. thanks

this is pretty simple to do:
for the category set upload permission to "private"
then greate a users group for that category.
then asign "honored" users to that group.
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 Bomba

  • Full Member
  • ***
  • Posts: 202
    • View Profile
Random Images of one category
« Reply #3 on: February 26, 2003, 12:21:43 AM »
:) i guess i didn't explain myself
i know how to do that

1. what i want is to show on the index.php a line of 6 random images from that category.

2. and also i would like to put a text at the top of that category when people enter the category. for example:
"category name
 featuring the users: name1; name2; name3; ..." these names would be links to their profile pages

thanks

Offline helluvaguy

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
Random Images of one category
« Reply #4 on: February 26, 2003, 12:59:17 AM »
Quote from: Bomba
1. what i want is to show on the index.php a line of 6 random images from that category.
Maybe it would help if you change the {random_image} tag to the {random_cat_image} tag. You'll probably have to specify the category to display, but i wouldn't know where to do that. sorry
 
Quote
2. and also i would like to put a text at the top of that category when people enter the category. for example:
"category name
 featuring the users: name1; name2; name3; ..." these names would be links to their profile pages
Why don't you just wright it in the description of that catogory, yourself?

Offline Bomba

  • Full Member
  • ***
  • Posts: 202
    • View Profile
Random Images of one category
« Reply #5 on: February 26, 2003, 01:07:27 AM »
i don't want to write it at the description. i want to write it at categories.php and i wanna know how to do the changes only for that specific category.

cause if i write a description in categories php it will show on every single category page.

anyway, thanks for trying to help

Offline Bomba

  • Full Member
  • ***
  • Posts: 202
    • View Profile
Random Images of one category
« Reply #6 on: February 26, 2003, 07:20:32 PM »
Code: [Select]
this is pretty simple to do:
for the category set upload permission to "private"
then greate a users group for that category.
then asign "honored" users to that group.


and how can i show in the index.php a line of 6 random thumbnails from that category?

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
Random Images of one category
« Reply #7 on: February 26, 2003, 09:04:57 PM »
Quote from: Bomba

and how can i show in the index.php a line of 6 random thumbnails from that category?

it was actualy simplier than I thought  :D
in index.php find:
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").")
change it to:
Code: [Select]
       WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id = XX
Where XX at the end is number of your category
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 Bomba

  • Full Member
  • ***
  • Posts: 202
    • View Profile
Random Images of one category
« Reply #8 on: February 26, 2003, 11:56:21 PM »
but what exactly will this do?
i don't want to delete the last submited images or the current random image code
i just want to add a line of 6 random images from that specific category at the top of my index.php, where it will be above the last submited images.

sorry for my lack of knowledge
thanks

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
Random Images of one category
« Reply #9 on: February 27, 2003, 01:27:58 AM »
well, use that code, and do the changes I posted in this thread.
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 bine

  • Full Member
  • ***
  • Posts: 150
    • View Profile
    • art-stylers free Stockphotos,  Website-Templates and e-cards
Re: Random Images of one category
« Reply #10 on: March 16, 2005, 11:19:11 PM »
V@no
Quote
well, use that code, and do the changes I posted in this thread.

Hi, is the code behind the broken Link 'that code' still available in the forum? I didn't found something by searching.
I also like to create random images from one specified categorie.
:) bine