<div style="border-bottom: 1px solid #ecebeb; margin: 4px 0; padding: 0 0 10px;">
<div style="background: transparent url(<?php echo JURI::root(); ?>modules/mod_hellome/images/icons-16x16.gif) no-repeat 0 -118px; padding: 0 0 0 22px;">
<a style="color:#9b1812; line-height: 18px;" href="<?php echo CRoute::_('index.php?option=com_community&view=inbox'); ?>"><?php echo JText::sprintf( (cIsPlural($unreadCount)) ? 'MOD_HELLOME NEW MESSAGE MANY' : 'MOD_HELLOME NEW MESSAGE', $unreadCount); ?></a>
</div>
<div style="background: transparent url(<?php echo JURI::root(); ?>modules/mod_hellome/images/icons-16x16.gif) no-repeat 0 -180px; padding: 0 0 0 22px;">
<a style="line-height: 18px;" href="<?php echo CRoute::_('index.php?option=com_community&view=friends&task=pending'); ?>"><?php echo JText::sprintf( (cIsPlural($pending)) ? 'MOD_HELLOME NEW FRIEND REQUEST MANY' : 'MOD_HELLOME NEW FRIEND REQUEST', $pending); ?></a>
</div>
</div>
Styling PHP Variable?
Page 1 of 15 Replies - 1912 Views - Last Post: 10 March 2011 - 09:29 AM
#1
Styling PHP Variable?
Posted 10 March 2011 - 08:30 AM
Is there a way to style a PHP variable? I have a link to a users inbox and pending friend requests on my site and I have the variable: $unreadCount. When this is active I want It to be red so that it sticks out when someone has a message. Any Ideas?
Replies To: Styling PHP Variable?
#2
Re: Styling PHP Variable?
Posted 10 March 2011 - 08:40 AM
a PHP variable never has a visual style, as PHP is a programming language, not a markup language.
what you certainly mean is the style of an HTML element having the text of the variable’s content, which is a matter of CSS.
what you certainly mean is the style of an HTML element having the text of the variable’s content, which is a matter of CSS.
#3
Re: Styling PHP Variable?
Posted 10 March 2011 - 08:41 AM
How would I style this particular element to show red when there is something in the "$unreadCount"?
#4
Re: Styling PHP Variable?
Posted 10 March 2011 - 08:59 AM
if($unreadCount > 0)
{
$unreadCount = '<font color="red">'.$unreadCount.'</font>';
}
else
{
$unreadCount = '<font color="green">'.$unreadCount.'</font>';
}
Something like that.
#5
Re: Styling PHP Variable?
Posted 10 March 2011 - 09:07 AM
fo the sake of proper HTML, let’s use
# given that you have defined the classes in your CSS
if($unreadCount > 0)
{
$unreadCount = '<a class="red">'.$unreadCount.'</a>';
}
else
{
$unreadCount = '<a class="green">'.$unreadCount.'</a>';
}
#6
Re: Styling PHP Variable?
Posted 10 March 2011 - 09:29 AM
I was debating using classes, but didn't want to be asked how or where to create the CSS Classes
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|