Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 05-06-2006, 03:22 PM
Dot50Cal Dot50Cal is offline
 
Join Date: Sep 2005
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default News System wont parse QUOTE!?

Im at the end of my rope, Ive tried everything and even the slightest change breaks this. Heres my code, tell me what Im doing wrong please! This works, but I notice sometimes the page errors and displays nothing for prolonged periods of time. Im not sure what thats about though.

PHP Code:
<?php 
chdir
('/home/horror/public_html/forums'); 
//PluhNews 1.5 released under GNU GPL Licence version 2.0 (see copying.txt file for more info) 
//Set your permissions in your control panel to make sure that only YOU and who you specify can post news. Otherwise, everyone and their dog can register and post in your news forums, thus posting where your news will appear. But for this script to work it's extra magic, be sure your members can reply to your news posts. 

require($_SERVER['DOCUMENT_ROOT'] . '/news/PluhConfig.php');
require(
$_SERVER['DOCUMENT_ROOT'] . '/forums/includes/config.php');

//scroll down to edit the HTML for the news 
//********************** 

//Start the goodies (please do not edit to goodies unless you know what you are doing 

//connect 
$link mysql_connect('localhost''*EDITED*''*EDITED*');
if (!
$link) {
  die(
'Not connected : ' mysql_error());
}

//select database 
$db_selected mysql_select_db('*EDITED'$link);
if (!
$db_selected) {
  die (
'Can\'t use *EDITED : ' mysql_error());
}

// create sql statement 
$sql "SELECT threadid, title, forumid, replycount, postusername, postuserid, lastposter, dateline, iconid FROM thread WHERE forumid = \"$newsforums\" ORDER BY threadid DESC LIMIT $newsitems"
//execute sql query 
$sql_result mysql_query($sql$link) or die ("Could not execute query."); 

if (!
$sql_result) {  
  echo 
"<p>Could not get record."
}  
while (
$row mysql_fetch_array($sql_result)) { 
   
$threadid $row["threadid"]; 
   
$title $row["title"];    
   
$forumid $row["forumid"]; 
   
$replycount $row["replycount"]; 
   
$postusername $row["postusername"]; 
   
$postuserid $row["postuserid"]; 
   
$lastposter $row["lastposter"]; 
   
$iconid $row["iconid"]; 
   
$dateline $row["dateline"]; 

//create the second SQL statement to pull the post from the thread it resides in 
$sql2 "SELECT postid, threadid, username, userid, title, dateline, pagetext, iconid FROM post WHERE threadid = \"$threadid\" ORDER BY postid ASC LIMIT 1"

//execute second sql query 
$sql_result2 mysql_query($sql2$link) or die ("Could not execute query in second sql statement."); 

if (!
$sql_result2) {  
  echo 
"<p>Could not get record in second statement."
}  

while (
$row mysql_fetch_array($sql_result2)) { 
   
$pagetext $row["pagetext"]; 

//gotta convert unix time
$dateposted date("D j M Y, g:i A",$dateline); 
//end the goodies 


if ($replycount==1) { 
 
$commenttext "Comment"
 } 
else { 
 
$commenttext "Comments"
 }

define('VB_AREA''Forum');
define('PLUH_NEWS_FETCH'true);
include_once(
$_SERVER['DOCUMENT_ROOT'] . '/forums/includes/init.php');
require_once(
$_SERVER['DOCUMENT_ROOT'] . '/forums/includes/class_bbcode.php'); 
require_once(
$_SERVER['DOCUMENT_ROOT'] . '/forums/includes/class_hook.php');
$parser77 =& new vB_BbCodeParser($vbulletinfetch_tag_list()); 
$bericht $parser77->do_parse($pagetexttrue);  

// ********************** 
//Edit the HTML here (keep in mind that any double quote that is HTML requires a backslash in front of it) 

echo "
<table width=100% border=0 cellspacing=0 cellpadding=0>
              <tr> 
                <td width=14 valign=top background=images/dl-title-side-bg-norm.gif><img src=images/blank.gif width=14></td>
                <td background=images/texture-norm.jpg><table width=100% border=0 cellspacing=0 cellpadding=0>
                    <tr> 
                      <td><br><p><strong><font color=#C19A6B>
$title</font></strong><br>
              <img src=images/linebreak.gif><br>
              <font size=1>Posted on 
$dateposted by <b>$postusername</b><br></font><br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
$bericht</p><br><br><div align=right>$replycount $commenttext | <a href=$forumspath/showthread.php?s=&threadid=$threadid>View $commenttext</a> | <a href=$forumspath/newreply.php?action=newreply&threadid=$threadid>Post $commenttext</a></div>
                        </td>
                    </tr>
                    <tr>
              <td height=1 bgcolor=#6B6B6B><img src=images/blank.gif width=1 height=1></td>
              </tr>
                  </table></td>
                <td width=5 background=images/dl-title-side-bg2.gif><img src=images/blank.gif></td>
              </tr>
            </table>

"
;

}
}


//add news search stuff (this is optional - delete if you do not wish to include this, or edit it to meet your needs 
echo "
<table width=100% border=0 cellspacing=0 cellpadding=0>
              <tr> 
                <td width=14 valign=top background=images/dl-title-side-bg-norm.gif><img src=images/blank.gif width=14></td>
                <td background=images/texture-norm.jpg><table width=100% border=0 cellspacing=1 cellpadding=1>
                    <tr> 
                      <td>
<center><a href=\"forums/search.php?f=2\">Search the News</a> | <a href=\"forums/forumdisplay.php?forumid=2\">View All News Posts</a></center>
                        </td>
                    </tr>
                  </table></td>
                <td width=5 background=images/dl-title-side-bg2.gif><img src=images/blank.gif></td>
              </tr>
            </table>
"
;


//end HTML edit 
//********************** 

//disconnect 
mysql_free_result($sql_result); 
mysql_close($link); 

chdir('/home/horror/public_html/'); 
?>
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 01:14 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.06534 seconds
  • Memory Usage 2,263KB
  • Queries Executed 11 (?)
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_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)showthread_list
  • (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_threadedmode.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • 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_threaded
  • showthread_threaded_construct_link
  • 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