![]() |
| Home Community Mys-Script Creative Off-Topic |
|
|||||||
![]() |
|
|
Thread Tools | Display Modes |
|
#31
|
|||
|
|||
|
I've got it up and working, but when you click on a forum nothing appears...
My site: http://www.pokefarm.2x.nu/poke/main_forum2.php |
|
#32
|
||||
|
||||
|
Quote:
|
|
#33
|
|||
|
|||
|
Code:
<?php
// **********************************************************************
// Rusnak PHP Adoptables Script
// Copyright 2009 Brandon Rusnak
// For help and support: http://www.rusnakweb.com/forum/
//
// Redistribution prohibited without written permission
// File ID: profile.php
// Shows a user profile, or a member list.
// **********************************************************************
// Wake the sleeping giant
// **********************************************************************
// Basic Configuration Info
// **********************************************************************
include("inc/functions.php");
include("inc/config.php");
include("lang/lang.php");
$themeurl = "templates/default/forumtemp.html";
// **********************************************************************
// Define our top links by calling getlinks()
// **********************************************************************
$links = getlinks();
// **********************************************************************
// Define our ads by calling getads()
// **********************************************************************
$ads = getads("any");
// **********************************************************************
// Grab any dynamic article content from the content table
// **********************************************************************
$article_title = $pagecontent[title];
$article_content = $pagecontent[content];
$article_content = nl2br($article_content);
// **********************************************************************
// Grab any settings that we will need for the current page from the DB
// **********************************************************************
$browsertitle = grabanysetting("browsertitle");
$sitename = grabanysetting("sitename");
$slogan = grabanysetting("slogan");
// **********************************************************************
// Check and see if the user is logged in to the site
// **********************************************************************
$loginstatus = logincheck();
$isloggedin = $loginstatus[loginstatus];
$loggedinname = $loginstatus[username];
// **********************************************************************
// End Prepwork - Output the page to the user
// **********************************************************************
// This page handles user profiles and shows the site members...
$query = "SELECT * FROM ".$prefix."messages WHERE touser='".$loggedinname."' and status='unread'";
$result = mysql_query($query);
$num = mysql_numrows($result);
if($num > 0){
$msg = "
<table width='888px' border='1' cellpadding='3' cellspacing='1' bordercolor='1' bgcolor='#F9AE00' class='ftable'>
<td>
<table width='888px' border='1' cellpadding='3' cellspacing='1' bordercolor='1' bgcolor='#FECF61'>
<tr>
<td><center>You have a new message(s): <a href='messages.php'>Visit Message Center</a>(<b>".$num."</b>)<br></center></td>
</tr>
</table>
</table><br>";
}
$table = "".$msg."<br>".$article_content."";
$status2 = "".grabanysetting("status")."";
$reason2 = "".grabanysetting("reason")."";
if($status2 == "1") {
$article_content = "
<table>
<table width='100%' border='1'>
<tr>
<td width='100' align='center'><strong>Your Administrator has turned the board offline. If your administrator has listed a reason, it is given below:</strong></td>
</tr>
<tr>
<td width='100' align='center'><strong>".$reason2."</strong></td>
</tr></table></table><br>";
}
else {
$fid=$_GET['fid'];
$query = "SELECT * FROM forum_question WHERE fid='".$fid."' ORDER BY id DESC";
$result = mysql_query($query);
$num = mysql_numrows($result);
$id=@mysql_result($result,$i,"id");
$impid=@mysql_result($result,$i,"impid");
if($id == ""){
$not = "<tr><td class='trow' colspan='7'>There are currently no threads in this forum. If you would like to make a thread click the 'Create New Topic' button.</td></tr>";
}
if($impid == "1"){
$imp = "<td width='10%' align='center' class='tr'><strong>Important Thread</strong></td>";
}
else{
$imp = "<td width='10%' align='center' class='tr'><strong>Important Thread</strong></td>";
}
$query = "SELECT * FROM forum WHERE fid='".$fid."'";
$result = mysql_query($query);
$topic=@mysql_result($result,$i,"topic");
$group = getgroup();
$cancp = cancp($group);
if($cancp != "yes"){
}
else if($cancp == "yes"){
$tab = "<td width='10%' align='center' class='tr'><strong>Status</strong></td>";
}
$article_title = "<a href='main_forum2.php'>4U Forum</a> / ".$topic."";
$table = $table."
<table width='90%' border='0' align='center' cellpadding='3' cellspacing='1' class='ftable'>
<tr>
<td width='100%' class='thead'>".$topic."</td>
</tr>
</table>
<table width='90%' border='0' align='center' cellpadding='3' cellspacing='1' class='ftable'>
<tr>
<td width='43%' align='center' class='tr'><strong>Topic</strong></td>
".$imp."
<td width='15%' align='center' class='tr'><strong>Views</strong></td>
<td width='13%' align='center' class='tr'><strong>Replies</strong></td>
<td width='13%' align='center' class='tr'><strong>Date/Time</strong></td>
<td width='40%' class='tr' align='center'><strong>Last Post</strong></td>
".$tab."
</tr>
".$not."";
$fid=$_GET['fid'];
$query = "SELECT * FROM forum_question WHERE fid='".$fid."' ORDER BY id DESC";
$result = mysql_query($query);
$num = mysql_numrows($result);
while ($i < $num) {
$id=@mysql_result($result,$i,"id");
$impid=@mysql_result($result,$i,"impid");
$name=@mysql_result($result,$i,"name");
$topic=@mysql_result($result,$i,"topic");
$view=@mysql_result($result,$i,"view");
$reply=@mysql_result($result,$i,"reply");
$datetime=@mysql_result($result,$i,"datetime");
$status=@mysql_result($result,$i,"status");
$lby=@mysql_result($result,$i,"lby");
$ltopic=@mysql_result($result,$i,"ltopic");
$lname=@mysql_result($result,$i,"lname");
$ldatetime=@mysql_result($result,$i,"ldatetime");
$topic = stripslashes($topic);
$ltopic = stripslashes($ltopic);
$group = getgroup();
$cancp = cancp($group);
if($cancp != "yes"){
}
else if($cancp == "yes"){
$tab2 = "<td align='center' class='trow'>".$status."</td>";
}
if($status == "Open"){
$tname = "".$topic."";
}
else if($status == "Locked"){
$tname = "<s>".$topic."</s>";
}
if($impid == "1"){
$imp2 = "<td align='center' bgcolor='#FECF61'>Important Thread</td>";
}
else{
$imp2 = "<td align='center' class='trow'>Normal Thread</td>";
}
if($ltopic == ""){
$lpost = "<i>Never</i>";
}
else{
$lpost = "".$ldatetime."<br>by: <a href='profile2.php?user=".$lby."'>".$lby."</a>";
}
$table = $table."
<tr>
<td class='trow'><a href='view_topic.php?id=".$id."'>".$tname."</a><BR><strong>Created by:</strong><a href='profile2.php?user=".$name."'>".$name."</a></td>
".$imp2."
<td align='center' class='trow'>".$view."</td>
<td align='center' class='trow'>".$reply."</td>
<td align='center' class='trow'>".$datetime."</td>
<td align='center' class='trow'>".$lpost."</td>
".$tab2."
</tr>
";
$i++;
}
if($isloggedin == "yes"){
$create = "<a href='create_topic.php?fid=".$fid."'><strong>Create New Topic</strong> </a>";
}
else{
$create = "<br>";
}
$table = $table."
<tr>
<td colspan='7' align='right' class='tr'><a href='accountpost.php?act=changesettings&more=".$fid."'>Subscribe to this Forum</a> | ".$create."</td>
</tr></table>
";
}
// **********************************************************************
// Begin Template Definition
// **********************************************************************
//Define our current theme
$file = $themeurl;
// Do the template changes and echo the ready template
$template = file_get_contents($file);
$template = replace(':ARTICLETITLE:',$article_title,$template);
$template = replace(':ARTICLECONTENT:',$article_content,$template);
$template = replace(':TABLE:',$table,$template);
$template = replace(':ARTICLEDATE:',$article_date,$template);
$template = replace(':BROWSERTITLE:',$browsertitle,$template);
$template = replace(':SITENAME:',$sitename,$template);
//Define our links
$template = replace(':LINKSBAR:',$links,$template);
//Get the content for the side bar...
$sidebar = getsidebar();
$template = replace(':SIDEFEED:',$sidebar,$template);
//Get the ad content...
$template = replace(':ADS:',$ads,$template);
//Get the slogan info
$template = replace(':SLOGAN:',$slogan,$template);
echo $template;
// **********************************************************************
// End Template Definition
// **********************************************************************
?>
|
|
#34
|
||||
|
||||
|
Okay that's not the problem. Because now you can view the forums. But when I click to see a thread I get an internal service error. Paste your view_topic.php thread here.
|
|
#35
|
|||
|
|||
|
Code:
<?php
// **********************************************************************
// Rusnak PHP Adoptables Script
// Copyright 2009 Brandon Rusnak
// For help and support: http://www.rusnakweb.com/forum/
//
// Redistribution prohibited without written permission
// File ID: profile.php
// Shows a user profile, or a member list.
// **********************************************************************
// Wake the sleeping giant
// **********************************************************************
// Basic Configuration Info
// **********************************************************************
include("inc/functions.php");
include("inc/config.php");
include("lang/lang.php");
$themeurl = "templates/forumtemp.html";
// **********************************************************************
// Define our top links by calling getlinks()
// **********************************************************************
$links = getlinks();
// **********************************************************************
// Define our ads by calling getads()
// **********************************************************************
$ads = getads("any");
// **********************************************************************
// Grab any dynamic article content from the content table
// **********************************************************************
$article_title = $pagecontent[title];
$article_content = $pagecontent[content];
$article_content = nl2br($article_content);
// **********************************************************************
// Grab any settings that we will need for the current page from the DB
// **********************************************************************
$browsertitle = grabanysetting("browsertitle");
$sitename = grabanysetting("sitename");
$slogan = grabanysetting("slogan");
// **********************************************************************
// Check and see if the user is logged in to the site
// **********************************************************************
$loginstatus = logincheck();
$isloggedin = $loginstatus[loginstatus];
$loggedinname = $loginstatus[username];
// **********************************************************************
// End Prepwork - Output the page to the user
// **********************************************************************
// This page handles user profiles and shows the site members...
$query = "SELECT * FROM ".$prefix."messages WHERE touser='".$loggedinname."' and status='unread'";
$result = mysql_query($query);
$num = mysql_numrows($result);
if($num > 0){
$msg = "
<table width='888px' border='1' cellpadding='3' cellspacing='1' bordercolor='1' bgcolor='#F9AE00' class='ftable'>
<td>
<table width='888px' border='1' cellpadding='3' cellspacing='1' bordercolor='1' bgcolor='#FECF61'>
<tr>
<td><center>You have a new message(s): <a href='messages.php'>Visit Message Center</a>(<b>".$num."</b>)<br></center></td>
</tr>
</table>
</table><br>";
}
$table = "".$msg."<br>".$article_content."";
$status2 = "".grabanysetting("status")."";
$reason2 = "".grabanysetting("reason")."";
if($status2 == "1") {
$article_content = "
<table>
<table width='100%' border='1'>
<tr>
<td width='100' align='center'><strong>Your Administrator has turned the board offline. If your administrator has listed a reason, it is given below:</strong></td>
</tr>
<tr>
<td width='100' align='center'><strong>".$reason2."</strong></td>
</tr></table></table><br>";
}
else {
$id=$_GET['id'];
$query = "SELECT * FROM forum_question WHERE id='".$id."'";
$result = mysql_query($query);
$num = mysql_numrows($result);
$fid=@mysql_result($result,$i,"fid");
$tname=@mysql_result($result,$i,"name");
$tname = stripslashes($name);
$query = "SELECT * FROM forum WHERE fid='".$fid."'";
$result = mysql_query($query);
$topic=@mysql_result($result,$i,"topic");
$ftopic = "".$topic."";
// get value of id that sent from address bar
$fid=$_GET['fid'];
$id=$_GET['id'];
$query = "SELECT * FROM forum_question WHERE id='".$id."'";
$result = mysql_query($query);
$num = mysql_numrows($result);
while ($i < $num) {
$topic=@mysql_result($result,$i,"topic");
$fid=@mysql_result($result,$i,"fid");
$id=@mysql_result($result,$i,"id");
$detail=@mysql_result($result,$i,"detail");
$name=@mysql_result($result,$i,"name");
$datetime=@mysql_result($result,$i,"datetime");
$status=@mysql_result($result,$i,"status");
$topic = stripslashes($topic);
$detail = stripslashes($detail);
$name = stripslashes($name);
$name = "".$name."";
$fid = "".$fid."";
$signature = getsignature($name);
$postbar = getpostbar($name);
if($loggedinname != "$name"){
}
else if($loggedinname == "$name"){
$edit = "<a href='editpost.php?do=edit&id=".$id."&fid=".$fid."'>Edit Post</a>";
}
if($isloggedin == "yes"){
$treport = " | <a href='editpost.php?do=reportthread&id=".$id."'>Report Post</a>";
$pm = " | <a href='messages.php?act=newpm&user=".$name."'>Send ".$name." a Private Message</a>";
}
else{
$treport = "";
$pm = "";
}
$group = getgroup();
$cancp = cancp($group);
if($cancp != "yes"){
}
else if($cancp == "yes"){
$edit2 = " | <a href='editpost.php?do=delete&id=".$id."&fid=".$fid."'>Delete Post</a>";
$status2 = "
<table width='100%' border='0' cellpadding='3' cellspacing='0' bordercolor='1' class='ftable2a'>
<tr>
<td class='tr' width='100%'>
<form name='form1' method='post' action='update_thread.php'>
<select name='status' id='status'>
<option value='none' selected>No Selection</option>
<option value='Locked'>Lock Thread</option>
<option value='Open'>Open Thread</option>
<option value='1'>Stick Thread</option>
<option value='2'>Un-Stick Thread</option>
</select>
<input name='fid' type='hidden' id='fid' value='".$fid."'>
<input name='id' type='hidden' id='id' value='".$id."'>
<input type='submit' name='Submit' value='Submit'>
</form>
</td>
</tr>
</table><br>";
}
$article_title = "<a href='main_forum2.php'>4U Forum</a> / <a href='main_forum.php?fid=".$fid."'>".$ftopic."</a> / ".$topic."";
$table = $table."
<table width='100%' border='0' cellpadding='3' cellspacing='0' bordercolor='1' class='ftable2a'>
<tr>
<td class='thead' width='100%'><strong>Date/time : </strong>".$datetime."<center><strong>".$topic."</strong></center></td>
</tr>
</table>
<td class='tr'><table width='100%' border='0' cellpadding='3' cellspacing='0' bordercolor='1' class='ftable2a'>
<tr>
<td class='trow'><center><a href='profile2.php?user=".$name."'><strong>".$name."</strong></a></center><br><center>".$postbar."</center></td>
<td class='trow' valign='top' width='100%'>
".$detail."".$signature."</td>
</tr>
</table></td>
<table width='100%' border='0' cellpadding='3' cellspacing='0' bordercolor='1' class='ftable2a'>
<tr>
<td class='tr' width='100%'>".$edit."".$edit2."".$treport."".$pm."</td>
</tr>
</table><br>
";
$id=$_GET['id'];
$query = "SELECT * FROM forum_answer WHERE question_id='".$id."' ORDER BY a_id ASC";
$result = mysql_query($query);
$num = mysql_numrows($result);
while ($i < $num) {
$a_name=@mysql_result($result,$i,"a_name");
$a_answer=@mysql_result($result,$i,"a_answer");
$a_id=@mysql_result($result,$i,"a_id");
$a_datetime=@mysql_result($result,$i,"a_datetime");
$a_answer = stripslashes($a_answer);
$name = "".$a_name."";
$signature = getsignature($name);
$postbar = getpostbar($name);
if($isloggedin == "yes"){
$preport = " | <a href='editpost.php?do=reportpost&id=".$id."&a_id=".$a_id."'>Report Post</a>";
$apm = " | <a href='messages.php?act=newpm&user=".$a_name."'>Send ".$a_name." a Private Message</a>";
}
else{
$preport = "";
$apm = "";
}
$group = getgroup();
$cancp = cancp($group);
if($cancp != "yes"){
}
else if($cancp == "yes"){
$edit = "<a href='editpost.php?do=editreply&fid=".$fid."&question_id=".$id."&a_id=".$a_id."'>Edit Post</a>";
$edit2 = " | <a href='editpost.php?do=deletereply&fid=".$fid."&question_id=".$id."&a_id=".$a_id."'>Delete Post</a>";
}
$table = $table."
<table border='0' cellpadding='3' cellspacing='0' bordercolor='1' class='ftable2a'>
<tr>
<td class='tr' width='100%'><strong>Date/time : </strong>".$a_datetime."</td>
<td class='tr' width='20%'><center><strong>ID</strong>:".$a_id."</center></td>
</tr>
</table>
<td class='tr'><table border='0' cellpadding='3' cellspacing='1' bordercolor='1' class='ftable2a'>
<tr>
<td class='trow'><center><a href='profile2.php?user=".$a_name."'><strong>".$a_name."</strong></a>".$postbar."</td>
<td class='trow' valign='top' width='100%'>
".$a_answer."".$signature."</td>
</tr>
</table></td>
<table border='0' cellpadding='3' cellspacing='0' bordercolor='1' class='ftable2a'>
<tr>
<td class='tr' width='100%'>".$edit."".$edit2."".$preport."".$apm."</td>
</tr>
</table><br>
";
$i++;
}
$i++;
}
$query = "SELECT view FROM forum_question WHERE id='".$id."'";
$result = mysql_query($query);
$num = mysql_numrows($result);
$view=@mysql_result($result,"view");
// if have no counter value set counter = 1
if(empty($view)){
$view=1;
$query = "INSERT INTO forum_question(view) VALUES('".$view."') WHERE id='".$id."'";
$result = mysql_query($query);
}
// count more value
$addview=$view+1;
$query = "UPDATE forum_question SET view='".$addview."' WHERE id='".$id."'";
$result = mysql_query($query);
if($status == "Locked" or $isloggedin != "yes"){
$post = "";
}
else if($status == "Open" or $isloggedin == "yes"){
$post = "
<BR>
<form name='form1' method='post' action='add_answer.php'>
<td>
<table width='100%' border='0' cellpadding='0' cellspacing='0' class='ftable2a'>
<tr>
<td class='trow'><input name='a_name' type='hidden' id='a_name' value='".$loggedinname."' />
<center><strong>Reply:</strong></center>
<center><textarea name='a_answer' cols='45' rows='3' id='a_answer'></textarea></center>
<input name='name' type='hidden' value='".$name."'>
<input name='pam' type='hidden' value='5'>
<input name='a_topic' type='hidden' value='".$topic."'>
<input name='dip' type='hidden' value='1'>
<input name='id' type='hidden' value='".$id."'>
<input name='fid' type='hidden' value='".$fid."'>
<center><input type='submit' name='Submit' value='Submit'> <input type='reset' name='Submit2' value='Reset'></center></td>
</tr>
</table>
</td>
</form>
";
}
$table = $table."
".$status2."
".$post."
";
}
// **********************************************************************
// Begin Template Definition
// **********************************************************************
//Define our current theme
$file = $themeurl;
// Do the template changes and echo the ready template
$template = file_get_contents($file);
$template = replace(':ARTICLETITLE:',$article_title,$template);
$template = replace(':ARTICLECONTENT:',$article_content,$template);
$template = replace(':TABLE:',$table,$template);
$template = replace(':ARTICLEDATE:',$article_date,$template);
$template = replace(':BROWSERTITLE:',$browsertitle,$template);
$template = replace(':SITENAME:',$sitename,$template);
//Define our links
$template = replace(':LINKSBAR:',$links,$template);
//Get the content for the side bar...
$sidebar = getsidebar();
$template = replace(':SIDEFEED:',$sidebar,$template);
//Get the ad content...
$template = replace(':ADS:',$ads,$template);
//Get the slogan info
$template = replace(':SLOGAN:',$slogan,$template);
echo $template;
// **********************************************************************
// End Template Definition
// **********************************************************************
?>
|
|
#36
|
||||
|
||||
|
This doesn't make sense. I can view the view_topic.php page, but as soon as I specify a thread it gives me he internal error..
Did you edit anythig in the view_topic.php file? |
|
#37
|
|||
|
|||
|
No....
|
|
#38
|
||||
|
||||
|
Quote:
|
|
#39
|
|||
|
|||
|
Hmm, it uses functions.php right? Well maybe there was something wrong with that file.
|
|
#40
|
||||
|
||||
|
Quote:
Wait, paste your functions.php here so I can look at it. |
![]() |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Integrated Forum & Premium Question | Niku | Questions and Supports | 2 | 08-11-2011 01:01 AM |
| MyBB 1.4.11 released! | God of | Webmasters Area | 0 | 12-30-2009 01:50 AM |
| A basic Integrated Forum | Bloodrun | Addons/Mods Graveyard | 30 | 05-17-2009 09:51 PM |
What's New? |
What's Hot? |
What's Popular? |