Convert!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Aaron
Forum Commoner
Posts: 82
Joined: Sun May 12, 2002 2:51 pm

Convert!

Post by Aaron »

Code: Select all

<table width="500" border="0" cellspacing="0" cellpadding="0"><tr> 
<td bgcolor="#000000"><font color="#FFFFFF"> :: Title // Catogory :: Poster</font></td></tr>
<tr><td bgcolor="#999999">News</td></tr><tr> 
<td bgcolor="#999999"><div align="right">no of comments :: Add // View</div></td></tr></table>
Is how the I want the news displayed...but this is how it looks =/

Code: Select all

echo "	<h1>news</h1>\n";

$query = mysql_query("SELECT * FROM $table_news WHERE approved = 'Yes' ORDER BY id DESC LIMIT $ppp");
while($result = mysql_fetch_array($query)) &#123;
	$result&#1111;body] = zap($result&#1111;body]);

	$date = date("F d, Y", $result&#1111;time]);
	$time = date("h:i a", $result&#1111;time]);
	
	$date = strtolower($date);
	$time = strtolower($time);
	
	if($result&#1111;numcom] > 1) &#123;
		$word = "comments";
	&#125; else &#123;
		$word = "comment";
	&#125;

	if($result&#1111;extended]) &#123;
		$size = number_format(strlen($result&#1111;extended]));
		$morelink = "<br /><br /><a href='truth.php?id=$result&#1111;id]'>read more ($size bytes)</a>";
	&#125; else &#123;
		$morelink = "";
	&#125;
	
	echo "	<p>\n";
	echo "		<b> :: <a href='users.php?name=$result&#1111;aname]'>$result&#1111;aname]</a> // <a href='truth.php?id=$result&#1111;id]'>$result&#1111;title]</a></b><br />\n";
	echo "		for <a href='topics.php?name=$result&#1111;topic]'>$result&#1111;topic]</a> on $date at $time ($result&#1111;numcom] $word: <a href='truth.php?id=$result&#1111;id]#addcomments'>add</a> // <a href='truth.php?id=$result&#1111;id]#comments'>view</a>)<br /><br /></p>\n";
	echo "		<blockquote>$result&#1111;body]\n";
	echo "		$morelink</blockquote>\n";
	echo "	<br />\n";
&#125;

Can anyone combine them without causing a parse error =/
jason
Site Admin
Posts: 1767
Joined: Thu Apr 18, 2002 3:14 pm
Location: Montreal, CA
Contact:

Post by jason »

What program is this from?
Aaron
Forum Commoner
Posts: 82
Joined: Sun May 12, 2002 2:51 pm

Post by Aaron »

nos. not public, brought it.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

oh sorry,
just signed a non-disclosure agreement about this problem ;)
Aaron
Forum Commoner
Posts: 82
Joined: Sun May 12, 2002 2:51 pm

Post by Aaron »

=(
User avatar
hex
Forum Commoner
Posts: 92
Joined: Sat Apr 20, 2002 3:20 am
Location: UK

Post by hex »

Code: Select all

echo "   <h1>news</h1>\n"; 

$query = mysql_query("SELECT * FROM $table_news WHERE approved = 'Yes' ORDER BY id DESC LIMIT $ppp"); 
while($result = mysql_fetch_array($query)) &#123; 
   $result&#1111;body] = zap($result&#1111;body]); 

   $date = date("F d, Y", $result&#1111;time]); 
   $time = date("h:i a", $result&#1111;time]); 
    
   $date = strtolower($date); 
   $time = strtolower($time); 
    
   if($result&#1111;numcom] > 1) &#123; 
      $word = "comments"; 
   &#125; else &#123; 
      $word = "comment"; 
   &#125; 

   if($result&#1111;extended]) &#123; 
      $size = number_format(strlen($result&#1111;extended])); 
      $morelink = "<br /><br /><a href='truth.php?id=$result&#1111;id]'>read more ($size bytes)</a>"; 
   &#125; else &#123; 
      $morelink = ""; 
   &#125; 

   echo "<table width='500' border='0' cellspacing='0' cellpadding='0'><tr>";
   echo "<td bgcolor='#000000'><font color='#FFFFFF'> :: ";
   echo "<a href='truth.php?id=$result&#1111;id]'>$result&#1111;title]</a> // <a href='topics.php?name=$result&#1111;topic]'>$result&#1111;topic]</a> :: ";
   echo "<a href='users.php?name=$result&#1111;aname]'>$result&#1111;aname]</a></font></td></tr>";
   echo "<tr><td bgcolor='#999999'>$result&#1111;body]\n$morelink\n";
   echo "<td bgcolor='#999999'><div align='right'>($result&#1111;numcom] $word: <a href='truth.php?id=$result&#1111;id]#addcomments'>add</a> // ";
   echo "<a href='truth.php?id=$result&#1111;id]#comments'>view</a>)</div></td></tr></table>";
&#125;
Aaron
Forum Commoner
Posts: 82
Joined: Sun May 12, 2002 2:51 pm

Post by Aaron »

it looks alittle borxed....www.unknownzone.org/index2
Post Reply