PDA

View Full Version : merk...


KuraFire
05-03-2002, 08:19 AM
<?
$templatesused = 'newsportal,newsportal_news,newsportal_threads';
include('./global.php');

$newsql = $DB_site->query_first(" SELECT thread.threadid as tid, thread.title as ttitle,
thread.replycount as treply, thread.postusername as user, thread.postuserid as userid, thread.dateline as dateline,
post.pagetext as pagetext FROM thread LEFT JOIN post USING (threadid) WHERE forumid=5
GROUP BY thread.threadid ORDER BY thread.threadid DESC LIMIT 7");

if (!$newsql) {
echo "<p>Could not get record.";
}


while ($news=$DB_site->fetch_array($newsql)) {
$userid=$news['userid'];
$pagetext=$news['pagetext'];
$bericht=bbcodeparse2($pagetext,"1","1","1","1");
$user=$news['user'];
$threadid=$news['tid'];
$title=$news['ttitle'];
$replycount=$news['treply'];
$dateline=$news['dateline'];
$dateposted = date("M j, Y - g:i A",$dateline);

$userid = "The userid is: <font color=red>".$userid."</font><br />";
$bericht = "The newsmessage is: <font color=red>".$bericht."</font><br />";

eval("\$news .= \", ".gettemplate('newsportal_news')."\";");
}

eval("dooutput(\"".gettemplate("newsportal")."\");");

?>


this is my newsportal.php so far...

merk
05-03-2002, 08:25 AM
As far as i can see, it was a simple MySQL error.

I modified the file a touch (require is alot nicer than include, if it cant load global, it fails(which is better imo)

I also killed the templatesused variable, ive never used that once yet.


<?
require('./global.php');

$newsq = $DB_site->query("
SELECT thread.threadid as tid,thread.title as ttitle,thread.replycount as treply,thread.postusername as user,thread.postuserid as userid,thread.dateline as dateline,post.pagetext as pagetext
FROM thread
LEFT JOIN post ON post.threadid=thread.threadid
WHERE forumid=5
GROUP BY thread.threadid
ORDER BY thread.threadid DESC
LIMIT 7");

if (!$newsq) {
echo "<p>Could not get record.";
}


while ($news=$DB_site->fetch_array($newsq)) {
$userid=$news['userid'];
$pagetext=$news['pagetext'];
$bericht=bbcodeparse2($pagetext,"1","1","1","1");
$user=$news['user'];
$threadid=$news['tid'];
$title=$news['ttitle'];
$replycount=$news['treply'];
$dateline=$news['dateline'];
$dateposted = date("M j, Y - g:i A",$dateline);

$userid = "The userid is: <font color=red>".$userid."</font><br />";
$bericht = "The newsmessage is: <font color=red>".$bericht."</font><br />";
eval("\$news .= \", ".gettemplate('newsportal_news')."\";");
}

eval("dooutput(\"".gettemplate("newsportal")."\");");

?>


Also, i modified your SQL query, it wasnt correct. (and that is wrong too! I was wrong D:!)

The only problem, with it was that, you used $DB_site->query_first! Which should have been $DB_site->query.

KuraFire
05-03-2002, 08:34 AM
<!-- BEGIN TEMPLATE: newsportal -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>the Couch - Newsportal</title>
<!-- BEGIN TEMPLATE: headinclude -->
<meta name="MSSmartTagsPreventParsing" content="TRUE">
<meta http-equiv="MSThemeCompatible" content="Yes">
<meta name="keywords" content="graphics, sigpics, avatars, writings, games, anime, forum, forums, board, community, help, tutorials, tutorial forums, graphic tutorials, graphics tutorials, support, support forums, wallpapers, game wallpapers, anime wallpapers, art wallpapers, wallpaper forums">
<meta name="description" content="the Couch is the support forum for all KF*Network projects, which include a writing-site, wallpaper site, sigpic site, and more. There are tutorials, a showcase forum for your writings, and much more!">
<style type="text/css">
BODY {
SCROLLBAR-BASE-COLOR: #367BAF;
SCROLLBAR-ARROW-COLOR: #A9D6FF;
}
SELECT {
FONT-FAMILY: Verdana,Arial,Helvetica,sans-serif;
FONT-SIZE: 11px;
COLOR: #CCCCCC;
BACKGROUND-COLOR: #093F68
}
TEXTAREA, .bginput {
FONT-SIZE: 12px;
FONT-FAMILY: Verdana,Arial,Helvetica,sans-serif;
COLOR: #FFFFFF;
BACKGROUND-COLOR: #093F68
}
A:link, A:visited, A:active {
COLOR: #6BB1EF; text-decoration: none;
}
A:hover {
COLOR: #FFFFFF; text-decoration: underline;
}
#cat A:link, #cat A:visited, #cat A:active {
COLOR: #A9D6FF;
TEXT-DECORATION: none;
}
#cat A:hover {
COLOR: #A9D6FF;
TEXT-DECORATION: underline;
}
#ltlink A:link, #ltlink A:visited, #ltlink A:active {
COLOR: #6BB1EF;
TEXT-DECORATION: none;
}
#ltlink A:hover {
COLOR: #FFFFFF;
TEXT-DECORATION: underline;
}
.thtcolor {
COLOR: #A9D6FF;
}
#name A:link, #name A:visited, #name A:Active {
COLOR: #FFFFFF;
TEXT-DECORATION: underline;
}
#name A:hover {
COLOR: #9EB8DA;
TEXT-DECORATION: none;
}
.quotable { border: 1px #83A5D0 solid; background-color: #367BAF; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #FFFFFF; text-decoration: none}
.head { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 14px; color: #6699CC; text-decoration: none}
.head_link { font-size: 12px; color: #6BB1EF; text-decoration: none}

</style>
<script src="def_fade.js" language="Javascript"></script>
<!-- a.head_link:hover { color: #8EC1FA; text-decoration: underline} -->

<!-- END TEMPLATE: headinclude -->
</head>

<body bgcolor="#000000" text="#FFFFFF" id="all" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" link="#000020" vlink="#000020" alink="#000020">
<!-- BEGIN TEMPLATE: header -->
<a name="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>
<td width="595" height="174"><img src="images/def_header.jpg" border="0" alt="the Couch" width="595" height="174" /></td><td align="right" valign="bottom"><a href="PayPalLink.php" target="_blank"><img src="images/donate.gif" width="88" height="31" border="0" alt="Donate via PayPal to help out the Couch!" /></a>&nbsp; <a href="index.php?munchie=1"><img src="images/tc1.jpg" width="88" height="31" alt="the Couch" border="0" /></a>&nbsp; <br /><font face="verdana,arial,helvetica" size="1" >Link to us! &nbsp;</font></td>
</tr></table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr> <td rowspan="2" width="97" height="26" valign="top"><img src="images/def_miniheader.jpg" width="97" height="26" /></td>
<td background="images/def_headerbar.gif" height="10"><img src="images/def_headerbar.gif" width="2" height="10"></td>
</tr>

<tr> <td height="16"><font face="verdana,arial,helvetica" size="1" ><a href="usercp.php?" alt="Here you can view your subscribed threads, work with private messages and edit your profile and preferences" class="head_link">user cp</a> | <a href="register.php?action=signup" alt="Sign up here - Registration is free!" class="head_link">register</a> | <a href="calendar.php?" class="head_link" alt="Calendar">calendar</a> | <a href="memberlist.php?" alt="Find other members" class="head_link">members</a> | <a href="misc.php?action=faq" alt="F.A.Q." class="head_link">faq</a> | <a href="search.php?" alt="Search" class="head_link">search</a> | <a href="index.php?" alt="Home" class="head_link">home</a> | <a href="search.php?action=getnew" alt="View new posts" class="head_link">new posts</a> | <a href="newsportal.php?" class="head_link" alt="Check up on the latest news and threads">newsportal</a> | <a href="online.php?" class="head_link" alt="Who's online">users online: 1</a> (1/0)</font></td>

</tr></table>
<table border="0" cellpadding="10" width="100%"><tr><td align="center"><font face="verdana, arial, helvetica" size="2" ><br /><font color="#6BB1EF">RANDOM QUOTE</font></font><br /><font face="verdana,arial,helvetica" size="1" >98% of all statistics are made up.<br /><font color="#c0c0c0">by: Unknown</font></font></td></tr>
</table>
<!-- content table -->
<table bgcolor="#000000" width="100%" cellpadding="10" cellspacing="0" border="0">
<tr>
<td>
<!-- END TEMPLATE: header -->

<hr>


<hr><hr>
NEWSSCRIPTS HERE
<hr><hr><hr>
<!-- BEGIN TEMPLATE: footer -->
</td>
</tr>
</table>
<!-- /content area table -->
</center>
<p align="center"><br /><b><font face="verdana, arial, helvetica" size="2" ><b><a href="mailto:faruk@kurafire.com">Contact us</a> - <a href="http://www.kurafire.com">KF*Network</a></b></b></font><br /><font face="verdana,arial,helvetica" size="1" ><a href="#top">back to top</a></font><br /></p>
<table width="100%" border="0" cellspacing="0" cellpadding="4"><tr>

<td bgcolor="#1C6095"><font face="verdana,arial,helvetica" size="1" >
<a href="usercp.php?" alt="Here you can view your subscribed threads, work with private messages and edit your profile and preferences" class="head_link">user cp</a> | <a href="register.php?action=signup" alt="Sign up here - Registration is free!" class="head_link">register</a> | <a href="calendar.php?" class="head_link" alt="Calendar">calendar</a> | <a href="memberlist.php?" alt="Find other members" class="head_link">members</a> | <a href="misc.php?action=faq" alt="F.A.Q." class="head_link">faq</a> | <a href="search.php?" alt="Search" class="head_link">search</a> | <a href="index.php?" alt="Home" class="head_link">home</a> | <a href="search.php?action=getnew" alt="View new posts" class="head_link">new posts</a> | <a href="newsportal.php?" class="head_link" alt="Check up on the latest news and threads">newsportal</a> | <a href="online.php?" class="head_link" alt="Who's online">users online: 1</a> (1/0) &nbsp; &raquo; &nbsp; [<a href="credits.php?">credits</a>]

</font></td></tr><tr>
<td bgcolor="#367BAF"><font face="verdana,arial,helvetica" size="1" >Powered by: vBulletin version 2.2.5 copyright &copy; 2000, 2001, Jelsoft Enterprises Limited<br />
Page generated in 0.2712960 seconds (-22.28% PHP / 122.28% MySQL) with 13 queries <br />PHP version 4.0.4pl1 with GZIP library compression enabled (level 1). [<a href="?explain=1" target="_blank">details</a>]</font>
</td></tr></table>
<!-- END TEMPLATE: footer -->
</body></html>
<!-- END TEMPLATE: newsportal -->


this is the outcome where nothing loads...