darkcarnival Posted March 4, 2006 Share Posted March 4, 2006 hi,I have a post icon system on my news page that has these options:important, new, old, popular, and lockednow the problem comes with the important one.i want it to alway be the important icon when the news is important, nothing else. but I do not know how to do it.if you want to see how im doing it now reply back and I'll pop that code here for you.thanks. Quote Link to comment Share on other sites More sharing options...
Hooker Posted March 4, 2006 Share Posted March 4, 2006 maybe it'd help if you popped your code in so we can see Quote Link to comment Share on other sites More sharing options...
darkcarnival Posted March 4, 2006 Author Share Posted March 4, 2006 ok then here how im doing it:[code]//decide on icon.if ($row['important'] == "yes"){$icon = "$template_path/images/important.gif";}elseif ($row['Locked'] == 1){$icon = "$template_path/images/locked_topic.gif";}elseif ($row['Type'] == "Poll"){$icon = "$template_path/images/poll.gif";}elseif ($read_status == "new"){$icon = "$template_path/images/new.gif";}elseif ($read_status == "old"){$icon = "$template_path/images/old.gif";}elseif ($reply_num >= 10){$icon = "$template_path/images/hottopic.gif";}[/code]setting each as a if statement only made it worse in case you plan on saying that. Quote Link to comment Share on other sites More sharing options...
High_-_Tek Posted March 4, 2006 Share Posted March 4, 2006 [code]if ($row['important'] == "yes"){$icon = "$template_path/images/important.gif";}if ($row['Locked'] == 1){$icon = "$template_path/images/locked_topic.gif";}elseif ($row['Type'] == "Poll"){$icon = "$template_path/images/poll.gif";}elseif ($read_status == "new"){$icon = "$template_path/images/new.gif";}elseif ($read_status == "old"){$icon = "$template_path/images/old.gif";}elseif ($reply_num >= 10){$icon = "$template_path/images/hottopic.gif";}[/code]Not tested Quote Link to comment Share on other sites More sharing options...
darkcarnival Posted March 4, 2006 Author Share Posted March 4, 2006 nope that kills off the important icon from even working.isnt there a way to make a item important no matter what else the item could have.like phpbb for example, no matter what if its new/old, locked or has a poll that icon stays the same, thats what i want. Quote Link to comment Share on other sites More sharing options...
AndyB Posted March 4, 2006 Share Posted March 4, 2006 Can you explain exactly what it is you want the script to do? Does it only display one icon? Can it display multiple icons? If so, under what circumstances?Maybe what you want is this:[code]if ($row['important'] == "yes") { $icon = "$template_path/images/important.gif";} else { if ($row['Locked'] == 1) { $icon = "$template_path/images/locked_topic.gif"; } elseif ($row['Type'] == "Poll") { $icon = "$template_path/images/poll.gif"; } elseif ($read_status == "new") { $icon = "$template_path/images/new.gif"; } elseif ($read_status == "old") { $icon = "$template_path/images/old.gif"; } elseif ($reply_num >= 10) { $icon = "$template_path/images/hottopic.gif"; }}[/code] Quote Link to comment Share on other sites More sharing options...
darkcarnival Posted March 5, 2006 Author Share Posted March 5, 2006 heres a map of how i want it:if post is important and also either new,old, a poll, or locked the icon is set to importantotherwise:new-new iconold-old iconectlike i said before like how phpbb or ipb. if the user marks the post as important it will keep the important icon no matter what.so in general yes I want only one icon to show. currently if the topic is important but i locked it from getting comments the lock icon takes over or if i make it a poll the poll take over.i know theres a way to do this, I just cant figure it out.I hope you all understand what i'm trying to say.Andyb,i tried your method and it seems to do what I want :)so thanks for that. 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.