liam1412 Posted December 12, 2006 Share Posted December 12, 2006 Whats the best way to go about changing a post status images based on several peices of info!I have a box for an image that I want to be different based on the current status of a postFor exampleI will have these imagesStandard EnvelopeNew Posts (Since last visit)Hot TopicHot topic with new posts (since last visit)Thread you have posted inlocked topicand so on........Can anyone tell me what is the bast way to go about this. I presume it would be some sort of switch stetment. Any hints for a good database setup for this. I currently have[b]forum_topic[/b] with the fields topic_id, topic, topic_text, topic_username, topic_start_date_time, topic_view, topic_reply[b]forum_answer[/b]with the fields ans_topic_id, ans_id, ans_text, ans_username, ans_datetimeAny help with this woud be as always greatly appreciated.Thanks Link to comment https://forums.phpfreaks.com/topic/30333-help-with-my-forum/ Share on other sites More sharing options...
liam1412 Posted December 12, 2006 Author Share Posted December 12, 2006 ANy help with this one still please. My brain hurts after a full day of thinking about it Link to comment https://forums.phpfreaks.com/topic/30333-help-with-my-forum/#findComment-139717 Share on other sites More sharing options...
evilstrike Posted December 12, 2006 Share Posted December 12, 2006 just add a field called something like "topic_status"with numerical values taken from another table called "status" with fileds somewhat like[code]status_id -- status_name -------- status_img_path1 Standard Envelope /somepath/img.gif2 New Posts /somepath/img.gifetc....[/code]add the ID to to your main table then when displaying the topics add an if statement or a case statement[code]$result = mysql_qeury("select * from status where id='$status");$res = mysql_fetch_array($result);switch($status){ case 1: $img = $res['status_img_path'];etc......[/code] Link to comment https://forums.phpfreaks.com/topic/30333-help-with-my-forum/#findComment-139729 Share on other sites More sharing options...
liam1412 Posted December 12, 2006 Author Share Posted December 12, 2006 Thats a great help ta. So the only other problem would be who had posted in what topic. if one of the images was topic you have posted in - How would you find out what topics the person logged in had posted in. WOuld I need a seperate table. Bu t if the site got anything bigger than just afew hundred peole that table would surely way too big and slugish. Link to comment https://forums.phpfreaks.com/topic/30333-help-with-my-forum/#findComment-139738 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.