Go Back   EQEmulator Home > EQEmulator Forums > Misc > Misc::Off Topic

Misc::Off Topic Want to talk about something that has nothing to do with EverQuest or the emulator? Post here.

Reply
 
Thread Tools Display Modes
  #1  
Old 11-27-2004, 02:14 PM
Spike
Discordant
 
Join Date: Mar 2004
Location: Florida
Posts: 362
Default News on main page???

Could I have the php code to put news from a forum to be put on the main page? Like yours... please
__________________
Reply With Quote
  #2  
Old 11-28-2004, 08:37 AM
Cisyouc
Demi-God
 
Join Date: Jun 2004
Location: Heaven.
Posts: 1,260
Default

Code:
<? 
// Main.php by Rogean 
require('forums/config.php'); 
mysql_connect($dbhost, $dbuser, $dbpasswd); 
@mysql_select_db("$dbname")or die(mysql_error()); 

//GET FORUM NEWS 
$getnews=mysql_query("SELECT topic_id,forum_id,topic_title,topic_poster,topic_time,topic_views,topic_replies,topic_first_post_id FROM phpbb_topics WHERE forum_id='11' ORDER by topic_time DESC LIMIT 4"); 
while(list($topic[id],$forum[id],$topic[title],$topic[poster],$topic[time],$topic[views],$topic[replies],$topic[firstpostid])=mysql_fetch_row($getnews)){ 

$newsbody=mysql_query("SELECT * FROM phpbb_posts_text WHERE post_id=$topic[firstpostid]"); 
$text=mysql_fetch_array($newsbody); 

$userinfo=mysql_query("SELECT * FROM phpbb_users WHERE user_id=$topic[poster]"); 
$user=mysql_fetch_array($userinfo); 

$text[post_text]=str_replace("\n", "<br>", $text[post_text]); 
$text[post_text]=str_replace("[b]", "<b>", $text[post_text]); 
$text[post_text]=str_replace("[/b]", "</b>", $text[post_text]); 
$text[post_text]=str_replace("[i]", "<i>", $text[post_text]); 
$text[post_text]=str_replace("[/i]", "</i>", $text[post_text]); 
$text[post_text]=str_replace("<", "<", $text[post_text]); 
$text[post_text]=str_replace(">", ">", $text[post_text]); 



echo "<div class=\"content\"> 
<span class=\"title\">$text[post_subject]</span><br> 
<font size=1>Posted by: $user[username] :: $topic[replies] Replies :: $topic[views] Views<br><br> 
$text[post_text] 
</div> 
<hr width=80% color=darkblue align=left>"; 
} 
?>
__________________
namespace retval { template <class T> class ReturnValueGen { private: T x; public: ReturnValueGen() { x = 0; }; T& Generator() { return x; }; }; } int main() { retval::ReturnValueGen<int> retvalue; return retvalue.Generator(); }
C++ is wonderful.
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 -4. The time now is 01:40 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3