Icy Phoenix

     
 


Post new topic  Reply to topic 
Page 1 of 1
 
 
Reply with quote Download Post
Post [Ratings Block MOD] How To Make Loopings In PHPbb-Icy? 
 
Hi to all. I'm back since long time searching over there. I'd like to see if you're able to save our big Achilles heel: the PHPbb loopings, you know, those things like this <!-- BEGIN loop y END loop-->. So, I'll try to explain an example about something I talked about sometime before, concretly about a Ranking with the best valued topics from the Icy application to do that (the stars one).

One example about what we understand as a Looping is to take some results from a SQL query and print them, in this case the Icy Topic Ratings which are higher than 9 points (four stars and a half).

1. We select all post which are higher or equal to 9 points (all of PHP should be in the PHP file of the Icy Block we want to make)
Code: [Download] [Hide] [Select]
$sql = "SELECT topic_title,topic_views,topic_rating
    FROM `ip_topics`
    WHERE `topic_rating` >= 9";


2. We execute the query:
Code: [Download] [Hide] [Select]
if ( !($result = $db->sql_query($sql)) )  
{  
   message_die(GENERAL_ERROR, 'Could not obtain information', '', __LINE__, __FILE__, $sql);  
}


3. We store every topic in variables in order to use them on the template and we define TEST as the Looping name:

Code: [Download] [Hide] [Select]
while($row = $db->sql_fetchrow($result))  
{
   $template->assign_block_vars('test', array(  
       'TOPIC_TITLE' => $row['topic_title'],  
    'TOPIC_VIEWS' => $row['topic_views'],
    'TOPIC_RATING' => $row['topic_rating']
   ));
}


4. With this, we've just got out array full with every topic which got a Rating higher than 9, so now we should to walk around all results in our template in order to print them on the screen, and we guess we should do it by this way:

Code: [Download] [Hide] [Select]
<!-- BEGIN test -->
{test.TOPIC_TITLE}
{test.TOPIC_VIEWS}
{test.TOPIC_RATING}
<!-- END test -->


This is because we've seen several examples in Icy which they make this way, BUT... ours doesn't work!   And we don't know why nor what part is failing. We just want to dominate the Looping in order to customize Icy a lot, adding new features to it, so we'll thank everyone who could help us and throw us a wire. Mighty Gorgon, save us, please!

Thanks for our attention in advance and Till nex time!
 




____________
Support Info

Ivory Tower URL: : http://www.torredemarfil.es/foro/ Version: 2.0
 
SarakinSend private message  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Post new topic  Reply to topic  Page 1 of 1
 


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events


  

 

  cron