annotate forum/Themes/default/Who.template.php @ 98:054c48a8860c rdfquery

Style the "no results found" message
author Chris Cannam
date Mon, 23 Jun 2014 16:01:00 +0100
parents e3e11437ecea
children
rev   line source
Chris@76 1 <?php
Chris@76 2 /**
Chris@76 3 * Simple Machines Forum (SMF)
Chris@76 4 *
Chris@76 5 * @package SMF
Chris@76 6 * @author Simple Machines
Chris@76 7 * @copyright 2011 Simple Machines
Chris@76 8 * @license http://www.simplemachines.org/about/smf/license.php BSD
Chris@76 9 *
Chris@76 10 * @version 2.0
Chris@76 11 */
Chris@76 12
Chris@76 13 // The only template in the file.
Chris@76 14 function template_main()
Chris@76 15 {
Chris@76 16 global $context, $settings, $options, $scripturl, $txt;
Chris@76 17
Chris@76 18 // Display the table header and linktree.
Chris@76 19 echo '
Chris@76 20 <div class="main_section" id="whos_online">
Chris@76 21 <form action="', $scripturl, '?action=who" method="post" id="whoFilter" accept-charset="', $context['character_set'], '">
Chris@76 22 <div class="title_bar">
Chris@76 23 <h4 class="titlebg margin_lower">', $txt['who_title'], '</h4>
Chris@76 24 </div>
Chris@76 25 <div class="topic_table" id="mlist">
Chris@76 26 <div class="pagesection">
Chris@76 27 <div class="pagelinks floatleft">', $txt['pages'], ': ', $context['page_index'], '</div>';
Chris@76 28 echo '
Chris@76 29 <div class="selectbox floatright">', $txt['who_show1'], '
Chris@76 30 <select name="show_top" onchange="document.forms.whoFilter.show.value = this.value; document.forms.whoFilter.submit();">';
Chris@76 31
Chris@76 32 foreach ($context['show_methods'] as $value => $label)
Chris@76 33 echo '
Chris@76 34 <option value="', $value, '" ', $value == $context['show_by'] ? ' selected="selected"' : '', '>', $label, '</option>';
Chris@76 35 echo '
Chris@76 36 </select>
Chris@76 37 <noscript>
Chris@76 38 <input type="submit" name="submit_top" value="', $txt['go'], '" class="button_submit" />
Chris@76 39 </noscript>
Chris@76 40 </div>
Chris@76 41 </div>
Chris@76 42 <table class="table_grid" cellspacing="0">
Chris@76 43 <thead>
Chris@76 44 <tr class="catbg">
Chris@76 45 <th scope="col" class="lefttext first_th" width="40%"><a href="', $scripturl, '?action=who;start=', $context['start'], ';show=', $context['show_by'], ';sort=user', $context['sort_direction'] != 'down' && $context['sort_by'] == 'user' ? '' : ';asc', '" rel="nofollow">', $txt['who_user'], ' ', $context['sort_by'] == 'user' ? '<img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></th>
Chris@76 46 <th scope="col" class="lefttext" width="10%"><a href="', $scripturl, '?action=who;start=', $context['start'], ';show=', $context['show_by'], ';sort=time', $context['sort_direction'] == 'down' && $context['sort_by'] == 'time' ? ';asc' : '', '" rel="nofollow">', $txt['who_time'], ' ', $context['sort_by'] == 'time' ? '<img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></th>
Chris@76 47 <th scope="col" class="lefttext last_th" width="50%">', $txt['who_action'], '</th>
Chris@76 48 </tr>
Chris@76 49 </thead>
Chris@76 50 <tbody>';
Chris@76 51
Chris@76 52 // For every member display their name, time and action (and more for admin).
Chris@76 53 $alternate = 0;
Chris@76 54
Chris@76 55 foreach ($context['members'] as $member)
Chris@76 56 {
Chris@76 57 // $alternate will either be true or false. If it's true, use "windowbg2" and otherwise use "windowbg".
Chris@76 58 echo '
Chris@76 59 <tr class="windowbg', $alternate ? '2' : '', '">
Chris@76 60 <td>';
Chris@76 61
Chris@76 62 // Guests don't have information like icq, msn, y!, and aim... and they can't be messaged.
Chris@76 63 if (!$member['is_guest'])
Chris@76 64 {
Chris@76 65 echo '
Chris@76 66 <span class="contact_info floatright">
Chris@76 67 ', $context['can_send_pm'] ? '<a href="' . $member['online']['href'] . '" title="' . $member['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $member['online']['image_href'] . '" alt="' . $member['online']['text'] . '" align="bottom" />' : $member['online']['text'], $context['can_send_pm'] ? '</a>' : '', '
Chris@76 68 ', isset($context['disabled_fields']['icq']) ? '' : $member['icq']['link'] , ' ', isset($context['disabled_fields']['msn']) ? '' : $member['msn']['link'], ' ', isset($context['disabled_fields']['yim']) ? '' : $member['yim']['link'], ' ', isset($context['disabled_fields']['aim']) ? '' : $member['aim']['link'], '
Chris@76 69 </span>';
Chris@76 70 }
Chris@76 71
Chris@76 72 echo '
Chris@76 73 <span class="member', $member['is_hidden'] ? ' hidden' : '', '">
Chris@76 74 ', $member['is_guest'] ? $member['name'] : '<a href="' . $member['href'] . '" title="' . $txt['profile_of'] . ' ' . $member['name'] . '"' . (empty($member['color']) ? '' : ' style="color: ' . $member['color'] . '"') . '>' . $member['name'] . '</a>', '
Chris@76 75 </span>';
Chris@76 76
Chris@76 77 if (!empty($member['ip']))
Chris@76 78 echo '
Chris@76 79 (<a href="' . $scripturl . '?action=', ($member['is_guest'] ? 'trackip' : 'profile;area=tracking;sa=ip;u=' . $member['id']), ';searchip=' . $member['ip'] . '">' . $member['ip'] . '</a>)';
Chris@76 80
Chris@76 81 echo '
Chris@76 82 </td>
Chris@76 83 <td nowrap="nowrap">', $member['time'], '</td>
Chris@76 84 <td>', $member['action'], '</td>
Chris@76 85 </tr>';
Chris@76 86
Chris@76 87 // Switch alternate to whatever it wasn't this time. (true -> false -> true -> false, etc.)
Chris@76 88 $alternate = !$alternate;
Chris@76 89 }
Chris@76 90
Chris@76 91 // No members?
Chris@76 92 if (empty($context['members']))
Chris@76 93 {
Chris@76 94 echo '
Chris@76 95 <tr class="windowbg2">
Chris@76 96 <td colspan="3" align="center">
Chris@76 97 ', $txt['who_no_online_' . ($context['show_by'] == 'guests' || $context['show_by'] == 'spiders' ? $context['show_by'] : 'members')], '
Chris@76 98 </td>
Chris@76 99 </tr>';
Chris@76 100 }
Chris@76 101
Chris@76 102 echo '
Chris@76 103 </tbody>
Chris@76 104 </table>
Chris@76 105 </div>
Chris@76 106 <div class="pagesection">
Chris@76 107 <div class="pagelinks floatleft">', $txt['pages'], ': ', $context['page_index'], '</div>';
Chris@76 108
Chris@76 109 echo '
Chris@76 110 <div class="selectbox floatright">', $txt['who_show1'], '
Chris@76 111 <select name="show" onchange="document.forms.whoFilter.submit();">';
Chris@76 112
Chris@76 113 foreach ($context['show_methods'] as $value => $label)
Chris@76 114 echo '
Chris@76 115 <option value="', $value, '" ', $value == $context['show_by'] ? ' selected="selected"' : '', '>', $label, '</option>';
Chris@76 116 echo '
Chris@76 117 </select>
Chris@76 118 <noscript>
Chris@76 119 <input type="submit" value="', $txt['go'], '" class="button_submit" />
Chris@76 120 </noscript>
Chris@76 121 </div>
Chris@76 122 </div>
Chris@76 123 </form>
Chris@76 124 </div>';
Chris@76 125 }
Chris@76 126
Chris@76 127 function template_credits()
Chris@76 128 {
Chris@76 129 global $context, $txt;
Chris@76 130
Chris@76 131 // The most important part - the credits :P.
Chris@76 132 echo '
Chris@76 133 <div class="main_section" id="credits">
Chris@76 134 <div class="cat_bar">
Chris@76 135 <h3 class="catbg">', $txt['credits'], '</h3>
Chris@76 136 </div>';
Chris@76 137
Chris@76 138 foreach ($context['credits'] as $section)
Chris@76 139 {
Chris@76 140 if (isset($section['pretext']))
Chris@76 141 echo '
Chris@76 142 <div class="windowbg">
Chris@76 143 <span class="topslice"><span></span></span>
Chris@76 144 <div class="content">
Chris@76 145 <p>', $section['pretext'], '</p>
Chris@76 146 </div>
Chris@76 147 <span class="botslice"><span></span></span>
Chris@76 148 </div>';
Chris@76 149
Chris@76 150 if (isset($section['title']))
Chris@76 151 echo '
Chris@76 152 <div class="cat_bar">
Chris@76 153 <h3 class="catbg">', $section['title'], '</h3>
Chris@76 154 </div>';
Chris@76 155
Chris@76 156 echo '
Chris@76 157 <div class="windowbg2">
Chris@76 158 <span class="topslice"><span></span></span>
Chris@76 159 <div class="content">
Chris@76 160 <dl>';
Chris@76 161
Chris@76 162 foreach ($section['groups'] as $group)
Chris@76 163 {
Chris@76 164 if (isset($group['title']))
Chris@76 165 echo '
Chris@76 166 <dt>
Chris@76 167 <strong>', $group['title'], '</strong>
Chris@76 168 </dt>
Chris@76 169 <dd>';
Chris@76 170
Chris@76 171 // Try to make this read nicely.
Chris@76 172 if (count($group['members']) <= 2)
Chris@76 173 echo implode(' ' . $txt['credits_and'] . ' ', $group['members']);
Chris@76 174 else
Chris@76 175 {
Chris@76 176 $last_peep = array_pop($group['members']);
Chris@76 177 echo implode(', ', $group['members']), ' ', $txt['credits_and'], ' ', $last_peep;
Chris@76 178 }
Chris@76 179
Chris@76 180 echo '
Chris@76 181 </dd>';
Chris@76 182 }
Chris@76 183
Chris@76 184 echo '
Chris@76 185 </dl>';
Chris@76 186
Chris@76 187 if (isset($section['posttext']))
Chris@76 188 echo '
Chris@76 189 <p class="posttext">', $section['posttext'], '</p>';
Chris@76 190
Chris@76 191 echo '
Chris@76 192 </div>
Chris@76 193 <span class="botslice"><span></span></span>
Chris@76 194 </div>';
Chris@76 195 }
Chris@76 196
Chris@76 197 echo '
Chris@76 198 <div class="cat_bar">
Chris@76 199 <h3 class="catbg">', $txt['credits_copyright'], '</h3>
Chris@76 200 </div>
Chris@76 201 <div class="windowbg">
Chris@76 202 <span class="topslice"><span></span></span>
Chris@76 203 <div class="content">
Chris@76 204 <dl>
Chris@76 205 <dt><strong>', $txt['credits_forum'], '</strong></dt>', '
Chris@76 206 <dd>', $context['copyrights']['smf'];
Chris@76 207
Chris@76 208 echo '
Chris@76 209 </dd>
Chris@76 210 </dl>';
Chris@76 211
Chris@76 212 if (!empty($context['copyrights']['mods']))
Chris@76 213 {
Chris@76 214 echo '
Chris@76 215 <dl>
Chris@76 216 <dt><strong>', $txt['credits_modifications'], '</strong></dt>
Chris@76 217 <dd>', implode('</dd><dd>', $context['copyrights']['mods']), '</dd>
Chris@76 218 </dl>';
Chris@76 219 }
Chris@76 220
Chris@76 221 echo '
Chris@76 222 </div>
Chris@76 223 <span class="botslice"><span></span></span>
Chris@76 224 </div>
Chris@76 225 </div>';
Chris@76 226 }
Chris@76 227 ?>