Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 10-22-2011, 06:48 PM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,113
Gender: Female
Credits: 82,353
SilverDragonTears is on a distinguished road
Default News/kinda forum script help

What I've done is made a news table and then combined the shoutbox to work as a comment feature for the news. But the problem I'm having is that all the news entries won't show. Only one will show but the shoutbox does show under the one entry.

PHP Code:
<?php

include("inc/functions.php");
include(
"inc/bbcode.php");

//***************//
//  START SCRIPT //
//***************//

$article_content .= "<A NAME='top'>";

mysql_connect("localhost""---""---") or die(mysql_error());
mysql_select_db("---_adopts") or die(mysql_error());


$result mysql_query("SELECT * FROM news ORDER BY id DESC")
or die(
mysql_error()); 
    
$article_title .= "News Den";
$article_content .= "<div id='news'>"

while(
$row mysql_fetch_array$result )) {
// Print out the contents of the entry

            
$article_content .= "<table class='news'><tr><td colspan='2'>".$row['date']."</td></tr>";
$article_content .= "<tr><td width='90px'><center><img src='http://www.freefever.com/freeclipart/clipart/newspaper2.gif' height='50px' width='50px'><br>SilverDragonTears<br><i><span style='font-size:10px; color:red'>Administrator</span></i></center></td><td>".$row['news']."<br><br><div class='enclosecomments'>";
$query "SELECT * FROM ".$prefix."shoutbox ORDER BY id DESC LIMIT 0, 10";
$result mysql_query($query);
$num mysql_numrows($result);

//Loop out code
$i=0;
while (
$i $num) {
    
$id=@mysql_result($result,$i,"id");
    
$user=@mysql_result($result,$i,"user");
    
$date=@mysql_result($result,$i,"date");
    
$nolinecomment=@mysql_result($result,$i,"comment");
    
$nolinecomment bbconvert($nolinecomment);
    
$comment=nl2br($nolinecomment);
    
$commentdiv "<div class='comment' style='width:94%;padding:2%;background-color:aliceblue;margin-bottom:5px;'><div class='userdate' style='width:50%;height:25px;color:red;'>".$user." - ".$date."</div>".stripslashes($comment)."</div>";
    
$article_content $article_content.$commentdiv;
    
$i++;
}
$article_content $article_content."</div><p>Post a comment!</p>";
$article_content $article_content."<form action='news.php' method='post'>
<textarea rows='5' cols='60' name='comment' wrap='physical' ></textarea><br>
<input type='submit' /></form>"
;

//here the user posts a comment
$comment $_POST["comment"];
if (
$comment != "") {
    
$date date("Y-m-d H:i:s");
    
// $date = "10-23-3 21:02:35";
    
$user $loggedinname;
    if (
$isloggedin!="yes") {
        
$user "Guest";
        }
    
$comment $comment;
    
mysql_query("INSERT INTO ".$prefix."shoutbox VALUES ('', '$user', '$date', '$comment')");
    
$article_content $article_content."<p>Your comment has been posted. Click <a href='news.php'>here</a> to view it.</p>";
}
else {
    
$article_content $article_content."Post a comment.";
    }
$article_content .= "<div id='topbutton'><a alt='Back to Top' href='#bottom' title='Bottom'><img src='images/arrow_up_16red.png'></a><a alt='Down' href='#top' title='Top'><img src='images/arrow_up_16.png'></a></div></tr></td></table>";

}

$article_content .= "</div>";
//***************//
//  OUTPUT PAGE  //
//***************//

echo showpage($article_title$article_content$date);

?>

<A NAME="bottom">
__________________

Check out SilvaTales
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mys v1.3.4 News System IntoRain Mys v1.3.x Mods 66 02-27-2018 05:35 PM
Promo Help Again >.< (Different kinda question) parayna Questions and Supports 16 11-09-2014 04:05 PM
News feed script? Aasixx Staff Central 3 06-18-2012 03:06 AM
forum in script Nemesis Adoptables Sites Showcase 4 05-29-2011 07:57 AM
News 12345 Questions and Supports 9 05-10-2009 03:13 PM


All times are GMT -5. The time now is 06:17 AM.

Currently Active Users: 9799 (0 members and 9799 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636