avatar.alex Posted April 28, 2007 Share Posted April 28, 2007 ok im having trouble localing the problem ok well first here the problem on some of the post it has to lines together and then skips a line to lines together and then skips lines whats going on heres a screen shot and heres the code i was having a lot of trouble going through the code: <?php session_start(); include "../admin/connect.php"; include "../header.php"; print "<link rel='stylesheet' href='../style.css' type='text/css'>"; $blogadmin=$_SESSION['blogadmin']; $getadmin="SELECT * from bl_admin where username='$blogadmin'"; $getadmin2=mysql_query($getadmin) or die("Cannot get admin"); $getadmin3=mysql_fetch_array($getadmin2); print "<center>"; print "<table width=90%><tr><td>"; $forumID=$_GET['forumID']; $ID=$_GET['ID']; $getforum="SELECT forumid,forumname from bl_forums where forumid='$forumID'"; $getforum2=mysql_query($getforum) or die("Could not get forums"); $getforum3=mysql_fetch_array($getforum2); print "<A href='index.php'>Forum Main</a>-<A href='forum.php?ID=$getforum3[forumid]'>$getforum3[forumname]</a>-"; if(isset($_SESSION['blogadmin'])) { print "Welcome $blogadmin"; } else { print "<A href='../index.php'>Login</a>"; } $gettopics="SELECT * FROM bl_forumposts a, bl_admin b where b.adminid=a.posterid and a.forumid='$forumID' and a.postid='$ID'"; $gettopics2=mysql_query($gettopics) or die("Could not get topics"); $gettopics3=mysql_fetch_array($gettopics2); print "</td></tr></table><br><br></center>"; print "<center><table border='0' width=95%><tr><td>"; print "<A href='newpost.php?forumID=$forumID'>New Post</a>-<A href='reply.php?forumID=$forumID&threadid=$ID'>Reply</a></td></tr></table><br>"; print "<table width=95% border='0'>"; print "<tr class='headline'><td width=25% valign='top'><center>Author</center></td><td valign='top' width=75%><center>Post</center></td></tr>"; print "<tr class='mainrow'><td width=25% valign='top'><A href='../members.php?membername=$gettopics3[username]'>$gettopics3[username]</a><br><br><A href='banuser.php?userid=$gettopics3[adminid]'>Ban User from Posting</a></td>"; print "<td valign='top' width=75%>Last replied to on $gettopics3[posttime]<br>"; //start logic for forum permissions if($getadmin3['status']>=2 || $getadmin3[adminid]==$gettopics3[adminid]) { print "<A href='editpost.php?forumID=$forumID&threadid=$ID'>Edit Post</a>|"; } print "<A href='quote.php?forumID=$forumID&threadid=$ID'>Quote</a>"; if($getadmin3['status']>=2) { if($gettopics3['islocked']==1) { print "|<A href='unlockthread.php?ID=$ID'>Unlock Thread</a>|"; } else { print "|<A href='lockthread.php?ID=$ID'>Lock Thread</a>|"; } print "<A href='movethread.php?ID=$ID'>Move Thread</a>|<A href='deletethread.php?ID=$ID'>Delete Thread</a>"; } print "<br><hr>"; $gettopics3[thepost] = wordwrap($gettopics3[thepost], 100, "\n", 1); $gettopics3[thepost]= BBCode($gettopics3[thepost]); $gettopics3[thepost]= BBCode($gettopics3[thepost]); print "$gettopics3[thepost]<br><hr>"; print "</td></tr>"; if(!isset($_GET['start'])) { $start=0; } else { $start=$_GET['start']; } $update="update bl_forumposts set numviews=numviews+1 where forumid='$forumID'"; mysql_query($update) or die("Could not update"); $getreplies="SELECT * from bl_forumposts a, bl_admin b where b.adminid=a.posterid and a.threadid='$ID' limit $start,15"; $getreplies2=mysql_query($getreplies) or die(mysql_error()); //put reply stuff here while($getreplies3=mysql_fetch_array($getreplies2)) { print "<tr class='mainrow'><td width=25% valign='top'><A href='../members.php?membername=$getreplies3[username]'>$getreplies3[username]</a><br><br><A href='banuser.php?userid=$getreplies3[adminid]'>Ban User from Posting</a></td>"; print "<td width=75% valign='top'><A href='quote.php?forumID=$forumID&threadid=$getreplies3[postid]'>Quote</a>|"; if($getadmin3['status']>=2 || $getadmin3[adminid]==$gettopics3[adminid]) { print "<A href='editpost.php?forumID=$forumID&threadid=$getreplies3[postid]'>Edit Post</a>|"; } if($getadmin3['status']>=2) { print "<A href='deletepost.php?ID=$getreplies3[postid]'>Delete Post</a>"; } print "<br><hr>"; $getreplies3[thepost]= wordwrap($getreplies3[thepost],100,"\n",1); $getreplies3[thepost]=BBCode($getreplies3[thepost]); print "$getreplies3[thepost]<br><hr></td></tr>"; } print "</table><br><br>"; print "<center>"; $order="SELECT COUNT(*) FROM bl_forumposts where threadid='$ID'"; $order2=mysql_query($order) or die("2"); $d=0; $f=0; $g=1; $order3=mysql_result($order2,0); $prev=$start-15; $next=$start+15; if($start>=15) { print "<A href='message.php?forumID=$forumID&ID=$ID'>First</a>  "; print "<A href='message.php?forumID=$forumID&ID=$ID&start=$prev'><<</a> "; } while($f<$order3) { if($f%15==0) { if($f>=$start-3*15&&$f<=$start+7*15) { print "<A href='message.php?forumID=$forumID&ID=$ID&start=$d'><b>$g</b></a> "; $g++; } } $d=$d+1; $f++; } if($start<$order3-15) { print " <A href='message.php?forumID=$forumID&ID=$ID&start=$next'>>></a> "; $last=$order3-$numrepliesperpage; print "<A href='message.php?forumID=$forumID&ID=$ID&start=$last'>Last</a>"; } ?> <? //BBCODE function //Local copy function BBCode($Text) { // Replace any html brackets with HTML Entities to prevent executing HTML or script // Don't use strip_tags here because it breaks [url] search by replacing & with amp // Convert new line chars to html <br /> tags $Text = nl2br($Text); // Set up the parameters for a URL search string $URLSearchString = " a-zA-Z0-9\:&\/\-\?\.\=\_\~\#\'"; // Set up the parameters for a MAIL search string $MAILSearchString = $URLSearchString . " a-zA-Z0-9\.@"; // Perform URL Search $Text = preg_replace("(\[url\]([$URLSearchString]*)\[/url\])", '<a href="$1">$1</a>', $Text); $Text = preg_replace("(\[url\=([$URLSearchString]*)\]([$URLSearchString]*)\[/url\])", '<a href="$1" target="_blank">$2</a>', $Text); $Text = preg_replace("(\[url\=([$URLSearchString]*)\]([$URLSearchString]*)\[/url\])", '<a href="$1" target="_blank">$2</a>', $Text); // Perform MAIL Search $Text = preg_replace("(\[mail\]([$MAILSearchString]*)\[/mail\])", '<a href="mailto:$1">$1</a>', $Text); $Text = preg_replace("/\[mail\=([$MAILSearchString]*)\](.+?)\[\/mail\]/", '<a href="mailto:$1">$2</a>', $Text); // Check for bold text $Text = preg_replace("(\[b\](.+?)\[\/b])is",'<b>$1</b>',$Text); // Check for Italics text $Text = preg_replace("(\[i\](.+?)\[\/i\])is",'<I>$1</I>',$Text); $Text= str_replace("JavaScript", "Java Script",$Text); // Check for Underline text $Text = preg_replace("(\[u\](.+?)\[\/u\])is",'<u>$1</u>',$Text); // Check for strike-through text $Text = preg_replace("(\[s\](.+?)\[\/s\])is",'<span class="strikethrough">$1</span>',$Text); // Check for over-line text $Text = preg_replace("(\[o\](.+?)\[\/o\])is",'<span class="overline">$1</span>',$Text); // Check for colored text $Text = preg_replace("(\[color=(.+?)\](.+?)\[\/color\])is","<span style=\"color: $1\">$2</span>",$Text); // Check for sized text $Text = preg_replace("(\[size=(.+?)\](.+?)\[\/size\])is","<span style=\"font-size: $1px\">$2</span>",$Text); // Check for list text $Text = preg_replace("/\[list\](.+?)\[\/list\]/is", '<ul class="listbullet">$1</ul>' ,$Text); $Text = preg_replace("/\[list=1\](.+?)\[\/list\]/is", '<ul class="listdecimal">$1</ul>' ,$Text); $Text = preg_replace("/\[list=i\](.+?)\[\/list\]/s", '<ul class="listlowerroman">$1</ul>' ,$Text); $Text = preg_replace("/\[list=I\](.+?)\[\/list\]/s", '<ul class="listupperroman">$1</ul>' ,$Text); $Text = preg_replace("/\[list=a\](.+?)\[\/list\]/s", '<ul class="listloweralpha">$1</ul>' ,$Text); $Text = preg_replace("/\[list=A\](.+?)\[\/list\]/s", '<ul class="listupperalpha">$1</ul>' ,$Text); $Text = str_replace("[*]", "<li>", $Text); $Text = preg_replace("(\[quote\](.+?)\[\/quote])is",'<center><table class="quotecode"><tr row="forumrow"><td>Quote:<br>$1</td></tr></table></center>',$Text); $Text = preg_replace("(\[code\](.+?)\[\/code])is",'<center><table class="quotecode"><tr row="forumrow"><td>Code:<br>$1</td></tr></table></center>',$Text); // Check for font change text $Text = preg_replace("(\[font=(.+?)\](.+?)\[\/font\])","<span style=\"font-family: $1;\">$2</span>",$Text); // Images // [img=pathtoimage] $Text = preg_replace("/\[img\](.+?)\[\/IMG\]/", '<img src="$1">', $Text); $Text = preg_replace("/\[img\](.+?)\[\/img\]/", '<img src="$1">', $Text); // [img=widthxheight]image source[/img] $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.+?)\[\/img\]/", '<img src="$3" height="$2" width="$1">', $Text); return $Text; } ?> Link to comment https://forums.phpfreaks.com/topic/49114-help-with-chipmunk-forum/ Share on other sites More sharing options...
avatar.alex Posted April 30, 2007 Author Share Posted April 30, 2007 ok well I noticed that my locked post aren't at the top the move down as people post new topics is there a way so that I can Lock topics and as they get locked they stay at the top: and how would I do that with this code <?php session_start(); include "../admin/connect.php"; include "../header.php"; print "<link rel='stylesheet' href='../style.css' type='text/css'>"; $blogadmin=$_SESSION['blogadmin']; $getadmin="SELECT * from bl_admin where username='$blogadmin'"; $getadmin2=mysql_query($getadmin) or die("Cannot get admin"); $getadmin3=mysql_fetch_array($getadmin2); print "<center>"; print "<table width=90%><tr><td>"; print "<A href='index.php'>Forum Main</a>-"; if(isset($_SESSION['blogadmin'])) { print "Welcome $blogadmin"; } else { print "<A href='../index.php'>Login</a>"; } if(!isset($_GET['start'])) { $start=0; } else { $start=$_GET['start']; } //code from new/old post identification $thedate=date("U"); $checktime=$thedate-200; $uprecords="Update bl_admin set lasttime='$thedate' where adminid='$getadmin3[adminid]'"; mysql_query($uprecords) or die("Could not update records"); if($getuser3[tsgone]<$checktime) { $updatetime="Update bl_admin set tsgone='$thedate', oldtime='$getadmin3[tsgone]' where adminid='$getadmin3[adminid]'"; mysql_query($updatetime) or die("Could not update time"); } //now select topics $ID=$_GET['ID']; $gettopics="SELECT * FROM bl_forumposts a, bl_admin b where b.adminid=a.posterid and a.forumid='$ID' and a.threadid='0' order by a.thetime DESC limit $start,20"; $gettopics2=mysql_query($gettopics) or die("Could not get topics"); print "</td></tr></table><br><br></center>"; print "<center><table border='0' width=95%><tr><td>"; print "<A href='newpost.php?forumID=$ID'>New Post</a></td></tr></table><br>"; print "<table width=95% border='0'>"; print "<tr class='headline'><td colspan='2'><b>Topic</b></td><td><b>Topic Starter</b></td><td><b>Replies</b></td><td>Views</td><td>Last post</td></tr>"; while($gettopics3=mysql_fetch_array($gettopics2)) { $gettopics3[title]=strip_tags($gettopics3[title]); print "<tr class='mainrow'><td width=3%>"; if($gettopics3['islocked']==1) { print "<img src='../images/locked.gif' border='0'>"; } else { if($gettopics3['thetime']>$getadmin3['oldtime']) { print "<img src='../images/yesnewposts.gif' border='0'>"; } else { print "<img src='../images/topic.gif' border='0'>"; } } print "</td><td width=35%><A href='message.php?forumID=$ID&ID=$gettopics3[postid]'>$gettopics3[title]</a></td><td width=15%>$gettopics3[username]</td><td width=8%>$gettopics3[numreplied]</td><td width=8%>$gettopics3[numviews]</td><td>$gettopics3[posttime]<br>Last Post by:<b>$gettopics3[lastposter]</b></td></tr>"; } print "</table>"; print "<center>"; $order="SELECT COUNT(*) FROM bl_forumposts where forumid='$ID' and threadid='0'"; $order2=mysql_query($order) or die("2"); $d=0; $f=0; $g=1; $order3=mysql_result($order2,0); $prev=$start-15; $next=$start+15; if($start>=15) { print "<A href='forum.php?ID=$ID'>First</a>  "; print "<A href='forum.php?ID=$ID&start=$prev'><<</a> "; } while($f<$order3) { if($f%15==0) { if($f>=$start-3*15&&$f<=$start+7*15) { print "<A href='forum.php?ID=$ID&start=$d'><b>$g</b></a> "; $g++; } } $d=$d+1; $f++; } if($start<$order3-15) { print " <A href='forum.php?ID=$ID&start=$next'>>></a> "; $last=$order3-$numrepliesperpage; print "<A href='forum.php?ID=$ID&start=$last'>Last</a>"; } print "</center><br><br>"; print "<center><font size='1'>Powered by © <A href='http://www.chipmunk-scripts.com'>Chipmunk Blogger</a></font></center>"; ?> Link to comment https://forums.phpfreaks.com/topic/49114-help-with-chipmunk-forum/#findComment-241840 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.