View Single Post
  #7  
Old 03-05-2001, 07:01 PM
Guest
 
Posts: n/a
Default

Well the script is still imature as of yet. The version running on that site is different then my latest one. All the HTML is hard coded into the one that is running, however here is what I have done. I added templates for this version to make it easier to work with.

PHP Code:
<?php
chdir
"./forum" );
require( 
"./global.php" );
chdir".." );

/*
  Move to CP
  $newsForum_ID = 33;
  $numberPerPage = 20;
*/
$newsForum_ID 33;
$numberPerPage 20;
$newsDateFormat "l, F d, Y";
$newsTimeFormat "h:i A";

$stories $DB_site->query"
SELECT threadid, dateline, TO_DAYS( FROM_UNIXTIME( dateline,\"%Y-%c-%d\" )) AS day,
postuserid, user.username, user.email, replycount, views, title
FROM thread LEFT JOIN user ON thread.postuserid=user.userid
WHERE forumid=
$newsForum_ID AND pollid=0 AND visible=1
ORDER BY day DESC, dateline DESC
LIMIT 
$numberPerPage;");

$cDay 0;
while ( 
$story $DB_site->fetch_array$stories ))
{
 
$date vbdate$newsDateFormat$story[dateline]);
 
$time vbdate$newsTimeFormat$story[dateline]);

 
$text $DB_site->query_first"SELECT pagetext, dateline FROM post WHERE threadid=$story[threadid] AND userid=$story[postuserid] ORDER BY dateline LIMIT 1;");
 
$text bbcodeparse$text[pagetext], $newsForum_ID );

 if ( 
$cDay != $story[day] )
 {
      if ( 
$cDay != )
      {
           eval( 
"\$newstext .= \"".gettemplate('news_postdaybit')."\";");
      }
      eval( 
"\$newstext .= \"".gettemplate('news_datelinebit')."\";");
      eval( 
"\$newstext .= \"".gettemplate('news_predaybit')."\";");
      
$cDay $story[day];
 }
 eval( 
"\$newstext .= \"".gettemplate('news_storybit')."\";");  // story text
}
eval( 
"\$news = \"".gettemplate('news_display')."\";");
?>
Just place that block at the beginning of the news page, it must be placed at the beginning because of cookie settings run through the session.php included from global.php.

Then where I want to put the news I have the line:

PHP Code:
      <?php echo"$news"?>
I'm adding a lot of stuff to this though, support for announcements and polls.

If you would like email me at: ryans@ravingaming.com and I'll let you know when I make changes. I figure its the least I can do since I've used your site as an inspiration for my development.

If you need any help with it let me know.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01686 seconds
  • Memory Usage 1,788KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)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_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete