Script Pulse

Trade Pulse => Trade Pulse Support => Topic started by: cPimp on June 22, 2012, 12:17:48 PM

Title: Toplist Codes - HIDE output if NO Trade
Post by: cPimp on June 22, 2012, 12:17:48 PM
How can I hide output completely if there's no trades in my toplist? For example:

If I make a toplist that displays 25 thumb trades, but I only have 11, how can I hide the output from the other 14 spots so I'm not displaying broken images if I use a thumb toplist?
Title: Re: Toplist Codes - HIDE output if NO Trade
Post by: ip0li on June 22, 2012, 02:08:00 PM
You can't except if U code toplist in php :)
Title: Re: Toplist Codes - HIDE output if NO Trade
Post by: cPimp on June 23, 2012, 12:45:24 AM
I'd be glad to code it in PHP... would you like to provide pointers?
Title: Re: Toplist Codes - HIDE output if NO Trade
Post by: ip0li on June 24, 2012, 01:29:54 AM
Hm sorry but I was not thinking when I wrote above, there is no way to do it with php, sorry. You can maybe do it with jquery by checking if src part is empty or href part is empty and then hide entire div/link/image.
Title: Re: Toplist Codes - HIDE output if NO Trade
Post by: allniche on June 24, 2012, 02:19:46 PM
How can I hide output completely if there's no trades in my toplist? For example:

If I make a toplist that displays 25 thumb trades, but I only have 11, how can I hide the output from the other 14 spots so I'm not displaying broken images if I use a thumb toplist?

When I use a thumb toplist as long as I don't check the "Fill empty spots by 'Add your site here!' link" box it doesn't show any broken thumbs for the spots it doesn't fill.  So if I have 25 spots but only ten active trades, then it only shows 10 spots and no broken thumbs.  That's how it works for me now anyway unless I am missing something?

To hide all I bet you could also use a special php input (called from your page) which reads the normal tp toplist output file and only displays the active ones (and if none are active then it displays nothing).  You would include/virtual it instead of the normal TP toplist output.  Maybe another more hackish approach could just be to set up a cron call to regularly process the normal TP toplist output.  I would think that might work too in addition to the suggested Jquery approach?