View Full Version : Integrating phpBB into main site


evalopez
09-19-2005, 07:50 PM
I've seen pages where you can allow your latest forum topics and such appear on your main site in something like a latest news feed. What is required to do this? I've got phpbb 2.0.17.

Douglas
09-21-2005, 09:09 PM
i dont think there is a programme..... you might have to try advanced programming, us a code like this (php):


<?
$servername="YOUR SERVERNAME";
$dbusername="YOUR DBUSERNAME";
$dbpassword="YOUR DBPASSWORD";
$dbname="YOUR DBNAME";
mysql_connect("$servername","$dbusername","$dbpassword") or die(mysql_error());
mysql_select_db("$dbname");
$lastpost=mysql_query("SELECT LAST_POST_ID() FROM phpbb_posts") or die(mysql_error());
$resulta=mysql_query("SELECT * FROM phpbb_posts WHERE post_id>'$lastpost'") or die
(mysql_error());
$num_rowsa=mysql_num_rows($resulta);
if ($num_rowsa==0) {
echo "No Posts";
}
elseif ($num_rowsa==1) {
$rowa=mysql_fetch_array($resulta);
$resultb=mysql_query("SELECT * FROM phpbb_posts_text WHERE post_id='$rowa[post_id]'") or die(mysql_error());
$rowb=mysql_fetch_array($resultb);
$resultc=mysql_query("SELECT username FROM phpbb_users WHERE id='$rowa[poster_id]'") or die(mysql_error());
echo "<table>
<tr>
<td>Username:</td>
<td>$resultc</td>
</tr>
<tr>
<td>Subject:</td>
<td>".$rowb['post_subject']."</td>
</tr>
<tr>
<td>Text:</td>
<td>".$rowb['post_text']."</td>
</tr>
<tr>
<td>Link:</td>
<td><a href=\"forumlocation/showtopic.php?p=".$rowa['post_id']."\">Go</a></td>
</tr>
</table>";
}
else {
while ($rowa=mysql_fetch_array($resulta)) {
$resultb=mysql_query("SELECT * FROM phpbb_posts_text WHERE post_id='$rowa[post_id]'") or die(mysql_error());
$rowb=mysql_fetch_array($resultb);
$resultc=mysql_query("SELECT username FROM phpbb_users WHERE id='$rowa[poster_id]'") or die(mysql_error());
echo "<table>
<tr>
<td>Username:</td>
<td>$resultc</td>
</tr>
<tr>
<td>Subject:</td>
<td>".$rowb['post_subject']."</td>
</tr>
<tr>
<td>Text:</td>
<td>".$rowb['post_text']."</td>
</tr>
<tr>
<td>Link:</td>
<td><a href=\"forumlocation/showtopic.php?p=".$rowa['post_id']."\">Go</a></td>
</tr>
</table>";
}
}
?>


wheew just whipped that up, something like that should work, just edit it a bit :D

Rosey
09-22-2005, 09:49 PM
you can try this:

http://www.phpbbhacks.com/download/3090


what you may look into is a portal. Personally I like integramod (http://integramod.com/).

hdshngout
09-25-2005, 12:35 AM
i tried to do somthing like that when i first started my forum (less than 5 members and generic layout). I didnt back up, and i ruined it. Be very careful when monkeying with the coding. I would highly reccomend integramod. Simple to set up, and has a bunch of features. (I spent the last few days just monkeying around with the features/hacks).