Shubz Posted April 2, 2008 Share Posted April 2, 2008 Can some one help me with a customer php forum that i have made? I just help on some bits thanks. Quote Link to comment Share on other sites More sharing options...
Shubz Posted April 2, 2008 Author Share Posted April 2, 2008 Im asking for help admins not a freelancer Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted April 2, 2008 Share Posted April 2, 2008 Perhaps, why don't you post what your problem is and the code regarding that. Then it's likely someone is able to help you with your issue. Quote Link to comment Share on other sites More sharing options...
Shubz Posted April 2, 2008 Author Share Posted April 2, 2008 Perhaps, why don't you post what your problem is and the code regarding that. Then it's likely someone is able to help you with your issue. Â Hi i can but there is like 4 pages of code that i need help with...:S Quote Link to comment Share on other sites More sharing options...
trq Posted April 2, 2008 Share Posted April 2, 2008 Well, how about one problem at a time. Post the relevent code. Quote Link to comment Share on other sites More sharing options...
Shubz Posted April 2, 2008 Author Share Posted April 2, 2008 Well, how about one problem at a time. Post the relevent code. Â I need help with the whole 4 pages lol...i need it to be setup a bit differently...if anybody can add me on msn or something that would be great.... ??? like you thorpe or daniel please lol i need big help Quote Link to comment Share on other sites More sharing options...
trq Posted April 2, 2008 Share Posted April 2, 2008 Your missing the entire point of this forum I'm afraid. Quote Link to comment Share on other sites More sharing options...
Shubz Posted April 2, 2008 Author Share Posted April 2, 2008 please explain Quote Link to comment Share on other sites More sharing options...
unsider Posted April 2, 2008 Share Posted April 2, 2008 You send them the whole script outside of the forum boards and expect them fix it, and your not sure how you're missing the point. Try to break it down, try to learn. That's the point. They want you to think, and figure it out on your own. Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted April 2, 2008 Share Posted April 2, 2008 It's easier to help you here because there are more people working on it and the people helping have time to look up references seeing as it's not in real-time. It's also easier to post large amounts of code here. Often you'll experience faster response times on the forums, but that requires you to actually give us something which we can help you with (problem description, error messages, source code, etc.). Quote Link to comment Share on other sites More sharing options...
Shubz Posted April 2, 2008 Author Share Posted April 2, 2008 Ok i will do that i will put four pages of code on...thanks mods Quote Link to comment Share on other sites More sharing options...
Shubz Posted April 2, 2008 Author Share Posted April 2, 2008 Well here it is first the index page i would like to ecplain wot i need doing:  i have a mafia game which has a nice simple forum but i want to manipulate this forum so it works with my IP board on www.RadioBounce.com.. i want it so that people can log into this on the front page as a MINI forum with their IP board user and pass but the posts and topics are seperate...   INDEX:  <? session_start(); include "http://www.radiobounce.com/forum/conf_global.php"; include "includes/functions.php"; logincheck(); $username=$_SESSION['name']; $forum=$_GET['forum']; $username=$_SESSION['name']; $viewtopic = $_GET['viewtopic']; $forum_look=$_GET['forum_look']; if (!$viewtopic){ $viewtopic = "1"; } $fetch=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$username'")); if ($forum == "Crew" && $fetch->crew != "0"){ $crew="1"; } $owner=mysql_num_rows(mysql_query("SELECT * FROM crews WHERE owner='$username' OR rhm='$username'")); $userlevel=$fetch->userlevel; $select = mysql_fetch_object(mysql_query("SELECT * FROM topics WHERE id='$viewtopic' AND forum='$forum'")); $forum_count = 15; function index_navigation($index, $count, $num) { $forum = $_GET['forum']; $viewtopic = $_GET['viewtopic']; if ($index != 0) { print "<a href=\"right.php?forum=$forum&viewtopic=$viewtopic&forum_look=" . ($index - $count) . "\">Previous</a> "; } if ($num == $count) { print " <a href=\"right.php?forum=$forum&viewtopic=$viewtopic&forum_look=" . ($index + $count) . "\">Next</a>"; } } if (! isset($forum_look) ) { $forum_look = 0; } ?> <html><head> <link href="includes/in.css" rel="stylesheet" type="text/css"> <title>Forum</title></head><body><center> <table width="551" border=1 align="center" cellpadding=2 cellspacing=0 class=thinline rules=none>  <tr>   <td class=header align=center><?php echo "$select->title"; ?></td>  </tr>  <tr>   <td bgcolor=black height=1><a name="<?php echo "$select->id"; ?></a>"></a></td>  </tr>  <tr>   <td bgcolor="white" class=tip>Poster: <a href="profile.php?viewuser=<? echo "$select->username"; ?>" style="color:red;font-weight=bold"><?php echo "$select->username"; ?></a>    Time: <?php echo "$select->made"; ?> </td>  </tr>  <tr>   <td bgcolor=black height=2></td>  </tr>  <tr>   <td width="80%"> <table width="100%" border="0" cellspacing="3" cellpadding="0">     <tr>      <td><?php echo "".replace($select->topictext).""; ?></td>     </tr>    </table></td>  </tr>  <?php $replys=mysql_query("SELECT * FROM replys WHERE idto = '$viewtopic' AND forum='$forum' ORDER by `id` DESC LIMIT $forum_look, $forum_count");  while($curr=mysql_fetch_object($replys)){  ?>  <tr>   <td bgcolor=black height=2><a name="39453"></a></td>  </tr>  <tr>   <td bgcolor="white" class=tip>Poster: <a href="profile.php?viewuser=<?php echo "$curr->username"; ?>" style="color:black" title=""><?php echo "$curr->username"; ?></a>    Time: <?php echo "$curr->made"; ?></td>  </tr>  <tr>   <td bgcolor=black height=2></td>  </tr>  <tr>   <td width="80%"> <table width="100%" border="0" cellspacing="3" cellpadding="0">     <tr>      <td><?php echo "".replace($curr->text).""; ?></td>     </tr>    </table></td>  </tr>  <? } ?>    <tr>   <td bgcolor=black height=2></td>  </tr>  <tr bgcolor=white>   <td colspan=2 align=right class=tip><?php if ($select->locked == "1"){ echo "This topic is locked. No more replys can be made."; }else{ ?><a href=reply.php?forum=<?php echo "$forum"; ?>&viewtopic=<?php echo "$viewtopic"; ?>><font color="#000000">Add    reply </font></a><? } ?></td>  </tr>  <tr bgcolor=white>   <td colspan=2 align=right class=tip><div align="center">     <?php index_navigation($forum_look, $forum_count, $num); ?>    </div></td>  </tr> </table> </body></html> Quote Link to comment Share on other sites More sharing options...
Shubz Posted April 2, 2008 Author Share Posted April 2, 2008 Left Panel that includes the topics list:  <? session_start(); include "includes/functions.php"; logincheck(); $username=$_SESSION['username']; include "http://www.radiobounce.com/forum/conf_global.php"; include"includes/smile.php"; ?> <? $fetch=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$username'")); $userlevel=$fetch->userlevel; if ($fetch->fban == "1"){ echo "<b><font color=white>You Have Been Banned From Using The Forums."; die(); } $forum=$_GET['forum']; if ($forum == "Crew" && $fetch->crew != "0"){ $crew="1"; } $boss=mysql_num_rows(mysql_query("SELECT * FROM crews WHERE boss='$username' OR underboss='$username'")); $forum_look=$_GET['forum_look']; echo "<link rel=stylesheet href=includes/in.css type=text/css>"; $forum_count = 30; function index_navigation($index, $count, $num) { $forum = $_GET['forum']; if ($index != 0) { print "<a href=\"left.php?forum=".$forum."&forum_look=" . ($index - $count) . "\"><b>Previous</a> "; } if ($num == $count) { print " <a href=\"left.php?forum=".$forum."&forum_look=" . ($index + $count) . "\"><b>Next</a>"; } } if (! isset($forum_look) ) { $forum_look = 0; } ?><title><border="2" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">Topics</title><body bgcolor="#000000" background="backg.gif"> <p align="center"><a href="topic.php?forum=<? echo "$forum"; ?>" target="frameright"><strong>Create New Topic</strong></font> </a></font> <b><font color=white>| <a href="left.php?forum=main"><b>Refresh</a></p> <table width="276" border="1" cellspacing="0" cellpadding="4" bordercolor="#666666" bgcolor="#000000">  <tr><td height="29" colspan="5" background="includes/grad.gif" bordercolor=""><p align="center"><font size="2"><strong><font color="#FFFFFF" size="1">Topics  </font></strong></font></p>  </td>  </tr> <font color='white'><b><? if ($crew == "1"){ $query="SELECT * FROM `topics` WHERE `forum`='$forum' AND crew='$fetch->crew' ORDER BY `lastreply` DESC LIMIT $forum_look, $forum_count"; }else{ $query="SELECT * FROM `topics` WHERE `forum`='$forum' ORDER BY `lastreply` DESC LIMIT $forum_look, $forum_count"; } $query=mysql_query("$query"); $num=mysql_num_rows($query); $col="0"; while($fo=mysql_fetch_object($query)){ if ($col=="0"){ $td="#000000"; $col="1"; }else{ $td="#000000"; $col="0"; } $hehe=mysql_num_rows(mysql_query("SELECT * FROM replys WHERE idto='$fo->id'")); if ($fetch->userlevel == "1" || $fetch->userlevel == "4" || $fetch->userlevel == "3" || $fetch->userlevel == "5" || strtolower($by) == strtolower($username) || $crew == "1" && $owner != "0"){ echo "<tr bgcolor=$td><td width='92%'>"; if ($fo->important == "1" ){ echo"<font color='white'><b><u>Important:</u> <a href='right.php?viewtopic=$fo->id&forum=$forum' target='frameright'><b>$fo->title</b></a></font>"; } if ($fo->sticky == "1" ){ echo"<font color='white'><b>Sticky: </b></font>"; } if ($fo->sticky == "1" ) { echo "<a href='right.php?viewtopic=$fo->id&forum=$forum' target='frameright'><b>$fo->title</b></a> </font>"; } if ($fo->locked == "1" ){ echo"<font color='white'><b> (locked)</b></font>"; } elseif ($fo->sticky == "1" && $fo->locked == "1") { echo "<b>Sticky: </b></font>"; } elseif ($fo->sticky == "0" && $fo->important == "0" ) { echo "<a href='right.php?viewtopic=$fo->id&forum=$forum' target='frameright'>$fo->title</a> </font></td>"; } if ($fo->locked == "1" ) { echo "<td width=1><a title='Unlock' href='left.php?unlock=$fo->id&forum=$forum'><font color=3399cc>[uL]</font></a></td>"; } elseif($fo->locked == "0" ) { echo "<td width=1><a title='Lock' href='left.php?lock=$fo->id&forum=$forum'><font color=3399cc>[L]</font></a></td>"; } if ($fo->important == "0" && $fo->sticky == "1" ) { echo "<td width=1><a title='Unsticky' href='left.php?unstick=$fo->id&forum=$forum'><font color=3399cc>[uS]</font></a></td>"; } if ($fo->important == "1" && $fo->sticky == "0" ) { echo "<td width=1><a title='Unimportant' href='left.php?unimportant=$fo->id&forum=$forum'><font color=3399cc>[uI]</font></a></td>"; } if ($fo->sticky == "1" ) { echo "<td width=1><a title='Important' href='left.php?important=$fo->id&forum=$forum'><font color=3399cc>[i]</font></a></td>"; } elseif ($fo->sticky == "0") { echo "<td width=1><a title='Sticky' href='left.php?stick=$fo->id&forum=$forum'><font color=3399cc>[s]</font></a></td>"; } echo "<td width=1><a title='Delete' href='left.php?clean=$fo->id&forum=$forum'><font color=3399cc>[D]</font></a></td>"; }else{ echo "<tr bgcolor=$td><td width='92%'>"; if ($fo->important == "1" ){ echo"<font color='white'><b><u>Important:</u> <a href='right.php?viewtopic=$fo->id&forum=$forum' target='frameright'><b>$fo->title</b></a></font>"; } if ($fo->sticky == "1" ){ echo"<font color='white'><b>Sticky: </b></font>"; } if ($fo->sticky == "1" ){ echo "<a href='right.php?viewtopic=$fo->id&forum=$forum' target='frameright'><b>$fo->title</b></a></font>"; } if ($fo->locked == "1" ){ echo"<font color='white'><b> (locked)</b></font></td>"; } elseif ($fo->sticky == "0" ){ echo "<a href='right.php?viewtopic=$fo->id&forum=$forum' target='frameright'>$fo->title</a></td></font>"; } } } if($_GET[lock]) { $lock = $_GET[lock]; if($fetch->userlevel == "0") { die('You cannot lock this topic'); } $locked =mysql_num_rows(mysql_query("SELECT * FROM topics WHERE username='$username' AND id='$lock'")); $check1=mysql_query("SELECT * FROM topics WHERE id='$lock'"); $chech=mysql_fetch_object($check1); if($userlevel > 0 || $lock != "0" ){ if ($forum == "Crew" && $crew == "1"){ mysql_query("UPDATE topics SET locked='1' WHERE id='$lock' AND crew = '$fetch->crew' "); }else{ mysql_query("UPDATE topics SET locked='1' WHERE id='$lock'"); } echo "Locked"; echo "<META HTTP-EQUIV='Refresh' CONTENT='1; URL=left.php?forum=$forum'>"; } } if($_GET[unlock]) { $lock = $_GET[unlock]; if($fetch->userlevel == "0") { die('You cannot unlock this topic'); } $locked =mysql_num_rows(mysql_query("SELECT * FROM topics WHERE username='$username' AND id='$lock'")); $check1=mysql_query("SELECT * FROM topics WHERE id='$lock'"); $chech=mysql_fetch_object($check1); if($userlevel > 0 || $lock != "0" ){ if ($forum == "Crew" && $crew == "1"){ mysql_query("UPDATE topics SET locked='0' WHERE id='$lock' AND crew = '$fetch->crew' "); mysql_query("UPDATE topics SET title='$new_tit2' WHERE id='$lock'"); }else{ mysql_query("UPDATE topics SET locked='0' WHERE id='$lock'"); } echo "<font color=white>Unlocked"; echo "<META HTTP-EQUIV='Refresh' CONTENT='1; URL=left.php?forum=$forum'>"; } } if($_GET[important]) { if($fetch->userlevel == "0") { die('<font coldor=white>You cannot make this topic Important'); } $important = $_GET[important]; $check1=mysql_query("SELECT * FROM topics WHERE id='$important'"); $chech=mysql_fetch_object($check1); $new_tit=" <b>$chech->title</b>"; $sticky =mysql_num_rows(mysql_query("SELECT * FROM topics WHERE username='$username' AND id='$important'")); if($userlevel > 0 || $important != "0" ){ if ($forum == "Crew" && $crew == "1"){ mysql_query("UPDATE topics SET important='1' && sticky='0', lastreply='99999999999999999' WHERE id='$important' AND crew = '$fetch->crew'"); } else { mysql_query("UPDATE topics SET important='1' && sticky='0', lastreply='99999999999999999' WHERE id='$important'"); } echo "<font color=white>Made Important!"; echo "<META HTTP-EQUIV='Refresh' CONTENT='1; URL=left.php?forum=$forum'>"; } } if($_GET[unimportant]) { if($fetch->userlevel == "0") { die('<font color=white>You cannot make this topic Unimportant'); } $important = $_GET[unimportant]; $check1=mysql_query("SELECT * FROM topics WHERE id='$important'"); $chech=mysql_fetch_object($check1); $new_tit="<b>$chech->title</b>"; $sticky =mysql_num_rows(mysql_query("SELECT * FROM topics WHERE username='$username' AND id='$important'")); if($userlevel > 0 || $important != "0" ){ if ($forum == "Crew" && $crew == "1"){ mysql_query("UPDATE topics SET important='0', lastreply='1290232642' WHERE id='$important' AND crew = '$fetch->crew'"); } else { mysql_query("UPDATE topics SET important='0', lastreply='1290232642' WHERE id='$important'"); } echo "<font color=white>Made Unimportant"; echo "<META HTTP-EQUIV='Refresh' CONTENT='1; URL=left.php?forum=$forum'>"; } } if($_GET[stick]) { if($fetch->userlevel == "0") { die('<font coldor=white>You cannot sticky this topic'); } $stick = $_GET[stick]; $check1=mysql_query("SELECT * FROM topics WHERE id='$stick'"); $chech=mysql_fetch_object($check1); $new_tit=" <b>$chech->title</b>"; $sticky =mysql_num_rows(mysql_query("SELECT * FROM topics WHERE username='$username' AND id='$stick'")); if($userlevel > 0 || $stick != "0" ){ if ($forum == "Crew" && $crew == "1"){ mysql_query("UPDATE topics SET sticky='1', lastreply='999999999999999' WHERE id='$stick' AND crew = '$fetch->crew'"); } else { mysql_query("UPDATE topics SET sticky='1', lastreply='999999999999999' WHERE id='$stick'"); } echo "<font color=white>Stickied"; echo "<META HTTP-EQUIV='Refresh' CONTENT='1; URL=left.php?forum=$forum'>"; } } if($_GET[unstick]) { if($fetch->userlevel == "0") { die('<font color=white>You cannot unstick this topic'); } $stick = $_GET[unstick]; $check1=mysql_query("SELECT * FROM topics WHERE id='$stick'"); $chech=mysql_fetch_object($check1); $new_tit="<b>$chech->title</b>"; $sticky =mysql_num_rows(mysql_query("SELECT * FROM topics WHERE username='$username' AND id='$stick'")); if($userlevel > 0 || $stick != "0" ){ if ($forum == "Crew" && $crew == "1"){ mysql_query("UPDATE topics SET sticky='0', lastreply='1290232641' WHERE id='$stick' AND crew = '$fetch->crew'"); } else { mysql_query("UPDATE topics SET sticky='0', lastreply='1290232641' WHERE id='$stick'"); } echo "<font color=white>Unstickied"; echo "<META HTTP-EQUIV='Refresh' CONTENT='1; URL=left.php?forum=$forum'>"; } } if($_GET[clean]) { if($fetch->userlevel == "0") { die('<font color=white>You cannot delete this topic'); } $clean = $_GET[clean]; $cc=mysql_num_rows(mysql_query("SELECT * FROM topics WHERE username='$username' AND id='$clean'")); if($userlevel > 0 || $clean != "0" ){ if ($forum == "Crew" && $crew == "1"){ mysql_query("DELETE FROM topics WHERE id='$clean' AND crew='$fetch->crew'"); mysql_query("DELETE FROM replys WHERE idto='$clean' AND crew='$fetch->crew'"); }else{ mysql_query("DELETE FROM topics WHERE id='$clean'"); mysql_query("DELETE FROM replys WHERE idto='$clean'"); } echo "<font color=white>Cleaned"; echo "<META HTTP-EQUIV='Refresh' CONTENT='1; URL=left.php?forum=$forum'>"; } } ?></b></font> </table><br> <?php index_navigation($forum_look, $forum_count, $num); ?> Quote Link to comment Share on other sites More sharing options...
Shubz Posted April 2, 2008 Author Share Posted April 2, 2008  Right Panel which has options to reply and create new topics:  <?php session_start(); include "http://www.radiobounce.com/forum/conf_global.php"; include "includes/functions.php"; include"includes/smile.php"; //////////////////////////////////////////////////////////////////////////////////////////////////////// ///logincheck(); ///$forum=$_GET['forum']; ///$username=$_SESSION['username']; ///$viewtopic = $_GET['viewtopic']; ///$forum_look=$_GET['forum_look']; ///$fetch=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$username'")); //////////////////////////////////////////////////////////////////////////////////////////////////////// if($_GET[clean]) { $clean=$_GET[clean]; if($fetch->userlevel == "2" || $fetch->userlevel == "0") { die('You cannot delete this post!'); } mysql_query("UPDATE `replys` SET `text` = '<b>This Post Has Been Removed By $username Who Is Moderating The Forum!' WHERE id='$clean' AND forum='$forum'") or die ("<font color=white>Cannot delete reply</font>"); echo "<font color=white>Reply Deleted</font>!"; echo "<meta http-equiv='refresh' content='1;url=right.php?forum=$forum&viewtopic=$viewtopic'>"; } if (!$viewtopic){ $viewtopic = "1"; } if ($forum == "Crew" && $fetch->crew != "0"){ $crew="1"; } $boss=mysql_num_rows(mysql_query("SELECT * FROM crews WHERE boss='$username' OR underboss='$username'")); $userlevel=$fetch->userlevel; if ($fetch->fban != "1"){ $ggee = mysql_query("SELECT locked, sticky, lastreply FROM topics WHERE id='$viewtopic' AND forum='$forum'"); while($dsdsd = mysql_fetch_row($ggee)){ $lockedornot = $dsdsd[0]; $stikornot = $dsdsd[1]; $lastreplyit = $dsdsd[2]; } if ($crew == "1"){ $gg = mysql_query("SELECT * FROM topics WHERE id='$viewtopic' AND forum='$forum' AND crews='$fetch->crews'"); }else{ $gg = mysql_query("SELECT * FROM topics WHERE id='$viewtopic' AND forum='$forum'"); } while($success = mysql_fetch_row($gg)){ $username1 = $success[1]; $title = $success[2]; $topictext = $success[3];     $made = $success[8]; } $fetchhim=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$username1'")); ?> <style> body { font-family: Verdana, Tahoma, Arial, Trebuchet MS, Sans-Serif, Georgia, Courier, Times New Roman, Serif; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; color: #FFFFCC; font-size: 11px; line-height: 135%; margin: 0px; padding: 0px; } .post { padding: 10px; color: #FFFFCC; background: #161616; font-family: Verdana, Tahoma, Arial, Trebuchet MS, Sans-Serif, Georgia, Courier, Times New Roman, Serif; font-size: 11px; line-height: 135%; margin: 0px;     border: 2px solid #454545; } .postdetails2 { background: #161616; border: 2px solid #454545; color: #FFFFCC; } .postspace { padding: 7px; background: #000000; border: 2px solid #454545; } .border   border: 2px solid 454545; { border: 2px solid #454545; } .style2 {font-size: 10px} a:link { text-decoration: none; color: #33CCFF; font-weight: bold; } a:visited { text-decoration: none; color: #33CCFF; font-weight: bold; } a:active { text-decoration: none; color: #33CCFF; font-weight: bold; } a:hover { color: #FFFFFF; font-weight: bold; text-decoration: blink; } .gradient { font-family: Verdana; font-style: normal; line-height: 30px; font-weight: bold; color: #FFFFFF; background-image: url(includes/grad.gif); background-repeat: repeat-x;     border: 2px solid #454545; } .style4 {font-weight: bold; font-size: 12px;} .tableborder2 { font-family: Verdana, Tahoma, Arial, Trebuchet MS, Sans-Serif, Georgia, Courier, Times New Roman, Serif; font-size: 11px; color: #FFFFFF; background-color: #000000; background-image: url(includes/grad.gif); background-repeat: no-repeat; background-position: center top; padding: 5px;     border: 2px solid #454545; } </style>  <div align="center"> <br>  <table width="570" border="1" bgcolor=#666666 class="thinline" id="table1" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF" style="border-collapse: collapse">   <tr>    <td width="200" rowspan="2" valign="top" class="postspace" bordercolor=#FFFFFF> <table width="100%" height="100%" border="1" cellpadding="0" cellspacing="0" id="table2">     <tr>      <td bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF" bordercolor="#FFFFCC"><div align="center" class="postdetails2" bordercolor=black>       <span class="style4"><br></color><font color='#FFFFCC'>Username:</font></span><font color='#FFFFCC'>      <b><?php echo"<b>$username1</font>"; ?></b> </font>       <br />             Rank: </span><?php echo "$fetchhim->rank"; ?>  </font>      <br>Crew: <?php echo "$fetchhim->crew"; if ($fetchhim->crew == "0"){ echo "<b> None</font></b>"; } ?> </font></b> </span>    <br \>  <left> <span class="style4"><font color="#FFFFFF"><br></font></span><?php echo"<a href='profile.php?viewuser=$username1'>Profile</a> | <a href='send.php?fromper=$username1'>Message</a>"; ?><br><br> <?php if($fetch->userlevel == "4" || $fetch->userlevel == "1" || $fetch->userlevel == "3"){  echo"<a href='fpanel.php'><b>Forum Panel</a> <br />";}   ?> </table></td>    <th width="400" height="20" valign="top" class="gradient" bordercolor="#FFFFCC">  <font color='#FFFFCC'><span style="font-size:10pt;">  <?php echo "$title"; ?></span></th>   </tr>   <tr>    <td width="400" height="100%" valign="top" class="post" bordercolor="#FFFFCC"><div align="left"> <? echo replace($topictext); if ($topictext == ""){  $topictext = "Main Forum";}?>      <br \><br>      <span class="style2"><i></b>          </i> </span></span></div></td>   </tr>  </table> <br> <br> <?php $forum_count = 25; function index_navigation($index, $count, $num) { $forum = $_GET['forum']; $viewtopic = $_GET['viewtopic']; if ($index != 0) { print "<a href=\"right.php?forum=$forum&viewtopic=$viewtopic&forum_look=" . ($index - $count) . "\"><b>Previous</a> "; } if ($num == $count) { print " <a href=\"right.php?forum=$forum&viewtopic=$viewtopic&forum_look=" . ($index + $count) . "\"><b>Next</a>"; } } if (! isset($forum_look) ) { $forum_look = 0; } if ($crew == "1"){ $query="SELECT * FROM replys WHERE idto = '$viewtopic' AND forum='$forum' AND crew='$fetch->crew' ORDER by `id` DESC LIMIT $forum_look, $forum_count"; }else{ $query="SELECT * FROM replys WHERE idto = '$viewtopic' AND forum='$forum' ORDER by `id` DESC LIMIT $forum_look, $forum_count"; } $query=mysql_query("$query"); $num=mysql_num_rows($query); while($right=mysql_fetch_object($query)){ if ($fetch->userlevel == "4" || $fetch->userlevel == "1" || $fetch->userlevel == "3"){ $forumquote = mysql_query("SELECT * FROM users WHERE username = '$right->username'"); $fq = mysql_fetch_object($forumquote); echo "<table width=570 cellspacing=1 cellpadding=2 border=1 class=thinline bordercolor='#FFFFCC' bgcolor=black style=border-collapse: collapse><tr>       <td height=30 colspan=5 bordercolor='#454545' background=includes/grad.gif> <b><a href='profile.php?viewuser=$right->username' target=middle><b>$right->username</b></a> <b><font color='#FFFFCC'>On: $right->made | </b><a href='right.php?clean=$right->id&forum=$forum&viewtopic=$viewtopic'><b>Delete</a> <b></b></font> </td></tr> <tr>  <td height='40' bgcolor=#131313 bordercolor='#FFFFCC' width=600 height=25 ><font color='#FFFFCC'>"; echo replace($right->text); if($fq->forumquote == "") { echo "</td></tr></table><br></font> <p>"; } else { echo "</td></tr><tr><td width=845>$fq->forumquote</td></tr></table><br> <p>"; } }elseif ($userlevel == 0 || $userlevel == 2){ $forumquote = mysql_query("SELECT * FROM users WHERE username = '$right->username'"); $fq = mysql_fetch_object($forumquote); echo "<table width=600 height=29 cellspacing=0 cellpadding=2 border=1 class=thinline bordercolor=#FFFFCC bgcolor=black style=border-collapse: collapse><tr>       <td height=30 colspan=5 background=includes/grad.gif><a href='profile.php?viewuser=$right->username' target=middle><b>$right->username</b></a> <b><font color='#FFFFCC'>On: $right->made</b></td></tr> <tr>  <td height='40' bordercolor='#FFFFCC' bgcolor=#131313 width=845><font color='#FFFFCC'>"; echo replace($right->text); if($fq->forumquote == "") { echo "</td></tr></table><br> <p>"; } else { echo "</td></tr><tr><td width=845>$fq->forumquote</td></tr></table><br> <p>"; } } } ?> <?php index_navigation($forum_look, $forum_count, $num); ?> <br> <br> <? if (!$viewtopic){ $viewtopic = "1"; } if(strip_tags($_POST['Submit']) && strip_tags($_POST['reply_text']) && $forum && $viewtopic){ $reply_text = addslashes(strip_tags($_POST['reply_text'])); $topic_info=mysql_fetch_object(mysql_query("SELECT * FROM topics WHERE id='$viewtopic' AND forum='$forum'")); if ($topic_info->sticky == "1"){ $lastreplytime = $topic_info->lastreply; }elseif ($stikornot == "0"){ $lastreplytime = time(); } $date = gmdate('Y-m-d h:i:s'); if ($crew == "1" && $fetch->crew != "0"){ mysql_query("INSERT INTO `replys` (`id`, `username`, `text`, `forum`, `idto`,`made`,`crew`) VALUES ('', '$username', '$reply_text', '$forum', '$viewtopic','$date','$fetch->crew');") or die (mysql_error()); }else{ mysql_query("INSERT INTO `replys` (`id`, `username`, `text`, `forum`, `idto`,`made`) VALUES ('', '$username', '$reply_text', '$forum', '$viewtopic','$date');") or die (mysql_error()); } mysql_query("UPDATE `user_info` SET `posts` = `posts`+1 WHERE username='$username'"); mysql_query("UPDATE topics SET lastreply='$lastreplytime' WHERE id='$viewtopic'"); echo " <SCRIPT LANGUAGE='JavaScript'> window.location='right.php?forum=$forum&viewtopic=$viewtopic'; </script>"; } ?> <? if($info->rank =='Tramp'){ die("<center><b>You Must be Ranked Chav or above to Post in the Forum!</b></font></center>"); } ?> <script language=JavaScript> function so(dis) { for (i=0;i<dis.elements.length;i++){ if (dis.elements[i].type=='submit')  dis.elements[i].style.visibility='hidden'; } if(fs==false){ fs=true; return true; }else return false; } function goaway() { for(i=0;i<document.forms.length;i++) document.forms[i].onsubmit = function() {return so(this);}; } </script> <script language="javascript" type="text/javascript"> function AddEmoticon(text) { var txtarea = document.form.reply_text; text = ' ' + text + ' '; if (txtarea.createTextRange && txtarea.caretPos) { var caretPos = txtarea.caretPos; caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text; txtarea.focus(); } else { txtarea.value += text; txtarea.focus(); } } </script> <title>Posts</title> <style type="text/css"> <!-- .style4 { color: #FFFFFF; font-weight: bold; font-size: 10px;     } .tableborder2 {font-family: Verdana, Tahoma, Arial, Trebuchet MS, Sans-Serif, Georgia, Courier, Times New Roman, Serif; font-size: 11px; color: #FFFFCC; background-color: #000000; background-image: url(Images/tableback.png); background-repeat: no-repeat; background-position: center top; padding: 5px;     } --> </style> <style type="text/css"> <!-- .style4 { color: #FFFFFF; font-weight: bold; font-size: 10px; } --> </style> <style type="text/css"> <!-- .tableborder2 {font-family: Verdana, Tahoma, Arial, Trebuchet MS, Sans-Serif, Georgia, Courier, Times New Roman, Serif; font-size: 11px; color: #FFFFFF; background-color: #000000; background-image: url(Images/tableback.png); background-repeat: no-repeat; background-position: center top; padding: 5px; } --> </style> <style type="text/css"> <!-- .tableborder2 {font-family: Verdana, Tahoma, Arial, Trebuchet MS, Sans-Serif, Georgia, Courier, Times New Roman, Serif; font-size: 11px; color: #FFFFFF; background-color: #000000; background-image: url(Images/tableback.png); background-repeat: no-repeat; background-position: center top; padding: 5px; } --> </style> <body onload=goaway();> <form action='' method=post> <input name="forumto" type="hidden" value="<?php echo "$forum"; ?>">     <input name="this" type="hidden" id="this" value="<?php echo "$viewtopic"; ?>"> <center> <table class=thinline border=1 cellspacing=0 cellpadding=2 width=92% bordercolor="black" bgcolor="#DDDDDD" style="border-collapse: collapse">   <tr><? if ($topic_info->locked == "1"){ echo "This topic has been locked. This means no more replys can be added!"; exit(); } ?><? if ($lockedornot == '1'){ echo "<font size=2><b>This topic has been locked. This means no more replys can be added!"; }elseif ($userlevel != '0' || $lockedornot != '1'){ ?> <td height="30" background="includes/grad.gif"><center>  <span class="style4">Reply</span> </center></td> </tr> <tr>    <td bordercolor="#000000" width=600 bgcolor="#000000" ><center>          <div align="center"><br>     </div></td> </tr> <tr>  <td bordercolor="#000000" bgcolor="#000000" class=thinline><div align="center">   <textarea name="reply_text" cols="60" rows="5" class="tableborder2" src="includes/BOX.gif" id="reply_text" style="width: 90%;"></textarea>  </div></td> </tr> <tr> <td width=33% bordercolor="#000000" bgcolor="#000000" class=thinline><center>  <div align="center">   <input name=Submit type=submit class="button" value=Submit>  </div></td> </tr> </table></center> </form> <? if ($fetch->userlevel != "0"){?> <br /> <? } ?><? }} ?> Quote Link to comment Share on other sites More sharing options...
Shubz Posted April 2, 2008 Author Share Posted April 2, 2008 and finally the fucntions page which is the backbone of the forum: Â <?php session_start(); include_once "db_connect.php"; $username=$_SESSION['username']; echo "<link rel=stylesheet href=includes/in.css type=text/css>"; $query=mysql_query("SELECT * FROM users WHERE username='$username' LIMIT 1"); $info = mysql_fetch_object($query); $don=mysql_num_rows(mysql_query("SELECT * FROM donaters WHERE username='$username'")); $date = gmdate('Y-m-d h:i:s'); if ($info->health <= "-1000"){ mysql_query("UPDATE users SET status='Dead' WHERE username='$username'"); session_destroy(); } if ($info->status == "Dead" || $info->status == "Banned"){ session_destroy(); echo "<b><font color=white>You have been Killed!"; exit(); } $crew_check =mysql_query("SELECT * FROM crews"); while($k = mysql_fetch_object($crew_check)){ $user=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$k->owner'")); $rhm=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$k->rhm'")); if ($user->status == "Dead" || $user->status == "Banned"){ if ($k->rhm != "0" && $rhm->status == "Alive"){ mysql_query("UPDATE crews SET owner='$k->rhm', rhm='0' WHERE name='$k->name'"); } elseif ($k->rhm == "0" || $rhm->status == "Dead" || $rhm->status == "Banned"){ mysql_query("UPDATE `users` SET `crew`='1' WHERE `crew`='$k->name'"); mysql_query("DELETE FROM crews WHERE name='$k->name'"); } } } $bba=mysql_query("SELECT * FROM bank"); while($nana =mysql_fetch_object($bba)){ $ppl=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$nana->owner'")); if ($ppl->status == "Dead" || $ppl->status == "Banned"){ mysql_query("UPDATE bank SET owner='0' WHERE id='$nana->id'"); } } $oc_query=mysql_query("SELECT * FROM oc"); while($ttfn = mysql_fetch_object($oc_query)){ $user_oc=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$ttfn->leader'")); if ($user_oc->status == "Dead" || $user_oc->status == "Banned"){ mysql_query("UPDATE users SET oc='0' WHERE username='$ttfn->we'"); mysql_query("UPDATE users SET oc='0' WHERE username='$ttfn->ee'"); mysql_query("UPDATE users SET oc='0' WHERE username='$ttfn->driver'"); mysql_query("UPDATE users SET oc='0' WHERE username='$ttfn->leader'"); mysql_query("DELETE FROM oc WHERE id='$ttfn->id'"); }} function logincheck(){ if (empty($_SESSION['username'])){ echo " <SCRIPT LANGUAGE='JavaScript'> window.location='index.php'; </script> "; exit(); }} ////UPDATE ONLINE $time = time() + (60 * 10); mysql_query("UPDATE users SET online='$time' WHERE username='$username'"); ///FINSH UPDATING ONLINE function makecomma($input) { Â Â if(strlen($input)<=3) Â { return $input; } Â $length=substr($input,0,strlen($input)-3); Â $formatted_input = makecomma($length).",".substr($input,-3); Â return $formatted_input; } /////////NOW TO THE BB CODES ETC.... function rankcheck(){ $username=$_SESSION['username']; $query=mysql_query("SELECT * FROM users WHERE username='$username' LIMIT 1"); $info = mysql_fetch_object($query); $date = gmdate('Y-m-d h:i:s'); if (($info->rank == "Scum") && ($info->rankpoints >= "100")){ $newrank="Tramp"; $done="1"; } elseif (($info->rank == "Tramp") && ($info->rankpoints >= "200")){ $newrank="Chav"; $done="1"; } elseif (($info->rank == "Chav") && ($info->rankpoints >= "300")){ $newrank="Vandal"; $done="1"; } elseif (($info->rank == "Vandal") && ($info->rankpoints >= "500")){ $newrank="Mobster"; $done="1"; } elseif (($info->rank == "Mobster") && ($info->rankpoints >= "800")){ $newrank="Hitman"; $done="1"; } elseif (($info->rank == "Hitman") && ($info->rankpoints >= "1300")){ $newrank="Agent"; $done="1"; } elseif (($info->rank == "Agent") && ($info->rankpoints >= "2100")){ $newrank="Boss"; $done="1"; } elseif (($info->rank == "Boss") && ($info->rankpoints >= "3400")){ $newrank="Assassin"; $done="1"; } elseif (($info->rank == "Assassin") && ($info->rankpoints >= "5500")){ $newrank="Godfather"; $done="1"; } elseif (($info->rank == "Godfather") && ($info->rankpoints >= "8900")){ $newrank="Global Threat"; $done="1"; } elseif (($info->rank == "Global Threat") && ($info->rankpoints >= "14400")){ $newrank="World Dominator"; $done="1"; } elseif (($info->rank == "World Dominator") && ($info->rankpoints >= "23300")){ $newrank="World Class Dominator"; $done="1"; } elseif (($info->rank == "World Class Dominator") && ($info->rankpoints >= "37700")){ $newrank="Untouchable Godfather"; $done="1"; } elseif (($info->rank == "Untouchable Godfather") && ($info->rankpoints >= "61000")){ $newrank="Mobster Legend"; $done="1"; } elseif (($info->rank == "Mobster Legend") && ($info->rankpoints >= "159700")){ $newrank="Legend"; $done="1"; } elseif (($info->rank == "Legend") && ($info->rankpoints >= "300000")){ $newrank="Official Bliss Godfather"; $done="1"; } if (!$done){ $done="0"; } if ($done == "1"){ mysql_query("UPDATE users SET rank='$newrank' WHERE username='$username'"); mysql_query("INSERT INTO `inbox` ( `id` , `to` , `from` , `message` , `date` , `read` , `saved` , `event_id` ) VALUES ('', '$username', '$username', '[center]Congratulations, You have been promoted to <b>$newrank</b><br> Keep it up!', '$date', '0', '0', '')"); }} rankcheck();///////HOUSTON WE HAVE JAIL CHECK! $jail_check=mysql_query("SELECT * FROM jail"); while($monster=mysql_fetch_object($jail_check)){ if (time() > $monster->time_left){ mysql_query("DELETE FROM jail WHERE username='$monster->username'"); }} function maketime($last){ $timenow = time(); if($last>$timenow){ $order = $last-$timenow; while($order >= 60){ $order = $order-60; $ordermleft++; } while($ordermleft >= 60){ $ordermleft = $ordermleft-60; $orderhleft++; } if($ordermleft == 0){ $ordermleft = ""; } else { $ordermleft = "$ordermleft Minutes"; } if($orderhleft == 0){ $orderhleft = ""; } else { $orderhleft = "$orderhleft Hours"; } return "$orderhleft $ordermleft $order Seconds"; }} function loose_energy(){ $username=$_SESSION['username']; $query=mysql_query("SELECT * FROM users WHERE username='$username' LIMIT 1"); $info = mysql_fetch_object($query); $energy=$info->energy - rand(1,3); if ($energy <= "0"){ $update=health; $thing=$info->health - rand(1,3); $energy_new="0"; }elseif ($energy > "0"){ $update=energy; $thing=$info->energy - rand(1,3); } if (!$energy_new){ mysql_query("UPDATE users SET $update='$thing' WHERE username='$username'"); }elseif ($energy_new){ mysql_query("UPDATE users SET $update='$thing', energy='0' WHERE username='$username'"); } } $most_online=mysql_fetch_object(mysql_query("SELECT * FROM site_stats WHERE id='1'")); $timenow=time(); $now_online =mysql_num_rows(mysql_query("SELECT * FROM users WHERE online > '$timenow'")); if ($now_online > $most_online->online){ mysql_query("UPDATE site_stats SET online='$now_online' WHERE id='1'"); } $drop =mysql_query("SELECT * FROM casinos"); while($tard=mysql_fetch_object($drop)){ $per = mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$tard->owner'")); if ($per->status == "Dead" || $per->status == "Banned"){ mysql_query("UPDATE casinos SET owner='0' WHERE casino='$tard->casino' AND owner='$tard->owner'"); } } $drop_bar =mysql_query("SELECT * FROM bar"); while($tard_bar=mysql_fetch_object($drop_bar)){ $per_bar = mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$tard_bar->owner'")); if ($per_bar->status == "Dead" || $per_bar->status == "Banned"){ mysql_query("UPDATE bar SET owner='0' WHERE owner='$tard_bar->owner'"); } } $drop_crew =mysql_query("SELECT * FROM crews"); while($tard_crew=mysql_fetch_object($drop_crew)){ $per_crew = mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$tard_crew->owner'")); if ($per_bar->status == "Dead" || $per_bar->status == "Banned"){ mysql_query("UPDATE crew SET owner='$tard_bar->rhm', rhm=''Â WHERE owner='$tard_bar->owner'"); } } $drop_bf =mysql_query("SELECT * FROM bf"); while($tard_bf=mysql_fetch_object($drop_bf)){ $per_bf = mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$tard_bf->owner'")); if ($per_bf->status == "Dead" || $per_bf->status == "Banned"){ mysql_query("UPDATE bf SET owner='0' WHERE owner='$tard_bf->owner'"); } } if ($info->banktime <= time() && $info->bank > "0"){ $nmoney =Â 10 * $info->bank / 100; $money_in = $info->bank + $nmoney; $money_in= round($money_in); $recieve = $info->money + $money_in; mysql_query("UPDATE users SET money = '$recieve', bank='0', banktime='0' WHERE username='$username'"); } $drop_und =mysql_query("SELECT * FROM shop"); while($tard_und=mysql_fetch_object($drop_und)){ $per_und = mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$tard_und->owner'")); if ($per_und->status == "Dead" || $per_und->status == "Banned"){ mysql_query("UPDATE shop SET owner='0' WHERE owner='$tard_und->owner'"); } } $user_info=mysql_fetch_object(mysql_query("SELECT * FROM user_info WHERE username='$username'")); if ($user_info->jail_able == "1" && $user_info->jail_untill <= time()){ mysql_query("UPDATE user_info SET jail_able='0' WHERE username='$username'"); } $user_shit=mysql_fetch_object(mysql_query("SELECT * FROM user_info WHERE username='$username'")); if ($user_shit->last_respect < time() && $fetch->rank != "Tramp"){ if ($info->rank == "Paper Kid"){ $new_res="1"; }elseif($info->rank == "Theif"){Â $new_res="2"; }elseif($info->rank == "Robber"){Â $new_res="3"; }elseif($info->rank == "Gangster"){Â $new_res="4";Â Â }elseif($info->rank == "Associate"){Â $new_res="5";Â }elseif($info->rank == "Piciotto"){Â $new_res="6";Â }elseif($info->rank == "Made Man"){Â $new_res="7"; }elseif($info->rank == "Capo"){Â $new_res="8"; }elseif($info->rank == "Consigliere"){Â $new_res="9"; }elseif($info->rank == "Underboss"){Â $new_res="10"; }elseif($info->rank == "Druglord"){Â $new_res="11"; }elseif($info->rank == "Godfather"){Â $new_res="12"; } $now=time() + (3600 * 24 * 7); mysql_query("UPDATE user_info SET respect='$new_res', last_respect='$now' WHERE username='$username'"); } ?> Quote Link to comment Share on other sites More sharing options...
Shubz Posted April 2, 2008 Author Share Posted April 2, 2008 Please help.... ??? Quote Link to comment Share on other sites More sharing options...
Shubz Posted April 2, 2008 Author Share Posted April 2, 2008 .... ??? Quote Link to comment Share on other sites More sharing options...
discomatt Posted April 2, 2008 Share Posted April 2, 2008 You want the PHP freelancers forum. This forum is for programming help, not programming for you. Hopefully someone will do it within your budget Quote Link to comment Share on other sites More sharing options...
trq Posted April 2, 2008 Share Posted April 2, 2008 Please help.... Â You haven't asked a question / told us what the problem is. Quote Link to comment Share on other sites More sharing options...
Crew-Portal Posted April 2, 2008 Share Posted April 2, 2008 wow, I laughed so hard looking at this... U gotta say what your problem is or how you want us to expand your code? Is there an error or do u just want it to function better? Do you want it to function the same but with less code or do you want us to re-create the code? You have to expalin what it is you want us to do in order for us to help you out with your problem! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.