Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
merk... Details »»
merk...
Version: , by KuraFire KuraFire is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 05-03-2002 Last Update: Never Installs: 0
 
No support by the author.

PHP Code:
<?
$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...

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 05-03-2002, 08:25 AM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.

PHP Code:
<?
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.
Reply With Quote
  #3  
Old 05-03-2002, 08:34 AM
KuraFire's Avatar
KuraFire KuraFire is offline
 
Join Date: Oct 2001
Location: inside vB3's .php
Posts: 1,245
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
<!-- 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...
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:05 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.11235 seconds
  • Memory Usage 2,258KB
  • Queries Executed 18 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (2)postbit
  • (3)postbit_onlinestatus
  • (3)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete