Thread: [Openfirst-cvscommit] forum forumvisit.php,1.1,1.2 index.php,1.5,1.6 thread.php,1.2,1.3
Brought to you by:
xtimg
From: <i-...@us...> - 2003-10-25 23:03:07
|
Update of /cvsroot/openfirst/forum In directory sc8-pr-cvs1:/tmp/cvs-serv9255/forum Modified Files: forumvisit.php index.php thread.php Log Message: Bug fixes, new functionality (recent msg list) Index: forumvisit.php =================================================================== RCS file: /cvsroot/openfirst/forum/forumvisit.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** forumvisit.php 13 Oct 2003 20:11:34 -0000 1.1 --- forumvisit.php 25 Oct 2003 23:02:50 -0000 1.2 *************** *** 46,48 **** --- 46,77 ---- $_SESSION["forumvisit"]=date("Y-m-d H:i:s"); } + + function latest_posts($number){ + $query=ofirst_dbquery("SELECT Title,Author,Forum,ID,ReplyTo FROM ofirst_forumposts ORDER BY DatePosted DESC LIMIT ".$number); + if(ofirst_dbnum_rows($query)==0){ + echo("<div>No posts in forums</div>"); + }else{ + echo("<ul>"); + while($post=ofirst_dbfetch_object($query)){ + $q=ofirst_dbquery("SELECT hidden FROM ofirst_forum WHERE name='$post->Forum'"); + $forum=ofirst_dbfetch_object($q); + if($forum->hidden==0){ + if($post->ReplyTo==0){ + $msgid=$post->ID; + }else{ + $msgid=$post->ReplyTo; + } + if($post->Title==""){ + $q=ofirst_dbquery("SELECT Title FROM ofirst_forumposts WHERE ID='$post->ReplyTo'"); + $root=ofirst_dbfetch_object($q); + $title=$root->Title; + }else{ + $title=$post->Title; + } + echo("<li><a href=\"".$GLOBALS["basepath"]."/forum/thread.php?id=$msgid\">$title</a><br />by $post->Author"); + } + } + echo("</ul>"); + } + } ?> Index: index.php =================================================================== RCS file: /cvsroot/openfirst/forum/index.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** index.php 21 Oct 2003 23:47:42 -0000 1.5 --- index.php 25 Oct 2003 23:02:50 -0000 1.6 *************** *** 139,143 **** echo("<td align=right> "); if(isset($lastposter)){ ! echo($lastdate.' by <a href="'.$basepath."/members/profile.php?id=".$lastposter.'">'.$lastposter."</a>"); unset($lastposter); } --- 139,147 ---- echo("<td align=right> "); if(isset($lastposter)){ ! echo($lastdate." by "); ! if(is_readable("../members/profile.php")){ ! echo('<a href="'.$basepath."/members/profile.php?id=".$lastposter.'">'); ! } ! echo($lastposter."</a>"); unset($lastposter); } *************** *** 179,183 **** echo("<td align=right> "); if(isset($lastposter)){ ! echo($lastdate.' by <a href="'.$basepath."/members/profile.php?id=".$lastposter.'">'.$lastposter."</a>"); unset($lastposter); } --- 183,191 ---- echo("<td align=right> "); if(isset($lastposter)){ ! echo($lastdate." by "); ! if(is_readable("../members/profile.php")){ ! echo('<a href="'.$basepath."/members/profile.php?id=".$lastposter.'">'); ! } ! echo($lastposter."</a>"); unset($lastposter); } Index: thread.php =================================================================== RCS file: /cvsroot/openfirst/forum/thread.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** thread.php 21 Oct 2003 23:47:42 -0000 1.2 --- thread.php 25 Oct 2003 23:02:50 -0000 1.3 *************** *** 77,81 **** echo("<table width=600><tr><th colspan=2>$msg->Title</th></tr>"); echo("<tr><td width=200 valign=top class=sub>".userdetails($msg->Author)."<div>Date: $msg->DatePosted</div></td><td valign=top>".$msg->Message."</td></tr>"); ! echo("<tr><td colspan=2 align=right class=sub><a href=".$basepath."/members/profile.php?id=".urlencode($msg->Author).'>Profile</a> | <a href="editpost.php?id='.$msg->ID.'&threadid='.$thread.'">Edit</a></td></tr></table><br />'); $query = ofirst_dbquery("SELECT * FROM ofirst_forumposts WHERE ReplyTo=$thread ORDER BY DatePosted"); --- 77,85 ---- echo("<table width=600><tr><th colspan=2>$msg->Title</th></tr>"); echo("<tr><td width=200 valign=top class=sub>".userdetails($msg->Author)."<div>Date: $msg->DatePosted</div></td><td valign=top>".$msg->Message."</td></tr>"); ! echo("<tr><td colspan=2 align=right class=sub>"); ! if(is_readable("../members/profile.php")){ ! echo("<a href=".$basepath."/members/profile.php?id=".urlencode($msg->Author).">Profile</a> | "); ! } ! echo('<a href="'.$basepath.'/forum/editpost.php?id='.$msg->ID.'&threadid='.$thread.'">Edit</a></td></tr></table><br />'); $query = ofirst_dbquery("SELECT * FROM ofirst_forumposts WHERE ReplyTo=$thread ORDER BY DatePosted"); *************** *** 115,119 **** } echo("<div>$msg->Message</div></td></tr>"); ! echo("<tr><td colspan=2 align=right class=sub><a href=".$basepath."/members/profile.php?id=".urlencode($msg->Author).'>Profile</a> | <a href="editpost.php?id='.$msg->ID.'&threadid='.$thread.'">Edit</a></td></tr>'); }else{ break; --- 119,127 ---- } echo("<div>$msg->Message</div></td></tr>"); ! echo("<tr><td colspan=2 align=right class=sub>"); ! if(is_readable("../members/profile.php")){ ! echo("<a href=".$basepath."/members/profile.php?id=".urlencode($msg->Author).">Profile</a> | "); ! } ! echo('<a href="'.$basepath.'/forum/editpost.php?id='.$msg->ID.'&threadid='.$thread.'">Edit</a></td></tr>'); }else{ break; *************** *** 136,142 **** } } ! echo("</div></th></tr></table>"); } ! echo('<br /><div><a href="newpost.php?forumid='.urlencode($forum).'&replyto='.$reply.'">New Reply</a></div>'); } } --- 144,150 ---- } } ! echo("</div></th></tr>"); } ! echo('</table><br /><div><a href="'.$basepath.'/forum/newpost.php?forumid='.urlencode($forum).'&replyto='.$reply.'">New Reply</a></div>'); } } |