renegade44 Posted June 23, 2009 Share Posted June 23, 2009 I am trying to apply css to individual section of the below code. It is basically recent posts that show up on the front page to my site. I want each recent post to consist of 3 lines, the thread topic bold, the poster name in italic and a color and then on the 3rd line, the date and time of the post in italic. Can anyone help me out? //Edit these parameters: //MySQL server adress $host="p50mysql271.secureserver.net"; //Username $user=""; //Password $pass=""; //Database $db=""; //Table prefix $table="phpbb_"; //Show last x topics $laforums="5"; $link=mysql_connect($host, $user, $pass); $db=mysql_select_db($db); $query="select * from $table".topics." WHERE topic_approved = '1' order by topic_last_post_time desc limit 0,$laforums"; $query2="select config_name,config_value from $table".config." where config_name = 'server_name' limit 0,1"; $result2=mysql_query($query2); $row2 = mysql_fetch_array($result2); extract($row2); $result=mysql_query($query); while ($row=mysql_fetch_array($result)) { extract($row); $date = date("F j, Y, g:i a", $topic_last_post_time ); $query3="select forum_name from $table".forums." WHERE forum_id = ".$forum_id.""; $result3=mysql_query($query3); $row2 = mysql_fetch_array($result3); echo "<a href='http://".$config_value."/forums/viewforum.php?f=".$forum_id."' target='_blank'>".$row2[forum_name].":</a> <a href='http://".$config_value."/forums/viewtopic.php?f=".$forum_id."&t=".$topic_id."' target='_self'>".$topic_title."</a>,Last Post By: ".$topic_last_poster_name.",Posted On: ".$date."<br><br>\n"; } //-------------------------- END ?> Quote Link to comment Share on other sites More sharing options...
xtopolis Posted June 24, 2009 Share Posted June 24, 2009 Well... this is the current line for displaying the results: echo "<a href='http://".$config_value."/forums/viewforum.php?f=".$forum_id."' target='_blank'>".$row2[forum_name].":</a> <a href='http://".$config_value."/forums/viewtopic.php?f=".$forum_id."&t=".$topic_id."' target='_self'>".$topic_title."</a>,Last Post By: ".$topic_last_poster_name.",Posted On: ".$date."<br><br>\n"; What do you have so far? edit: and does your query(ies) return the data you want? Looking at it, I don't know that it does? Quote Link to comment Share on other sites More sharing options...
renegade44 Posted June 25, 2009 Author Share Posted June 25, 2009 It currently displays: Forum Name: Thread Name,Last Post By: name,Posted On: June 25, 2009, 11:35 am I want it to display like this: Thread Name By: Date&Time I would also like to be able to apply CSS to each line IE Thread name, bym d&t,etc. Quote Link to comment Share on other sites More sharing options...
xtopolis Posted June 26, 2009 Share Posted June 26, 2009 Well, from what I can tell, you just need to use these values from your existing script, and apply the CSS as wanted. echo "<a href='http://".$config_value."/forums/viewforum.php?f=".$forum_id."' target='_blank'>".$row2[forum_name].":</a><br>By: ".$topic_last_poster_name."<br>".$date."<br><br>\n"; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.