liam1412 Posted December 19, 2006 Share Posted December 19, 2006 Within my forum I have column (status) that displays a picture dependent on the status of the topicfor exampleless than 50 posts diplay pic 1more than 50 posts diplay pic 2locked post - display pic 3topic you have posted in - display pic 4hot topic you have posted in display pic 5etc etcHow would I go about doing this. ???The main one I think I would struggle with is the topics you have posted in as I can't figure out what database structure would be needed for this. But advise on the whole thing would help;DThanksEdit - On this forum it is the normal picture for a thread with a little smiley face next to it - down the left hand side of the main forum page. Link to comment https://forums.phpfreaks.com/topic/31230-help-within-displaying-a-topic-status-symbol-dependant-on-how-many-posts-etc/ Share on other sites More sharing options...
makeshift_theory Posted December 19, 2006 Share Posted December 19, 2006 Simple way is to create a switch, or you can use a function or class. I will give an example:[code]switch ($variable) {case ($variable < 50):$img[0] = "img/img1.jpg";break;case ($variable > 50):$img[0] = "img/img2.jpg";break;default:$img[0] = "img/imgdefault.jpg";break; }[/code] Link to comment https://forums.phpfreaks.com/topic/31230-help-within-displaying-a-topic-status-symbol-dependant-on-how-many-posts-etc/#findComment-144459 Share on other sites More sharing options...
liam1412 Posted December 19, 2006 Author Share Posted December 19, 2006 Brilliant mate. Any ideas in a how I would do the topics you have posted in though. What would I do to log what topics they have posted in as the only way I can see would make for a massive database Link to comment https://forums.phpfreaks.com/topic/31230-help-within-displaying-a-topic-status-symbol-dependant-on-how-many-posts-etc/#findComment-144481 Share on other sites More sharing options...
makeshift_theory Posted December 19, 2006 Share Posted December 19, 2006 Sorry I'm having a hard time understanding your question, can you please rephrase a little bit so I can help you. :P Link to comment https://forums.phpfreaks.com/topic/31230-help-within-displaying-a-topic-status-symbol-dependant-on-how-many-posts-etc/#findComment-144610 Share on other sites More sharing options...
liam1412 Posted December 20, 2006 Author Share Posted December 20, 2006 Sorry mate. I don't make much sense LolOn forums you have a post status symbol at the sideThis has a switch between 5 pics One of thos pics will be say a thread you have posted in. What would be the databse structure for storing every thread that somone has posted in> Surely that database would just be so slow if the site got big.Does this help?!?! Link to comment https://forums.phpfreaks.com/topic/31230-help-within-displaying-a-topic-status-symbol-dependant-on-how-many-posts-etc/#findComment-145167 Share on other sites More sharing options...
liam1412 Posted December 20, 2006 Author Share Posted December 20, 2006 Sorry to Bump. I just really cant figure this Link to comment https://forums.phpfreaks.com/topic/31230-help-within-displaying-a-topic-status-symbol-dependant-on-how-many-posts-etc/#findComment-145211 Share on other sites More sharing options...
makeshift_theory Posted December 20, 2006 Share Posted December 20, 2006 One thing with database design is to try and break things down as much as possible. There is really not much you can do to simplify a thread setup except use a thread table by itself and a categories table by itself. Have the category id the foreign key in your thread table then when you click on a category you can speed up the search by using the category id so it will only grab threads related to that category. Hopefully this helps, best advice to you is to download a couple of opensource forums and inspect for yourself, that's the most efficient way of learning. :P Link to comment https://forums.phpfreaks.com/topic/31230-help-within-displaying-a-topic-status-symbol-dependant-on-how-many-posts-etc/#findComment-145275 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.