Uutiset:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu
Advertisement:

interface to integrate certain threads into a home page

Aloittaja Kan5478, kesäkuu 27, 2007, 01:59:28 IP

« edellinen - seuraava »

Kan5478

sorry if this has been requested/rejected/implemented... but i was unable to find it with the search function...

here's the deal:

we use SMF for a world of warcraft guild... forums are working great... we have a board where we post the latest news/kills/etc...

we currently have a index.html with a logo of the guild and links to forums...

now we want to create a index.php that queries the threads from the news board and displays it on the home page...

if you got php knowledge, it's probably easy... but without them... it's kind of time consuming...

is there anyway to create an interface to facilitate this process? basically a UI to create this php or a wizard... etc...

thank you

Oldiesmann

Tinyportal has a nice interface for that - you can put posts from selected boards on the front page, and choose how may to display there.

If you don't want a portal, it's extremely easy to do with SSI.php.
Michael Eshom
Christian Metal Fans

Kan5478

#2
awesome info! thanks... i'll give it a try

EDIT: i installed it and then the boards disappeared... all i was able to see what the left menu...

青山 素子

TinyPortal requires slightly different themes from the normal SMF ones. Try switching to the default theme and see if that helps.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


fshagan

SMF has this capability built in, with SSI.PHP.  Your server has to be able to process .PHP files like HTML files.

Take your index.html file and rename it index.php.  At the very top, before the DOCTYPE declaration, include the SSI.PHP file with an include statement:


<?php require("/home/path_to/public_html/your_forums/SSI.php"); ?>


Then, where you want the posts to appear on your home page, such as in a DIV or table in the center column, put:


<?php
$results 
ssi_recentTopics(10null'noecho'); flush();
  foreach ($results as $post){
$trackdown $post['poster'];
$dateposted $post['timestamp'];
$dateposted date("d/m/y");
  
       echo '<b><a href="'$post['href'], '" target="_blank">'$post['subject'].'</a></b>';
    
echo '<br /><i>' $post['preview'] . '</i>';
echo ' <br />by ' $trackdown['name'];
echo ' in ' '<a href="' $post['board']['href'] . '" target="_blank">' $post['board']['name'] . '</a>';
   
echo '<br /><br />';
?>



SSI.php will reveal the last 10 posts in this case, formatted according to my preferences above.  You can see how it looks at http://www.messing-about.com

SSI.php is pretty powerful; it can display the calendar events, etc.  See the full function list at SSI.php Functions .


Advertisement: