If you are not registered or logged in, you may still use these forums but with limited features. Show recent topics
  [Search] Search   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [FAQ]  FAQ 
[Register] Register / 
[Login] Login 
Advanced PHP Poll - How to realize limited result output?  XML
Forum Index » Support Forum
Author Message
Anonymous



Hello,

I'm just trying to implement Advanced PHP Poll with a flat file on a non-profit cinema's website. Everything works fine.

The Poll contains 30 movies to choose from. After a period of a few days there is a favourite movie - the "winner movie". This movie will be shown next at the cinema.

After voting for one of these 30 movies, the visitor is shown the results - 30 movies sorted by their ranking.

Now the Problem:
I want to implement an additional "Top Ten" ranking page during the voting period. This should do the same like the usual "show results" page, but limited to the first 10 entries.

Is this possible? Maybe by adding a parameter to the poll URL or by changing something in the source code? My idea is to break the repeat-loop, but only if there's a limiting parameter at the end of the calling URL ("poll.php?limit=10").

If Advanced PHP Poll isn't able to do this, does anybody have an idea which script could do this for us?

By the way: I'm one of these PHP beginners

Thanks a lot for help,
Alex
Auron
Expert
[Avatar]

Joined: 23/06/2003 22:02:17
Messages: 1053
Offline

Well as you've got the basic idea why don't you code it into the loop. One point if you want the 30 ranked then you don't want the whole loop to stop at 10. You'd have to run it twice, once for the 30 and again for the 10, or you could extract the top ten data from the first run-through of the loop by storing them in some variables to be used when ouputting the results.

Auron
[Email] [WWW]
 
Forum Index » Support Forum
Go to:   
Based on the open source JForum