SMF Support > SMF 2.0.x Support

Using SSS.PHP

<< < (3/3)

Kays:
If you haven't seen his already. The second FAQ covers outputting as an array. [README] SSI FAQ's

just as a test to see the output, include SSI.php and then the following code:


--- Code: ---$topics = ssi_recentTopics(8, null, null, 'array');
echo ;<pre>', print_r($topics), '</pre>';

--- End code ---

That should show all of the variables available. To output as you wish, then you would need to loop through the array.


--- Code: ---$topics = ssi_recentTopics(8, null, null, 'array');
foreach($topics as $topic)
      echo ' <li><a href="', $topic['href'], '">', $topic['subject'], '</a> ', $txt['by'], ' ', $topic['poster']['link'], '</li>';

--- End code ---

bestfriendavinash:

--- Quote from: Kays on April 23, 2012, 07:38:40 AM ---If you haven't seen his already. The second FAQ covers outputting as an array. [README] SSI FAQ's

just as a test to see the output, include SSI.php and then the following code:


--- Code: ---$topics = ssi_recentTopics(8, null, null, 'array');
echo ;<pre>', print_r($topics), '</pre>';

--- End code ---

That should show all of the variables available. To output as you wish, then you would need to loop through the array.


--- Code: ---$topics = ssi_recentTopics(8, null, null, 'array');
foreach($topics as $topic)
      echo ' <li><a href="', $topic['href'], '">', $topic['subject'], '</a> ', $txt['by'], ' ', $topic['poster']['link'], '</li>';

--- End code ---

--- End quote ---

Thank You Done it... Marking the topic as solved but if you could tell me why the following is giving me an error


--- Code: ---$topics = ssi_recentTopics(8, null, null, 'array');
foreach($topics as $topic)
      echo ' <li><a href="', $topic['href'], '">', $topic['subject'], '</a> ' '</li>';

--- End code ---

Thank You all for your great support... reading the complete SSI.PHP manual  :)

Yoshi:
What error is it giving?

Kays:
Great SSI.php is fun to use once you get the hang of it. :)

Hmm, I should of added a disclaimer that the code wasn't tested. I just copied parts of it from your first post and just noticed this little problem. Those two single quotes shouldn't be there. ::)


--- Quote --- echo ' <li><a href="', $topic['href'], '">', $topic['subject'], '</a> ' '</li>';

--- End quote ---

bestfriendavinash:

--- Quote from: Kays on April 23, 2012, 11:07:42 AM ---Great SSI.php is fun to use once you get the hang of it. :)

Hmm, I should of added a disclaimer that the code wasn't tested. I just copied parts of it from your first post and just noticed this little problem. Those two single quotes shouldn't be there. ::)


--- Quote --- echo ' <li><a href="', $topic['href'], '">', $topic['subject'], '</a> ' '</li>';

--- End quote ---

--- End quote ---

thank you ... I was also guessing the same...

Navigation

[0] Message Index

[*] Previous page

Go to full version