Archive for myfreeforum.org Before posting please check the "stickies" in the support forums.
Please ask questions in real English and not "txt". You will get a better response.
Please do not ask support questions via PMs.
 



       myfreeforum.org Forum Index -> PhpBB2 General Support
SpaceInvaderz

Only Show x amount of items.

PLEASE ENTER THE FOLLOWING>>>>


Enter your myff forum url here, if the issue is on a particular part of the forum, then give a link to where the problem actually is. Do not enter your own domain name it must be the actual myff link : http://swapitshoplounge.myfreeforum.org


Please indicate keywords you have searched on:


Now ask your question in clear English without "txt" speak>>>>

Hello, as you can see from this post, you can see that some people have waaay too many items showing up in view_topic.

Currently the coding for the items to show up in view_topic is this;
Spoiler:

Code:
<br>My Items:<br>{postrow.RED_IMG}
{postrow.GREENBALL_IMG}
{postrow.GLIDER_IMG}
{postrow.FOOT_IMG}
{postrow.VILLA_IMG}
{postrow.NEWCASTLE_IMG}
{postrow.LERED_IMG}
{postrow.LEBLUE_IMG}
{postrow.LEGREEN_IMG}{XBOX_IMG}
{postrow.PS3_IMG}
{postrow.DS_IMG}
{postrow.IPOD_IMG}
{postrow.BASKET_IMG}
{postrow.TENNIS_IMG}
{postrow.RUGBY_IMG}
{postrow.CHOC_IMG}
{postrow.APPLE_IMG}
{postrow.COKE_IMG}
{postrow.ICECREAM_IMG}



Which is quite alot of items. Is there a way that I can set it so that only x number of items will show up?

Thanks for any help,
Bradley.
while()

Not sure if you're able to have variables, but you could do a simple if {POSTROW.item} is set then increment by 1, if it gets above xx then stop displaying.

btw the link to the post isn't guest viewable.
while()

Taking a look at the information on templating available from phpbb, it looks like this is possible.

It's very simple actually, do:

before everything do:
Code:
<!-- DEFINE $TOTALITEMS = 0 -->


then for each item you do:

Code:

<!-- IF $TOTALITEMS < 5 -->

         <!-- IF {postrow.GREENBALL_IMG} == 1 -->

         <!-- DEFINE $TOTALITEMS = $TOTALITEMS + 1 -->
      
         {postrow.GREENBALL_IMG}

         <!-- ENDIF -->

<!-- ENDIF -->


Apologies if it doesn't work, but this is the basic idea. For each element that exists you increment by 1, if the total is over 5 then it stops showing.
SpaceInvaderz

while() wrote:
Taking a look at the information on templating available from phpbb, it looks like this is possible.

It's very simple actually, do:

before everything do:
Code:
<!-- DEFINE $TOTALITEMS = 0 -->


then for each item you do:

Code:

<!-- IF $TOTALITEMS < 5 -->

         <!-- IF {postrow.GREENBALL_IMG} == 1 -->

         <!-- DEFINE $TOTALITEMS = $TOTALITEMS + 1 -->
      
         {postrow.GREENBALL_IMG}

         <!-- ENDIF -->

<!-- ENDIF -->


Apologies if it doesn't work, but this is the basic idea. For each element that exists you increment by 1, if the total is over 5 then it stops showing.


Thankyou so much
I will be trying this now!

Ahh, I see what you mean about the link, http://swapitshoplounge.co.uk/sutra745734.php#745734 This is a good example, viewable to guests.

edit: I'm afraid it didn't work, but thanks for trying!
admin (no pm's please)

That was not guest viewable for me.
SpaceInvaderz

admin (no pm's please) wrote:
That was not guest viewable for me.


It's hard to find one when you are logged in!  
http://swapitshoplounge.co.uk/sutra748914.php#748914
while()

Just wondering if you got this working; I don't see it live on the site.
SpaceInvaderz

Sorry for the late delay; no, it unfortunately didn't work.
Thanks for the attemp, much appreciated

       myfreeforum.org Forum Index -> PhpBB2 General Support
Page 1 of 1
Create your own free forum | Buy a domain to use with your forum