WebmasterSite.net: PHP scripts to enable your creativity
WSN Links PHP Directory Software
PHP Scripts Webmaster Links Support Forums


Placing limits on random image
How to exclude certain images from the randomizer

Version: 2.14
printPrint


Placing limits on random image
lepus
Beginner

Usergroup: Member
Joined: Jul 04, 2005
Location: Portland, OR
Total Topics: 4
Total Posts: 8
Posted 07/04/05 - 02:47 PM:
quote post
#1
I'm setting up a gallery in which there will be lots of art files stored by various artists. Some of the pictures will only be appropriate for viewers of a certain age. I've added some fields to the tables to reflect both the user's rating limit and the rating of the picture. How do I get the random image selector to select only images appropriate (i.e., if the user is a guest, only G-rated)?
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 55
Total Posts: 5703
Posted 07/04/05 - 10:23 PM:
quote post
#2
In your toplist generator, where it asks for a condition to filter results by type
contentrating='G'

if for example your field is named contentrating and contains G where you want it shown. Then paste that new toplist over the old one... or just replace the <CONFIG> line to keep if you like.
lepus
Beginner

Usergroup: Member
Joined: Jul 04, 2005
Location: Portland, OR
Total Topics: 4
Total Posts: 8
Posted 07/05/05 - 04:19 PM:
quote post
#3
Thanks! If I want to display one toplist for one type of user and another toplist for another type of user, what do I put in the template?

I tried this:
<IF {MEMBERCONTENT}='G'>
(...toplist 1...)
</IF>
<IF {MEMBERCONTENT}='X'>
(...toplist 2...)
</IF>

But it just shows both toplists no matter what the user is.
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 55
Total Posts: 5703
Posted 07/06/05 - 01:15 PM:
quote post
#4
If they're distinct toplists, simply make the two toplists, using the contentrating='X' in the other one's condition line. I don't know why you're involving conditionals or how in the world member template variables became involved.
lepus
Beginner

Usergroup: Member
Joined: Jul 04, 2005
Location: Portland, OR
Total Topics: 4
Total Posts: 8
Posted 07/06/05 - 01:35 PM:
quote post
#5
But wouldn't that just make two toplists, one that shows "general" images and one that shows "adult" images, and just display them both on the main page regardless of whether or not the member has been cleared to view the "adult" ones?

How do I display one toplist for members with a certain field set to one value and another toplist for members with a certain field set to another value without using conditionals?
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 55
Total Posts: 5703
Posted 07/06/05 - 02:56 PM:
quote post
#6
Well then I guess you do want conditionals, so please read the manual entry since the syntax you're using there isn't the WSN conditionals syntax: http://scripts.webmastersite.net/wsngallery/manua...

Also {MEMBER is improper if you mean to reference the person viewing, as the manual explains that's {THISMEMBER.
Search thread for
Download thread as


You don't have permission to post.

Please login or register.

   
 
© 2008 Paul Knierim. All rights reserved.