Monkuar Posted July 19, 2009 Share Posted July 19, 2009 else if ($cur_topic['icon_topic'] == '2') { $icon_topic = '<font color=red>'; $subject = '<font color="red">' . $subject . '</font>'; } and it just wont make it turn bold on my topic title am i doing something wrong? 2 is value of a input type text box of a using checking if they want there topic title red.. I can use <b> and <i> and it works just not font color weird eH? Link to comment Share on other sites More sharing options...
9three Posted July 19, 2009 Share Posted July 19, 2009 $check = 1; if ($check == 1) { echo '<font color=red>Hello</font>'; } That works. Maybe your code is not reaching the else/if statement? Link to comment Share on other sites More sharing options...
Monkuar Posted July 19, 2009 Author Share Posted July 19, 2009 no like i put any text before $subject and it works just font face.. omgg or font color Link to comment Share on other sites More sharing options...
Amtran Posted July 19, 2009 Share Posted July 19, 2009 The <font> tag was depreciated as of HTML4 and XHTML. Might not be causing the problem, but you shouldn't be using <font> anyway. Use <span style="color:red"></span> instead. Link to comment Share on other sites More sharing options...
Monkuar Posted July 19, 2009 Author Share Posted July 19, 2009 The <font> tag was depreciated as of HTML4 and XHTML. Might not be causing the problem, but you shouldn't be using <font> anyway. Use <span style="color:red"></span> instead. i tryed. still not working omg i even put <span style="color:red">hey</span> next to the $subject and it worked but whenever i put it inisdd $subject it doesnt work lol then i view source on my page and it shows it perfect wtf man Link to comment Share on other sites More sharing options...
Amtran Posted July 19, 2009 Share Posted July 19, 2009 Hmm, so you're putting: "echo '<span style="color:red">' . $subject . '</span>;"? Link to comment Share on other sites More sharing options...
Daniel0 Posted July 19, 2009 Share Posted July 19, 2009 Not working? What could that mean? That your monitor is broken and can no longer display the color red? Seriously, "not working" doesn't help us at all. Is the HTML output (check the source)? Link to comment Share on other sites More sharing options...
Amtran Posted July 19, 2009 Share Posted July 19, 2009 Not working? What could that mean? That your monitor is broken and can no longer display the color red? Seriously, "not working" doesn't help us at all. Is the HTML output (check the source)? Maybe he should reformat his hard drive. It could fix it if it's just a monitor issue. Link to comment Share on other sites More sharing options...
Monkuar Posted July 19, 2009 Author Share Posted July 19, 2009 Not working? What could that mean? That your monitor is broken and can no longer display the color red? Seriously, "not working" doesn't help us at all. Is the HTML output (check the source)? Maybe he should reformat his hard drive. It could fix it if it's just a monitor issue. Get off his sack please, k thanks. And no it when i view page source, it shows it just perfect fine right between the tags, do u know what problem could be with my $subject variable? i'll post my whole function below: if ($cur_topic['moved_to'] == null) $last_post = '<a href="viewtopic.php?pid='.$cur_topic['last_post_id'].'#p'.$cur_topic['last_post_id'].'">'.format_time($cur_topic['last_post']).'</a><br />'.$lang_common['by'].' <a href="profile.php?id='.$cur_topic['last_poster_id'].'">'.pun_htmlspecialchars($cur_topic['last_poster']).''.$desktop.'</a></span>'; else $last_post = ' '; if ($pun_config['o_censoring'] == '1') $cur_topic['subject'] = censor_words($cur_topic['subject']); if ($cur_topic['moved_to'] != 0) $subject = $lang_forum['Moved'].': <a href="viewtopic.php?id='.$cur_topic['moved_to'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> '.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>'; else if ($cur_topic['closed'] == '0') $subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> '.''; //monk@ else { $subject = '<font color=red>Closed: <a href="viewtopic.php?id='.$cur_topic['id'].'">'.$cur_topic['subject'].'</a></font>'.''; $icon_text = '<tr class="cl bc1"> '; } if (!$pun_user['is_guest'] && $cur_topic['last_post'] > $pun_user['last_visit'] && $cur_topic['moved_to'] == null) { $item_status .= ' inew'; $icon_type = 'e1'; $subject = $subject; $subject_new_posts = '[ <a href="viewtopic.php?id='.$cur_topic['id'].'&action=new"><b>New Posts</b></a> ]'; } else $subject_new_posts = null; // Should we display the dot or not? if (!$pun_user['is_guest'] && $pun_config['o_show_dot'] == '1') { if ($cur_topic['has_posted'] == $pun_user['id']) $subject = '<strong>·</strong> '.$subject; else $subject = ' '.$subject; } if ($cur_topic['sticky'] == '1') { $subject = '<b>'.'Pinned'.':</b> '.$subject; } if ($cur_topic['icon_topic'] == '1') { $icon_topic = 'I chose value =1'; $subject = $icon_topic.' '.$subject; } else if ($cur_topic['icon_topic'] == '2') { $subject = "<span style=\"color:red;\">2 $subject</span>"; } Thanks! $subject i cant find, were the problem is, see the word 2.. it shows red, but the subject doesn't here's a screenshot bro..: (it's at bottom of code) thank u sir! Link to comment Share on other sites More sharing options...
xcoderx Posted July 19, 2009 Share Posted July 19, 2009 Omg, wtf did u fix it? Hehe Link to comment Share on other sites More sharing options...
Monkuar Posted July 19, 2009 Author Share Posted July 19, 2009 Omg, wtf did u fix it? Hehe No ? check my post above please.. thx lol Link to comment Share on other sites More sharing options...
Daniel0 Posted July 19, 2009 Share Posted July 19, 2009 You likely have CSS elsewhere that is overriding it. Use Firebug to debug it. Using Firebug you can inspect an element to see which CSS selectors and which attributes that are applied to that element, and overstruck attributes mean they've been overridden. Link to comment Share on other sites More sharing options...
Amtran Posted July 19, 2009 Share Posted July 19, 2009 Ugghhhh. It was so simple after all! The CSS file is overriding it! You have to change the CSS file to allow it to be red. Link to comment Share on other sites More sharing options...
Monkuar Posted July 19, 2009 Author Share Posted July 19, 2009 You likely have CSS elsewhere that is overriding it. Use Firebug to debug it. not true, i removed all css on the site, and took a screenshot, look.. yes i use firebug and i do inspect element nothing shows, that's why i post here for your help.. Link to comment Share on other sites More sharing options...
Daniel0 Posted July 19, 2009 Share Posted July 19, 2009 Any chance you could provide a link then? Link to comment Share on other sites More sharing options...
Amtran Posted July 19, 2009 Share Posted July 19, 2009 Doesn't matter. The link is still not going to change color. You have to explicitly set a new class in the CSS file. Link to comment Share on other sites More sharing options...
Monkuar Posted July 19, 2009 Author Share Posted July 19, 2009 Any chance you could provide a link then? he meansa link to my site.. ROFL dood it's on localhost, -.- OMG hmm... what else should i try bro ? should i add a header that defines my page as a html strict or something? Link to comment Share on other sites More sharing options...
xcoderx Posted July 19, 2009 Share Posted July 19, 2009 Where r the quotes in font? Dnt u think it should be like <font color="red">omg wtf</font> Link to comment Share on other sites More sharing options...
Monkuar Posted July 19, 2009 Author Share Posted July 19, 2009 Where r the quotes in font? Dnt u think it should be like <font color="red">omg wtf</font> HAha bro i tryed the font color="red" and stuff it doesn't help.. at all, thanks tho.. man im so nervous i really need this to work. omgggggggg O_O On my s/s it shows it's purple text? maybe that has something to do with it? isn't that just a.class link ? ? -.- Link to comment Share on other sites More sharing options...
xcoderx Posted July 19, 2009 Share Posted July 19, 2009 Make a css class and try then. Wtf Link to comment Share on other sites More sharing options...
Amtran Posted July 19, 2009 Share Posted July 19, 2009 Yep, I know monkuar, I was referring to the link on your website. @the localhost problem: either PM Daniel0 with your server's IP address, or put the page on some free hosting site. Oh, and, I'm right. (jk, I'm only perfect) Link to comment Share on other sites More sharing options...
Daniel0 Posted July 19, 2009 Share Posted July 19, 2009 should i add a header that defines my page as a html strict or something? You should have a strict DOCTYPE regardless. As for your problem, instead of using inline styles, define a class and then style it and the links within it. If you just try this: <span style="color:red">foo <a href="http://phpfreaks.com">test</a></span> you'll see that it will not result in a red link either. That's just not how things work. Link to comment Share on other sites More sharing options...
Monkuar Posted July 19, 2009 Author Share Posted July 19, 2009 Make a css class and try then. Wtf Ok i'll try that right now.. BRB.. WOW FAIL WTF? IM GOING CRAZY.. LOL!! EDIT: Why move to css help this is php help.. it's something to do with $subject variable.. i posted the code for u.. Link to comment Share on other sites More sharing options...
Amtran Posted July 19, 2009 Share Posted July 19, 2009 Try this: a.red:link { color:#ff0000; } Then: echo '<span class="red">' . $subject . '</span>'; Link to comment Share on other sites More sharing options...
Monkuar Posted July 19, 2009 Author Share Posted July 19, 2009 Try this: a.red:link { color:#ff0000; } Then: echo '<span class="red">' . $subject . '</span>'; sorry sir, that doesn't work, thanks tho .. omg man i am so lost in this world Link to comment Share on other sites More sharing options...
Recommended Posts