Jump to content


Photo

need help with icon system I made


  • Please log in to reply
6 replies to this topic

#1 darkcarnival

darkcarnival
  • Members
  • PipPipPip
  • Advanced Member
  • 162 posts

Posted 04 March 2006 - 04:40 PM

hi,

I have a post icon system on my news page that has these options:

important, new, old, popular, and locked

now 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.

#2 Hooker

Hooker
  • Members
  • PipPipPip
  • Advanced Member
  • 193 posts
  • LocationWales, UK

Posted 04 March 2006 - 05:32 PM

maybe it'd help if you popped your code in so we can see

#3 darkcarnival

darkcarnival
  • Members
  • PipPipPip
  • Advanced Member
  • 162 posts

Posted 04 March 2006 - 06:01 PM

ok then here how im doing it:

//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";
}

setting each as a if statement only made it worse in case you plan on saying that.

#4 High_-_Tek

High_-_Tek
  • Members
  • PipPipPip
  • Advanced Member
  • 72 posts

Posted 04 March 2006 - 06:15 PM

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";
}

Not tested

#5 darkcarnival

darkcarnival
  • Members
  • PipPipPip
  • Advanced Member
  • 162 posts

Posted 04 March 2006 - 07:11 PM

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.


#6 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 04 March 2006 - 07:15 PM

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:
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";
    }
}

Legend has it that reading the manual never killed anyone.
My site

#7 darkcarnival

darkcarnival
  • Members
  • PipPipPip
  • Advanced Member
  • 162 posts

Posted 05 March 2006 - 01:27 AM

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 important

otherwise:

new-new icon
old-old icon
ect

like 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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users