Skip to content

Commit

Permalink
from image to CSS! Bye On/Off images :)
Browse files Browse the repository at this point in the history
Signed-off-by: Antes <antes@simplemachines.org>
  • Loading branch information
XinYenFon committed Jun 27, 2014
1 parent dac4ffa commit 26151b1
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 5 deletions.
1 change: 0 additions & 1 deletion Sources/Load.php
Expand Up @@ -1221,7 +1221,6 @@ function loadMemberContext($user, $display_custom_fields = false)
'member_online_text' => sprintf($txt[$profile['is_online'] ? 'member_is_online' : 'member_is_offline'], $smcFunc['htmlspecialchars']($profile['real_name'])),
'href' => $scripturl . '?action=pm;sa=send;u=' . $profile['id_member'],
'link' => '<a href="' . $scripturl . '?action=pm;sa=send;u=' . $profile['id_member'] . '">' . $txt[$profile['is_online'] ? 'online' : 'offline'] . '</a>',
'image_href' => $settings['images_url'] . '/' . ($profile['buddy'] ? 'buddy_' : '') . ($profile['is_online'] ? 'useron' : 'useroff') . '.png',
'label' => $txt[$profile['is_online'] ? 'online' : 'offline']
),
'language' => $smcFunc['ucwords'](strtr($profile['lngfile'], array('_' => ' ', '-utf8' => ''))),
Expand Down
2 changes: 1 addition & 1 deletion Themes/default/Display.template.php
Expand Up @@ -524,7 +524,7 @@ function template_single_post($message, $force_alternate = null)
// Show online and offline buttons?
if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest'])
echo '
', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', '<img src="', $message['member']['online']['image_href'], '" alt="', $message['member']['online']['text'], '">', $context['can_send_pm'] ? '</a>' : '';
', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '" class="pm_icon">' : '', '<span class="' . ($message['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $message['member']['online']['text'] . '"></span>', $context['can_send_pm'] ? '</a>' : '';


// Show a link to the member's profile.
Expand Down
2 changes: 1 addition & 1 deletion Themes/default/PersonalMessage.template.php
Expand Up @@ -224,7 +224,7 @@ function loadLabelChoices()
// Show online and offline buttons?
if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest'])
echo '
<img src="', $message['member']['online']['image_href'], '" alt="', $message['member']['online']['text'], '">';
<span class="' . ($message['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $message['member']['online']['text'] . '"></span>';

// Show a link to the member's profile (but only if the sender isn't a guest).
echo '
Expand Down
2 changes: 1 addition & 1 deletion Themes/default/Profile.template.php
Expand Up @@ -180,7 +180,7 @@ function template_summary()

echo '
</ul>
<span id="userstatus">', $context['can_send_pm'] ? '<a href="' . $context['member']['online']['href'] . '" title="' . $context['member']['online']['text'] . '" rel="nofollow">' : '', $settings['use_image_buttons'] ? '<img src="' . $context['member']['online']['image_href'] . '" alt="' . $context['member']['online']['text'] . '" class="centericon">' : $context['member']['online']['label'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $context['member']['online']['label'] . '</span>' : '';
<span id="userstatus">', $context['can_send_pm'] ? '<a href="' . $context['member']['online']['href'] . '" title="' . $context['member']['online']['text'] . '" rel="nofollow">' : '', $settings['use_image_buttons'] ? '<span class="' . ($context['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $context['member']['online']['text'] . '"></span>' : $context['member']['online']['label'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $context['member']['online']['label'] . '</span>' : '';

// Can they add this member as a buddy?
if (!empty($context['can_have_buddy']) && !$context['user']['is_owner'])
Expand Down
27 changes: 26 additions & 1 deletion Themes/default/css/index.css
Expand Up @@ -2173,7 +2173,7 @@ ul.quickbuttons li a.modifybutton {
}
ul.quickbuttons li a.remove_button {
background: url(../images/theme/quickbuttons.png) no-repeat 2px -29px;
padding: 0px 2px 0px 20px;
padding: 0 2px 0 25px;
}
ul.quickbuttons li a.modify_button {
background: url(../images/theme/quickbuttons.png) no-repeat 2px -59px;
Expand Down Expand Up @@ -2853,12 +2853,14 @@ tr.windowbg td, tr.windowbg2 td, tr.highlight2 td, .table_grid tr td {
display: inline-block;
background: url(../images/generic_icons.png) no-repeat 0 0;
}
/* You wait here till the sprite gets renew */
.generic_icons.user_on {
background-position: 0 0;
}
.generic_icons.user_off {
background-position: 0 -16px;
}
/* from here */
.generic_icons.gender_Female {
background-position: -16px 0;
}
Expand Down Expand Up @@ -4094,4 +4096,27 @@ p.information img {
.topic {
clear: both;
padding: 3px 0 0 0;
}
.on, .off {
width: 14px;
height: 14px;
border-radius: 12px;
border: 1px solid none;
position: absolute;
margin: 4px 0 0 0;
}
.on {
background: #99FF66;
}
.off {
background: grey;
}
#userstatus .smalltext {
margin: 0 0 0 20px;
}
.pm_icon, #personal_messages .poster h4 a {
margin: 0 15px 0 0 !important;
}
#personal_messages .poster span {
margin: 3px 0 0 -15px;
}
Binary file removed Themes/default/images/useroff.png
Binary file not shown.
Binary file removed Themes/default/images/useron.png
Binary file not shown.

0 comments on commit 26151b1

Please sign in to comment.