Import the theme from the Khaganat forum

This commit is contained in:
Antoine Le Gonidec 2024-07-24 10:55:50 +02:00
commit bfecece60d
Signed by: vv221
GPG key ID: 636B78F91CEB80D8
177 changed files with 44903 additions and 0 deletions

1672
Admin.template.php Normal file

File diff suppressed because it is too large Load diff

88
Agreement.template.php Normal file
View file

@ -0,0 +1,88 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
// The main sub template - show the agreement and/or privacy policy
function template_main()
{
global $context, $scripturl, $txt;
if (!empty($context['accept_doc']))
echo '
<form action="', $scripturl, '?action=acceptagreement;doc=', $context['accept_doc'], '" method="post">';
if (!empty($context['agreement']))
{
echo '
<div class="cat_bar">
<h2 class="catbg">', $txt['agreement' . (!empty($context['can_accept_agreement']) ? '_updated' : '')], '</h2>
</div>';
if (!empty($context['can_accept_agreement']))
{
echo '
<div class="information noup">
', $txt['agreement_updated_desc'], '
</div>';
}
elseif (!empty($context['agreement_accepted_date']))
{
echo '
<div class="information noup">
', sprintf($txt['agreement_accepted'], timeformat($context['agreement_accepted_date'], false)), '
</div>';
}
echo '
<div class="windowbg noup">
', $context['agreement'], '
</div>';
}
if (!empty($context['privacy_policy']))
{
echo '
<div class="cat_bar">
<h2 class="catbg">', $txt['privacy_policy' . (!empty($context['can_accept_privacy_policy']) ? '_updated' : '')], '</h2>
</div>';
if (!empty($context['can_accept_privacy_policy']))
{
echo '
<div class="information noup">
', $txt['privacy_policy_updated_desc'], '
</div>';
}
elseif (!empty($context['privacy_policy_accepted_date']))
{
echo '
<div class="information noup">
', sprintf($txt['privacy_policy_accepted'], timeformat($context['privacy_policy_accepted_date'], false)), '
</div>';
}
echo '
<div class="windowbg noup">
', $context['privacy_policy'], '
</div>';
}
if (!empty($context['accept_doc']))
echo '
<div id="confirm_buttons">
<input type="submit" value="', $txt['agree'], '" class="button">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
</div>
</form>';
}
?>

606
BoardIndex.template.php Normal file
View file

@ -0,0 +1,606 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* The top part of the outer layer of the boardindex
*/
function template_boardindex_outer_above()
{
template_newsfader();
}
/**
* This shows the newsfader
*/
function template_newsfader()
{
global $context, $settings;
// Show the news fader? (assuming there are things to show...)
if (!empty($settings['show_newsfader']) && !empty($context['news_lines']))
{
echo '
<ul id="smf_slider" class="roundframe">';
foreach ($context['news_lines'] as $news)
echo '
<li>', $news, '</li>';
echo '
</ul>
<script>
jQuery("#smf_slider").slippry({
pause: ', $settings['newsfader_time'], ',
adaptiveHeight: 0,
captions: 0,
controls: 0,
});
</script>';
}
}
/**
* This actually displays the board index
*/
function template_main()
{
global $context, $txt, $scripturl;
echo '
<div id="boardindex_table" class="boardindex_table">';
/* Each category in categories is made up of:
id, href, link, name, is_collapsed (is it collapsed?), can_collapse (is it okay if it is?),
new (is it new?), collapse_href (href to collapse/expand), collapse_image (up/down image),
and boards. (see below.) */
foreach ($context['categories'] as $category)
{
// If theres no parent boards we can see, avoid showing an empty category (unless its collapsed)
if (empty($category['boards']) && !$category['is_collapsed'])
continue;
echo '
<div class="main_container">
<div class="khbiseau_topright_color"></div>
<div class="cat_bar ', $category['is_collapsed'] ? 'collapsed' : '', '" id="category_', $category['id'], '">
<div class="info">
';
// If this category even can collapse, show a link to collapse it. Only if we are logged.
if ($category['can_collapse'])
echo '
<span id="category_', $category['id'], '_upshrink" class="', $category['is_collapsed'] ? 'toggle_down' : 'toggle_up', ' "data-collapsed="', (int) $category['is_collapsed'], '" title="', !$category['is_collapsed'] ? $txt['hide_category'] : $txt['show_category'], '" style="display: none;"></span>';
echo '<h2 class="catbg">';
echo '
', $category['link'], '
</h2>', !empty($category['description']) ? '
<div class="desc">' . $category['description'] . '</div>' : '', '
</div><!--fin class info-->
<div class="board_stats">
<div>', $txt['board_topics'], '</div><div>', $txt['posts'], '</div></div>
<div class="lastpost">', $txt['last_post'], '</div>
</div>
<div id="category_', $category['id'], '_boards" ', (!empty($category['css_class']) ? ('class="' . $category['css_class'] . '"') : ''), $category['is_collapsed'] ? ' style="display: none;"' : '', '>';
/* Each board in each category's boards has:
new (is it new?), id, name, description, moderators (see below), link_moderators (just a list.),
children (see below.), link_children (easier to use.), children_new (are they new?),
topics (# of), posts (# of), link, href, and last_post. (see below.) */
foreach ($category['boards'] as $board)
{
echo '
<div id="board_', $board['id'], '" class="up_contain ', (!empty($board['css_class']) ? $board['css_class'] : ''), '">
<div class="board_icon">
', function_exists('template_bi_' . $board['type'] . '_icon') ? call_user_func('template_bi_' . $board['type'] . '_icon', $board) : template_bi_board_icon($board), '
</div>
<div class="info">
', function_exists('template_bi_' . $board['type'] . '_info') ? call_user_func('template_bi_' . $board['type'] . '_info', $board) : template_bi_board_info($board), '
</div><!-- .info -->';
// Show some basic information about the number of posts, etc.
echo '
<div class="board_stats">
', function_exists('template_bi_' . $board['type'] . '_stats') ? call_user_func('template_bi_' . $board['type'] . '_stats', $board) : template_bi_board_stats($board), '
</div>';
// Show the last post if there is one.
echo'
<div class="lastpost">
', function_exists('template_bi_' . $board['type'] . '_lastpost') ? call_user_func('template_bi_' . $board['type'] . '_lastpost', $board) : template_bi_board_lastpost($board), '
</div>';
// Won't somebody think of the children!
if (function_exists('template_bi_' . $board['type'] . '_children'))
call_user_func('template_bi_' . $board['type'] . '_children', $board);
else
template_bi_board_children($board);
echo '
</div><!-- #board_[id] -->';
}
echo '
</div><!-- #category_[id]_boards -->
<div class="khbiseau_bottom_white"></div>
</div><!-- .main_container -->';
}
echo '
</div><!-- #boardindex_table -->';
// Show the mark all as read button?
if ($context['user']['is_logged'] && !empty($context['categories']))
echo '
<div class="mark_read">
', template_button_strip($context['mark_read_button'], 'right'), '
</div>';
}
/**
* Outputs the board icon for a standard board.
*
* @param array $board Current board information.
*/
function template_bi_board_icon($board)
{
global $context, $scripturl;
// L'icone devant le forum de niveau 1. Passé de "a" à "div" pour simplifier la navigation au clavier
echo '
<div href="', ($context['user']['is_guest'] ? $board['href'] : $scripturl . '?action=unread;board=' . $board['id'] . '.0;children'), '" class="board_', $board['board_class'], '"', !empty($board['board_tooltip']) ? ' title="' . $board['board_tooltip'] . '"' : '', '></div>';
}
/**
* Outputs the board icon for a redirect.
*
* @param array $board Current board information.
*/
function template_bi_redirect_icon($board)
{
global $context, $scripturl;
echo '
<a href="', $board['href'], '" class="board_', $board['board_class'], '"', !empty($board['board_tooltip']) ? ' title="' . $board['board_tooltip'] . '"' : '', '></a>';
}
/**
* Outputs the board info for a standard board or redirect.
*
* @param array $board Current board information.
*/
function template_bi_board_info($board)
{
global $context, $scripturl, $txt;
echo '
<h3><a class="subject mobile_subject" href="', $board['href'], '" id="b', $board['id'], '">
', $board['name'], '
</a></h3>';
// Has it outstanding posts for approval?
if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics']))
echo '
<a href="', $scripturl, '?action=moderate;area=postmod;sa=', ($board['unapproved_topics'] > 0 ? 'topics' : 'posts'), ';brd=', $board['id'], ';', $context['session_var'], '=', $context['session_id'], '" title="', sprintf($txt['unapproved_posts'], $board['unapproved_topics'], $board['unapproved_posts']), '" class="moderation_link amt">!</a>';
echo '
<div class="board_description">', $board['description'], '</div>';
// Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.)
if (!empty($board['link_moderators']))
echo '
<p class="moderators">', count($board['link_moderators']) == 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>';
}
/**
* Outputs the board stats for a standard board.
*
* @param array $board Current board information.
*/
function template_bi_board_stats($board)
{
global $txt;
echo '
<div>
', comma_format($board['topics']), '
</div>
<div>
', comma_format($board['posts']), '
</div>
';
}
/**
* Outputs the board stats for a redirect.
*
* @param array $board Current board information.
*/
function template_bi_redirect_stats($board)
{
global $txt;
echo '
<p>
', $txt['redirects'], ': ', comma_format($board['posts']), '
</p>';
}
/**
* Outputs the board lastposts for a standard board or a redirect.
* When on a mobile device, this may be hidden if no last post exists.
*
* @param array $board Current board information.
*/
function template_bi_board_lastpost($board)
{
if (!empty($board['last_post']['id']))
echo
'<p>', $board['last_post']['last_post_message'], '</p>';
}
/**
* Outputs the board children for a standard board.
*
* @param array $board Current board information.
*/
function template_bi_board_children($board)
{
global $txt, $scripturl, $context;
// Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
if (!empty($board['children']))
{
// Sort the links into an array with new boards bold so it can be imploded.
$children = array();
/* Each child in each board's children has:
id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
foreach ($board['children'] as $child)
{ //ici le lien vers les sous-forum et la façon dont ils s'affichent. Juste les liens !
if (!$child['is_redirect'])
$child['link'] = '' . ($child['new'] ? '
<!-- Lien vers nouveau message--><a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')" class="new_posts">
' . $txt['new'] . '
</a> ' : '') . '
<!-- Lien vers la board-->
<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">
' . $child['name'] . '
</a>
';
else
$child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . ' - ' . $child['short_description'] . '">' . $child['name'] . '</a>';
// Has it posts awaiting approval?
if ($child['can_approve_posts'] && ($child['unapproved_posts'] || $child['unapproved_topics']))
$child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link amt">!</a>';
// Ici la mise en forme des catégories des enfants. Probablement pas au bon endroit...Todo afficher le bon lien !
//Lien en trop, redondant avec le titre ensuite
// <!-- 1 : --> <a href="' . $child['href'] . '" class="board_on" title="Nouveaux messages"></a>
// <!-- 2 : --> <a href="' . $child['href'] . '" class="board_off" title="Pas de nouveaux messages"></a>
$children[] = $child['new'] ? '
<!-- nouveau message -->
<div class="khbb_children">
<div class="board_icon">
<!-- 1 -->
<div class="board_on" title="Nouveaux messages"></div>
<!-- mettre icone nouveau message -->
</div>
<div class="info">
<h4>' . $child['link'] . '</h4>
<div class="desc">' . $child['description'] . '
</div>
</div>
<div class="board_stats">
<div>' . comma_format($child['topics']) . '</div>
<div>' . comma_format($child['posts']) . '</div>
</div>
<div class="lastpost"><!--'. $board['last_post']['last_post_message']. '--></div>
</div>' : '
<!-- sans nouveau message -->
<div class="khbb_children">
<div class="board_icon">
<!-- 2 -->
<div class="board_off" title="Pas de nouveaux messages"></div>
</div>
<div class="info">
<h4>' . $child['link'] . '</h4>
<div class="desc">' . $child['description'] . '
</div>
</div>
<div class="board_stats">
<div>' . comma_format($child['topics']) . '</div>
<div>' . comma_format($child['posts']) . '</div>
</div>
<div class="lastpost"><!--Todo Erreur !!
'. $board['last_post']['last_post_message']. '-->
</div>
</div>
';
}
echo '
<div id="board_', $board['id'], '_children" class="children">
<p><span id="child_list_', $board['id'], '"></span>
', implode(' ', $children), '
</p>
</div>';
// c'est là qu'est le truc pour "Sous-sections". Balise autour du "implode" fonctionne mais... pas assez pointu.
// TODO : ajouter aussi nb de messages, dernier message, etc. Mais une fois que c'est ok sur le forum parent car on va recopier...
}
}
/**
* The lower part of the outer layer of the board index
*/
function template_boardindex_outer_below()
{
template_info_center();
}
/**
* Displays the info center
*/
function template_info_center()
{
global $context, $options, $txt;
if (empty($context['info_center']))
return;
// Here's where the "Info Center" starts...
echo '
<div class="khbiseau_topright_color"></div>
<div class="roundframe" id="info_center">
<div class="title_bar">
<h2 class="titlebg">
<span class="toggle_up" id="upshrink_ic" title="', $txt['hide_infocenter'], '" style="display: none;"></span>
<a href="#" id="upshrink_link">', sprintf($txt['info_center_title'], $context['forum_name_html_safe']), '</a>
</h2>
</div>
<time datetime="', smf_gmstrftime('%FT%TZ'), '">', $context['current_time'], '</time>
<div id="upshrink_stats"', empty($options['collapse_header_ic']) ? '' : ' style="display: none;"', '>';
foreach ($context['info_center'] as $block)
{
$func = 'template_ic_block_' . $block['tpl'];
$func();
}
echo '
</div><!-- #upshrink_stats -->
</div><!-- #info_center -->';
// Info center collapse object.
echo '
<script>
var oInfoCenterToggle = new smc_Toggle({
bToggleEnabled: true,
bCurrentlyCollapsed: ', empty($options['collapse_header_ic']) ? 'false' : 'true', ',
aSwappableContainers: [
\'upshrink_stats\'
],
aSwapImages: [
{
sId: \'upshrink_ic\',
altExpanded: ', JavaScriptEscape($txt['hide_infocenter']), ',
altCollapsed: ', JavaScriptEscape($txt['show_infocenter']), '
}
],
aSwapLinks: [
{
sId: \'upshrink_link\',
msgExpanded: ', JavaScriptEscape(sprintf($txt['info_center_title'], $context['forum_name_html_safe'])), ',
msgCollapsed: ', JavaScriptEscape(sprintf($txt['info_center_title'], $context['forum_name_html_safe'])), '
}
],
oThemeOptions: {
bUseThemeSettings: ', $context['user']['is_guest'] ? 'false' : 'true', ',
sOptionName: \'collapse_header_ic\',
sSessionId: smf_session_id,
sSessionVar: smf_session_var,
},
oCookieOptions: {
bUseCookie: ', $context['user']['is_guest'] ? 'true' : 'false', ',
sCookieName: \'upshrinkIC\'
}
});
</script>';
}
/**
* The recent posts section of the info center
*/
function template_ic_block_recent()
{
global $context, $scripturl, $settings, $txt;
// This is the "Recent Posts" bar.
echo '
<div class="sub_bar">
<h4 class="subbg">
<a href="', $scripturl, '?action=recent"><span class="main_icons recent_posts"></span> ', $txt['recent_posts'], '</a>
</h4>
</div>
<div id="recent_posts_content">';
// Only show one post.
if ($settings['number_recent_posts'] == 1)
{
// latest_post has link, href, time, subject, short_subject (shortened with...), and topic. (its id.)
echo '
<p id="infocenter_onepost" class="inline">
<a href="', $scripturl, '?action=recent">', $txt['recent_view'], '</a> ', sprintf($txt['is_recent_updated'], '&quot;' . $context['latest_post']['link'] . '&quot;'), ' (', $context['latest_post']['time'], ')<br>
</p>';
}
// Show lots of posts.
elseif (!empty($context['latest_posts']))
{
echo '
<table id="ic_recentposts">
<tr class="windowbg">
<th class="recentpost">', $txt['message'], '</th>
<th class="recentposter">', $txt['author'], '</th>
<th class="recentboard">', $txt['board'], '</th>
<th class="recenttime">', $txt['date'], '</th>
</tr>';
/* Each post in latest_posts has:
board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
subject, short_subject (shortened with...), time, link, and href. */
foreach ($context['latest_posts'] as $post)
echo '
<tr class="windowbg">
<td class="recentpost"><strong>', $post['link'], '</strong></td>
<td class="recentposter">', $post['poster']['link'], '</td>
<td class="recentboard">', $post['board']['link'], '</td>
<td class="recenttime">', $post['time'], '</td>
</tr>';
echo '
</table>';
}
echo '
</div><!-- #recent_posts_content -->';
}
/**
* The calendar section of the info center
*/
function template_ic_block_calendar()
{
global $context, $scripturl, $txt;
// Show information about events, birthdays, and holidays on the calendar.
echo '
<div class="sub_bar">
<h4 class="subbg">
<a href="', $scripturl, '?action=calendar' . '"><span class="main_icons calendar"></span> ', $context['calendar_only_today'] ? $txt['calendar_today'] : $txt['calendar_upcoming'], '</a>
</h4>
</div>';
// Holidays like "Christmas", "Chanukah", and "We Love [Unknown] Day" :P
if (!empty($context['calendar_holidays']))
echo '
<p class="inline holiday">
<span>', $txt['calendar_prompt'], '</span> ', implode(', ', $context['calendar_holidays']), '
</p>';
// People's birthdays. Like mine. And yours, I guess. Kidding.
if (!empty($context['calendar_birthdays']))
{
echo '
<p class="inline">
<span class="birthday">', $context['calendar_only_today'] ? $txt['birthdays'] : $txt['birthdays_upcoming'], '</span>';
// Each member in calendar_birthdays has: id, name (person), age (if they have one set?), is_last. (last in list?), and is_today (birthday is today?)
foreach ($context['calendar_birthdays'] as $member)
echo '
<a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['is_today'] ? '<strong class="fix_rtl_names">' : '', $member['name'], $member['is_today'] ? '</strong>' : '', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '' : ', ';
echo '
</p>';
}
// Events like community get-togethers.
if (!empty($context['calendar_events']))
{
echo '
<p class="inline">
<span class="event">', $context['calendar_only_today'] ? $txt['events'] : $txt['events_upcoming'], '</span> ';
// Each event in calendar_events should have:
// title, href, is_last, can_edit (are they allowed?), modify_href, and is_today.
foreach ($context['calendar_events'] as $event)
echo '
', $event['can_edit'] ? '<a href="' . $event['modify_href'] . '" title="' . $txt['calendar_edit'] . '"><span class="main_icons calendar_modify"></span></a> ' : '', $event['href'] == '' ? '' : '<a href="' . $event['href'] . '">', $event['is_today'] ? '<strong>' . $event['title'] . '</strong>' : $event['title'], $event['href'] == '' ? '' : '</a>', $event['is_last'] ? '<br>' : ', ';
echo '
</p>';
}
}
/**
* The stats section of the info center
*/
function template_ic_block_stats()
{
global $scripturl, $txt, $context, $settings;
// Show statistical style information...
echo '
<div class="sub_bar">
<h3 class="subbg">
<a href="', $scripturl, '?action=stats" title="', $txt['more_stats'], '"><span class="main_icons stats"></span> ', $txt['forum_stats'], '</a>
</h3>
</div>
<p class="inline">
', $context['common_stats']['boardindex_total_posts'], '', !empty($settings['show_latest_member']) ? ' - ' . $txt['latest_member'] . ': <strong> ' . $context['common_stats']['latest_member']['link'] . '</strong>' : '', '<br>
', (!empty($context['latest_post']) ? $txt['latest_post'] . ': <strong>&quot;' . $context['latest_post']['link'] . '&quot;</strong> (' . $context['latest_post']['time'] . ')<br>' : ''), '
<a href="', $scripturl, '?action=recent">', $txt['recent_view'], '</a>
</p>';
}
/**
* The who's online section of the info center
*/
function template_ic_block_online()
{
global $context, $scripturl, $txt, $modSettings, $settings;
// "Users online" - in order of activity.
echo '
<div class="sub_bar">
<h4 class="subbg">
', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', '<span class="main_icons people"></span> ', $txt['online_users'], '', $context['show_who'] ? '</a>' : '', '
</h4>
</div>
<p class="inline">
', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', '<strong>', $txt['online'], ': </strong>', comma_format($context['num_guests']), ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ', comma_format($context['num_users_online']), ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'];
// Handle hidden users and buddies.
$bracketList = array();
if ($context['show_buddies'])
$bracketList[] = comma_format($context['num_buddies']) . ' ' . ($context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies']);
if (!empty($context['num_spiders']))
$bracketList[] = comma_format($context['num_spiders']) . ' ' . ($context['num_spiders'] == 1 ? $txt['spider'] : $txt['spiders']);
if (!empty($context['num_users_hidden']))
$bracketList[] = comma_format($context['num_users_hidden']) . ' ' . ($context['num_spiders'] == 1 ? $txt['hidden'] : $txt['hidden_s']);
if (!empty($bracketList))
echo ' (' . implode(', ', $bracketList) . ')';
echo $context['show_who'] ? '</a>' : '', '
&nbsp;-&nbsp;', $txt['most_online_today'], ': <strong>', comma_format($modSettings['mostOnlineToday']), '</strong>&nbsp;-&nbsp;
', $txt['most_online_ever'], ': ', comma_format($modSettings['mostOnline']), ' (', timeformat($modSettings['mostDate']), ')<br>';
// Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link.
/*if (!empty($context['users_online']))
{
echo '
', sprintf($txt['users_active'], $modSettings['lastActive']), ': ', implode(', ', $context['list_users_online']);
// Showing membergroups?
if (!empty($settings['show_group_key']) && !empty($context['membergroups']))
echo '
<span class="membergroups">' . implode(', ', $context['membergroups']) . '</span>';
}*/
echo '
</p>';
}
?>

1237
Calendar.template.php Normal file

File diff suppressed because it is too large Load diff

1011
Display.template.php Normal file

File diff suppressed because it is too large Load diff

380
Errors.template.php Normal file
View file

@ -0,0 +1,380 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.3
*/
// @todo
/* This template file contains only the sub template fatal_error. It is
shown when an error occurs, and should show at least a back button and
$context['error_message'].
*/
/**
* THis displays a fatal error message
*/
function template_fatal_error()
{
global $context, $txt;
if (!empty($context['simple_action']))
echo '
<strong>
', $context['error_title'], '
</strong><br>
<div ', $context['error_code'], 'class="padding">
', $context['error_message'], '
</div>';
else
{
echo '
<div id="fatal_error">
<div class="cat_bar">
<h2 class="catbg">
', $context['error_title'], '
</h2>
</div>
<div class="windowbg">
<div ', $context['error_code'], 'class="padding">
', $context['error_message'], '
</div>
</div>
</div>';
// Show a back button
echo '
<div class="centertext">
<a class="button floatnone" href="', $context['error_link'], '">', $txt['back'], '</a>
</div>';
}
}
/**
* This template handles the error log in the admin center.
*/
function template_error_log()
{
global $scripturl, $context, $txt;
echo '
<form action="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';start=', $context['start'], $context['has_filter'] ? $context['filter']['href'] : '', '" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">
<a href="', $scripturl, '?action=helpadmin;help=error_log" onclick="return reqOverlayDiv(this.href);" class="help"><span class="main_icons help" title="', $txt['help'], '"></span></a> ', $txt['errorlog'], '
</h2>
</div>
<div class="information flow_hidden">
<div class="additional_row">';
// No errors, so just show a message and be done with it.
if (empty($context['errors']))
{
echo '
', $txt['errorlog_no_entries'], '
</div>
</div>
</form>';
return;
}
if ($context['has_filter'])
echo '
<div class="infobox">
<strong>', $txt['applying_filter'], ':</strong> ', $context['filter']['entity'], ' ', $context['filter']['value']['html'], '
</div>';
echo '
<div class="floatright">
<input type="submit" name="removeSelection" value="', $txt['remove_selection'], '" data-confirm="', $txt['remove_selection_confirm'], '" class="button you_sure">
<input type="submit" name="delall" value="', ($context['has_filter'] ? $txt['remove_filtered_results'] : $txt['remove_all']), '" data-confirm="', ($context['has_filter'] ? $txt['remove_filtered_results_confirm'] : $txt['sure_about_errorlog_remove']), '" class="button you_sure">
', ($context['has_filter'] ? '<a href="' . $scripturl . '?action=admin;area=logs;sa=errorlog' . ($context['sort_direction'] == 'down' ? ';desc' : '') . '" class="button">' . $txt['clear_filter'] . '</a>' : ''), '
</div>
', $txt['apply_filter_of_type'], ':';
$error_types = array();
foreach ($context['error_types'] as $type => $details)
$error_types[] = ($details['is_selected'] ? '<span class="main_icons right_arrow"></span> ' : '') . '<a href="' . $details['url'] . '" ' . ($details['is_selected'] ? 'style="font-weight: bold;"' : 'style="font-weight: normal;"') . ' title="' . $details['description'] . '">' . ($details['error_type'] === 'critical' ? '<span class="error">' . $details['label'] . '</span>' : $details['label']) . '</a>';
echo '
', implode(' | ', $error_types), '
</div>
</div>
<div class="pagesection">
<div class="pagelinks">
', $context['page_index'], '
</div>
<div class="floatright" style="padding: 0 12px">
<label for="check_all"><strong>', $txt['check_all'], '</strong></label>
<input type="checkbox" id="check_all" onclick="invertAll(this, this.form, \'delete[]\');">
</div>
</div>';
// We have some errors, must be some mods installed :P
foreach ($context['errors'] as $error)
{
echo '
<div class="windowbg word_break">
<div class="counter" style="padding: 0 10px 10px 0">', $error['id'], '</div>
<div class="topic_details">
<span class="floatright">
<input type="checkbox" name="delete[]" value="', $error['id'], '">
</span>
<h5>
<a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? '' : ';desc', $context['has_filter'] ? $context['filter']['href'] : '', '" title="', $txt['reverse_direction'], '"><span class="main_icons sort_' . $context['sort_direction'] . '"></span></a> ', $error['time'], '
</h5>
<hr class="clear">
</div>
<div>
<div class="half_content">
<a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=id_member;value=', $error['member']['id'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_member'], '"><span class="main_icons filter"></span></a>
<strong>', $error['member']['link'], '</strong>';
if (!empty($error['member']['ip']))
echo '
<br>
<a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=ip;value=', $error['member']['ip'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_ip'], '"><span class="main_icons filter"></span></a>
<strong><a href="', $scripturl, '?action=trackip;searchip=', $error['member']['ip'], '">', $error['member']['ip'], '</a></strong>';
if (!empty($error['member']['session']))
echo '
<br>
<a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=session;value=', $error['member']['session'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_session'], '"><span class="main_icons filter"></span></a> <a class="bbc_link" href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=session;value=', $error['member']['session'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_session'], '">', $error['member']['session'], '</a>';
echo '
<br>
<a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=url;value=', $error['url']['href'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_url'], '"><span class="main_icons filter"></span></a>
<a href="', $error['url']['html'], '" class="bbc_link word_break">', $error['url']['html'], '</a>';
if (!empty($error['file']))
echo '
<br>
<a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=file;value=', $error['file']['search'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_file'], '"><span class="main_icons filter"></span></a> <a class="bbc_link" href="', $error['file']['href'], '" onclick="return reqWin(this.href, 600, 480, false);">', $error['file']['file'], '</a> (', $txt['line'], ' ', $error['file']['line'], ')';
echo '
</div>
<div class="half_content">
<strong class="floatright">
<span class="main_icons details"></span> <a class="bbc_link" href="', $scripturl, '?action=admin;area=logs;sa=errorlog;backtrace=', $error['id'], '" onclick="return reqWin(this.href, 600, 480, false);">', $txt['backtrace_title'], '</a>
</strong>
</div>
</div>
<div class="post">
<br class="clear">
<a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=error_type;value=', $error['error_type']['type'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_type'], '"><span class="main_icons filter"></span></a>', $txt['error_type'], ': ', $error['error_type']['type'] === 'critical' ? '<span class="error">' . $error['error_type']['name'] . '</span>' : $error['error_type']['name'], '<br>
<a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=message;value=', $error['message']['href'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_message'], '"><span class="main_icons filter floatleft"></span></a>
<div class="codeheader"><span class="code floatleft">' . $txt['error_message'] . '</span> <a class="codeoperation smf_select_text">' . $txt['code_select'] . '</a> <a class="codeoperation smf_expand_code hidden" data-shrink-txt="' . $txt['code_shrink'] . '" data-expand-txt="' . $txt['code_expand'] . '">' . $txt['code_expand'] . '</a>
</div><code class="bbc_code" style="white-space: pre-line; overflow-y: auto">', $error['message']['html'], '</code>
</div>
</div>';
}
echo '
<div class="pagesection">
<div class="pagelinks">
', $context['page_index'], '
</div>
<div class="floatright">
<input type="submit" name="removeSelection" value="', $txt['remove_selection'], '" data-confirm="', $txt['remove_selection_confirm'], '" class="button you_sure">
<input type="submit" name="delall" value="', ($context['has_filter'] ? $txt['remove_filtered_results'] : $txt['remove_all']), '" data-confirm="', ($context['has_filter'] ? $txt['remove_filtered_results_confirm'] : $txt['sure_about_errorlog_remove']), '" class="button you_sure">
</div>
</div>';
if ($context['sort_direction'] == 'down')
echo '
<input type="hidden" name="desc" value="1">';
echo '
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-el_token_var'], '" value="', $context['admin-el_token'], '">
</form>';
}
/**
* This template shows a snippet of code from a file and highlights which line caused the error.
*/
function template_show_file()
{
global $context, $settings, $modSettings;
echo '<!DOCTYPE html>
<html', $context['right_to_left'] ? ' dir="rtl"' : '', '>
<head>
<meta charset="', $context['character_set'], '">
<title>', $context['file_data']['file'], '</title>
', template_css(), '
</head>
<body>
<table class="errorfile_table">';
foreach ($context['file_data']['contents'] as $index => $line)
{
$line_num = $index + $context['file_data']['min'];
$is_target = $line_num == $context['file_data']['target'];
echo '
<tr>
<td class="file_line', $is_target ? ' current">==&gt;' : '">', $line_num, ':</td>
<td ', $is_target ? 'class="current"' : '', '>', $line, '</td>
</tr>';
}
echo '
</table>
</body>
</html>';
}
/**
* This template handles showing attachment-related errors
*/
function template_attachment_errors()
{
global $context, $scripturl, $txt;
echo '
<div>
<div class="cat_bar">
<h2 class="catbg">
', $context['error_title'], '
</h2>
</div>
<div class="windowbg">
<div class="padding">
<div class="noticebox">',
$context['error_message'], '
</div>';
if (!empty($context['back_link']))
echo '
<a class="button" href="', $scripturl, $context['back_link'], '">', $txt['back'], '</a>';
echo '
<span style="float: right; margin:.5em;"></span>
<a class="button" href="', $scripturl, $context['redirect_link'], '">', $txt['continue'], '</a>
</div>
</div>
</div>';
}
/**
* This template shows a backtrace of the given error
*/
function template_show_backtrace()
{
global $context, $settings, $modSettings, $txt, $scripturl;
echo '<!DOCTYPE html>
<html', $context['right_to_left'] ? ' dir="rtl"' : '', '>
<head>
<meta charset="', $context['character_set'], '">
<title>', $txt['backtrace_title'], '</title>';
template_css();
echo '
</head>
<body class="padding">';
if (!empty($context['error_info']))
{
echo '
<div class="cat_bar">
<h2 class="catbg">
', $txt['error'], '
</h2>
</div>
<div class="windowbg" id="backtrace">
<table class="table_grid">
<tbody>';
if (!empty($context['error_info']['error_type']))
echo '
<tr class="title_bar">
<td><strong>', $txt['error_type'], '</strong></td>
</tr>
<tr class="windowbg">
<td>', ucfirst($context['error_info']['error_type']), '</td>
</tr>';
if (!empty($context['error_info']['message']))
echo '
<tr class="title_bar">
<td><strong>', $txt['error_message'], '</strong></td>
</tr>
<tr class="windowbg lefttext">
<td><code class="bbc_code" style="white-space: pre-line; overflow-y: auto">', $context['error_info']['message'], '</code></td>
</tr>';
if (!empty($context['error_info']['file']))
echo '
<tr class="title_bar">
<td><strong>', $txt['error_file'], '</strong></td>
</tr>
<tr class="windowbg">
<td>', $context['error_info']['file'], '</td>
</tr>';
if (!empty($context['error_info']['line']))
echo '
<tr class="title_bar">
<td><strong>', $txt['error_line'], '</strong></td>
</tr>
<tr class="windowbg">
<td>', $context['error_info']['line'], '</td>
</tr>';
if (!empty($context['error_info']['url']))
echo '
<tr class="title_bar">
<td><strong>', $txt['error_url'], '</strong></td>
</tr>
<tr class="windowbg word_break">
<td>', $context['error_info']['url'], '</td>
</tr>';
echo '
</tbody>
</table>
</div>';
}
if (!empty($context['error_info']['backtrace']))
{
echo '
<div class="cat_bar">
<h2 class="catbg">
', $txt['backtrace_title'], '
</h2>
</div>
<div class="windowbg">
<ul class="padding">';
foreach ($context['error_info']['backtrace'] as $key => $value)
{
//Check for existing
if (!property_exists($value, 'file') || empty($value->file))
$value->file = $txt['unknown'];
if (!property_exists($value, 'line') || empty($value->line))
$value->line = -1;
echo '
<li class="backtrace">', sprintf($txt['backtrace_info'], $key, $value->function, $value->file, $value->line, base64_encode($value->file), $scripturl), '</li>';
}
echo '
</ul>
</div>';
}
echo '
</body>
</html>';
}
?>

View file

@ -0,0 +1,273 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* This function displays all the stuff you get with a richedit box - BBC, smileys, etc.
*
* @param string $editor_id The editor ID
* @param null|bool $smileyContainer If null, hides the smiley section regardless of settings
* @param null|bool $bbcContainer If null, hides the bbcode buttons regardless of settings
*/
function template_control_richedit($editor_id, $smileyContainer = null, $bbcContainer = null)
{
global $context, $settings, $modSettings, $smcFunc;
$editor_context = &$context['controls']['richedit'][$editor_id];
if ($smileyContainer === null)
$editor_context['sce_options']['emoticonsEnabled'] = false;
if ($bbcContainer === null)
$editor_context['sce_options']['toolbar'] = '';
echo '
<textarea class="editor" name="', $editor_id, '" id="', $editor_id, '" cols="600" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);" tabindex="', $context['tabindex']++, '" style="width: ', $editor_context['width'], '; height: ', $editor_context['height'], ';', isset($context['post_error']['no_message']) || isset($context['post_error']['long_message']) ? 'border: 1px solid red;' : '', '"', !empty($context['editor']['required']) ? ' required' : '', '>', $editor_context['value'], '</textarea>
<div id="', $editor_id, '_resizer" class="richedit_resize"></div>
<input type="hidden" name="', $editor_id, '_mode" id="', $editor_id, '_mode" value="0">
<script>
$(document).ready(function() {
', !empty($context['bbcodes_handlers']) ? $context['bbcodes_handlers'] : '', '
var textarea = $("#', $editor_id, '").get(0);
sceditor.create(textarea, ', $smcFunc['json_encode']($editor_context['sce_options'], JSON_PRETTY_PRINT), ');';
if ($editor_context['sce_options']['emoticonsEnabled'])
echo '
sceditor.instance(textarea).createPermanentDropDown();';
if (empty($editor_context['rich_active']))
echo '
sceditor.instance(textarea).toggleSourceMode();';
if (isset($context['post_error']['no_message']) || isset($context['post_error']['long_message']))
echo '
$(".sceditor-container").find("textarea").each(function() {$(this).css({border: "1px solid red"})});
$(".sceditor-container").find("iframe").each(function() {$(this).css({border: "1px solid red"})});';
echo '
});';
// Now for backward compatibility let's collect few infos in the good ol' style
echo '
var oEditorHandle_', $editor_id, ' = new smc_Editor({
sUniqueId: ', JavaScriptEscape($editor_id), ',
sEditWidth: ', JavaScriptEscape($editor_context['width']), ',
sEditHeight: ', JavaScriptEscape($editor_context['height']), ',
bRichEditOff: ', empty($modSettings['disable_wysiwyg']) ? 'false' : 'true', ',
oSmileyBox: null,
oBBCBox: null
});
smf_editorArray[smf_editorArray.length] = oEditorHandle_', $editor_id, ';
</script>';
}
/**
* This template shows the form buttons at the bottom of the editor
*
* @param string $editor_id The editor ID
*/
function template_control_richedit_buttons($editor_id)
{
global $context, $settings, $txt, $modSettings;
$editor_context = &$context['controls']['richedit'][$editor_id];
echo '
<span class="smalltext">
', $context['shortcuts_text'], '
</span>
<span class="post_button_container">';
$tempTab = $context['tabindex'];
if (!empty($context['drafts_pm_save']))
$tempTab++;
elseif (!empty($context['drafts_save']))
$tempTab++;
elseif ($editor_context['preview_type'])
$tempTab++;
elseif ($context['show_spellchecking'])
$tempTab++;
$tempTab++;
$context['tabindex'] = $tempTab;
foreach ($context['richedit_buttons'] as $name => $button) {
if ($name == 'spell_check') {
$button['onclick'] = 'oEditorHandle_' . $editor_id . '.spellCheckStart();';
}
if ($name == 'preview') {
$button['value'] = isset($editor_context['labels']['preview_button']) ? $editor_context['labels']['preview_button'] : $button['value'];
$button['onclick'] = $editor_context['preview_type'] == 2 ? '' : 'return submitThisOnce(this);';
$button['show'] = $editor_context['preview_type'];
}
if ($button['show']) {
echo '
<input type="', $button['type'], '"', $button['type'] == 'hidden' ? ' id="' . $name . '"' : '', ' name="', $name, '" value="', $button['value'], '"', $button['type'] != 'hidden' ? ' tabindex="' . --$tempTab . '"' : '', !empty($button['onclick']) ? ' onclick="' . $button['onclick'] . '"' : '', !empty($button['accessKey']) ? ' accesskey="' . $button['accessKey'] . '"' : '', $button['type'] != 'hidden' ? ' class="button"' : '', '>';
}
}
echo '
<input type="submit" value="', isset($editor_context['labels']['post_button']) ? $editor_context['labels']['post_button'] : $txt['post'], '" name="post" tabindex="', --$tempTab, '" onclick="return submitThisOnce(this);" accesskey="s" class="button">
</span>';
// Load in the PM autosaver if it's enabled
if (!empty($context['drafts_pm_save']) && !empty($context['drafts_autosave']))
echo '
<span class="righttext padding" style="display: block">
<span id="throbber" style="display:none"><img src="' . $settings['images_url'] . '/loading_sm.gif" alt="" class="centericon"></span>
<span id="draft_lastautosave" ></span>
</span>
<script>
var oDraftAutoSave = new smf_DraftAutoSave({
sSelf: \'oDraftAutoSave\',
sLastNote: \'draft_lastautosave\',
sLastID: \'id_pm_draft\',
sSceditorID: \'', $editor_id, '\',
sType: \'post\',
bPM: true,
iBoard: 0,
iFreq: ', (empty($modSettings['drafts_autosave_frequency']) ? 60000 : $modSettings['drafts_autosave_frequency'] * 1000), '
});
</script>';
// Start an instance of the auto saver if its enabled
if (!empty($context['drafts_save']) && !empty($context['drafts_autosave']))
echo '
<span class="righttext padding" style="display: block">
<span id="throbber" style="display:none"><img src="', $settings['images_url'], '/loading_sm.gif" alt="" class="centericon"></span>
<span id="draft_lastautosave" ></span>
</span>
<script>
var oDraftAutoSave = new smf_DraftAutoSave({
sSelf: \'oDraftAutoSave\',
sLastNote: \'draft_lastautosave\',
sLastID: \'id_draft\',
sSceditorID: \'', $editor_id, '\',
sType: \'post\',
iBoard: ', (empty($context['current_board']) ? 0 : $context['current_board']), ',
iFreq: ', $context['drafts_autosave_frequency'], '
});
</script>';
}
/**
* This template displays a verification form
*
* @param int|string $verify_id The verification control ID
* @param string $display_type What type to display. Can be 'single' to only show one verification option or 'all' to show all of them
* @param bool $reset Whether to reset the internal tracking counter
* @return bool False if there's nothing else to show, true if $display_type is 'single', nothing otherwise
*/
function template_control_verification($verify_id, $display_type = 'all', $reset = false)
{
global $context, $txt;
$verify_context = &$context['controls']['verification'][$verify_id];
// Keep track of where we are.
if (empty($verify_context['tracking']) || $reset)
$verify_context['tracking'] = 0;
// How many items are there to display in total.
$total_items = count($verify_context['questions']) + ($verify_context['show_visual'] || $verify_context['can_recaptcha'] ? 1 : 0);
// If we've gone too far, stop.
if ($verify_context['tracking'] > $total_items)
return false;
// Loop through each item to show them.
for ($i = 0; $i < $total_items; $i++)
{
// If we're after a single item only show it if we're in the right place.
if ($display_type == 'single' && $verify_context['tracking'] != $i)
continue;
if ($display_type != 'single')
echo '
<div id="verification_control_', $i, '" class="verification_control">';
// Display empty field, but only if we have one, and it's the first time.
if ($verify_context['empty_field'] && empty($i))
echo '
<div class="smalltext vv_special">
', $txt['visual_verification_hidden'], ':
<input type="text" name="', $_SESSION[$verify_id . '_vv']['empty_field'], '" autocomplete="off" size="30" value="">
</div>';
// Do the actual stuff
if ($i == 0 && ($verify_context['show_visual'] || $verify_context['can_recaptcha']))
{
if ($verify_context['show_visual'])
{
if ($context['use_graphic_library'])
echo '
<img src="', $verify_context['image_href'], '" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '">';
else
echo '
<img src="', $verify_context['image_href'], ';letter=1" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_1">
<img src="', $verify_context['image_href'], ';letter=2" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_2">
<img src="', $verify_context['image_href'], ';letter=3" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_3">
<img src="', $verify_context['image_href'], ';letter=4" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_4">
<img src="', $verify_context['image_href'], ';letter=5" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_5">
<img src="', $verify_context['image_href'], ';letter=6" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_6">';
echo '
<div class="smalltext" style="margin: 4px 0 8px 0;">
<a href="', $verify_context['image_href'], ';sound" id="visual_verification_', $verify_id, '_sound" rel="nofollow">', $txt['visual_verification_sound'], '</a> / <a href="#visual_verification_', $verify_id, '_refresh" id="visual_verification_', $verify_id, '_refresh">', $txt['visual_verification_request_new'], '</a>', $display_type != 'quick_reply' ? '<br>' : '', '<br>
', $txt['visual_verification_description'], ':', $display_type != 'quick_reply' ? '<br>' : '', '
<input type="text" name="', $verify_id, '_vv[code]" value="" size="30" tabindex="', $context['tabindex']++, '" autocomplete="off" required>
</div>';
}
if ($verify_context['can_recaptcha'])
{
$lang = (isset($txt['lang_recaptcha']) ? $txt['lang_recaptcha'] : $txt['lang_dictionary']);
echo '
<div class="g-recaptcha centertext" data-sitekey="' . $verify_context['recaptcha_site_key'] . '" data-theme="' . $verify_context['recaptcha_theme'] . '"></div>
<br>
<script type="text/javascript" src="https://www.google.com/recaptcha/api.js?hl=' . $lang . '"></script>';
}
}
else
{
// Where in the question array is this question?
$qIndex = $verify_context['show_visual'] || $verify_context['can_recaptcha'] ? $i - 1 : $i;
if (isset($verify_context['questions'][$qIndex]))
echo '
<div class="smalltext">
', $verify_context['questions'][$qIndex]['q'], ':<br>
<input type="text" name="', $verify_id, '_vv[q][', $verify_context['questions'][$qIndex]['id'], ']" size="30" value="', $verify_context['questions'][$qIndex]['a'], '" ', $verify_context['questions'][$qIndex]['is_error'] ? 'style="border: 1px red solid;"' : '', ' tabindex="', $context['tabindex']++, '" required>
</div>';
}
if ($display_type != 'single')
echo '
</div><!-- #verification_control_[i] -->';
// If we were displaying just one and we did it, break.
if ($display_type == 'single' && $verify_context['tracking'] == $i)
break;
}
// Assume we found something, always.
$verify_context['tracking']++;
// Tell something displaying piecemeal to keep going.
if ($display_type == 'single')
return true;
}
?>

187
GenericList.template.php Normal file
View file

@ -0,0 +1,187 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* This template handles displaying a list
*
* @param string $list_id The list ID. If null, uses $context['default_list'].
*/
function template_show_list($list_id = null)
{
global $context;
// Get a shortcut to the current list.
$list_id = $list_id === null ? (!empty($context['default_list']) ? $context['default_list'] : '') : $list_id;
if (empty($list_id) || empty($context[$list_id]))
return;
$cur_list = &$context[$list_id];
if (isset($cur_list['form']))
echo '
<form action="', $cur_list['form']['href'], '" method="post"', empty($cur_list['form']['name']) ? '' : ' name="' . $cur_list['form']['name'] . '" id="' . $cur_list['form']['name'] . '"', ' accept-charset="', $context['character_set'], '">';
// Show the title of the table (if any).
if (!empty($cur_list['title']))
echo '
<div class="cat_bar">
<h2 class="catbg">
', $cur_list['title'], '
</h2>
</div>';
if (isset($cur_list['additional_rows']['after_title']))
{
echo '
<div class="information flow_hidden">';
template_additional_rows('after_title', $cur_list);
echo '
</div>';
}
if (isset($cur_list['additional_rows']['top_of_list']))
template_additional_rows('top_of_list', $cur_list);
if ((!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) || isset($cur_list['additional_rows']['above_column_headers']))
{
// Show the page index (if this list doesn't intend to show all items).
if (!empty($cur_list['items_per_page']) && !empty($cur_list['page_index']))
echo '
<div class="pagesection">
<div class="pagelinks">', $cur_list['page_index'], '</div>
</div>';
if (isset($cur_list['additional_rows']['above_column_headers']))
template_additional_rows('above_column_headers', $cur_list);
}
echo '
<table class="table_grid" ', !empty($list_id) ? 'id="' . $list_id . '"' : '', ' ', !empty($cur_list['width']) ? ' style="width:' . $cur_list['width'] . '"' : '', '>';
// Show the column headers.
$header_count = count($cur_list['headers']);
if (!($header_count < 2 && empty($cur_list['headers'][0]['label'])))
{
echo '
<thead>
<tr class="title_bar">';
// Loop through each column and add a table header.
foreach ($cur_list['headers'] as $col_header)
echo '
<th scope="col" id="header_', $list_id, '_', $col_header['id'], '" class="', $col_header['id'], empty($col_header['class']) ? '' : ' ' . $col_header['class'], '"', empty($col_header['style']) ? '' : ' style="' . $col_header['style'] . '"', empty($col_header['colspan']) ? '' : ' colspan="' . $col_header['colspan'] . '"', '>
', empty($col_header['href']) ? '' : '<a href="' . $col_header['href'] . '" rel="nofollow">', empty($col_header['label']) ? '' : $col_header['label'], empty($col_header['href']) ? '' : (empty($col_header['sort_image']) ? '</a>' : ' <span class="main_icons sort_' . $col_header['sort_image'] . '"></span></a>'), '
</th>';
echo '
</tr>
</thead>';
}
echo '
<tbody>';
// Show a nice message informing there are no items in this list.
if (empty($cur_list['rows']) && !empty($cur_list['no_items_label']))
echo '
<tr class="windowbg">
<td colspan="', $cur_list['num_columns'], '" class="', !empty($cur_list['no_items_align']) ? $cur_list['no_items_align'] : 'centertext', '">
', $cur_list['no_items_label'], '
</td>
</tr>';
// Show the list rows.
elseif (!empty($cur_list['rows']))
{
foreach ($cur_list['rows'] as $id => $row)
{
echo '
<tr class="', empty($row['class']) ? 'windowbg' : $row['class'], '"', empty($row['style']) ? '' : ' style="' . $row['style'] . '"', ' id="list_', $list_id, '_', $id, '">';
if (!empty($row['data']))
foreach ($row['data'] as $row_id => $row_data)
echo '
<td class="', $row_id, empty($row_data['class']) ? '' : ' ' . $row_data['class'] . '', '"', empty($row_data['style']) ? '' : ' style="' . $row_data['style'] . '"', '>
', $row_data['value'], '
</td>';
echo '
</tr>';
}
}
echo '
</tbody>
</table>';
if ((!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) || isset($cur_list['additional_rows']['below_table_data']))
{
echo '
<div class="flow_auto">';
// Show the page index (if this list doesn't intend to show all items).
if (!empty($cur_list['items_per_page']) && !empty($cur_list['page_index']))
echo '
<div class="pagesection floatleft">
<div class="pagelinks">', $cur_list['page_index'], '</div>
</div>';
if (isset($cur_list['additional_rows']['below_table_data']))
template_additional_rows('below_table_data', $cur_list);
echo '
</div>';
}
if (isset($cur_list['additional_rows']['bottom_of_list']))
template_additional_rows('bottom_of_list', $cur_list);
if (isset($cur_list['form']))
{
foreach ($cur_list['form']['hidden_fields'] as $name => $value)
echo '
<input type="hidden" name="', $name, '" value="', $value, '">';
if (isset($cur_list['form']['token']))
echo '
<input type="hidden" name="', $context[$cur_list['form']['token'] . '_token_var'], '" value="', $context[$cur_list['form']['token'] . '_token'], '">';
echo '
</form>';
}
if (isset($cur_list['javascript']))
echo '
<script>
', $cur_list['javascript'], '
</script>';
}
/**
* This template displays additional rows above or below the list.
*
* @param string $row_position The position ('top', 'bottom', etc.)
* @param array $cur_list An array with the data for the current list
*/
function template_additional_rows($row_position, $cur_list)
{
foreach ($cur_list['additional_rows'][$row_position] as $row)
echo '
<div class="additional_row', empty($row['class']) ? '' : ' ' . $row['class'], '"', empty($row['style']) ? '' : ' style="' . $row['style'] . '"', '>
', $row['value'], '
</div>';
}
?>

308
GenericMenu.template.php Normal file
View file

@ -0,0 +1,308 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* This contains the HTML for the menu bar at the top of the admin center.
*/
function template_generic_menu_dropdown_above()
{
global $context, $txt;
// Which menu are we rendering?
$context['cur_menu_id'] = isset($context['cur_menu_id']) ? $context['cur_menu_id'] + 1 : 1;
$menu_context = &$context['menu_data_' . $context['cur_menu_id']];
$menu_label = isset($context['admin_menu_name']) ? $txt['admin_center'] : (isset($context['moderation_menu_name']) ? $txt['moderation_center'] : '');
// Load the menu
// Add mobile menu as well
echo '
<a class="mobile_generic_menu_', $context['cur_menu_id'], '">
<div class="khbb_mobile_button">
<span class="menu_icon"></span>
<span class="text_menu">', sprintf($txt['mobile_generic_menu'], $menu_label), '</span>
</div>
</a>
<nav id="genericmenu">
<div id="mobile_generic_menu_', $context['cur_menu_id'], '" class="popup_container">
<div class="popup_window description">
<div class="popup_heading">
', sprintf($txt['mobile_generic_menu'], $menu_label), '
<a href="javascript:void(0);" class="main_icons hide_popup"></a>
</div>
', template_generic_menu($menu_context), '
</div>
</div>
</nav>
<script>
$( ".mobile_generic_menu_', $context['cur_menu_id'], '" ).click(function() {
$( "#mobile_generic_menu_', $context['cur_menu_id'], '" ).show();
});
$( ".hide_popup" ).click(function() {
$( "#mobile_generic_menu_', $context['cur_menu_id'], '" ).hide();
});
</script>';
// This is the main table - we need it so we can keep the content to the right of it.
echo '
<div id="admin_content">';
// It's possible that some pages have their own tabs they wanna force...
// if (!empty($context['tabs']))
template_generic_menu_tabs($menu_context);
}
/**
* Part of the admin layer - used with generic_menu_dropdown_above to close the admin content div.
*/
function template_generic_menu_dropdown_below()
{
echo '
</div><!-- #admin_content -->';
}
/**
* The template for displaying a menu
*
* @param array $menu_context An array of menu information
*/
function template_generic_menu(&$menu_context)
{
global $context;
echo '
<div class="generic_menu">
<ul class="dropmenu dropdown_menu_', $context['cur_menu_id'], '">';
// Main areas first.
foreach ($menu_context['sections'] as $section)
{
echo '
<li ', !empty($section['areas']) ? 'class="subsections"' : '', '><a class="', !empty($section['selected']) ? 'active ' : '', '" href="', $section['url'], $menu_context['extra_parameters'], '">', $section['title'], !empty($section['amt']) ? ' <span class="amt">' . $section['amt'] . '</span>' : '', '</a>
<ul>';
// For every area of this section show a link to that area (bold if it's currently selected.)
// @todo Code for additional_items class was deprecated and has been removed. Suggest following up in Sources if required.
foreach ($section['areas'] as $i => $area)
{
// Not supposed to be printed?
if (empty($area['label']))
continue;
echo '
<li', !empty($area['subsections']) && empty($area['hide_subsections']) ? ' class="subsections"' : '', '>
<a class="', $area['icon_class'], !empty($area['selected']) ? ' chosen ' : '', '" href="', (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i), $menu_context['extra_parameters'], '">', $area['icon'], $area['label'], !empty($area['amt']) ? ' <span class="amt">' . $area['amt'] . '</span>' : '', '</a>';
// Is this the current area, or just some area?
if (!empty($area['selected']) && empty($context['tabs']))
$context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array();
// Are there any subsections?
if (!empty($area['subsections']) && empty($area['hide_subsections']))
{
echo '
<ul>';
foreach ($area['subsections'] as $sa => $sub)
{
if (!empty($sub['disabled']))
continue;
$url = isset($sub['url']) ? $sub['url'] : (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i) . ';sa=' . $sa;
echo '
<li>
<a ', !empty($sub['selected']) ? 'class="chosen" ' : '', ' href="', $url, $menu_context['extra_parameters'], '">', $sub['label'], !empty($sub['amt']) ? ' <span class="amt">' . $sub['amt'] . '</span>' : '', '</a>
</li>';
}
echo '
</ul>';
}
echo '
</li>';
}
echo '
</ul>
</li>';
}
echo '
</ul><!-- .dropmenu -->
</div><!-- .generic_menu -->';
}
/**
* The code for displaying the menu
*
* @param array $menu_context An array of menu context data
*/
function template_generic_menu_tabs(&$menu_context)
{
global $context, $settings, $scripturl, $txt;
// Handy shortcut.
$tab_context = &$menu_context['tab_data'];
if (!empty($tab_context['title']))
{
echo '
<div class="cat_bar">';
// The function is in Admin.template.php, but since this template is used elsewhere too better check if the function is available
if (function_exists('template_admin_quick_search'))
template_admin_quick_search();
echo '
<h2 class="catbg">';
// Exactly how many tabs do we have?
if (!empty($context['tabs']))
{
foreach ($context['tabs'] as $id => $tab)
{
// Can this not be accessed?
if (!empty($tab['disabled']))
{
$tab_context['tabs'][$id]['disabled'] = true;
continue;
}
// Did this not even exist - or do we not have a label?
if (!isset($tab_context['tabs'][$id]))
$tab_context['tabs'][$id] = array('label' => $tab['label']);
elseif (!isset($tab_context['tabs'][$id]['label']))
$tab_context['tabs'][$id]['label'] = $tab['label'];
// Has a custom URL defined in the main admin structure?
if (isset($tab['url']) && !isset($tab_context['tabs'][$id]['url']))
$tab_context['tabs'][$id]['url'] = $tab['url'];
// Any additional parameters for the url?
if (isset($tab['add_params']) && !isset($tab_context['tabs'][$id]['add_params']))
$tab_context['tabs'][$id]['add_params'] = $tab['add_params'];
// Has it been deemed selected?
if (!empty($tab['is_selected']))
$tab_context['tabs'][$id]['is_selected'] = true;
// Does it have its own help?
if (!empty($tab['help']))
$tab_context['tabs'][$id]['help'] = $tab['help'];
// Is this the last one?
if (!empty($tab['is_last']) && !isset($tab_context['override_last']))
$tab_context['tabs'][$id]['is_last'] = true;
}
// Find the selected tab
foreach ($tab_context['tabs'] as $sa => $tab)
{
if (!empty($tab['is_selected']) || (isset($menu_context['current_subsection']) && $menu_context['current_subsection'] == $sa))
{
$selected_tab = $tab;
$tab_context['tabs'][$sa]['is_selected'] = true;
}
}
}
// Show an icon and/or a help item?
if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class']) || !empty($selected_tab['icon']) || !empty($tab_context['icon']) || !empty($selected_tab['help']) || !empty($tab_context['help']))
{
if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class']))
echo '
<span class="', !empty($selected_tab['icon_class']) ? $selected_tab['icon_class'] : $tab_context['icon_class'], ' icon"></span>';
elseif (!empty($selected_tab['icon']) || !empty($tab_context['icon']))
echo '
<img src="', $settings['images_url'], '/icons/', !empty($selected_tab['icon']) ? $selected_tab['icon'] : $tab_context['icon'], '" alt="" class="icon">';
if (!empty($selected_tab['help']) || !empty($tab_context['help']))
echo '
<a href="', $scripturl, '?action=helpadmin;help=', !empty($selected_tab['help']) ? $selected_tab['help'] : $tab_context['help'], '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="main_icons help" title="', $txt['help'], '"></span></a>';
echo $tab_context['title'];
}
else
echo '
', $tab_context['title'];
echo '
</h2>
</div><!-- .cat_bar -->';
}
// Shall we use the tabs? Yes, it's the only known way!
if (!empty($selected_tab['description']) || !empty($tab_context['description']))
echo '
<p class="information">
', !empty($selected_tab['description']) ? $selected_tab['description'] : $tab_context['description'], '
</p>';
// Print out all the items in this tab (if any).
if (!empty($context['tabs']))
{
// The admin tabs.
echo '
<a class="mobile_generic_menu_', $context['cur_menu_id'], '_tabs">
<div class="khbb_mobile_button">
<span class="menu_icon"></span>
<span class="text_menu">', sprintf($txt['mobile_generic_menu'], $tab_context['title']), '</span>
</div>
</a>
<div id="adm_submenus">
<div id="mobile_generic_menu_', $context['cur_menu_id'], '_tabs" class="popup_container">
<div class="popup_window description">
<div class="popup_heading">
', sprintf($txt['mobile_generic_menu'], $tab_context['title']), '
<a href="javascript:void(0);" class="main_icons hide_popup"></a>
</div>';
echo '
<div class="generic_menu">
<ul class="dropmenu dropdown_menu_', $context['cur_menu_id'], '_tabs">';
foreach ($tab_context['tabs'] as $sa => $tab)
{
if (!empty($tab['disabled']))
continue;
if (!empty($tab['is_selected']))
echo '
<li>
<a class="active" href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '">', $tab['label'], '</a>
</li>';
else
echo '
<li>
<a href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '">', $tab['label'], '</a>
</li>';
}
// The end of tabs
echo '
</ul>
</div>
</div>
</div>
</div><!-- #adm_submenus -->
<script>
$( ".mobile_generic_menu_', $context['cur_menu_id'], '_tabs" ).click(function() {
$( "#mobile_generic_menu_', $context['cur_menu_id'], '_tabs" ).show();
});
$( ".hide_popup" ).click(function() {
$( "#mobile_generic_menu_', $context['cur_menu_id'], '_tabs" ).hide();
});
</script>';
}
}
?>

176
Help.template.php Normal file
View file

@ -0,0 +1,176 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.3
*/
/**
* This displays a help popup thingy
*/
function template_popup()
{
global $context, $settings, $txt, $modSettings;
// Since this is a popup of its own we need to start the html, etc.
echo '<!DOCTYPE html>
<html', $context['right_to_left'] ? ' dir="rtl"' : '', '>
<head>
<meta charset="', $context['character_set'], '">
<meta name="robots" content="noindex">
<title>', $context['page_title'], '</title>
', template_css(), '
<script src="', $settings['default_theme_url'], '/scripts/script.js', $context['browser_cache'], '"></script>
</head>
<body id="help_popup">
<div class="windowbg description">
', $context['help_text'], '<br>
<br>
<a href="javascript:self.close();">', $txt['close_window'], '</a>
</div>
</body>
</html>';
}
/**
* The template for the popup for finding members
*/
function template_find_members()
{
global $context, $settings, $scripturl, $modSettings, $txt;
echo '<!DOCTYPE html>
<html', $context['right_to_left'] ? ' dir="rtl"' : '', '>
<head>
<title>', $txt['find_members'], '</title>
<meta charset="', $context['character_set'], '">
<meta name="robots" content="noindex">
', template_css(), '
<script src="', $settings['default_theme_url'], '/scripts/script.js', $context['browser_cache'], '"></script>
<script>
var membersAdded = [];
function addMember(name)
{
var theTextBox = window.opener.document.getElementById("', $context['input_box_name'], '");
if (name in membersAdded)
return;
// If we only accept one name don\'t remember what is there.
if (', JavaScriptEscape($context['delimiter']), ' != \'null\')
membersAdded[name] = true;
if (theTextBox.value.length < 1 || ', JavaScriptEscape($context['delimiter']), ' == \'null\')
theTextBox.value = ', $context['quote_results'] ? '"\"" + name + "\""' : 'name', ';
else
theTextBox.value += ', JavaScriptEscape($context['delimiter']), ' + ', $context['quote_results'] ? '"\"" + name + "\""' : 'name', ';
window.focus();
}
</script>
</head>
<body id="help_popup">
<form action="', $scripturl, '?action=findmember;', $context['session_var'], '=', $context['session_id'], '" method="post" accept-charset="', $context['character_set'], '" class="padding description">
<div class="roundframe">
<div class="cat_bar">
<h2 class="catbg">', $txt['find_members'], '</h2>
</div>
<div class="padding">
<strong>', $txt['find_username'], ':</strong><br>
<input type="text" name="search" id="search" value="', isset($context['last_search']) ? $context['last_search'] : '', '" style="margin-top: 4px; width: 96%;"><br>
<span class="smalltext"><em>', $txt['find_wildcards'], '</em></span><br>';
// Only offer to search for buddies if we have some!
if (!empty($context['show_buddies']))
echo '
<span class="smalltext">
<label for="buddies"><input type="checkbox" name="buddies" id="buddies"', !empty($context['buddy_search']) ? ' checked' : '', '> ', $txt['find_buddies'], '</label>
</span><br>';
echo '
<div class="padding righttext">
<input type="submit" value="', $txt['search'], '" class="button">
<input type="button" value="', $txt['find_close'], '" onclick="window.close();" class="button">
</div>
</div><!-- .padding -->
</div><!-- .roundframe -->
<br>
<div class="roundframe">
<div class="cat_bar">
<h2 class="catbg">', $txt['find_results'], '</h2>
</div>';
if (empty($context['results']))
echo '
<p class="error">', $txt['find_no_results'], '</p>';
else
{
echo '
<ul class="padding">';
foreach ($context['results'] as $result)
echo '
<li class="windowbg">
<a href="', $result['href'], '" target="_blank" rel="noopener"> <span class="main_icons profile_sm"></span>
<a href="javascript:void(0);" onclick="addMember(this.innerHTML); return false;">', $result['name'], '</a>
</li>';
echo '
</ul>
<div class="pagesection">
<div class="pagelinks">', $context['page_index'], '</div>
</div>';
}
echo '
</div><!-- .roundframe -->
<input type="hidden" name="input" value="', $context['input_box_name'], '">
<input type="hidden" name="delim" value="', $context['delimiter'], '">
<input type="hidden" name="quote" value="', $context['quote_results'] ? '1' : '0', '">
</form>';
if (empty($context['results']))
echo '
<script>
document.getElementById("search").focus();
</script>';
echo '
</body>
</html>';
}
/**
* The main help page
*/
function template_manual()
{
global $context, $scripturl, $txt;
echo '
<div class="cat_bar">
<h2 class="catbg">', $txt['manual_smf_user_help'], '</h2>
</div>
<div id="help_container">
<div id="helpmain" class="windowbg">
<p>', sprintf($txt['manual_welcome'], $context['forum_name_html_safe']), '</p>
<p>', $txt['manual_introduction'], '</p>
<ul>';
foreach ($context['manual_sections'] as $section_id => $wiki_id)
echo '
<li><a href="', $context['wiki_url'], '/', $context['wiki_prefix'], $wiki_id, ($txt['lang_dictionary'] != 'en' ? '/' . $txt['lang_dictionary'] : ''), '" target="_blank" rel="noopener">', $txt['manual_section_' . $section_id . '_title'], '</a> - ', $txt['manual_section_' . $section_id . '_desc'], '</li>';
echo '
</ul>
<p>', sprintf($txt['manual_docs_and_credits'], $context['wiki_url'], $scripturl . '?action=credits'), '</p>
</div><!-- #helpmain -->
</div><!-- #help_container -->';
}
?>

102
Likes.template.php Normal file
View file

@ -0,0 +1,102 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.3
*/
/**
* This shows the popup that shows who likes a particular post.
*/
function template_popup()
{
global $context, $settings, $txt, $modSettings;
// Since this is a popup of its own we need to start the html, etc.
echo '<!DOCTYPE html>
<html', $context['right_to_left'] ? ' dir="rtl"' : '', '>
<head>
<meta charset="', $context['character_set'], '">
<meta name="robots" content="noindex">
<title>', $context['page_title'], '</title>
', template_css(), '
<script src="', $settings['default_theme_url'], '/scripts/script.js', $context['browser_cache'], '"></script>
</head>
<body id="likes_popup">
<div class="windowbg">
<ul id="likes">';
foreach ($context['likers'] as $liker => $like_details)
echo '
<li>
', $like_details['profile']['avatar']['image'], '
<span class="like_profile">
', $like_details['profile']['link_color'], '
<span class="description">', $like_details['profile']['group'], '</span>
</span>
<span class="floatright like_time">', $like_details['time'], '</span>
</li>';
echo '
</ul>
<br class="clear">
<a href="javascript:self.close();">', $txt['close_window'], '</a>
</div><!-- .windowbg -->
</body>
</html>';
}
/**
* Display a like button and info about how many people liked something
*/
function template_like()
{
global $context, $scripturl, $txt;
echo '
<ul class="floatleft">';
if (!empty($context['data']['can_like']))
echo '
<li class="smflikebutton" id="', $context['data']['type'], '_', $context['data']['id_content'], '_likes"', '>
<a href="', $scripturl, '?action=likes;ltype=', $context['data']['type'], ';sa=like;like=', $context['data']['id_content'], ';', $context['session_var'], '=', $context['session_id'], '" class="', $context['data']['type'], '_like"><span class="main_icons ', $context['data']['already_liked'] ? 'unlike' : 'like', '"></span> ', $context['data']['already_liked'] ? $txt['unlike'] : $txt['like'], '</a>
</li>';
if (!empty($context['data']['count']))
{
$context['some_likes'] = true;
$count = $context['data']['count'];
$base = 'likes_';
if ($context['data']['already_liked'])
{
$base = 'you_' . $base;
$count--;
}
$base .= (isset($txt[$base . $count])) ? $count : 'n';
echo '
<li class="like_count smalltext">', sprintf($txt[$base], $scripturl . '?action=likes;sa=view;ltype=' . $context['data']['type'] . ';js=1;like=' . $context['data']['id_content'] . ';' . $context['session_var'] . '=' . $context['session_id'], comma_format($count)), '</li>';
}
echo '
</ul>';
}
/**
* A generic template that outputs any data passed to it...
*/
function template_generic()
{
global $context;
echo $context['data'];
}
?>

503
Login.template.php Normal file
View file

@ -0,0 +1,503 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* This is just the basic "login" form.
*/
function template_login()
{
global $context, $settings, $scripturl, $modSettings, $txt;
echo '
<div class="login">
<div class="khbiseau_topright_color"></div>
<div class="cat_bar">
<h2 class="catbg">
<span class="main_icons login"></span> ', $txt['login'], '
</h2>
</div>
<div class="roundframe">
<form class="login" action="', $context['login_url'], '" name="frmLogin" id="frmLogin" method="post" accept-charset="', $context['character_set'], '">';
// Did they make a mistake last time?
if (!empty($context['login_errors']))
echo '
<div class="errorbox">', implode('<br>', $context['login_errors']), '</div>
<br>';
// Or perhaps there's some special description for this time?
if (isset($context['description']))
echo '
<div class="information">', $context['description'], '</div>';
// Now just get the basic information - username, password, etc.
echo '
<fieldset>
<legend>', $txt['khbb_connexion_info'], '</legend>
<label for="', !empty($context['from_ajax']) ? 'ajax_' : '', 'loginuser">', $txt['username'], ' :
<input type="text" id="', !empty($context['from_ajax']) ? 'ajax_' : '', 'loginuser" name="user" size="20" value="', $context['default_username'], '" required>
</label>
<label for="', !empty($context['from_ajax']) ? 'ajax_' : '', 'loginpass">', $txt['password'], ' :
<input type="password" id="', !empty($context['from_ajax']) ? 'ajax_' : '', 'loginpass" name="passwrd" value="', $context['default_password'], '" size="20" required>
</label>
<label for="cookielength">', $txt['time_logged_in'], ':
<select name="cookielength" id="cookielength">';
foreach ($context['login_cookie_times'] as $cookie_time => $cookie_txt)
echo '
<option value="', $cookie_time, '"', $modSettings['cookieTime'] == $cookie_time ? ' selected' : '', '>', $txt[$cookie_txt], '</option>';
echo '</select>
</label>
';
// If they have deleted their account, give them a chance to change their mind.
if (isset($context['login_show_undelete']))
echo '
<label for="undelete" class="alert">', $txt['undelete_account'], ':</label>
<input type="checkbox" name="undelete" id="undelete">';
echo '
<p>
<input type="submit" value="', $txt['login'], '" class="button">
</p>
<p class="smalltext">
<a href="', $scripturl, '?action=reminder">', $txt['forgot_your_password'], '</a>
</p>
</fieldset>';
if (!empty($modSettings['registration_method']) && $modSettings['registration_method'] == 1)
echo '
<p class="smalltext">
', sprintf($txt['welcome_guest_activate'], $scripturl), '
</p>';
echo '
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['login_token_var'], '" value="', $context['login_token'], '">
<script>
setTimeout(function() {
document.getElementById("', !empty($context['from_ajax']) ? 'ajax_' : '', isset($context['default_username']) && $context['default_username'] != '' ? 'loginpass' : 'loginuser', '").focus();
}, 150);';
if (!empty($context['from_ajax']) && ((empty($modSettings['allow_cors']) || empty($modSettings['allow_cors_credentials']) || empty($context['valid_cors_found']) || !in_array($context['valid_cors_found'], array('samel', 'subsite')))))
{
echo '
form = $("#frmLogin");
form.submit(function(e) {
e.preventDefault();
e.stopPropagation();
$.ajax({
url: form.prop("action") + ";ajax",
method: "POST",
headers: {
"X-SMF-AJAX": 1
},
xhrFields: {
withCredentials: typeof allow_xhjr_credentials !== "undefined" ? allow_xhjr_credentials : false
},
data: form.serialize(),
success: function(data) {';
// While a nice action is to replace the document body after a login, this may fail on CORS requests because the action may not be redirected back to the page they started the login process from. So for these cases, we simply just reload the page.
if (empty($context['valid_cors_found']) || $context['valid_cors_found'] == 'same')
echo '
if (data.indexOf("<bo" + "dy") > -1) {
document.open();
document.write(data);
document.close();
}
else
form.parent().html($(data).find(".roundframe").html());';
else
echo '
window.location.reload();';
echo '
},
error: function(xhr) {
var data = xhr.responseText;
if (data.indexOf("<bo" + "dy") > -1) {
document.open();
document.write(data);
document.close();
}
else
form.parent().html($(data).filter("#fatal_error").html());
}
});
return false;
});';
}
echo '
</script>
</form>';
if (!empty($context['can_register']))
echo '
<div class="centertext khbb_register">
', sprintf($txt['register_prompt'], $scripturl), '
</div>';
// It is a long story as to why we have this when we're clearly not going to use it.
if (!empty($context['from_ajax']))
echo '
<br>
<a href="javascript:self.close();"></a>';
echo '
</div><!-- .roundframe -->
<div class="khbiseau_bottom_white"></div>
</div><!-- .login -->';
}
/**
* TFA authentication form
*/
function template_login_tfa()
{
global $context, $scripturl, $txt;
echo '
<div class="login">
<div class="cat_bar">
<h2 class="catbg">
', $txt['tfa_profile_label'], '
</h2>
</div>
<div class="roundframe">';
if (!empty($context['tfa_error']) || !empty($context['tfa_backup_error']))
echo '
<div class="error">
', $txt['tfa_' . (!empty($context['tfa_error']) ? 'code_' : 'backup_') . 'invalid'], '
</div>';
echo '
<form action="', $context['tfa_url'], '" method="post" id="frmTfa">
<div id="tfaCode">
<p style="margin-bottom: 0.5em">', $txt['tfa_login_desc'], '</p>
<div class="centertext">
<strong>', $txt['tfa_code'], ':</strong>
<input type="text" name="tfa_code" value="', !empty($context['tfa_value']) ? $context['tfa_value'] : '', '">
<input type="submit" class="button" name="submit" value="', $txt['login'], '">
</div>
<hr>
<div class="centertext">
<input type="button" class="button" name="backup" value="', $txt['tfa_backup'], '">
</div>
</div>
<div id="tfaBackup" style="display: none;">
<p style="margin-bottom: 0.5em">', $txt['tfa_backup_desc'], '</p>
<div class="centertext">
<strong>', $txt['tfa_backup_code'], ': </strong>
<input type="text" name="tfa_backup" value="', !empty($context['tfa_backup']) ? $context['tfa_backup'] : '', '">
<input type="submit" class="button" name="submit" value="', $txt['login'], '">
</div>
</div>
</form>
<script>
form = $("#frmTfa");';
if (!empty($context['from_ajax']))
echo '
form.submit(function(e) {
// If we are submitting backup code, let normal workflow follow since it redirects a couple times into a different page
if (form.find("input[name=tfa_backup]:first").val().length > 0)
return true;
e.preventDefault();
e.stopPropagation();
$.post(form.prop("action"), form.serialize(), function(data) {
if (data.indexOf("<bo" + "dy") > -1)
document.location = ', JavaScriptEscape(!empty($_SESSION['login_url']) ? $_SESSION['login_url'] : $scripturl), ';
else {
form.parent().html($(data).find(".roundframe").html());
}
});
return false;
});';
echo '
form.find("input[name=backup]").click(function(e) {
$("#tfaBackup").show();
$("#tfaCode").hide();
});
</script>
</div><!-- .roundframe -->
</div><!-- .login -->';
}
/**
* Tell a guest to get lost or login!
*/
function template_kick_guest()
{
global $context, $settings, $scripturl, $modSettings, $txt;
// This isn't that much... just like normal login but with a message at the top.
echo '
<form action="', $context['login_url'], '" method="post" accept-charset="', $context['character_set'], '" name="frmLogin" id="frmLogin">
<div class="login">
<div class="cat_bar">
<h2 class="catbg">', $txt['warning'], '</h2>
</div>';
// Show the message or default message.
echo '
<p class="information centertext">
', empty($context['kick_message']) ? $txt['only_members_can_access'] : $context['kick_message'], '<br>';
if ($context['can_register'])
echo sprintf($txt['login_below_or_register'], $scripturl . '?action=signup', $context['forum_name_html_safe']);
else
echo $txt['login_below'];
// And now the login information.
echo '
<div class="cat_bar">
<h2 class="catbg">
<span class="main_icons login"></span> ', $txt['login'], '
</h2>
</div>
<div class="roundframe">
<dl>
<dt>', $txt['username'], ':</dt>
<dd><input type="text" name="user" size="20"></dd>
<dt>', $txt['password'], ':</dt>
<dd><input type="password" name="passwrd" size="20"></dd>
<dt>', $txt['time_logged_in'], ':</dt>
<dd>
<select name="cookielength" id="cookielength">';
foreach ($context['login_cookie_times'] as $cookie_time => $cookie_txt)
echo '
<option value="', $cookie_time, '"', $modSettings['cookieTime'] == $cookie_time ? ' selected' : '', '>', $txt[$cookie_txt], '</option>';
echo '
</select>
</dd>
</dl>
<p class="centertext">
<input type="submit" value="', $txt['login'], '" class="button">
</p>
<p class="centertext smalltext">
<a href="', $scripturl, '?action=reminder">', $txt['forgot_your_password'], '</a>
</p>
</div>
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['login_token_var'], '" value="', $context['login_token'], '">
</div><!-- .login -->
</form>';
// Do the focus thing...
echo '
<script>
document.forms.frmLogin.user.focus();
</script>';
}
/**
* This is for maintenance mode.
*/
function template_maintenance()
{
global $context, $settings, $txt, $modSettings;
// Display the administrator's message at the top.
echo '
<form action="', $context['login_url'], '" method="post" accept-charset="', $context['character_set'], '">
<div class="login" id="maintenance_mode">
<div class="cat_bar">
<h2 class="catbg">', $context['title'], '</h2>
</div>
<div class="information">
<img class="floatleft" src="', $settings['images_url'], '/construction.png" width="40" height="40" alt="', $txt['in_maintain_mode'], '">
', $context['description'], '<br class="clear">
</div>
<div class="title_bar">
<h4 class="titlebg">', $txt['admin_login'], '</h4>
</div>
<div class="roundframe">
<dl>
<dt>', $txt['username'], ':</dt>
<dd><input type="text" name="user" size="20"></dd>
<dt>', $txt['password'], ':</dt>
<dd><input type="password" name="passwrd" size="20"></dd>
<dt>', $txt['time_logged_in'], ':</dt>
<dd>
<select name="cookielength" id="cookielength">';
foreach ($context['login_cookie_times'] as $cookie_time => $cookie_txt)
echo '
<option value="', $cookie_time, '"', $modSettings['cookieTime'] == $cookie_time ? ' selected' : '', '>', $txt[$cookie_txt], '</option>';
echo '
</select>
</dd>
</dl>
<input type="submit" value="', $txt['login'], '" class="button">
<br class="clear">
</div>
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['login_token_var'], '" value="', $context['login_token'], '">
</div><!-- #maintenance_mode -->
</form>';
}
/**
* This is for the security stuff - makes administrators login every so often.
*/
function template_admin_login()
{
global $context, $settings, $scripturl, $txt, $modSettings;
// Since this should redirect to whatever they were doing, send all the get data.
echo '
<form action="', !empty($modSettings['force_ssl']) ? strtr($scripturl, array('http://' => 'https://')) : $scripturl, $context['get_data'], '" method="post" accept-charset="', $context['character_set'], '" name="frmLogin" id="frmLogin">
<div class="login" id="admin_login">
<div class="cat_bar">
<h2 class="catbg">
<span class="main_icons login"></span> ', $txt['login'], '
</h2>
</div>
<div class="roundframe centertext">';
if (!empty($context['incorrect_password']))
echo '
<div class="error">', $txt['admin_incorrect_password'], '</div>';
echo '
<strong>', $txt['password'], ':</strong>
<input type="password" name="', $context['sessionCheckType'], '_pass" size="24">
<a href="', $scripturl, '?action=helpadmin;help=securityDisable_why" onclick="return reqOverlayDiv(this.href);" class="help"><span class="main_icons help" title="', $txt['help'], '"></span></a><br>
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-login_token_var'], '" value="', $context['admin-login_token'], '">
<input type="submit" value="', $txt['login'], '" class="button">';
// Make sure to output all the old post data.
echo $context['post_data'], '
</div><!-- .roundframe -->
</div><!-- #admin_login -->
<input type="hidden" name="', $context['sessionCheckType'], '_hash_pass" value="">
</form>';
// Focus on the password box.
echo '
<script>
document.forms.frmLogin.', $context['sessionCheckType'], '_pass.focus();
</script>';
}
/**
* Activate your account manually?
*/
function template_retry_activate()
{
global $context, $txt, $scripturl;
// Just ask them for their code so they can try it again...
echo '
<form action="', $scripturl, '?action=activate;u=', $context['member_id'], '" method="post" accept-charset="', $context['character_set'], '">
<div class="title_bar">
<h2 class="titlebg">', $context['page_title'], '</h2>
</div>
<div class="roundframe">
<dl>';
// You didn't even have an ID?
if (empty($context['member_id']))
echo '
<dt>', $txt['invalid_activation_username'], ':</dt>
<dd><input type="text" name="user" size="30"></dd>';
echo '
<dt>', $txt['invalid_activation_retry'], ':</dt>
<dd><input type="text" name="code" size="30"></dd>
</dl>
<p><input type="submit" value="', $txt['invalid_activation_submit'], '" class="button"></p>
</div>
</form>';
}
/**
* The form for resending the activation code.
*/
function template_resend()
{
global $context, $txt, $scripturl;
// Just ask them for their code so they can try it again...
echo '
<form action="', $scripturl, '?action=activate;sa=resend" method="post" accept-charset="', $context['character_set'], '">
<div class="title_bar">
<h2 class="titlebg">', $context['page_title'], '</h2>
</div>
<div class="roundframe">
<dl>
<dt>', $txt['invalid_activation_username'], ':</dt>
<dd><input type="text" name="user" size="40" value="', $context['default_username'], '"></dd>
</dl>
<p>', $txt['invalid_activation_new'], '</p>
<dl>
<dt>', $txt['invalid_activation_new_email'], ':</dt>
<dd><input type="text" name="new_email" size="40"></dd>
<dt>', $txt['invalid_activation_password'], ':</dt>
<dd><input type="password" name="passwd" size="30"></dd>
</dl>';
if ($context['can_activate'])
echo '
<p>', $txt['invalid_activation_known'], '</p>
<dl>
<dt>', $txt['invalid_activation_retry'], ':</dt>
<dd><input type="text" name="code" size="30"></dd>
</dl>';
echo '
<p><input type="submit" value="', $txt['invalid_activation_resend'], '" class="button"></p>
</div><!-- .roundframe -->
</form>';
}
/**
* Confirm a logout.
*/
function template_logout()
{
global $context, $settings, $scripturl, $modSettings, $txt;
// This isn't that much... just like normal login but with a message at the top.
echo '
<form action="', $scripturl . '?action=logout;', $context['session_var'], '=', $context['session_id'], '" method="post" accept-charset="', $context['character_set'], '" name="frmLogout" id="frmLogout">
<div class="logout">
<div class="cat_bar">
<h2 class="catbg">', $txt['logout_confirm'], '</h2>
</div>
<div class="roundframe">
<p class="information centertext">
', $txt['logout_notice'], '
</p>
<p class="centertext">
<input type="submit" value="', $txt['logout'], '" class="button">
<input type="submit" name="cancel" value="', $txt['logout_return'], '" class="button">
</p>
</div>
</div><!-- .logout -->
</form>';
}
?>

View file

@ -0,0 +1,277 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* This template wraps around the simple settings page to add javascript functionality.
*/
function template_avatar_settings_above()
{
}
/**
* JavaScript to be output below the simple settings page
*/
function template_avatar_settings_below()
{
echo '
<script>
var fUpdateStatus = function ()
{
document.getElementById("avatar_max_width_external").disabled = document.getElementById("avatar_download_external").checked;
document.getElementById("avatar_max_height_external").disabled = document.getElementById("avatar_download_external").checked;
document.getElementById("avatar_action_too_large").disabled = document.getElementById("avatar_download_external").checked;
}
addLoadEvent(fUpdateStatus);
</script>';
}
/**
* The attachment maintenance page
*/
function template_maintenance()
{
global $context, $settings, $scripturl, $txt, $modSettings;
echo '
<div id="manage_attachments">
<div class="cat_bar">
<h2 class="catbg">', $txt['attachment_stats'], '</h2>
</div>
<div class="windowbg">
<dl class="settings">
<dt><strong>', $txt['attachment_total'], ':</strong></dt>
<dd>', $context['num_attachments'], '</dd>
<dt><strong>', $txt['attachment_manager_total_avatars'], ':</strong></dt>
<dd>', $context['num_avatars'], '</dd>
<dt><strong>', $txt['attachmentdir_size'], ':</strong></dt>
<dd>', $context['attachment_total_size'], ' ', $txt['kilobyte'], '</dd>
<dt><strong>', $txt['attach_current_dir'], ':</strong></dt>
<dd class="word_break">', $modSettings['attachmentUploadDir'][$modSettings['currentAttachmentUploadDir']], '</dd>
<dt><strong>', $txt['attachmentdir_size_current'], ':</strong></dt>
<dd>', $context['attachment_current_size'], ' ', $txt['kilobyte'], '</dd>
<dt><strong>', $txt['attachment_space'], ':</strong></dt>
<dd>', isset($context['attachment_space']) ? $context['attachment_space'] . ' ' . $txt['kilobyte'] : $txt['attachmentdir_size_not_set'], '</dd>
<dt><strong>', $txt['attachmentdir_files_current'], ':</strong></dt>
<dd>', $context['attachment_current_files'], '</dd>
<dt><strong>', $txt['attachment_files'], ':</strong></dt>
<dd>', isset($context['attachment_files']) ? $context['attachment_files'] : $txt['attachmentdir_files_not_set'], '</dd>
</dl>
</div>
<div class="cat_bar">
<h2 class="catbg">', $txt['attachment_integrity_check'], '</h2>
</div>
<div class="windowbg">
<form action="', $scripturl, '?action=admin;area=manageattachments;sa=repair;', $context['session_var'], '=', $context['session_id'], '" method="post" accept-charset="', $context['character_set'], '">
<p>', $txt['attachment_integrity_check_desc'], '</p>
<input type="submit" name="repair" value="', $txt['attachment_check_now'], '" class="button">
</form>
</div>
<div class="cat_bar">
<h2 class="catbg">', $txt['attachment_pruning'], '</h2>
</div>
<div class="windowbg">
<form action="', $scripturl, '?action=admin;area=manageattachments" method="post" accept-charset="', $context['character_set'], '" onsubmit="return confirm(\'', $txt['attachment_pruning_warning'], '\');">
<dl class="settings">
<dt>', $txt['attachment_remove_old'], '</dt>
<dd><input type="number" name="age" value="25" size="4"> ', $txt['days_word'], '</dd>
<dt>', $txt['attachment_pruning_message'], '</dt>
<dd><input type="text" name="notice" value="', $txt['attachment_delete_admin'], '" size="40"></dd>
<input type="submit" name="remove" value="', $txt['remove'], '" class="button">
<input type="hidden" name="type" value="attachments">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="sa" value="byAge">
</dl>
</form>
<form action="', $scripturl, '?action=admin;area=manageattachments" method="post" accept-charset="', $context['character_set'], '" onsubmit="return confirm(\'', $txt['attachment_pruning_warning'], '\');">
<dl class="settings">
<dt>', $txt['attachment_remove_size'], '</dt>
<dd><input type="number" name="size" id="size" value="100" size="4"> ', $txt['kilobyte'], '</dd>
<dt>', $txt['attachment_pruning_message'], '</dt>
<dd><input type="text" name="notice" value="', $txt['attachment_delete_admin'], '" size="40"></dd>
<input type="submit" name="remove" value="', $txt['remove'], '" class="button">
<input type="hidden" name="type" value="attachments">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="sa" value="bySize">
</dl>
</form>
<form action="', $scripturl, '?action=admin;area=manageattachments" method="post" accept-charset="', $context['character_set'], '" onsubmit="return confirm(\'', $txt['attachment_pruning_warning'], '\');">
<dl class="settings">
<dt>', $txt['attachment_manager_avatars_older'], '</dt>
<dd><input type="number" name="age" value="45" size="4"> ', $txt['days_word'], '</dd>
<input type="submit" name="remove" value="', $txt['remove'], '" class="button">
<input type="hidden" name="type" value="avatars">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="sa" value="byAge">
</dl>
</form>
</div><!-- .windowbg -->
</div><!-- #manage_attachments -->';
if (!empty($context['results']))
echo '
<div class="noticebox">', $context['results'], '</div>';
echo '
<div id="transfer" class="cat_bar">
<h2 class="catbg">', $txt['attachment_transfer'], '</h2>
</div>
<div class="windowbg">
<form action="', $scripturl, '?action=admin;area=manageattachments;sa=transfer" method="post" accept-charset="', $context['character_set'], '">
<p>', $txt['attachment_transfer_desc'], '</p>
<dl class="settings">
<dt>', $txt['attachment_transfer_from'], '</dt>
<dd>
<select name="from">
<option value="0">', $txt['attachment_transfer_select'], '</option>';
foreach ($context['attach_dirs'] as $id => $dir)
echo '
<option value="', $id, '">', $dir, '</option>';
echo '
</select>
</dd>
<dt>', $txt['attachment_transfer_auto'], '</dt>
<dd>
<select name="auto">
<option value="0">', $txt['attachment_transfer_auto_select'], '</option>
<option value="-1">', $txt['attachment_transfer_forum_root'], '</option>';
if (!empty($context['base_dirs']))
foreach ($context['base_dirs'] as $id => $dir)
echo '
<option value="', $id, '">', $dir, '</option>';
else
echo '
<option value="0" disabled>', $txt['attachment_transfer_no_base'], '</option>';
echo '
</select>
</dd>
<dt>', $txt['attachment_transfer_to'], '</dt>
<dd>
<select name="to">
<option value="0">', $txt['attachment_transfer_select'], '</option>';
foreach ($context['attach_dirs'] as $id => $dir)
echo '
<option value="', $id, '">', $dir, '</option>';
echo '
</select>
</dd>';
if (!empty($modSettings['attachmentDirFileLimit']))
echo '
<dt>', $txt['attachment_transfer_empty'], '</dt>
<dd><input type="checkbox" name="empty_it"', $context['checked'] ? ' checked' : '', '></dd>';
echo '
</dl>
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="submit" onclick="start_progress()" name="transfer" value="', $txt['attachment_transfer_now'], '" class="button">
<div id="progress_msg"></div>
<div id="show_progress" class="padding"></div>
</form>
<script>
function start_progress() {
setTimeout(\'show_msg()\', 1000);
}
function show_msg() {
$(\'#progress_msg\').html(\'<div><img src="', $settings['actual_images_url'], '/loading_sm.gif" alt="', $txt['ajax_in_progress'], '" width="35" height="35"> ', $txt['attachment_transfer_progress'], '<\/div>\');
show_progress();
}
function show_progress() {
$(\'#show_progress\').on("load", "progress.php");
setTimeout(\'show_progress()\', 1500);
}
</script>
</div><!-- .windowbg -->';
}
/**
* The file repair page
*/
function template_attachment_repair()
{
global $context, $txt, $scripturl;
// If we've completed just let them know!
if ($context['completed'])
echo '
<div id="manage_attachments">
<div class="cat_bar">
<h2 class="catbg">', $txt['repair_attachments_complete'], '</h2>
</div>
<div class="windowbg">
', $txt['repair_attachments_complete_desc'], '
</div>
</div>';
// What about if no errors were even found?
elseif (!$context['errors_found'])
echo '
<div id="manage_attachments">
<div class="cat_bar">
<h2 class="catbg">', $txt['repair_attachments_complete'], '</h2>
</div>
<div class="windowbg">
', $txt['repair_attachments_no_errors'], '
</div>
</div>';
// Otherwise, I'm sad to say, we have a problem!
else
{
echo '
<div id="manage_attachments">
<form id="admin_form_wrapper" action="', $scripturl, '?action=admin;area=manageattachments;sa=repair;fixErrors=1;step=0;substep=0;', $context['session_var'], '=', $context['session_id'], '" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">', $txt['repair_attachments'], '</h2>
</div>
<div class="windowbg">
<p>', $txt['repair_attachments_error_desc'], '</p>';
// Loop through each error reporting the status
foreach ($context['repair_errors'] as $error => $number)
if (!empty($number))
echo '
<input type="checkbox" name="to_fix[]" id="', $error, '" value="', $error, '">
<label for="', $error, '">', sprintf($txt['attach_repair_' . $error], $number), '</label><br>';
echo '
<br>
<input type="submit" value="', $txt['repair_attachments_continue'], '" class="button">
<input type="submit" name="cancel" value="', $txt['repair_attachments_cancel'], '" class="button">
</div>
</form>
</div><!-- #manage_attachments -->';
}
}
/**
* The page that handles managing attachment paths.
*/
function template_attachment_paths()
{
global $modSettings;
if (!empty($modSettings['attachment_basedirectories']))
template_show_list('base_paths');
template_show_list('attach_paths');
}
?>

338
ManageBans.template.php Normal file
View file

@ -0,0 +1,338 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* Add or edit a ban
*/
function template_ban_edit()
{
global $context, $scripturl, $txt, $modSettings;
echo '
<div id="manage_bans">
<form id="admin_form_wrapper" action="', $context['form_url'], '" method="post" accept-charset="', $context['character_set'], '" onsubmit="return confirmBan(this);">';
// If there were errors creating the ban, show them.
if (!empty($context['error_messages']))
{
echo '
<div class="errorbox">
<strong>', $txt['ban_errors_detected'], '</strong>
<ul>';
foreach ($context['error_messages'] as $error)
echo '
<li class="error">', $error, '</li>';
echo '
</ul>
</div>';
}
echo '
<div class="cat_bar">
<h2 class="catbg">
', $context['ban']['is_new'] ? $txt['ban_add_new'] : $txt['ban_edit'] . ' \'' . $context['ban']['name'] . '\'', '
</h2>
</div>';
if ($context['ban']['is_new'])
echo '
<div class="information noup">', $txt['ban_add_notes'], '</div>';
echo '
<div class="windowbg noup">
<dl class="settings">
<dt id="ban_name_label">
<strong>', $txt['ban_name'], ':</strong>
</dt>
<dd>
<input type="text" id="ban_name" name="ban_name" value="', $context['ban']['name'], '" size="45" maxlength="60">
</dd>';
if (isset($context['ban']['reason']))
echo '
<dt>
<strong><label for="reason">', $txt['ban_reason'], ':</label></strong><br>
<span class="smalltext">', $txt['ban_reason_desc'], '</span>
</dt>
<dd>
<textarea name="reason" id="reason" cols="40" rows="3">', $context['ban']['reason'], '</textarea>
</dd>';
if (isset($context['ban']['notes']))
echo '
<dt>
<strong><label for="ban_notes">', $txt['ban_notes'], ':</label></strong><br>
<span class="smalltext">', $txt['ban_notes_desc'], '</span>
</dt>
<dd>
<textarea name="notes" id="ban_notes" cols="40" rows="3">', $context['ban']['notes'], '</textarea>
</dd>';
echo '
</dl>
<fieldset class="ban_settings floatleft">
<legend>
', $txt['ban_expiration'], '
</legend>
<input type="radio" name="expiration" value="never" id="never_expires" onclick="fUpdateStatus();"', $context['ban']['expiration']['status'] == 'never' ? ' checked' : '', '> <label for="never_expires">', $txt['never'], '</label><br>
<input type="radio" name="expiration" value="one_day" id="expires_one_day" onclick="fUpdateStatus();"', $context['ban']['expiration']['status'] == 'one_day' ? ' checked' : '', '> <label for="expires_one_day">', $txt['ban_will_expire_within'], '</label>: <input type="number" name="expire_date" id="expire_date" size="3" value="', $context['ban']['expiration']['days'], '"> ', $txt['ban_days'], '<br>
<input type="radio" name="expiration" value="expired" id="already_expired" onclick="fUpdateStatus();"', $context['ban']['expiration']['status'] == 'expired' ? ' checked' : '', '> <label for="already_expired">', $txt['ban_expired'], '</label>
</fieldset>
<fieldset class="ban_settings floatright">
<legend>
', $txt['ban_restriction'], '
</legend>
<input type="radio" name="full_ban" id="full_ban" value="1" onclick="fUpdateStatus();"', $context['ban']['cannot']['access'] ? ' checked' : '', '> <label for="full_ban">', $txt['ban_full_ban'], '</label><br>
<input type="radio" name="full_ban" id="partial_ban" value="0" onclick="fUpdateStatus();"', !$context['ban']['cannot']['access'] ? ' checked' : '', '> <label for="partial_ban">', $txt['ban_partial_ban'], '</label><br>
<input type="checkbox" name="cannot_post" id="cannot_post" value="1"', $context['ban']['cannot']['post'] ? ' checked' : '', ' class="ban_restriction"> <label for="cannot_post">', $txt['ban_cannot_post'], '</label> (<a href="', $scripturl, '?action=helpadmin;help=ban_cannot_post" onclick="return reqOverlayDiv(this.href);">?</a>)<br>
<input type="checkbox" name="cannot_register" id="cannot_register" value="1"', $context['ban']['cannot']['register'] ? ' checked' : '', ' class="ban_restriction"> <label for="cannot_register">', $txt['ban_cannot_register'], '</label><br>
<input type="checkbox" name="cannot_login" id="cannot_login" value="1"', $context['ban']['cannot']['login'] ? ' checked' : '', ' class="ban_restriction"> <label for="cannot_login">', $txt['ban_cannot_login'], '</label><br>
</fieldset>
<br class="clear_right">';
if (!empty($context['ban_suggestions']))
{
echo '
<fieldset>
<legend>
<input type="checkbox" onclick="invertAll(this, this.form, \'ban_suggestion\');"> ', $txt['ban_triggers'], '
</legend>
<dl class="settings">
<dt>
<input type="checkbox" name="ban_suggestions[]" id="main_ip_check" value="main_ip"', !empty($context['ban_suggestions']['main_ip']) ? ' checked' : '', '>
<label for="main_ip_check">', $txt['ban_on_ip'], '</label>
</dt>
<dd>
<input type="text" name="main_ip" value="', $context['ban_suggestions']['main_ip'], '" size="44" onfocus="document.getElementById(\'main_ip_check\').checked = true;">
</dd>';
if (empty($modSettings['disableHostnameLookup']))
echo '
<dt>
<input type="checkbox" name="ban_suggestions[]" id="hostname_check" value="hostname"', !empty($context['ban_suggestions']['hostname']) ? ' checked' : '', '>
<label for="hostname_check">', $txt['ban_on_hostname'], '</label>
</dt>
<dd>
<input type="text" name="hostname" value="', $context['ban_suggestions']['hostname'], '" size="44" onfocus="document.getElementById(\'hostname_check\').checked = true;">
</dd>';
echo '
<dt>
<input type="checkbox" name="ban_suggestions[]" id="email_check" value="email"', !empty($context['ban_suggestions']['email']) ? ' checked' : '', '>
<label for="email_check">', $txt['ban_on_email'], '</label>
</dt>
<dd>
<input type="email" name="email" value="', $context['ban_suggestions']['email'], '" size="44" onfocus="document.getElementById(\'email_check\').checked = true;">
</dd>
<dt>
<input type="checkbox" name="ban_suggestions[]" id="user_check" value="user"', !empty($context['ban_suggestions']['user']) || isset($context['ban']['from_user']) ? ' checked' : '', '>
<label for="user_check">', $txt['ban_on_username'], '</label>:
</dt>
<dd>
<input type="text" ', isset($context['ban']['from_user']) ? 'readonly value="' . $context['ban_suggestions']['member']['name'] . '"' : ' value=""', ' name="user" id="user" size="44">
</dd>
</dl>';
if (!empty($context['ban_suggestions']['other_ips']))
{
foreach ($context['ban_suggestions']['other_ips'] as $key => $ban_ips)
{
if (!empty($ban_ips))
{
echo '
<div>', $txt[$key], ':</div>
<dl class="settings">';
$count = 0;
foreach ($ban_ips as $ip)
echo '
<dt>
<input type="checkbox" id="suggestions_', $key, '_', $count, '" name="ban_suggestions[', $key, '][]"', !empty($context['ban_suggestions']['saved_triggers'][$key]) && in_array($ip, $context['ban_suggestions']['saved_triggers'][$key]) ? ' checked' : '', ' value="', $ip, '">
</dt>
<dd>
<label for="suggestions_', $key, '_', $count++, '">', $ip, '</label>
</dd>';
echo '
</dl>';
}
}
}
echo '
</fieldset>';
}
echo '
<input type="submit" name="', $context['ban']['is_new'] ? 'add_ban' : 'modify_ban', '" value="', $context['ban']['is_new'] ? $txt['ban_add'] : $txt['ban_modify'], '" class="button">
<input type="hidden" name="old_expire" value="', $context['ban']['expiration']['days'], '">
<input type="hidden" name="bg" value="', $context['ban']['id'], '">', isset($context['ban']['from_user']) ? '
<input type="hidden" name="u" value="' . $context['ban_suggestions']['member']['id'] . '">' : '', '
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-bet_token_var'], '" value="', $context['admin-bet_token'], '">
</div><!-- .windowbg -->
</form>';
if (!$context['ban']['is_new'] && empty($context['ban_suggestions']))
{
echo '
<br>';
template_show_list('ban_items');
}
echo '
</div><!-- #manage_bans -->
<script>
var fUpdateStatus = function ()
{
document.getElementById("expire_date").disabled = !document.getElementById("expires_one_day").checked;
document.getElementById("cannot_post").disabled = document.getElementById("full_ban").checked;
document.getElementById("cannot_register").disabled = document.getElementById("full_ban").checked;
document.getElementById("cannot_login").disabled = document.getElementById("full_ban").checked;
}
addLoadEvent(fUpdateStatus);';
// Auto suggest only needed for adding new bans, not editing
if ($context['ban']['is_new'] && empty($_REQUEST['u']))
echo '
var oAddMemberSuggest = new smc_AutoSuggest({
sSelf: \'oAddMemberSuggest\',
sSessionId: smf_session_id,
sSessionVar: smf_session_var,
sSuggestId: \'user\',
sControlId: \'user\',
sSearchType: \'member\',
sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
bItemList: false
});
function onUpdateName(oAutoSuggest)
{
document.getElementById(\'user_check\').checked = true;
return true;
}
oAddMemberSuggest.registerCallback(\'onBeforeUpdate\', \'onUpdateName\');';
echo '
function confirmBan(aForm)
{
if (aForm.ban_name.value == \'\')
{
alert(\'', $txt['ban_name_empty'], '\');
return false;
}
if (aForm.partial_ban.checked && !(aForm.cannot_post.checked || aForm.cannot_register.checked || aForm.cannot_login.checked))
{
alert(\'', $txt['ban_restriction_empty'], '\');
return false;
}
}
</script>';
}
/**
* Add or edit a ban trigger
*/
function template_ban_edit_trigger()
{
global $context, $txt, $modSettings;
echo '
<div id="manage_bans">
<form id="admin_form_wrapper" action="', $context['form_url'], '" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">
', $context['ban_trigger']['is_new'] ? $txt['ban_add_trigger'] : $txt['ban_edit_trigger_title'], '
</h2>
</div>
<div class="windowbg">
<fieldset>';
if ($context['ban_trigger']['is_new'])
echo '
<legend>
<input type="checkbox" onclick="invertAll(this, this.form, \'ban_suggestion\');"> ', $txt['ban_triggers'], '
</legend>';
echo '
<dl class="settings">';
if ($context['ban_trigger']['is_new'] || $context['ban_trigger']['ip']['selected'])
echo '
<dt>
<input type="checkbox" name="ban_suggestions[]" id="main_ip_check" value="main_ip"', $context['ban_trigger']['ip']['selected'] ? ' checked' : '', '>
<label for="main_ip_check">', $txt['ban_on_ip'], '</label>
</dt>
<dd>
<input type="text" name="main_ip" value="', $context['ban_trigger']['ip']['value'], '" size="44" onfocus="document.getElementById(\'main_ip_check\').checked = true;">
</dd>';
if (empty($modSettings['disableHostnameLookup']) && ($context['ban_trigger']['is_new'] || $context['ban_trigger']['hostname']['selected']))
echo '
<dt>
<input type="checkbox" name="ban_suggestions[]" id="hostname_check" value="hostname"', $context['ban_trigger']['hostname']['selected'] ? ' checked' : '', '>
<label for="hostname_check">', $txt['ban_on_hostname'], '</label>
</dt>
<dd>
<input type="text" name="hostname" value="', $context['ban_trigger']['hostname']['value'], '" size="44" onfocus="document.getElementById(\'hostname_check\').checked = true;">
</dd>';
if ($context['ban_trigger']['is_new'] || $context['ban_trigger']['email']['selected'])
echo '
<dt>
<input type="checkbox" name="ban_suggestions[]" id="email_check" value="email"', $context['ban_trigger']['email']['selected'] ? ' checked' : '', '>
<label for="email_check">', $txt['ban_on_email'], '</label>
</dt>
<dd>
<input type="email" name="email" value="', $context['ban_trigger']['email']['value'], '" size="44" onfocus="document.getElementById(\'email_check\').checked = true;">
</dd>';
if ($context['ban_trigger']['is_new'] || $context['ban_trigger']['banneduser']['selected'])
echo '
<dt>
<input type="checkbox" name="ban_suggestions[]" id="user_check" value="user"', $context['ban_trigger']['banneduser']['selected'] ? ' checked' : '', '>
<label for="user_check">', $txt['ban_on_username'], '</label>:
</dt>
<dd>
<input type="text" value="' . $context['ban_trigger']['banneduser']['value'] . '" name="user" id="user" size="44" onfocus="document.getElementById(\'user_check\').checked = true;">
</dd>';
echo '
</dl>
</fieldset>
<input type="submit" name="', $context['ban_trigger']['is_new'] ? 'add_new_trigger' : 'edit_trigger', '" value="', $context['ban_trigger']['is_new'] ? $txt['ban_add_trigger_submit'] : $txt['ban_edit_trigger_submit'], '" class="button">
</div><!-- .windowbg -->
<input type="hidden" name="bi" value="' . $context['ban_trigger']['id'] . '">
<input type="hidden" name="bg" value="' . $context['ban_trigger']['group'] . '">
<input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '">
<input type="hidden" name="', $context['admin-bet_token_var'], '" value="', $context['admin-bet_token'], '">
</form>
</div><!-- #manage_bans -->
<script>
var oAddMemberSuggest = new smc_AutoSuggest({
sSelf: \'oAddMemberSuggest\',
sSessionId: smf_session_id,
sSessionVar: smf_session_var,
sSuggestId: \'username\',
sControlId: \'user\',
sSearchType: \'member\',
sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
bItemList: false
});
function onUpdateName(oAutoSuggest)
{
document.getElementById(\'user_check\').checked = true;
return true;
}
oAddMemberSuggest.registerCallback(\'onBeforeUpdate\', \'onUpdateName\');
</script>';
}
?>

768
ManageBoards.template.php Normal file
View file

@ -0,0 +1,768 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* Template for listing all the current categories and boards.
*/
function template_main()
{
global $context, $settings, $scripturl, $txt, $modSettings;
// Table header.
echo '
<div id="manage_boards">
<div class="cat_bar">
<h2 class="catbg">', $txt['boards_edit'], '</h2>
</div>
<div class="windowbg">';
if (!empty($context['move_board']))
echo '
<div class="noticebox">
', $context['move_title'], ' [<a href="', $scripturl, '?action=admin;area=manageboards">', $txt['mboards_cancel_moving'], '</a>]', '
</div>';
// No categories so show a label.
if (empty($context['categories']))
echo '
<div class="windowbg centertext">
', $txt['mboards_no_cats'], '
</div>';
// Loop through every category, listing the boards in each as we go.
foreach ($context['categories'] as $category)
{
// Link to modify the category.
echo '
<div class="sub_bar">
<h2 class="subbg">
<a href="', $scripturl, '?action=admin;area=manageboards;sa=cat;cat=', $category['id'], '">', $category['name'], '</a> <a href="', $scripturl, '?action=admin;area=manageboards;sa=cat;cat=', $category['id'], '">', $txt['cat_modify'], '</a>
</h2>
</div>';
// Boards table header.
echo '
<form action="', $scripturl, '?action=admin;area=manageboards;sa=newboard;cat=', $category['id'], '" method="post" accept-charset="', $context['character_set'], '">
<ul id="category_', $category['id'], '" class="nolist">';
if (!empty($category['move_link']))
echo '
<li><a href="', $category['move_link']['href'], '" title="', $category['move_link']['label'], '"><span class="main_icons select_above"></span></a></li>';
$recycle_board = '<a href="' . $scripturl . '?action=admin;area=manageboards;sa=settings"> <img src="' . $settings['images_url'] . '/post/recycled.png" alt="' . $txt['recycle_board'] . '" title="' . $txt['recycle_board'] . '"></a>';
$redirect_board = '<img src="' . $settings['images_url'] . '/new_redirect.png" alt="' . $txt['redirect_board_desc'] . '" title="' . $txt['redirect_board_desc'] . '">';
// List through every board in the category, printing its name and link to modify the board.
foreach ($category['boards'] as $board)
{
echo '
<li', !empty($modSettings['recycle_board']) && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] == $board['id'] ? ' id="recycle_board"' : ' ', ' class="windowbg', $board['is_redirect'] ? ' redirect_board' : '', '" style="padding-' . ($context['right_to_left'] ? 'right' : 'left') . ': ', 5 + 30 * $board['child_level'], 'px;">
<span class="floatleft"><a', $board['move'] ? ' class="red"' : '', ' href="', $scripturl, '?board=', $board['id'], '.0">', $board['name'], '</a>', !empty($modSettings['recycle_board']) && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] == $board['id'] ? $recycle_board : '', $board['is_redirect'] ? $redirect_board : '', '</span>
<span class="floatright">
', $context['can_manage_permissions'] ? '<a href="' . $scripturl . '?action=admin;area=permissions;sa=index;pid=' . $board['permission_profile'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" class="button">' . $txt['mboards_permissions'] . '</a>' : '', '
<a href="', $scripturl, '?action=admin;area=manageboards;move=', $board['id'], '" class="button">', $txt['mboards_move'], '</a>
<a href="', $scripturl, '?action=admin;area=manageboards;sa=board;boardid=', $board['id'], '" class="button">', $txt['mboards_modify'], '</a>
</span><br style="clear: right;">
</li>';
if (!empty($board['move_links']))
{
echo '
<li class="windowbg" style="padding-', $context['right_to_left'] ? 'right' : 'left', ': ', 5 + 30 * $board['move_links'][0]['child_level'], 'px;">';
foreach ($board['move_links'] as $link)
echo '
<a href="', $link['href'], '" class="move_links" title="', $link['label'], '"><span class="main_icons select_', $link['class'], '" title="', $link['label'], '"></span></a>';
echo '
</li>';
}
}
// Button to add a new board.
echo '
</ul>
<input type="submit" value="', $txt['mboards_new_board'], '" class="button">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
</form>';
}
echo '
</div><!-- .windowbg -->
</div><!-- #manage_boards -->';
}
/**
* Template for editing/adding a category on the forum.
*/
function template_modify_category()
{
global $context, $scripturl, $txt;
// Print table header.
echo '
<div id="manage_boards">
<form action="', $scripturl, '?action=admin;area=manageboards;sa=cat2" method="post" accept-charset="', $context['character_set'], '">
<input type="hidden" name="cat" value="', $context['category']['id'], '">
<div class="cat_bar">
<h2 class="catbg">
', isset($context['category']['is_new']) ? $txt['mboards_new_cat_name'] : $txt['cat_edit'], '
</h2>
</div>
<div class="windowbg">
<dl class="settings">';
// If this isn't the only category, let the user choose where this category should be positioned down the board index.
if (count($context['category_order']) > 1)
{
echo '
<dt><strong>', $txt['order'], ':</strong></dt>
<dd>
<select name="cat_order">';
// Print every existing category into a select box.
foreach ($context['category_order'] as $order)
echo '
<option', $order['selected'] ? ' selected' : '', ' value="', $order['id'], '">', $order['name'], '</option>';
echo '
</select>
</dd>';
}
// Allow the user to edit the category name and/or choose whether you can collapse the category.
echo '
<dt>
<strong>', $txt['full_name'], ':</strong><br>
<span class="smalltext">', $txt['name_on_display'], '</span>
</dt>
<dd>
<input type="text" name="cat_name" value="', $context['category']['editable_name'], '" size="30" tabindex="', $context['tabindex']++, '">
</dd>
<dt>
<strong>', $txt['mboards_description'], '</strong><br>
<span class="smalltext">', str_replace('{allowed_tags}', implode(', ', $context['description_allowed_tags']), $txt['mboards_cat_description_desc']), '</span>
</dt>
<dd>
<textarea name="cat_desc" rows="3" cols="35">', $context['category']['description'], '</textarea>
</dd>
<dt>
<strong>', $txt['collapse_enable'], '</strong><br>
<span class="smalltext">', $txt['collapse_desc'], '</span>
</dt>
<dd>
<input type="checkbox" name="collapse"', $context['category']['can_collapse'] ? ' checked' : '', ' tabindex="', $context['tabindex']++, '">
</dd>';
// Show any category settings added by mods using the 'integrate_edit_category' hook.
if (!empty($context['custom_category_settings']) && is_array($context['custom_category_settings']))
{
foreach ($context['custom_category_settings'] as $catset_id => $catset)
{
if (!empty($catset['dt']) && !empty($catset['dd']))
echo '
<dt class="clear', !is_numeric($catset_id) ? ' catset_' . $catset_id : '', '">
', $catset['dt'], '
</dt>
<dd', !is_numeric($catset_id) ? ' class="catset_' . $catset_id . '"' : '', '>
', $catset['dd'], '
</dd>';
}
}
// Table footer.
echo '
</dl>';
if (isset($context['category']['is_new']))
echo '
<input type="submit" name="add" value="', $txt['mboards_add_cat_button'], '" onclick="return !isEmptyText(this.form.cat_name);" tabindex="', $context['tabindex']++, '" class="button">';
else
echo '
<input type="submit" name="edit" value="', $txt['modify'], '" onclick="return !isEmptyText(this.form.cat_name);" tabindex="', $context['tabindex']++, '" class="button">
<input type="submit" name="delete" value="', $txt['mboards_delete_cat'], '" data-confirm="', $txt['cat_delete_confirm'], '" class="button you_sure">';
echo '
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
// If this category is empty we don't bother with the next confirmation screen.
if ($context['category']['is_empty'])
echo '
<input type="hidden" name="empty" value="1">';
echo '
</div><!-- .windowbg -->
</form>
</div><!-- #manage_boards -->';
}
/**
* A template to confirm if a user wishes to delete a category - and whether they want to save the boards.
*/
function template_confirm_category_delete()
{
global $context, $scripturl, $txt;
// Print table header.
echo '
<div id="manage_boards" class="roundframe">
<form action="', $scripturl, '?action=admin;area=manageboards;sa=cat2" method="post" accept-charset="', $context['character_set'], '">
<input type="hidden" name="cat" value="', $context['category']['id'], '">
<div class="cat_bar">
<h2 class="catbg">', $txt['mboards_delete_cat'], '</h2>
</div>
<div class="windowbg">
<p>', $txt['mboards_delete_cat_contains'], ':</p>
<ul>';
foreach ($context['category']['children'] as $child)
echo '
<li>', $child, '</li>';
echo '
</ul>
</div>
<div class="cat_bar">
<h2 class="catbg">', $txt['mboards_delete_what_do'], '</h2>
</div>
<div class="windowbg">
<p>
<label for="delete_action0"><input type="radio" id="delete_action0" name="delete_action" value="0" checked>', $txt['mboards_delete_option1'], '</label><br>
<label for="delete_action1"><input type="radio" id="delete_action1" name="delete_action" value="1"', count($context['category_order']) == 1 ? ' disabled' : '', '>', $txt['mboards_delete_option2'], '</label>:
<select name="cat_to"', count($context['category_order']) == 1 ? ' disabled' : '', '>';
foreach ($context['category_order'] as $cat)
if ($cat['id'] != 0)
echo '
<option value="', $cat['id'], '">', $cat['true_name'], '</option>';
echo '
</select>
</p>
<input type="submit" name="delete" value="', $txt['mboards_delete_confirm'], '" class="button">
<input type="submit" name="cancel" value="', $txt['mboards_delete_cancel'], '" class="button">
<input type="hidden" name="confirmation" value="1">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">
</div><!-- .windowbg -->
</form>
</div><!-- #manage_boards -->';
}
/**
* Below is the template for adding/editing a board on the forum.
*/
function template_modify_board()
{
global $context, $scripturl, $txt, $modSettings;
// The main table header.
echo '
<div id="manage_boards">
<form action="', $scripturl, '?action=admin;area=manageboards;sa=board2" method="post" accept-charset="', $context['character_set'], '">
<input type="hidden" name="boardid" value="', $context['board']['id'], '">
<div class="cat_bar">
<h2 class="catbg">
', isset($context['board']['is_new']) ? $txt['mboards_new_board_name'] : $txt['boards_edit'], '
</h2>
</div>
<div class="windowbg">
<dl class="settings">';
// Option for choosing the category the board lives in.
echo '
<dt>
<strong>', $txt['mboards_category'], ':</strong>
</dt>
<dd>
<select name="new_cat" onchange="if (this.form.order) {this.form.order.disabled = this.options[this.selectedIndex].value != 0; this.form.board_order.disabled = this.options[this.selectedIndex].value != 0 || this.form.order.options[this.form.order.selectedIndex].value == \'\';}">';
foreach ($context['categories'] as $category)
echo '
<option', $category['selected'] ? ' selected' : '', ' value="', $category['id'], '">', $category['name'], '</option>';
echo '
</select>
</dd>';
// If this isn't the only board in this category let the user choose where the board is to live.
if ((isset($context['board']['is_new']) && count($context['board_order']) > 0) || count($context['board_order']) > 1)
{
echo '
<dt>
<strong>', $txt['order'], ':</strong>
</dt>
<dd>';
// The first select box gives the user the option to position it before, after or as a child of another board.
echo '
<select id="order" name="placement" onchange="this.form.board_order.disabled = this.options[this.selectedIndex].value == \'\';">
', !isset($context['board']['is_new']) ? '<option value="">(' . $txt['mboards_unchanged'] . ')</option>' : '', '
<option value="after">' . $txt['mboards_order_after'] . '...</option>
<option value="child">' . $txt['mboards_order_child_of'] . '...</option>
<option value="before">' . $txt['mboards_order_before'] . '...</option>
</select>';
// The second select box lists all the boards in the category.
echo '
<select id="board_order" name="board_order"', !isset($context['board']['is_new']) ? ' disabled' : '', '>
', !isset($context['board']['is_new']) ? '<option value="">(' . $txt['mboards_unchanged'] . ')</option>' : '';
foreach ($context['board_order'] as $order)
echo '
<option', $order['selected'] ? ' selected' : '', ' value="', $order['id'], '">', $order['name'], '</option>';
echo '
</select>
</dd>';
}
// Options for board name and description.
echo '
<dt>
<strong>', $txt['full_name'], ':</strong><br>
<span class="smalltext">', $txt['name_on_display'], '</span>
</dt>
<dd>
<input type="text" name="board_name" value="', $context['board']['name'], '" size="30">
</dd>
<dt>
<strong>', $txt['mboards_description'], ':</strong><br>
<span class="smalltext">', str_replace('{allowed_tags}', implode(', ', $context['description_allowed_tags']), $txt['mboards_description_desc']), '</span>
</dt>
<dd>
<textarea name="desc" rows="3" cols="35">', $context['board']['description'], '</textarea>
</dd>
<dt>
<strong>', $txt['permission_profile'], ':</strong><br>
<span class="smalltext">', $context['can_manage_permissions'] ? sprintf($txt['permission_profile_desc'], $scripturl . '?action=admin;area=permissions;sa=profiles;' . $context['session_var'] . '=' . $context['session_id']) : strip_tags($txt['permission_profile_desc']), '</span>
</dt>
<dd>
<select name="profile">';
if (isset($context['board']['is_new']))
echo '
<option value="-1">[', $txt['permission_profile_inherit'], ']</option>';
foreach ($context['profiles'] as $id => $profile)
echo '
<option value="', $id, '"', $id == $context['board']['profile'] ? ' selected' : '', '>', $profile['name'], '</option>';
echo '
</select>
</dd>
<dt>
<strong>', $txt['mboards_groups'], ':</strong><br>
<span class="smalltext">', empty($modSettings['deny_boards_access']) ? $txt['mboards_groups_desc'] : $txt['boardsaccess_option_desc'], '</span>';
echo '
</dt>
<dd>';
if (!empty($modSettings['deny_boards_access']))
echo '
<table>
<tr>
<td></td>
<th>', $txt['permissions_option_on'], '</th>
<th>', $txt['permissions_option_off'], '</th>
<th>', $txt['permissions_option_deny'], '</th>
</tr>';
// List all the membergroups so the user can choose who may access this board.
foreach ($context['groups'] as $group)
if (empty($modSettings['deny_boards_access']))
echo '
<label for="groups_', $group['id'], '">
<input type="checkbox" name="groups[', $group['id'], ']" value="allow" id="groups_', $group['id'], '"', in_array($group['id'], $context['board_managers']) ? ' checked disabled' : ($group['allow'] ? ' checked' : ''), '>
<span', $group['is_post_group'] ? ' class="post_group" title="' . $txt['mboards_groups_post_group'] . '"' : ($group['id'] == 0 ? ' class="regular_members" title="' . $txt['mboards_groups_regular_members'] . '"' : ''), '>
', $group['name'], '
</span>
</label><br>';
else
echo '
<tr>
<td>
<label for="groups_', $group['id'], '_a">
<span', $group['is_post_group'] ? ' class="post_group" title="' . $txt['mboards_groups_post_group'] . '"' : ($group['id'] == 0 ? ' class="regular_members" title="' . $txt['mboards_groups_regular_members'] . '"' : ''), '>
', $group['name'], '
</span>
</label>
</td>
<td>
<input type="radio" name="groups[', $group['id'], ']" value="allow" id="groups_', $group['id'], '_a"', in_array($group['id'], $context['board_managers']) ? ' checked disabled' : ($group['allow'] ? ' checked' : ''), '>
</td>
<td>
<input type="radio" name="groups[', $group['id'], ']" value="ignore" id="groups_', $group['id'], '_x"', in_array($group['id'], $context['board_managers']) ? ' disabled' : (!$group['allow'] && !$group['deny'] ? ' checked' : ''), '>
</td>
<td>
<input type="radio" name="groups[', $group['id'], ']" value="deny" id="groups_', $group['id'], '_d"', in_array($group['id'], $context['board_managers']) ? ' disabled' : ($group['deny'] ? ' checked' : ''), '>
</td>
<td></td>
</tr>';
if (empty($modSettings['deny_boards_access']))
echo '
<span class="select_all_box">
<em>', $txt['check_all'], '</em> <input type="checkbox" onclick="invertAll(this, this.form, \'groups[\');">
</span>
<br><br>
</dd>';
else
echo '
<tr class="select_all_box">
<td>
</td>
<td>
<input type="radio" name="select_all" onclick="selectAllRadio(this, this.form, \'groups\', \'allow\');">
</td>
<td>
<input type="radio" name="select_all" onclick="selectAllRadio(this, this.form, \'groups\', \'ignore\');">
</td>
<td>
<input type="radio" name="select_all" onclick="selectAllRadio(this, this.form, \'groups\', \'deny\');">
</td>
<td>
<em>', $txt['check_all'], '</em>
</td>
</tr>
</table>
</dd>';
// Options to choose moderators, specify as announcement board and choose whether to count posts here.
echo '
<dt>
<strong>', $txt['mboards_moderators'], ':</strong><br>
<span class="smalltext">', $txt['mboards_moderators_desc'], '</span><br>
</dt>
<dd>
<input type="text" name="moderators" id="moderators" value="', $context['board']['moderator_list'], '" size="30">
<div id="moderator_container"></div>
</dd>
<dt>
<strong>', $txt['mboards_moderator_groups'], ':</strong><br>
<span class="smalltext">', $txt['mboards_moderator_groups_desc'], '</span><br>
</dt>
<dd>
<input type="text" name="moderator_groups" id="moderator_groups" value="', $context['board']['moderator_groups_list'], '" size="30">
<div id="moderator_group_container"></div>
</dd>
</dl>
<script>
$(document).ready(function () {
$(".select_all_box").each(function () {
$(this).removeClass(\'select_all_box\');
});
});
</script>
<hr>';
if (empty($context['board']['is_recycle']) && empty($context['board']['topics']))
{
echo '
<dl class="settings">
<dt>
<strong', $context['board']['topics'] ? ' style="color: gray;"' : '', '>', $txt['mboards_redirect'], ':</strong><br>
<span class="smalltext">', $txt['mboards_redirect_desc'], '</span><br>
</dt>
<dd>
<input type="checkbox" id="redirect_enable" name="redirect_enable"', $context['board']['redirect'] != '' ? ' checked' : '', ' onclick="refreshOptions();">
</dd>
</dl>
<div id="redirect_address_div">
<dl class="settings">
<dt>
<strong>', $txt['mboards_redirect_url'], ':</strong><br>
<span class="smalltext">', $txt['mboards_redirect_url_desc'], '</span><br>
</dt>
<dd>
<input type="text" name="redirect_address" value="', $context['board']['redirect'], '" size="40">
</dd>
</dl>
</div>';
if ($context['board']['redirect'])
echo '
<div id="reset_redirect_div">
<dl class="settings">
<dt>
<strong>', $txt['mboards_redirect_reset'], ':</strong><br>
<span class="smalltext">', $txt['mboards_redirect_reset_desc'], '</span><br>
</dt>
<dd>
<input type="checkbox" name="reset_redirect">
<em>(', sprintf($txt['mboards_current_redirects'], $context['board']['posts']), ')</em>
</dd>
</dl>
</div>';
}
echo '
<div id="count_posts_div">
<dl class="settings">
<dt>
<strong>', $txt['mboards_count_posts'], ':</strong><br>
<span class="smalltext">', $txt['mboards_count_posts_desc'], '</span><br>
</dt>
<dd>
<input type="checkbox" name="count"', $context['board']['count_posts'] ? ' checked' : '', '>
</dd>
</dl>
</div>';
// Here the user can choose to force this board to use a theme other than the default theme for the forum.
echo '
<div id="board_theme_div">
<dl class="settings">
<dt>
<strong>', $txt['mboards_theme'], ':</strong><br>
<span class="smalltext">', $txt['mboards_theme_desc'], '</span><br>
</dt>
<dd>
<select name="boardtheme" id="boardtheme" onchange="refreshOptions();">
<option value="0"', $context['board']['theme'] == 0 ? ' selected' : '', '>', $txt['mboards_theme_default'], '</option>';
foreach ($context['themes'] as $theme)
echo '
<option value="', $theme['id'], '"', $context['board']['theme'] == $theme['id'] ? ' selected' : '', '>', $theme['name'], '</option>';
echo '
</select>
</dd>
</dl>
</div><!-- #board_theme_div -->
<div id="override_theme_div">
<dl class="settings">
<dt>
<strong>', $txt['mboards_override_theme'], ':</strong><br>
<span class="smalltext">', $txt['mboards_override_theme_desc'], '</span><br>
</dt>
<dd>
<input type="checkbox" name="override_theme"', $context['board']['override_theme'] ? ' checked' : '', '>
</dd>
</dl>
</div>';
// Show any board settings added by mods using the 'integrate_edit_board' hook.
if (!empty($context['custom_board_settings']) && is_array($context['custom_board_settings']))
{
echo '
<hr>
<div id="custom_board_settings">
<dl class="settings">';
foreach ($context['custom_board_settings'] as $cbs_id => $cbs)
{
if (!empty($cbs['dt']) && !empty($cbs['dd']))
echo '
<dt class="clear', !is_numeric($cbs_id) ? ' cbs_' . $cbs_id : '', '">
', $cbs['dt'], '
</dt>
<dd', !is_numeric($cbs_id) ? ' class="cbs_' . $cbs_id . '"' : '', '>
', $cbs['dd'], '
</dd>';
}
echo '
</dl>
</div>';
}
if (!empty($context['board']['is_recycle']))
echo '
<div class="noticebox">', $txt['mboards_recycle_disabled_delete'], '</div>';
echo '
<input type="hidden" name="rid" value="', $context['redirect_location'], '">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-be-' . $context['board']['id'] . '_token_var'], '" value="', $context['admin-be-' . $context['board']['id'] . '_token'], '">';
// If this board has no children don't bother with the next confirmation screen.
if ($context['board']['no_children'])
echo '
<input type="hidden" name="no_children" value="1">';
if (isset($context['board']['is_new']))
echo '
<input type="hidden" name="cur_cat" value="', $context['board']['category'], '">
<input type="submit" name="add" value="', $txt['mboards_new_board'], '" onclick="return !isEmptyText(this.form.board_name);" class="button">';
else
echo '
<input type="submit" name="edit" value="', $txt['modify'], '" onclick="return !isEmptyText(this.form.board_name);" class="button">';
if (!isset($context['board']['is_new']) && empty($context['board']['is_recycle']))
echo '
<input type="submit" name="delete" value="', $txt['mboards_delete_board'], '" data-confirm="', $txt['board_delete_confirm'], '" class="button you_sure">';
echo '
</div><!-- .windowbg -->
</form>
</div><!-- #manage_boards -->
<script>
var oModeratorSuggest = new smc_AutoSuggest({
sSelf: \'oModeratorSuggest\',
sSessionId: smf_session_id,
sSessionVar: smf_session_var,
sSuggestId: \'moderators\',
sControlId: \'moderators\',
sSearchType: \'member\',
bItemList: true,
sPostName: \'moderator_list\',
sURLMask: \'action=profile;u=%item_id%\',
sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
sItemListContainerId: \'moderator_container\',
aListItems: [';
foreach ($context['board']['moderators'] as $id_member => $member_name)
echo '
{
sItemId: ', JavaScriptEscape($id_member), ',
sItemName: ', JavaScriptEscape($member_name), '
}', $id_member == $context['board']['last_moderator_id'] ? '' : ',';
echo '
]
});
var oModeratorGroupSuggest = new smc_AutoSuggest({
sSelf: \'oModeratorGroupSuggest\',
sSessionId: smf_session_id,
sSessionVar: smf_session_var,
sSuggestId: \'moderator_groups\',
sControlId: \'moderator_groups\',
sSearchType: \'membergroups\',
bItemList: true,
sPostName: \'moderator_group_list\',
sURLMask: \'action=groups;sa=members;group=%item_id%\',
sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
sItemListContainerId: \'moderator_group_container\',
aListItems: [';
foreach ($context['board']['moderator_groups'] as $id_group => $group_name)
echo '
{
sItemId: ', JavaScriptEscape($id_group), ',
sItemName: ', JavaScriptEscape($group_name), '
}', $id_group == $context['board']['last_moderator_group_id'] ? '' : ',';
echo '
]
});
</script>';
// Javascript for deciding what to show.
echo '
<script>
function refreshOptions()
{
var redirect = document.getElementById("redirect_enable");
var redirectEnabled = redirect ? redirect.checked : false;
var nonDefaultTheme = document.getElementById("boardtheme").value == 0 ? false : true;
// What to show?
if(redirectEnabled || !nonDefaultTheme)
document.getElementById("override_theme_div").classList.add(\'hidden\');
else
document.getElementById("override_theme_div").classList.remove(\'hidden\');
if(redirectEnabled) {
document.getElementById("board_theme_div").classList.add(\'hidden\');
document.getElementById("count_posts_div").classList.add(\'hidden\');
} else {
document.getElementById("board_theme_div").classList.remove(\'hidden\');
document.getElementById("count_posts_div").classList.remove(\'hidden\');
}';
if (!$context['board']['topics'] && empty($context['board']['is_recycle']))
{
echo '
if(redirectEnabled)
document.getElementById("redirect_address_div").classList.remove(\'hidden\');
else
document.getElementById("redirect_address_div").classList.add(\'hidden\');';
if ($context['board']['redirect'])
echo '
if(redirectEnabled)
document.getElementById("reset_redirect_div").classList.remove(\'hidden\');
else
document.getElementById("reset_redirect_div").classList.add(\'hidden\');';
}
// Include any JavaScript added by mods using the 'integrate_edit_board' hook.
if (!empty($context['custom_refreshOptions']) && is_array($context['custom_refreshOptions']))
{
foreach ($context['custom_refreshOptions'] as $refreshOption)
echo '
', $refreshOption;
}
echo '
}
refreshOptions();
</script>';
}
/**
* A template used when a user is deleting a board with child boards in it - to see what they want to do with them.
*/
function template_confirm_board_delete()
{
global $context, $scripturl, $txt;
// Print table header.
echo '
<div id="manage_boards" class="roundframe">
<form action="', $scripturl, '?action=admin;area=manageboards;sa=board2" method="post" accept-charset="', $context['character_set'], '">
<input type="hidden" name="boardid" value="', $context['board']['id'], '">
<div class="cat_bar">
<h2 class="catbg">', $txt['mboards_delete_board'], '</h2>
</div>
<div class="windowbg">
<p>', $txt['mboards_delete_board_contains'], '</p>
<ul>';
foreach ($context['children'] as $child)
echo '
<li>', $child['node']['name'], '</li>';
echo '
</ul>
</div>
<div class="cat_bar">
<h2 class="catbg">', $txt['mboards_delete_what_do'], '</h2>
</div>
<div class="windowbg">
<p>
<label for="delete_action0"><input type="radio" id="delete_action0" name="delete_action" value="0" checked>', $txt['mboards_delete_board_option1'], '</label><br>
<label for="delete_action1"><input type="radio" id="delete_action1" name="delete_action" value="1"', empty($context['can_move_children']) ? ' disabled' : '', '>', $txt['mboards_delete_board_option2'], '</label>:
<select name="board_to"', empty($context['can_move_children']) ? ' disabled' : '', '>';
foreach ($context['board_order'] as $board)
if ($board['id'] != $context['board']['id'] && empty($board['is_child']))
echo '
<option value="', $board['id'], '">', $board['name'], '</option>';
echo '
</select>
</p>
<input type="submit" name="delete" value="', $txt['mboards_delete_confirm'], '" class="button">
<input type="submit" name="cancel" value="', $txt['mboards_delete_cancel'], '" class="button">
<input type="hidden" name="confirmation" value="1">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-be-' . $context['board']['id'] . '_token_var'], '" value="', $context['admin-be-' . $context['board']['id'] . '_token'], '">
</div><!-- .windowbg -->
</form>
</div><!-- #manage_boards -->';
}
?>

View file

@ -0,0 +1,86 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* Editing or adding holidays.
*/
function template_edit_holiday()
{
global $context, $scripturl, $txt, $modSettings;
// Show a form for all the holiday information.
echo '
<form action="', $scripturl, '?action=admin;area=managecalendar;sa=editholiday" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">', $context['page_title'], '</h2>
</div>
<div class="windowbg">
<dl class="settings">
<dt>
<strong>', $txt['holidays_title_label'], ':</strong>
</dt>
<dd>
<input type="text" name="title" value="', $context['holiday']['title'], '" size="55" maxlength="60">
</dd>
<dt>
<strong>', $txt['calendar_year'], '</strong>
</dt>
<dd>
<select name="year" id="year" onchange="generateDays();">
<option value="0000"', $context['holiday']['year'] == '0000' ? ' selected' : '', '>', $txt['every_year'], '</option>';
// Show a list of all the years we allow...
for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++)
echo '
<option value="', $year, '"', $year == $context['holiday']['year'] ? ' selected' : '', '>', $year, '</option>';
echo '
</select>
<label for="month">', $txt['calendar_month'], '</label>
<select name="month" id="month" onchange="generateDays();">';
// There are 12 months per year - ensure that they all get listed.
for ($month = 1; $month <= 12; $month++)
echo '
<option value="', $month, '"', $month == $context['holiday']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>';
echo '
</select>
<label for="day">', $txt['calendar_day'], '</label>
<select name="day" id="day" onchange="generateDays();">';
// This prints out all the days in the current month - this changes dynamically as we switch months.
for ($day = 1; $day <= $context['holiday']['last_day']; $day++)
echo '
<option value="', $day, '"', $day == $context['holiday']['day'] ? ' selected' : '', '>', $day, '</option>';
echo '
</select>
</dd>
</dl>';
if ($context['is_new'])
echo '
<input type="submit" value="', $txt['holidays_button_add'], '" class="button">';
else
echo '
<input type="submit" name="edit" value="', $txt['holidays_button_edit'], '" class="button">
<input type="submit" name="delete" value="', $txt['holidays_button_remove'], '" class="button">
<input type="hidden" name="holiday" value="', $context['holiday']['id'], '">';
echo '
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="' . $context['admin-eh_token_var'] . '" value="' . $context['admin-eh_token'] . '">
</div><!-- .windowbg -->
</form>';
}
?>

View file

@ -0,0 +1,367 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* Download a new language file.
*/
function template_download_language()
{
global $context, $txt, $scripturl, $modSettings;
// Actually finished?
if (!empty($context['install_complete']))
{
echo '
<div class="cat_bar">
<h2 class="catbg">
', $txt['languages_download_complete'], '
</h2>
</div>
<div class="windowbg">
', $context['install_complete'], '
</div>';
return;
}
// An error?
if (!empty($context['error_message']))
echo '
<div class="errorbox">
', $context['error_message'], '
</div>';
// Provide something of an introduction...
echo '
<form action="', $scripturl, '?action=admin;area=languages;sa=downloadlang;did=', $context['download_id'], ';', $context['session_var'], '=', $context['session_id'], '" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">
', $txt['languages_download'], '
</h2>
</div>
<div class="windowbg">
<p>
', $txt['languages_download_note'], '
</p>
<div class="smalltext">
', $txt['languages_download_info'], '
</div>
</div>';
// Show the main files.
template_show_list('lang_main_files_list');
// Do we want some FTP baby?
// If the files are not writable, we might!
if (!empty($context['still_not_writable']))
{
if (!empty($context['package_ftp']['error']))
echo '
<div class="errorbox">
', $context['package_ftp']['error'], '
</div>';
echo '
<div class="cat_bar">
<h2 class="catbg">
', $txt['package_ftp_necessary'], '
</h2>
</div>
<div class="windowbg">
<p>', $txt['package_ftp_why'], '</p>
<dl class="settings">
<dt
<label for="ftp_server">', $txt['package_ftp_server'], ':</label>
</dt>
<dd>
<div class="floatright">
<label for="ftp_port">
', $txt['package_ftp_port'], ':
</label>
<input type="text" size="3" name="ftp_port" id="ftp_port" value="', isset($context['package_ftp']['port']) ? $context['package_ftp']['port'] : (isset($modSettings['package_port']) ? $modSettings['package_port'] : '21'), '">
</div>
<input type="text" size="30" name="ftp_server" id="ftp_server" value="', isset($context['package_ftp']['server']) ? $context['package_ftp']['server'] : (isset($modSettings['package_server']) ? $modSettings['package_server'] : 'localhost'), '" style="width: 70%;">
</dd>
<dt>
<label for="ftp_username">', $txt['package_ftp_username'], ':</label>
</dt>
<dd>
<input type="text" size="50" name="ftp_username" id="ftp_username" value="', isset($context['package_ftp']['username']) ? $context['package_ftp']['username'] : (isset($modSettings['package_username']) ? $modSettings['package_username'] : ''), '">
</dd>
<dt>
<label for="ftp_password">', $txt['package_ftp_password'], ':</label>
</dt>
<dd>
<input type="password" size="50" name="ftp_password" id="ftp_password">
</dd>
<dt>
<label for="ftp_path">', $txt['package_ftp_path'], ':</label>
</dt>
<dd>
<input type="text" size="50" name="ftp_path" id="ftp_path" value="', $context['package_ftp']['path'], '">
</dd>
</dl>
</div><!-- .windowbg -->';
}
// Install?
echo '
<div class="righttext padding">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-dlang_token_var'], '" value="', $context['admin-dlang_token'], '">
<input type="submit" name="do_install" value="', $txt['add_language_smf_install'], '" class="button">
</div>
</form>';
}
/**
* Edit language entries. Note that this doesn't always work because of PHP's max_post_vars setting.
*/
function template_modify_language_entries()
{
global $context, $txt, $scripturl;
echo '
<form action="', $scripturl, '?action=admin;area=languages;sa=editlang;lid=', $context['lang_id'], '" id="primary_settings" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">
', $txt['edit_languages'], '
</h2>
</div>
<div id="editlang_desc" class="information">
', $txt['edit_language_entries_primary'], '
</div>';
// Not writable? Oops, show an error for ya.
if (!empty($context['lang_file_not_writable_message']))
echo '
<div class="errorbox">
', $context['lang_file_not_writable_message'], '
</div>';
// Show the language entries
echo '
<div class="windowbg">
<fieldset>
<legend>', $context['primary_settings']['name'], '</legend>
<dl class="settings">';
foreach ($context['primary_settings'] as $setting => $setting_info)
{
if ($setting != 'name')
echo '
<dt>
<a id="settings_', $setting, '_help" href="', $scripturl, '?action=helpadmin;help=languages_', $setting_info['label'], '" onclick="return reqOverlayDiv(this.href);"><span class="main_icons help" title="', $txt['help'], '"></span></a>
<label for="', $setting, '">', $txt['languages_' . $setting_info['label']], ':</label>
</dt>
<dd>
<input type="', (is_bool($setting_info['value']) ? 'checkbox' : 'text'), '" name="', $setting, '" id="', $setting_info['label'], '" size="20"', (is_bool($setting_info['value']) ? (!empty($setting_info['value']) ? ' checked' : '') : ' value="' . $setting_info['value'] . '"'), (!empty($context['lang_file_not_writable_message']) ? ' disabled' : ''), ' data-orig="' . (is_bool($setting_info['value']) ? (!empty($setting_info['value']) ? 'true' : 'false') : $setting_info['value']) . '">
</dd>';
}
echo '
</dl>
</fieldset>
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-mlang_token_var'], '" value="', $context['admin-mlang_token'], '">
<input type="submit" name="save_main" value="', $txt['save'], '"', !empty($context['lang_file_not_writable_message']) ? ' disabled' : '', ' class="button">
<input type="reset" id="reset_main" value="', $txt['reset'], '" class="button">';
// Allow deleting entries. English can't be deleted though.
if ($context['lang_id'] != 'english')
echo '
<input type="submit" name="delete_main" value="', $txt['delete'], '"', !empty($context['lang_file_not_writable_message']) ? ' disabled' : '', ' onclick="return confirm(\'', $txt['languages_delete_confirm'], '\');" class="button">';
echo '
</div><!-- .windowbg -->
</form>
<form action="', $scripturl, '?action=admin;area=languages;sa=editlang;lid=', $context['lang_id'], ';entries" id="entry_form" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">
', $txt['edit_language_entries'], '
</h2>
</div>
<div class="information">
<div>
', sprintf($txt['edit_language_entries_desc'], $scripturl, $txt['themeadmin_edit_title']), '
</div>
<br>
<div id="taskpad" class="floatright">
', $txt['edit_language_entries_file'], ':
<select name="tfid" onchange="if (this.value != -1) document.forms.entry_form.submit();">
<option value="-1">&nbsp;</option>';
foreach ($context['possible_files'] as $id_theme => $theme)
{
echo '
<optgroup label="', $theme['name'], '">';
foreach ($theme['files'] as $file)
echo '
<option value="', $id_theme, '+', $file['id'], '"', $file['selected'] ? ' selected' : '', '>', $file['name'], '</option>';
echo '
</optgroup>';
}
echo '
</select>
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-mlang_token_var'], '" value="', $context['admin-mlang_token'], '">
<input type="submit" value="', $txt['go'], '" class="button" style="float: none">
</div><!-- #taskpad -->
</div><!-- .information -->';
// Is it not writable? Show an error.
if (!empty($context['entries_not_writable_message']))
echo '
<div class="errorbox">
', $context['entries_not_writable_message'], '
</div>';
// Already have some file entries?
if (!empty($context['file_entries']))
{
echo '
<div id="entry_fields" class="windowbg">';
$entry_num = 0;
foreach ($context['file_entries'] as $group => $entries)
{
echo '
<fieldset>
<legend>
<a id="settings_language_', $group, '_help" href="', $scripturl, '?action=helpadmin;help=languages_', $group, '" onclick="return reqOverlayDiv(this.href);"><span class="main_icons help" title="', $txt['help'], '"></span></a>
<span>', $txt['languages_' . $group], '</span>
</legend>
<dl class="settings" id="language_', $group, '">';
foreach ($entries as $entry)
{
++$entry_num;
echo '
<dt>
<span>', $entry['key'], isset($entry['subkey']) ? '[' . $entry['subkey'] . ']' : '', '</span>
</dt>
<dd id="entry_', $entry_num, '">';
if ($entry['can_remove'])
echo '
<span style="margin-right: 1ch; white-space: nowrap">
<input id="entry_', $entry_num, '_none" class="entry_toggle" type="radio" name="edit[', $entry['key'], ']', isset($entry['subkey']) ? '[' . $entry['subkey'] . ']' : '', '" value="" data-target="#entry_', $entry_num, '" checked>
<label for="entry_', $entry_num, '_none">', $txt['no_change'], '</label>
</span>
<span style="margin-right: 1ch; white-space: nowrap">
<input id="entry_', $entry_num, '_edit" class="entry_toggle" type="radio" name="edit[', $entry['key'], ']', isset($entry['subkey']) ? '[' . $entry['subkey'] . ']' : '', '" value="edit" data-target="#entry_', $entry_num, '">
<label for="entry_', $entry_num, '_edit">', $txt['edit'], '</label>
</span>
<span style="margin-right: 1ch; white-space: nowrap">
<input id="entry_', $entry_num, '_remove" class="entry_toggle" type="radio" name="edit[', $entry['key'], ']', isset($entry['subkey']) ? '[' . $entry['subkey'] . ']' : '', '" value="remove" data-target="#entry_', $entry_num, '">
<label for="entry_', $entry_num, '_remove">', $txt['remove'], '</label>
</span>';
else
echo '
<input id="entry_', $entry_num, '_edit" class="entry_toggle" type="checkbox" name="edit[', $entry['key'], ']', isset($entry['subkey']) ? '[' . $entry['subkey'] . ']' : '', '" value="edit" data-target="#entry_', $entry_num, '">
<label for="entry_', $entry_num, '_edit">', $txt['edit'], '</label>';
echo '
</span>
<input type="hidden" class="entry_oldvalue" name="comp[', $entry['key'], ']', isset($entry['subkey']) ? '[' . $entry['subkey'] . ']' : '', '" value="', $entry['value'], '">
<textarea name="entry[', $entry['key'], ']', isset($entry['subkey']) ? '[' . $entry['subkey'] . ']' : '', '" class="entry_textfield" cols="40" rows="', $entry['rows'] < 2 ? 2 : ($entry['rows'] > 25 ? 25 : $entry['rows']), '" style="width: 96%; margin-bottom: 2em;">', $entry['value'], '</textarea>
</dd>';
}
echo '
</dl>';
if (!empty($context['can_add_lang_entry'][$group]))
{
echo '
<span class="add_lang_entry_button" style="display: none;">
<a class="button" href="javascript:void(0);" onclick="add_lang_entry(\'', $group, '\'); return false;">' . $txt['editnews_clickadd'] . '</a>
</span>
<script>
entry_num = ', $entry_num, ';
</script>';
}
echo '
</fieldset>';
}
echo '
<input type="submit" name="save_entries" value="', $txt['save'], '"', !empty($context['entries_not_writable_message']) ? ' disabled' : '', ' class="button">
</div><!-- .windowbg -->';
}
echo '
</form>';
}
/**
* Add a new language
*
*/
function template_add_language()
{
global $context, $txt, $scripturl;
echo '
<form id="admin_form_wrapper"action="', $scripturl, '?action=admin;area=languages;sa=add;', $context['session_var'], '=', $context['session_id'], '" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">
', $txt['add_language'], '
</h2>
</div>
<div class="windowbg">
<fieldset>
<legend>', $txt['add_language_smf'], '</legend>
<label class="smalltext">', $txt['add_language_smf_browse'], '</label>
<input type="text" name="smf_add" size="40" value="', !empty($context['smf_search_term']) ? $context['smf_search_term'] : '', '">';
// Do we have some errors? Too bad. Display a little error box.
if (!empty($context['smf_error']))
echo '
<div>
<br>
<p class="errorbox">', $txt['add_language_error_' . $context['smf_error']], '</p>
</div>';
echo '
</fieldset>
', isBrowser('is_ie') ? '<input type="text" name="ie_fix" style="display: none;"> ' : '', '
<input type="submit" name="smf_add_sub" value="', $txt['search'], '" class="button">
<br>
</div><!-- .windowbg -->';
// Had some results?
if (!empty($context['smf_languages']['rows']))
{
echo '
<div class="cat_bar">
<h2 class="catbg">', $txt['add_language_found_title'], '</h2>
</div>
<div class="information">', $txt['add_language_smf_found'], '</div>';
template_show_list('smf_languages');
}
echo '
</form>';
}
?>

80
ManageMail.template.php Normal file
View file

@ -0,0 +1,80 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* Template for browsing the mail queue.
*/
function template_browse()
{
global $context, $txt;
echo '
<div id="manage_mail">
<div id="mailqueue_stats">
<div class="cat_bar">
<h2 class="catbg">', $txt['mailqueue_stats'], '</h2>
</div>
<div class="windowbg">
<dl class="settings">
<dt><strong>', $txt['mailqueue_size'], '</strong></dt>
<dd>', $context['mail_queue_size'], '</dd>
<dt><strong>', $txt['mailqueue_oldest'], '</strong></dt>
<dd>', $context['oldest_mail'], '</dd>
</dl>
</div>
</div>';
template_show_list('mail_queue');
echo '
</div>';
}
/**
* Template for testing mail send.
*/
function template_mailtest()
{
global $context, $txt, $scripturl;
// The results.
if (!empty($context['result']))
{
if ($context['result'] == 'failure')
$result_txt = sprintf($txt['mailtest_result_failure'], $scripturl . '?action=admin;area=logs;sa=errorlog;desc');
else
$result_txt = $txt['mailtest_result_success'];
echo '
<div class="', $context['result'] == 'success' ? 'infobox' : 'errorbox', '">', $result_txt, '</div>';
}
echo '
<form id="admin_form_wrapper" action="', $context['post_url'], '" method="post">
<div class="cat_bar">
<h2 class="catbg">', $txt['mailtest_header'], '</h2>
</div>
<div class="windowbg">
<dl id="post_header">
<dt><span id="caption_subject">', $txt['subject'], '</span></dt>
<dd><input type="text" name="subject" tabindex="1" size="80" maxlength="80"></dd>
</dl>
<textarea class="editor" name="message" rows="5" cols="200" tabindex="2"></textarea>
<dl id="post_footer">
<dd><input type="submit" value="', $txt['send_message'], '" class="button"></dd>
</dl>
</div>
</form>';
}
?>

View file

@ -0,0 +1,622 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* Template for the database maintenance tasks.
*/
function template_maintain_database()
{
global $context, $txt, $scripturl, $modSettings;
// If maintenance has finished tell the user.
if (!empty($context['maintenance_finished']))
echo '
<div class="infobox">
', sprintf($txt['maintain_done'], $context['maintenance_finished']), '
</div>';
echo '
<div id="manage_maintenance">
<div class="cat_bar">
<h2 class="catbg">', $txt['maintain_optimize'], '</h2>
</div>
<div class="windowbg">
<form action="', $scripturl, '?action=admin;area=maintain;sa=database;activity=optimize" method="post" accept-charset="', $context['character_set'], '">
<p>', $txt['maintain_optimize_info'], '</p>
<input type="submit" value="', $txt['maintain_run_now'], '" class="button">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '">
</form>
</div>';
// Show an option to convert the body column of the post table to MEDIUMTEXT or TEXT
if (isset($context['convert_to']))
echo '
<div class="cat_bar">
<h2 class="catbg">', $txt[$context['convert_to'] . '_title'], '</h2>
</div>
<div class="windowbg">
<form action="', $scripturl, '?action=admin;area=maintain;sa=database;activity=convertmsgbody" method="post" accept-charset="', $context['character_set'], '">
<p>', $txt['mediumtext_introduction'], '</p>',
$context['convert_to_suggest'] ? '<p class="infobox">' . $txt['convert_to_suggest_text'] . '</p>' : '', '
<input type="submit" name="evaluate_conversion" value="', $txt['maintain_run_now'], '" class="button">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '">
</form>
</div>';
// We might want to convert entities if we're on UTF-8.
if ($context['convert_entities'])
echo '
<div class="cat_bar">
<h2 class="catbg">', $txt['entity_convert_title'], '</h2>
</div>
<div class="windowbg">
<form action="', $scripturl, '?action=admin;area=maintain;sa=database;activity=convertentities" method="post" accept-charset="', $context['character_set'], '">
<p>', $txt['entity_convert_introduction'], '</p>
<input type="submit" value="', $txt['maintain_run_now'], '" class="button">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '">
</form>
</div>';
echo '
</div><!-- #manage_maintenance -->';
}
/**
* Template for the routine maintenance tasks.
*/
function template_maintain_routine()
{
global $context, $txt, $scripturl;
// Starts off with general maintenance procedures.
echo '
<div id="manage_maintenance">';
// If maintenance has finished tell the user.
if (!empty($context['maintenance_finished']))
echo '
<div class="infobox">
', sprintf($txt['maintain_done'], $context['maintenance_finished']), '
</div>';
echo '
<div class="cat_bar">
<h2 class="catbg">', $txt['maintain_version'], '</h2>
</div>
<div class="windowbg">
<form action="', $scripturl, '?action=admin;area=maintain;sa=routine;activity=version" method="post" accept-charset="', $context['character_set'], '">
<p>
', $txt['maintain_version_info'], '
<input type="submit" value="', $txt['maintain_run_now'], '" class="button">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
</p>
</form>
</div>
<div class="cat_bar">
<h2 class="catbg">', $txt['maintain_errors'], '</h2>
</div>
<div class="windowbg">
<form action="', $scripturl, '?action=admin;area=repairboards" method="post" accept-charset="', $context['character_set'], '">
<p>
', $txt['maintain_errors_info'], '
<input type="submit" value="', $txt['maintain_run_now'], '" class="button">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '">
</p>
</form>
</div>
<div class="cat_bar">
<h2 class="catbg">', $txt['maintain_recount'], '</h2>
</div>
<div class="windowbg">
<form action="', $scripturl, '?action=admin;area=maintain;sa=routine;activity=recount" method="post" accept-charset="', $context['character_set'], '">
<p>
', $txt['maintain_recount_info'], '
<input type="submit" value="', $txt['maintain_run_now'], '" class="button">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '">
</p>
</form>
</div>
<div class="cat_bar">
<h2 class="catbg">', $txt['maintain_rebuild_settings'], '</h2>
</div>
<div class="windowbg">
<form action="', $scripturl, '?action=admin;area=maintain;sa=routine;activity=rebuild_settings" method="post" accept-charset="', $context['character_set'], '">
<p>
', $txt['maintain_rebuild_settings_info'], '
<input type="submit" value="', $txt['maintain_run_now'], '" class="button">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
</p>
</form>
</div>
<div class="cat_bar">
<h2 class="catbg">', $txt['maintain_logs'], '</h2>
</div>
<div class="windowbg">
<form action="', $scripturl, '?action=admin;area=maintain;sa=routine;activity=logs" method="post" accept-charset="', $context['character_set'], '">
<p>
', $txt['maintain_logs_info'], '
<input type="submit" value="', $txt['maintain_run_now'], '" class="button">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '">
</p>
</form>
</div>
<div class="cat_bar">
<h2 class="catbg">', $txt['maintain_cache'], '</h2>
</div>
<div class="windowbg">
<form action="', $scripturl, '?action=admin;area=maintain;sa=routine;activity=cleancache" method="post" accept-charset="', $context['character_set'], '">
<p>
', $txt['maintain_cache_info'], '
<input type="submit" value="', $txt['maintain_run_now'], '" class="button">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '">
</p>
</form>
</div>
</div><!-- #manage_maintenance -->';
}
/**
* Template for the member maintenance tasks.
*/
function template_maintain_members()
{
global $context, $settings, $txt, $scripturl;
echo '
<script>
var warningMessage = \'\';
var membersSwap = false;
function swapMembers()
{
membersSwap = !membersSwap;
var membersForm = document.getElementById(\'membersForm\');
$("#membersPanel").slideToggle(300);
document.getElementById("membersIcon").src = smf_images_url + (membersSwap ? "/selected_open.png" : "/selected.png");
setInnerHTML(document.getElementById("membersText"), membersSwap ? "', $txt['maintain_members_choose'], '" : "', $txt['maintain_members_all'], '");
for (var i = 0; i < membersForm.length; i++)
{
if (membersForm.elements[i].type.toLowerCase() == "checkbox")
membersForm.elements[i].checked = !membersSwap;
}
}
function checkAttributeValidity()
{
origText = \'', $txt['reattribute_confirm'], '\';
valid = true;
// Do all the fields!
if (!document.getElementById(\'to\').value)
valid = false;
warningMessage = origText.replace(/%member_to%/, document.getElementById(\'to\').value);
if (document.getElementById(\'type_email\').checked)
{
if (!document.getElementById(\'from_email\').value)
valid = false;
warningMessage = warningMessage.replace(/%type%/, \'', addcslashes($txt['reattribute_confirm_email'], "'"), '\').replace(/%find%/, document.getElementById(\'from_email\').value);
}
else
{
if (!document.getElementById(\'from_name\').value)
valid = false;
warningMessage = warningMessage.replace(/%type%/, \'', addcslashes($txt['reattribute_confirm_username'], "'"), '\').replace(/%find%/, document.getElementById(\'from_name\').value);
}
document.getElementById(\'do_attribute\').disabled = valid ? \'\' : \'disabled\';
setTimeout("checkAttributeValidity();", 500);
return valid;
}
setTimeout("checkAttributeValidity();", 500);
</script>
<div id="manage_maintenance">';
// If maintenance has finished, tell the user.
if (!empty($context['maintenance_finished']))
echo '
<div class="infobox">
', sprintf($txt['maintain_done'], $context['maintenance_finished']), '
</div>';
echo '
<div class="cat_bar">
<h2 class="catbg">', $txt['maintain_reattribute_posts'], '</h2>
</div>
<div class="windowbg">
<form action="', $scripturl, '?action=admin;area=maintain;sa=members;activity=reattribute" method="post" accept-charset="', $context['character_set'], '">
<p><strong>', $txt['reattribute_guest_posts'], '</strong></p>
<dl class="settings">
<dt>
<label for="type_email"><input type="radio" name="type" id="type_email" value="email" checked>', $txt['reattribute_email'], '</label>
</dt>
<dd>
<input type="text" name="from_email" id="from_email" value="" onclick="document.getElementById(\'type_email\').checked = \'checked\'; document.getElementById(\'from_name\').value = \'\';">
</dd>
<dt>
<label for="type_name"><input type="radio" name="type" id="type_name" value="name">', $txt['reattribute_username'], '</label>
</dt>
<dd>
<input type="text" name="from_name" id="from_name" value="" onclick="document.getElementById(\'type_name\').checked = \'checked\'; document.getElementById(\'from_email\').value = \'\';">
</dd>
</dl>
<dl class="settings">
<dt>
<label for="to"><strong>', $txt['reattribute_current_member'], ':</strong></label>
</dt>
<dd>
<input type="text" name="to" id="to" value="">
</dd>
</dl>
<p class="maintain_members">
<input type="checkbox" name="posts" id="posts" checked>
<label for="posts">', $txt['reattribute_increase_posts'], '</label>
</p>
<input type="submit" id="do_attribute" value="', $txt['reattribute'], '" onclick="if (!checkAttributeValidity()) return false;
return confirm(warningMessage);" class="button">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '">
</form>
</div><!-- .windowbg -->
<div class="cat_bar">
<h2 class="catbg">
<a href="', $scripturl, '?action=helpadmin;help=maintenance_members" onclick="return reqOverlayDiv(this.href);" class="help"><span class="main_icons help" title="', $txt['help'], '"></span></a> ', $txt['maintain_members'], '
</h2>
</div>
<div class="windowbg">
<form action="', $scripturl, '?action=admin;area=maintain;sa=members;activity=purgeinactive" method="post" accept-charset="', $context['character_set'], '" id="membersForm">
<p>
<a id="membersLink"></a>', $txt['maintain_members_since1'], '
<select name="del_type">
<option value="activated" selected>', $txt['maintain_members_activated'], '</option>
<option value="logged">', $txt['maintain_members_logged_in'], '</option>
</select>
', $txt['maintain_members_since2'], '
<input type="number" name="maxdays" value="30" size="3">', $txt['maintain_members_since3'], '
</p>
<p>
<a href="#membersLink" onclick="swapMembers();"><img src="', $settings['images_url'], '/selected.png" alt="+" id="membersIcon"></a> <a href="#membersLink" onclick="swapMembers();" id="membersText" style="font-weight: bold;">', $txt['maintain_members_all'], '</a>
</p>
<div style="display: none;" id="membersPanel">';
foreach ($context['membergroups'] as $group)
echo '
<label for="groups', $group['id'], '"><input type="checkbox" name="groups[', $group['id'], ']" id="groups', $group['id'], '" checked> ', $group['name'], '</label><br>';
echo '
</div>
<input type="submit" value="', $txt['maintain_old_remove'], '" data-confirm="', $txt['maintain_members_confirm'], '" class="button you_sure">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '">
</form>
</div><!-- .windowbg -->
<div class="cat_bar">
<h2 class="catbg">', $txt['maintain_recountposts'], '</h2>
</div>
<div class="windowbg">
<form action="', $scripturl, '?action=admin;area=maintain;sa=members;activity=recountposts" method="post" accept-charset="', $context['character_set'], '" id="membersRecountForm">
<p>', $txt['maintain_recountposts_info'], '</p>
<input type="submit" value="', $txt['maintain_run_now'], '" class="button">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '">
</form>
</div>
</div><!-- #manage_maintenance -->
<script>
var oAttributeMemberSuggest = new smc_AutoSuggest({
sSelf: \'oAttributeMemberSuggest\',
sSessionId: smf_session_id,
sSessionVar: smf_session_var,
sSuggestId: \'attributeMember\',
sControlId: \'to\',
sSearchType: \'member\',
sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
bItemList: false
});
</script>';
}
/**
* Template for the topic maintenance tasks.
*/
function template_maintain_topics()
{
global $scripturl, $txt, $context, $settings, $modSettings;
// If maintenance has finished tell the user.
if (!empty($context['maintenance_finished']))
echo '
<div class="infobox">
', sprintf($txt['maintain_done'], $context['maintenance_finished']), '
</div>';
// Bit of javascript for showing which boards to prune in an otherwise hidden list.
echo '
<script>
var rotSwap = false;
function swapRot()
{
rotSwap = !rotSwap;
// Toggle icon
document.getElementById("rotIcon").src = smf_images_url + (rotSwap ? "/selected_open.png" : "/selected.png");
setInnerHTML(document.getElementById("rotText"), rotSwap ? ', JavaScriptEscape($txt['maintain_old_choose']), ' : ', JavaScriptEscape($txt['maintain_old_all']), ');
// Toggle panel
$("#rotPanel").slideToggle(300);
// Toggle checkboxes
var rotPanel = document.getElementById(\'rotPanel\');
var oBoardCheckBoxes = rotPanel.getElementsByTagName(\'input\');
for (var i = 0; i < oBoardCheckBoxes.length; i++)
{
if (oBoardCheckBoxes[i].type.toLowerCase() == "checkbox")
oBoardCheckBoxes[i].checked = !rotSwap;
}
}
</script>';
echo '
<div id="manage_maintenance">
<div class="cat_bar">
<h2 class="catbg">', $txt['maintain_old'], '</h2>
</div>
<div class="windowbg">
<div class="flow_auto">
<form action="', $scripturl, '?action=admin;area=maintain;sa=topics;activity=pruneold" method="post" accept-charset="', $context['character_set'], '">';
// The otherwise hidden "choose which boards to prune".
echo '
<p>
<a id="rotLink"></a>', $txt['maintain_old_since_days1'], '<input type="number" name="maxdays" value="30" size="3">', $txt['maintain_old_since_days2'], '
</p>
<p>
<label for="delete_type_nothing"><input type="radio" name="delete_type" id="delete_type_nothing" value="nothing"> ', $txt['maintain_old_nothing_else'], '</label><br>
<label for="delete_type_moved"><input type="radio" name="delete_type" id="delete_type_moved" value="moved" checked> ', $txt['maintain_old_are_moved'], '</label><br>
<label for="delete_type_locked"><input type="radio" name="delete_type" id="delete_type_locked" value="locked"> ', $txt['maintain_old_are_locked'], '</label><br>
</p>
<p>
<label for="delete_old_not_sticky"><input type="checkbox" name="delete_old_not_sticky" id="delete_old_not_sticky" checked> ', $txt['maintain_old_are_not_stickied'], '</label><br>
</p>
<p>
<a href="#rotLink" onclick="swapRot();"><img src="', $settings['images_url'], '/selected.png" alt="+" id="rotIcon"></a> <a href="#rotLink" onclick="swapRot();" id="rotText" style="font-weight: bold;">', $txt['maintain_old_all'], '</a>
</p>
<div style="display: none;" id="rotPanel" class="flow_hidden">
<div class="floatleft" style="width: 49%">';
// This is the "middle" of the list.
$middle = ceil(count($context['categories']) / 2);
$i = 0;
foreach ($context['categories'] as $category)
{
echo '
<fieldset>
<legend>', $category['name'], '</legend>
<ul>';
// Display a checkbox with every board.
foreach ($category['boards'] as $board)
echo '
<li style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'] * 1.5, 'em;">
<label for="boards_', $board['id'], '"><input type="checkbox" name="boards[', $board['id'], ']" id="boards_', $board['id'], '" checked>', $board['name'], '</label>
</li>';
echo '
</ul>
</fieldset>';
// Increase $i, and check if we're at the middle yet.
if (++$i == $middle)
echo '
</div><!-- .floatleft -->
<div class="floatright" style="width: 49%;">';
}
echo '
</div>
</div><!-- #rotPanel -->
<input type="submit" value="', $txt['maintain_old_remove'], '" data-confirm="', $txt['maintain_old_confirm'], '" class="button you_sure">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '">
</form>
</div><!-- .flow_auto -->
</div><!-- .windowbg -->
<div class="cat_bar">
<h2 class="catbg">', $txt['maintain_old_drafts'], '</h2>
</div>
<div class="windowbg">
<form action="', $scripturl, '?action=admin;area=maintain;sa=topics;activity=olddrafts" method="post" accept-charset="', $context['character_set'], '">
<p>
', $txt['maintain_old_drafts_days'], ' <input type="number" name="draftdays" value="', (!empty($modSettings['drafts_keep_days']) ? $modSettings['drafts_keep_days'] : 30), '" size="3"> ', $txt['days_word'], '
</p>
<input type="submit" value="', $txt['maintain_old_remove'], '" data-confirm="', $txt['maintain_old_drafts_confirm'], '" class="button you_sure">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '">
</form>
</div>
<div class="cat_bar">
<h2 class="catbg">', $txt['move_topics_maintenance'], '</h2>
</div>
<div class="windowbg">
<form action="', $scripturl, '?action=admin;area=maintain;sa=topics;activity=massmove" method="post" accept-charset="', $context['character_set'], '">
<p>
<label for="id_board_from">', $txt['move_topics_from'], ' </label>
<select name="id_board_from" id="id_board_from">
<option disabled>(', $txt['move_topics_select_board'], ')</option>';
// From board
foreach ($context['categories'] as $category)
{
echo '
<optgroup label="', $category['name'], '">';
foreach ($category['boards'] as $board)
echo '
<option value="', $board['id'], '"> ', str_repeat('==', $board['child_level']), '=&gt;&nbsp;', $board['name'], '</option>';
echo '
</optgroup>';
}
echo '
</select>
<label for="id_board_to">', $txt['move_topics_to'], '</label>
<select name="id_board_to" id="id_board_to">
<option disabled>(', $txt['move_topics_select_board'], ')</option>';
// To board
foreach ($context['categories'] as $category)
{
echo '
<optgroup label="', $category['name'], '">';
foreach ($category['boards'] as $board)
echo '
<option value="', $board['id'], '"> ', str_repeat('==', $board['child_level']), '=&gt;&nbsp;', $board['name'], '</option>';
echo '
</optgroup>';
}
echo '
</select>
</p>
<p>
', $txt['move_topics_older_than'], '
<input type="number" name="maxdays" value="30" size="3">
', $txt['manageposts_days'], ' (', $txt['move_zero_all'], ')
</p>
<p>
<label for="move_type_locked"><input type="checkbox" name="move_type_locked" id="move_type_locked" checked> ', $txt['move_type_locked'], '</label><br>
<label for="move_type_sticky"><input type="checkbox" name="move_type_sticky" id="move_type_sticky"> ', $txt['move_type_sticky'], '</label><br>
</p>
<input type="submit" value="', $txt['move_topics_now'], '" onclick="if (document.getElementById(\'id_board_from\').options[document.getElementById(\'id_board_from\').selectedIndex].disabled || document.getElementById(\'id_board_from\').options[document.getElementById(\'id_board_to\').selectedIndex].disabled) return false; var confirmText = \'', $txt['move_topics_confirm'] . '\'; return confirm(confirmText.replace(/%board_from%/, document.getElementById(\'id_board_from\').options[document.getElementById(\'id_board_from\').selectedIndex].text.replace(/^=+&gt;&nbsp;/, \'\')).replace(/%board_to%/, document.getElementById(\'id_board_to\').options[document.getElementById(\'id_board_to\').selectedIndex].text.replace(/^=+&gt;&nbsp;/, \'\')));" class="button">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '">
</form>
</div><!-- .windowbg -->
</div><!-- #manage_maintenance -->';
}
/**
* Simple template for showing results of our optimization...
*/
function template_optimize()
{
global $context, $txt, $scripturl;
echo '
<div id="manage_maintenance">
<div class="cat_bar">
<h2 class="catbg">', $txt['maintain_optimize'], '</h2>
</div>
<div class="windowbg">
<p>
', $txt['database_numb_tables'], '<br>
', $txt['database_optimize_attempt'], '<br>';
// List each table being optimized...
foreach ($context['optimized_tables'] as $table)
echo '
', sprintf($txt['database_optimizing'], $table['name'], $table['data_freed']), '<br>';
// How did we go?
echo '
<br>
', $context['num_tables_optimized'] == 0 ? $txt['database_already_optimized'] : $context['num_tables_optimized'] . ' ' . $txt['database_optimized'];
echo '
</p>
<p><a href="', $scripturl, '?action=admin;area=maintain">', $txt['maintain_return'], '</a></p>
</div><!-- .windowbg -->
</div><!-- #manage_maintenance -->';
}
/**
* Template for converting entities to UTF-8 characters
*/
function template_convert_entities()
{
global $context, $txt, $scripturl;
echo '
<div id="manage_maintenance">
<div class="cat_bar">
<h2 class="catbg">', $txt['entity_convert_title'], '</h2>
</div>
<div class="windowbg">
<p>', $txt['entity_convert_introduction'], '</p>
<form action="', $scripturl, '?action=admin;area=maintain;sa=database;activity=convertentities;start=0;', $context['session_var'], '=', $context['session_id'], '" method="post" accept-charset="', $context['character_set'], '">
<input type="submit" value="', $txt['entity_convert_proceed'], '" class="button">
</form>
</div>
</div>';
}
/**
* Template for converting posts to UTF-8.
*/
function template_convert_msgbody()
{
global $context, $txt, $scripturl;
echo '
<div id="manage_maintenance">
<div class="cat_bar">
<h2 class="catbg">', $txt[$context['convert_to'] . '_title'], '</h2>
</div>
<div class="windowbg">
<p>', $txt['body_checking_introduction'], '</p>';
if (!empty($context['exceeding_messages']))
{
echo '
<p class="noticebox">', $txt['exceeding_messages'], '</p>
<ul>
<li>
', implode('</li><li>', $context['exceeding_messages']), '
</li>
</ul>';
if (!empty($context['exceeding_messages_morethan']))
echo '
<p>', $context['exceeding_messages_morethan'], '</p>';
}
else
echo '
<p class="infobox">', $txt['convert_to_text'], '</p>';
echo '
<form action="', $scripturl, '?action=admin;area=maintain;sa=database;activity=convertmsgbody" method="post" accept-charset="', $context['character_set'], '">
<hr>
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '">
<input type="submit" name="do_conversion" value="', $txt['entity_convert_proceed'], '" class="button">
</form>
</div><!-- .windowbg -->
</div><!-- #manage_maintenance -->';
}
?>

View file

@ -0,0 +1,752 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* The main page listing all the groups.
*/
function template_main()
{
template_show_list('regular_membergroups_list');
echo '<br><br>';
template_show_list('post_count_membergroups_list');
}
/**
* Add a new membergroup.
*/
function template_new_group()
{
global $context, $scripturl, $txt, $modSettings;
echo '
<form id="new_group" action="', $scripturl, '?action=admin;area=membergroups;sa=add" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">', $txt['membergroups_new_group'], '</h2>
</div>
<div class="windowbg">
<dl class="settings">
<dt>
<label for="group_name_input"><strong>', $txt['membergroups_group_name'], ':</strong></label>
</dt>
<dd>
<input type="text" name="group_name" id="group_name_input" size="30">
</dd>';
if ($context['undefined_group'])
{
echo '
<dt>
<label for="group_type"><strong>', $txt['membergroups_edit_group_type'], '</strong>:</label>
</dt>
<dd>
<fieldset id="group_type">
<legend>', $txt['membergroups_edit_select_group_type'], '</legend>
<label for="group_type_private"><input type="radio" name="group_type" id="group_type_private" value="0" checked onclick="swapPostGroup(0);">', $txt['membergroups_group_type_private'], '</label><br>';
if ($context['allow_protected'])
echo '
<label for="group_type_protected"><input type="radio" name="group_type" id="group_type_protected" value="1" onclick="swapPostGroup(0);">', $txt['membergroups_group_type_protected'], '</label><br>';
echo '
<label for="group_type_request"><input type="radio" name="group_type" id="group_type_request" value="2" onclick="swapPostGroup(0);">', $txt['membergroups_group_type_request'], '</label><br>
<label for="group_type_free"><input type="radio" name="group_type" id="group_type_free" value="3" onclick="swapPostGroup(0);">', $txt['membergroups_group_type_free'], '</label><br>
<label for="group_type_post"><input type="radio" name="group_type" id="group_type_post" value="-1" onclick="swapPostGroup(1);">', $txt['membergroups_group_type_post'], '</label><br>
</fieldset>
</dd>';
}
if ($context['post_group'] || $context['undefined_group'])
echo '
<dt id="min_posts_text">
<strong>', $txt['membergroups_min_posts'], ':</strong>
</dt>
<dd>
<input type="number" name="min_posts" id="min_posts_input" size="5">
</dd>';
if (!$context['post_group'] || !empty($modSettings['permission_enable_postgroups']))
{
echo '
<dt>
<label for="permission_base"><strong>', $txt['membergroups_permissions'], ':</strong></label><br>
<span class="smalltext">', $txt['membergroups_can_edit_later'], '</span>
</dt>
<dd>
<fieldset id="permission_base">
<legend>', $txt['membergroups_select_permission_type'], '</legend>
<input type="radio" name="perm_type" id="perm_type_inherit" value="inherit" checked>
<label for="perm_type_inherit">', $txt['membergroups_new_as_inherit'], ':</label>
<select name="inheritperm" id="inheritperm_select" onclick="document.getElementById(\'perm_type_inherit\').checked = true;">
<option value="-1">', $txt['membergroups_guests'], '</option>
<option value="0" selected>', $txt['membergroups_members'], '</option>';
foreach ($context['groups'] as $group)
echo '
<option value="', $group['id'], '">', $group['name'], '</option>';
echo '
</select>
<br>
<input type="radio" name="perm_type" id="perm_type_copy" value="copy">
<label for="perm_type_copy">', $txt['membergroups_new_as_copy'], ':</label>
<select name="copyperm" id="copyperm_select" onclick="document.getElementById(\'perm_type_copy\').checked = true;">
<option value="-1">', $txt['membergroups_guests'], '</option>
<option value="0" selected>', $txt['membergroups_members'], '</option>';
foreach ($context['groups'] as $group)
echo '
<option value="', $group['id'], '">', $group['name'], '</option>';
echo '
</select>
<br>
<input type="radio" name="perm_type" id="perm_type_predefined" value="predefined">
<label for="perm_type_predefined">', $txt['membergroups_new_as_type'], ':</label>
<select name="level" id="level_select" onclick="document.getElementById(\'perm_type_predefined\').checked = true;">
<option value="restrict">', $txt['permitgroups_restrict'], '</option>
<option value="standard" selected>', $txt['permitgroups_standard'], '</option>
<option value="moderator">', $txt['permitgroups_moderator'], '</option>
<option value="maintenance">', $txt['permitgroups_maintenance'], '</option>
</select>
</fieldset>
</dd>';
}
echo '
<dt>
<strong>', $txt['membergroups_new_board'], ':</strong>', $context['post_group'] ? '<br>
<span class="smalltext">' . $txt['membergroups_new_board_post_groups'] . '</span>' : '', '
</dt>
<dd>';
template_add_edit_group_boards_list(false);
echo '
</dd>
</dl>
<input type="submit" value="', $txt['membergroups_add_group'], '" class="button">
</div><!-- .windowbg -->';
if ($context['undefined_group'])
echo '
<script>
function swapPostGroup(isChecked)
{
var min_posts_text = document.getElementById(\'min_posts_text\');
document.getElementById(\'min_posts_input\').disabled = !isChecked;
min_posts_text.style.color = isChecked ? "" : "#888888";
}
swapPostGroup(', $context['post_group'] ? 'true' : 'false', ');
</script>';
echo '
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-mmg_token_var'], '" value="', $context['admin-mmg_token'], '">
</form>';
}
/**
* Edit an existing membergroup.
*/
function template_edit_group()
{
global $context, $scripturl, $txt, $modSettings;
echo '
<form action="', $scripturl, '?action=admin;area=membergroups;sa=edit;group=', $context['group']['id'], '" method="post" accept-charset="', $context['character_set'], '" name="groupForm" id="groupForm">
<div class="cat_bar">
<h2 class="catbg">', $txt['membergroups_edit_group'], ' - ', $context['group']['name'], '
</h2>
</div>
<div class="windowbg">
<dl class="settings">
<dt>
<label for="group_name_input"><strong>', $txt['membergroups_edit_name'], ':</strong></label>
</dt>
<dd>
<input type="text" name="group_name" id="group_name_input" value="', $context['group']['editable_name'], '" size="30">
</dd>';
if ($context['group']['id'] != 3 && $context['group']['id'] != 4)
echo '
<dt id="group_desc_text">
<label for="group_desc_input"><strong>', $txt['membergroups_edit_desc'], ':</strong></label>
</dt>
<dd>
<textarea name="group_desc" id="group_desc_input" rows="4" cols="40">', $context['group']['description'], '</textarea>
</dd>';
// Group type...
if ($context['group']['allow_post_group'])
{
echo '
<dt>
<label for="group_type"><strong>', $txt['membergroups_edit_group_type'], ':</strong></label>
</dt>
<dd>
<fieldset id="group_type">
<legend>', $txt['membergroups_edit_select_group_type'], '</legend>
<label for="group_type_private"><input type="radio" name="group_type" id="group_type_private" value="0"', !$context['group']['is_post_group'] && $context['group']['type'] == 0 ? ' checked' : '', ' onclick="swapPostGroup(0);">', $txt['membergroups_group_type_private'], '</label><br>';
if ($context['group']['allow_protected'])
echo '
<label for="group_type_protected"><input type="radio" name="group_type" id="group_type_protected" value="1"', $context['group']['type'] == 1 ? ' checked' : '', ' onclick="swapPostGroup(0);">', $txt['membergroups_group_type_protected'], '</label><br>';
echo '
<label for="group_type_request"><input type="radio" name="group_type" id="group_type_request" value="2"', $context['group']['type'] == 2 ? ' checked' : '', ' onclick="swapPostGroup(0);">', $txt['membergroups_group_type_request'], '</label><br>
<label for="group_type_free"><input type="radio" name="group_type" id="group_type_free" value="3"', $context['group']['type'] == 3 ? ' checked' : '', ' onclick="swapPostGroup(0);">', $txt['membergroups_group_type_free'], '</label><br>
<label for="group_type_post"><input type="radio" name="group_type" id="group_type_post" value="-1"', $context['group']['is_post_group'] ? ' checked' : '', ' onclick="swapPostGroup(1);">', $txt['membergroups_group_type_post'], '</label><br>
</fieldset>
</dd>';
}
if ($context['group']['id'] != 3 && $context['group']['id'] != 4)
echo '
<dt id="group_moderators_text">
<label for="group_moderators"><strong>', $txt['moderators'], ':</strong></label>
</dt>
<dd>
<input type="text" name="group_moderators" id="group_moderators" value="', $context['group']['moderator_list'], '" size="30">
<div id="moderator_container"></div>
</dd>
<dt id="group_hidden_text">
<label for="group_hidden_input"><strong>', $txt['membergroups_edit_hidden'], ':</strong></label>
</dt>
<dd>
<select name="group_hidden" id="group_hidden_input" onchange="if (this.value == 2 &amp;&amp; !confirm(\'', $txt['membergroups_edit_hidden_warning'], '\')) this.value = 0;">
<option value="0"', $context['group']['hidden'] ? '' : ' selected', '>', $txt['membergroups_edit_hidden_no'], '</option>
<option value="1"', $context['group']['hidden'] == 1 ? ' selected' : '', '>', $txt['membergroups_edit_hidden_boardindex'], '</option>
<option value="2"', $context['group']['hidden'] == 2 ? ' selected' : '', '>', $txt['membergroups_edit_hidden_all'], '</option>
</select>
</dd>';
// Can they inherit permissions?
if ($context['group']['id'] > 1 && $context['group']['id'] != 3)
{
echo '
<dt id="group_inherit_text">
<label for="group_inherit_input"><strong>', $txt['membergroups_edit_inherit_permissions'], '</strong></label>:<br>
<span class="smalltext">', $txt['membergroups_edit_inherit_permissions_desc'], '</span>
</dt>
<dd>
<select name="group_inherit" id="group_inherit_input">
<option value="-2">', $txt['membergroups_edit_inherit_permissions_no'], '</option>
<option value="-1"', $context['group']['inherited_from'] == -1 ? ' selected' : '', '>', $txt['membergroups_edit_inherit_permissions_from'], ': ', $txt['membergroups_guests'], '</option>
<option value="0"', $context['group']['inherited_from'] == 0 ? ' selected' : '', '>', $txt['membergroups_edit_inherit_permissions_from'], ': ', $txt['membergroups_members'], '</option>';
// For all the inheritable groups show an option.
foreach ($context['inheritable_groups'] as $id => $group)
echo '
<option value="', $id, '"', $context['group']['inherited_from'] == $id ? ' selected' : '', '>', $txt['membergroups_edit_inherit_permissions_from'], ': ', $group, '</option>';
echo '
</select>
<input type="hidden" name="old_inherit" value="', $context['group']['inherited_from'], '">
</dd>';
}
if ($context['group']['allow_post_group'])
echo '
<dt id="min_posts_text">
<label for="min_posts_input"><strong>', $txt['membergroups_min_posts'], ':</strong></label>
</dt>
<dd>
<input type="number" name="min_posts" id="min_posts_input"', $context['group']['is_post_group'] ? ' value="' . $context['group']['min_posts'] . '"' : '', ' size="6">
</dd>';
echo '
<dt>
<label for="online_color_input"><strong>', $txt['membergroups_online_color'], ':</strong></label>
</dt>
<dd>
<input type="text" name="online_color" id="online_color_input" value="', $context['group']['color'], '" size="20">
</dd>
<dt>
<label for="icon_count_input"><strong>', $txt['membergroups_icon_count'], ':</strong></label>
</dt>
<dd>
<input type="number" name="icon_count" id="icon_count_input" value="', $context['group']['icon_count'], '" size="4">
</dd>';
// Do we have any possible icons to select from?
if (!empty($context['possible_icons']))
{
echo '
<dt>
<label for="icon_image_input"><strong>', $txt['membergroups_icon_image'], ':</strong></label><br>
<span class="smalltext">', $txt['membergroups_icon_image_note'], '</span>
<span class="smalltext">', $txt['membergroups_icon_image_size'], '</span>
</dt>
<dd>
', $txt['membergroups_images_url'], '
<select name="icon_image" id="icon_image_input">';
// For every possible icon, create an option.
foreach ($context['possible_icons'] as $icon)
echo '
<option value="', $icon, '"', $context['group']['icon_image'] == $icon ? ' selected' : '', '>', $icon, '</option>';
echo '
</select>
<img id="icon_preview" src="" alt="*">
</dd>';
}
// No? Hide the entire control.
else
echo '
<input type="hidden" name="icon_image" value="">';
echo '
<dt>
<label for="max_messages_input"><strong>', $txt['membergroups_max_messages'], ':</strong></label><br>
<span class="smalltext">', $txt['membergroups_max_messages_note'], '</span>
</dt>
<dd>
<input type="text" name="max_messages" id="max_messages_input" value="', $context['group']['id'] == 1 ? 0 : $context['group']['max_messages'], '" size="6"', $context['group']['id'] == 1 ? ' disabled' : '', '>
</dd>';
// Force 2FA for this membergroup?
if (!empty($modSettings['tfa_mode']) && $modSettings['tfa_mode'] == 2)
echo '
<dt>
<label for="group_tfa_force_input"><strong>', $txt['membergroups_tfa_force'], ':</strong></label><br>
<span class="smalltext">', $txt['membergroups_tfa_force_note'], '</span>
</dt>
<dd>
<input type="checkbox" name="group_tfa_force"', $context['group']['tfa_required'] ? ' checked' : '', '>
</dd>';
if (!empty($context['categories']))
{
echo '
<dt>
<strong>', $txt['membergroups_new_board'], ':</strong>', $context['group']['is_post_group'] ? '<br>
<span class="smalltext">' . $txt['membergroups_new_board_post_groups'] . '</span>' : '', '
</dt>
<dd>';
if (!empty($context['can_manage_boards']))
echo $txt['membergroups_can_manage_access'];
else
template_add_edit_group_boards_list(true, 'groupForm');
echo '
</dd>';
}
echo '
</dl>
<input type="submit" name="save" value="', $txt['membergroups_edit_save'], '" class="button">', $context['group']['allow_delete'] ? '
<input type="submit" name="delete" value="' . $txt['membergroups_delete'] . '" data-confirm="' . ($context['is_moderator_group'] ? $txt['membergroups_confirm_delete_mod'] : $txt['membergroups_confirm_delete']) . '" class="button you_sure">' : '', '
</div><!-- .windowbg -->
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-mmg_token_var'], '" value="', $context['admin-mmg_token'], '">
</form>
<script>
var oModeratorSuggest = new smc_AutoSuggest({
sSelf: \'oModeratorSuggest\',
sSessionId: smf_session_id,
sSessionVar: smf_session_var,
sSuggestId: \'group_moderators\',
sControlId: \'group_moderators\',
sSearchType: \'member\',
bItemList: true,
sPostName: \'moderator_list\',
sURLMask: \'action=profile;u=%item_id%\',
sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
sItemListContainerId: \'moderator_container\',
aListItems: [';
foreach ($context['group']['moderators'] as $id_member => $member_name)
echo '
{
sItemId: ', JavaScriptEscape($id_member), ',
sItemName: ', JavaScriptEscape($member_name), '
}', $id_member == $context['group']['last_moderator_id'] ? '' : ',';
echo '
]
});
</script>';
if ($context['group']['allow_post_group'])
echo '
<script>
function swapPostGroup(isChecked)
{
var is_moderator_group = ', (int)$context['is_moderator_group'], ';
var group_type = ', $context['group']['type'], ';
var min_posts_text = document.getElementById(\'min_posts_text\');
var group_desc_text = document.getElementById(\'group_desc_text\');
var group_hidden_text = document.getElementById(\'group_hidden_text\');
var group_moderators_text = document.getElementById(\'group_moderators_text\');
// If it\'s a moderator group, warn of possible problems... and remember the group type
if (isChecked && is_moderator_group && !confirm(\'', $txt['membergroups_swap_mod'], '\'))
{
isChecked = false;
switch(group_type)
{
case 0:
document.getElementById(\'group_type_private\').checked = true;
break;
case 1:
document.getElementById(\'group_type_protected\').checked = true;
break;
case 2:
document.getElementById(\'group_type_request\').checked = true;
break;
case 3:
document.getElementById(\'group_type_free\').checked = true;
break;
default:
document.getElementById(\'group_type_private\').checked = true;
break;
}
}
document.forms.groupForm.min_posts.disabled = !isChecked;
min_posts_text.style.color = isChecked ? "" : "#888888";
document.forms.groupForm.group_desc_input.disabled = isChecked;
group_desc_text.style.color = !isChecked ? "" : "#888888";
document.forms.groupForm.group_hidden_input.disabled = isChecked;
group_hidden_text.style.color = !isChecked ? "" : "#888888";
document.forms.groupForm.group_moderators.disabled = isChecked;
group_moderators_text.style.color = !isChecked ? "" : "#888888";
}
swapPostGroup(', $context['group']['is_post_group'] ? 'true' : 'false', ');
</script>';
}
/**
* The template for determining which boards a group has access to.
*
* @param bool $collapse Whether to collapse the list by default
*/
function template_add_edit_group_boards_list($collapse = true, $form_id = 'new_group')
{
global $context, $txt, $modSettings;
echo '
<fieldset id="visible_boards"', !empty($modSettings['deny_boards_access']) ? ' class="denyboards_layout"' : '', '>
<legend>', $txt['membergroups_new_board_desc'], '</legend>
<ul class="padding floatleft">';
foreach ($context['categories'] as $category)
{
if (empty($modSettings['deny_boards_access']))
echo '
<li class="category">
<a href="javascript:void(0);" onclick="selectBoards([', implode(', ', $category['child_ids']), '], \''.$form_id.'\'); return false;"><strong>', $category['name'], '</strong></a>
<ul>';
else
echo '
<li class="category clear">
<strong>', $category['name'], '</strong>
<span class="select_all_box floatright">
<em class="all_boards_in_cat">', $txt['all_boards_in_cat'], ': </em>
<select onchange="select_in_category(', $category['id'], ', this, [', implode(',', array_keys($category['boards'])), ']);">
<option>---</option>
<option value="allow">', $txt['board_perms_allow'], '</option>
<option value="ignore">', $txt['board_perms_ignore'], '</option>
<option value="deny">', $txt['board_perms_deny'], '</option>
</select>
</span>
<ul id="boards_list_', $category['id'], '">';
foreach ($category['boards'] as $board)
{
if (empty($modSettings['deny_boards_access']))
echo '
<li class="board" style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">
<input type="checkbox" name="boardaccess[', $board['id'], ']" id="brd', $board['id'], '" value="allow"', $board['allow'] ? ' checked' : '', '> <label for="brd', $board['id'], '">', $board['name'], '</label>
</li>';
else
echo '
<li class="board clear">
<span style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">', $board['name'], ': </span>
<span class="floatright">
<input type="radio" name="boardaccess[', $board['id'], ']" id="allow_brd', $board['id'], '" value="allow"', $board['allow'] ? ' checked' : '', '> <label for="allow_brd', $board['id'], '">', $txt['permissions_option_on'], '</label>
<input type="radio" name="boardaccess[', $board['id'], ']" id="ignore_brd', $board['id'], '" value="ignore"', !$board['allow'] && !$board['deny'] ? ' checked' : '', '> <label for="ignore_brd', $board['id'], '">', $txt['permissions_option_off'], '</label>
<input type="radio" name="boardaccess[', $board['id'], ']" id="deny_brd', $board['id'], '" value="deny"', $board['deny'] ? ' checked' : '', '> <label for="deny_brd', $board['id'], '">', $txt['permissions_option_deny'], '</label>
</span>
</li>';
}
echo '
</ul>
</li>';
}
echo '
</ul>';
if (empty($modSettings['deny_boards_access']))
echo '
<br class="clear"><br>
<input type="checkbox" id="checkall_check" onclick="invertAll(this, this.form, \'boardaccess\');">
<label for="checkall_check"><em>', $txt['check_all'], '</em></label>
</fieldset>';
else
echo '
<br class="clear">
<span class="select_all_box">
<em>', $txt['all'], ': </em>
<input type="radio" name="select_all" id="allow_all" onclick="selectAllRadio(this, this.form, \'boardaccess\', \'allow\');"> <label for="allow_all">', $txt['board_perms_allow'], '</label>
<input type="radio" name="select_all" id="ignore_all" onclick="selectAllRadio(this, this.form, \'boardaccess\', \'ignore\');"> <label for="ignore_all">', $txt['board_perms_ignore'], '</label>
<input type="radio" name="select_all" id="deny_all" onclick="selectAllRadio(this, this.form, \'boardaccess\', \'deny\');"> <label for="deny_all">', $txt['board_perms_deny'], '</label>
</span>
</fieldset>
<script>
$(document).ready(function () {
$(".select_all_box").each(function () {
$(this).removeClass(\'select_all_box\');
});
});
</script>';
if ($collapse)
echo '
<a href="javascript:void(0);" onclick="document.getElementById(\'visible_boards\').classList.remove(\'hidden\'); document.getElementById(\'visible_boards_link\').classList.add(\'hidden\'); return false;" id="visible_boards_link" class="hidden">[ ', $txt['membergroups_select_visible_boards'], ' ]</a>
<script>
document.getElementById("visible_boards_link").classList.remove(\'hidden\');
document.getElementById("visible_boards").classList.add(\'hidden\');
</script>';
}
/**
* Template for viewing the members of a group.
*/
function template_group_members()
{
global $context, $scripturl, $txt;
echo '
<form action="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;group=', $context['group']['id'], '" method="post" accept-charset="', $context['character_set'], '" id="view_group">
<div class="cat_bar">
<h2 class="catbg">', $context['page_title'], '</h2>
</div>
<div class="windowbg">
<dl class="settings">
<dt>
<strong>', $txt['name'], ':</strong>
</dt>
<dd>
<span ', $context['group']['online_color'] ? 'style="color: ' . $context['group']['online_color'] . ';"' : '', '>', $context['group']['name'], '</span> ', $context['group']['icons'], '
</dd>';
// Any description to show?
if (!empty($context['group']['description']))
echo '
<dt>
<strong>' . $txt['membergroups_members_description'] . ':</strong>
</dt>
<dd>
', $context['group']['description'], '
</dd>';
echo '
<dt>
<strong>', $txt['membergroups_members_top'], ':</strong>
</dt>
<dd>
', $context['total_members'], '
</dd>';
// Any group moderators to show?
if (!empty($context['group']['moderators']))
{
$moderators = array();
foreach ($context['group']['moderators'] as $moderator)
$moderators[] = '<a href="' . $scripturl . '?action=profile;u=' . $moderator['id'] . '">' . $moderator['name'] . '</a>';
echo '
<dt>
<strong>', $txt['membergroups_members_group_moderators'], ':</strong>
</dt>
<dd>
', implode(', ', $moderators), '
</dd>';
}
echo '
</dl>
</div><!-- .windowbg -->
<br>
<div class="cat_bar">
<h2 class="catbg">', $txt['membergroups_members_group_members'], '</h2>
</div>
<br>
<div class="pagesection">
<div class="pagelinks">', $context['page_index'], '</div>
</div>
<table class="table_grid" id="group_members">
<thead>
<tr class="title_bar">
<th class="user_name"><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=name', $context['sort_by'] == 'name' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['name'], $context['sort_by'] == 'name' ? ' <span class="main_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>';
if ($context['can_send_email'])
echo '
<th class="email"><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=email', $context['sort_by'] == 'email' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['email'], $context['sort_by'] == 'email' ? ' <span class="main_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>';
echo '
<th class="last_active"><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=active', $context['sort_by'] == 'active' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['membergroups_members_last_active'], $context['sort_by'] == 'active' ? '<span class="main_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>
<th class="date_registered"><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=registered', $context['sort_by'] == 'registered' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['date_registered'], $context['sort_by'] == 'registered' ? '<span class="main_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>
<th class="posts"', empty($context['group']['assignable']) ? ' colspan="2"' : '', '>
<a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=posts', $context['sort_by'] == 'posts' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['posts'], $context['sort_by'] == 'posts' ? ' <span class="main_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a>
</th>';
if (!empty($context['group']['assignable']))
echo '
<th class="quick_moderation" style="width: 4%"><input type="checkbox" onclick="invertAll(this, this.form);"></th>';
echo '
</tr>
</thead>
<tbody>';
if (empty($context['members']))
echo '
<tr class="windowbg">
<td colspan="6">', $txt['membergroups_members_no_members'], '</td>
</tr>';
foreach ($context['members'] as $member)
{
echo '
<tr class="windowbg">
<td class="user_name">', $member['name'], '</td>';
if ($context['can_send_email'])
echo '
<td class="email">
<a href="mailto:', $member['email'], '">', $member['email'], '</a>
</td>';
echo '
<td class="last_active">', $member['last_online'], '</td>
<td class="date_registered">', $member['registered'], '</td>
<td class="posts"', empty($context['group']['assignable']) ? ' colspan="2"' : '', '>', $member['posts'], '</td>';
if (!empty($context['group']['assignable']))
echo '
<td class="quick_moderation" style="width: 4%"><input type="checkbox" name="rem[]" value="', $member['id'], '" ', ($context['user']['id'] == $member['id'] && $context['group']['id'] == 1 ? 'onclick="if (this.checked) return confirm(\'' . $txt['membergroups_members_deadmin_confirm'] . '\')" ' : ''), '/></td>';
echo '
</tr>';
}
echo '
</tbody>
</table>';
if (!empty($context['group']['assignable']))
echo '
<div class="floatright">
<input type="submit" name="remove" value="', $txt['membergroups_members_remove'], '" class="button ">
</div>';
echo '
<div class="pagesection">
<div class="pagelinks">', $context['page_index'], '</div>
</div>
<br>';
if (!empty($context['group']['assignable']))
echo '
<div class="cat_bar">
<h2 class="catbg">', $txt['membergroups_members_add_title'], '</h2>
</div>
<div class="windowbg">
<dl class="settings">
<dt>
<strong><label for="toAdd">', $txt['membergroups_members_add_desc'], ':</label></strong>
</dt>
<dd>
<input type="text" name="toAdd" id="toAdd" value="">
<div id="toAddItemContainer"></div>
</dd>
</dl>
<input type="submit" name="add" value="', $txt['membergroups_members_add'], '" class="button">
</div>';
echo '
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['mod-mgm_token_var'], '" value="', $context['mod-mgm_token'], '">
</form>';
if (!empty($context['group']['assignable']))
echo '
<script>
var oAddMemberSuggest = new smc_AutoSuggest({
sSelf: \'oAddMemberSuggest\',
sSessionId: \'', $context['session_id'], '\',
sSessionVar: \'', $context['session_var'], '\',
sSuggestId: \'to_suggest\',
sControlId: \'toAdd\',
sSearchType: \'member\',
sPostName: \'member_add\',
sURLMask: \'action=profile;u=%item_id%\',
sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
bItemList: true,
sItemListContainerId: \'toAddItemContainer\'
});
</script>';
}
/**
* Allow the moderator to enter a reason to each user being rejected.
*/
function template_group_request_reason()
{
global $context, $txt, $scripturl;
// Show a welcome message to the user.
echo '
<div id="moderationcenter">
<form action="', $scripturl, '?action=groups;sa=requests" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">', $txt['mc_groups_reason_title'], '</h2>
</div>
<div class="windowbg">
<dl class="settings">';
// Loop through and print out a reason box for each...
foreach ($context['group_requests'] as $request)
echo '
<dt>
<strong>', sprintf($txt['mc_groupr_reason_desc'], $request['member_link'], $request['group_link']), ':</strong>
</dt>
<dd>
<input type="hidden" name="groupr[]" value="', $request['id'], '">
<textarea name="groupreason[', $request['id'], ']" rows="3" cols="40"></textarea>
</dd>';
echo '
</dl>
<input type="submit" name="go" value="', $txt['mc_groupr_submit'], '" class="button">
<input type="hidden" name="req_action" value="got_reason">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['mod-gr_token_var'], '" value="', $context['mod-gr_token'], '">
</div><!-- .windowbg -->
</form>
</div><!-- #moderationcenter -->';
}
?>

293
ManageMembers.template.php Normal file
View file

@ -0,0 +1,293 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* The admin member search form
*/
function template_search_members()
{
global $context, $scripturl, $txt;
echo '
<form action="', $scripturl, '?action=admin;area=viewmembers" method="post" accept-charset="', $context['character_set'], '" id="admin_form_wrapper">
<input type="hidden" name="sa" value="query">
<div class="cat_bar">
<h2 class="catbg">
<span class="floatleft">', $txt['search_for'], '</span>
<span class="smalltext floatright">', $txt['wild_cards_allowed'], '</span>
</h2>
</div>
<div class="windowbg">
<div class="flow_hidden">
<div class="msearch_details floatleft">
<dl class="settings right">
<dt class="righttext">
<strong><label for="mem_id">', $txt['member_id'], ':</label></strong>
<select name="types[mem_id]">
<option value="--">&lt;</option>
<option value="-">&lt;=</option>
<option value="=" selected>=</option>
<option value="+">&gt;=</option>
<option value="++">&gt;</option>
</select>
</dt>
<dd>
<input type="number" name="mem_id" id="mem_id" value="" size="6">
</dd>
<dt class="righttext">
<strong><label for="age">', $txt['age'], ':</label></strong>
<select name="types[age]">
<option value="--">&lt;</option>
<option value="-">&lt;=</option>
<option value="=" selected>=</option>
<option value="+">&gt;=</option>
<option value="++">&gt;</option>
</select>
</dt>
<dd>
<input type="number" name="age" id="age" value="" size="6">
</dd>
<dt class="righttext">
<strong><label for="posts">', $txt['member_postcount'], ':</label></strong>
<select name="types[posts]">
<option value="--">&lt;</option>
<option value="-">&lt;=</option>
<option value="=" selected>=</option>
<option value="+">&gt;=</option>
<option value="++">&gt;</option>
</select>
</dt>
<dd>
<input type="number" name="posts" id="posts" value="" size="6">
</dd>
<dt class="righttext">
<strong><label for="reg_date">', $txt['date_registered'], ':</label></strong>
<select name="types[reg_date]">
<option value="--">&lt;</option>
<option value="-">&lt;=</option>
<option value="=" selected>=</option>
<option value="+">&gt;=</option>
<option value="++">&gt;</option>
</select>
</dt>
<dd>
<input type="date" name="reg_date" id="reg_date" value="" size="10"><span class="smalltext"></span>
</dd>
<dt class="righttext">
<strong><label for="last_online">', $txt['viewmembers_online'], ':</label></strong>
<select name="types[last_online]">
<option value="--">&lt;</option>
<option value="-">&lt;=</option>
<option value="=" selected>=</option>
<option value="+">&gt;=</option>
<option value="++">&gt;</option>
</select>
</dt>
<dd>
<input type="date" name="last_online" id="last_online" value="" size="10"><span class="smalltext"></span>
</dd>
</dl>
</div><!-- .msearch_details -->
<div class="msearch_details floatright">
<dl class="settings right">
<dt class="righttext">
<strong><label for="membername">', $txt['username'], ':</label></strong>
</dt>
<dd>
<input type="text" name="membername" id="membername" value="">
</dd>
<dt class="righttext">
<strong><label for="email">', $txt['email_address'], ':</label></strong>
</dt>
<dd>
<input type="email" name="email" id="email" value="">
</dd>
<dt class="righttext">
<strong><label for="website">', $txt['website'], ':</label></strong>
</dt>
<dd>
<input type="url" name="website" id="website" value="">
</dd>
<dt class="righttext">
<strong><label for="ip">', $txt['ip_address'], ':</label></strong>
</dt>
<dd>
<input type="text" name="ip" id="ip" value="">
</dd>
</dl>
</div><!-- .msearch_details -->
<div class="msearch_details floatright">
<fieldset>
<legend>', $txt['activation_status'], '</legend>
<label for="activated-0"><input type="checkbox" name="activated[]" value="1" id="activated-0" checked> ', $txt['activated'], '</label>&nbsp;&nbsp;
<label for="activated-1"><input type="checkbox" name="activated[]" value="0" id="activated-1" checked> ', $txt['not_activated'], '</label>
</fieldset>
</div>
</div><!-- .flow_hidden -->
</div><!-- ..windowbg -->
<div class="cat_bar">
<h2 class="catbg">', $txt['member_part_of_these_membergroups'], '</h2>
</div>
<table class="table_grid">
<thead>
<tr class="title_bar">
<th scope="col">', $txt['membergroups'], '</th>
<th scope="col" class="centercol quarter_table">', $txt['primary'], '</th>
<th scope="col" class="centercol quarter_table">', $txt['additional'], '</th>
</tr>
</thead>
<tbody>';
foreach ($context['membergroups'] as $membergroup)
echo '
<tr class="windowbg">
<td>', $membergroup['name'], '</td>
<td class="centercol">
<input type="checkbox" name="membergroups[1][]" value="', $membergroup['id'], '" checked>
</td>
<td class="centercol">
', $membergroup['can_be_additional'] ? '<input type="checkbox" name="membergroups[2][]" value="' . $membergroup['id'] . '" checked>' : '', '
</td>
</tr>';
echo '
<tr class="windowbg">
<td>
<em>', $txt['check_all'], '</em>
</td>
<td class="centercol">
<input type="checkbox" onclick="invertAll(this, this.form, \'membergroups[1]\');" checked>
</td>
<td class="centercol">
<input type="checkbox" onclick="invertAll(this, this.form, \'membergroups[2]\');" checked>
</td>
</tr>
</tbody>
</table>
<table class="table_grid">
<thead>
<tr class="title_bar">
<th scope="col">
', $txt['membergroups_postgroups'], '
</th>
<th class="quarter_table"></th>
</tr>
</thead>
<tbody>';
foreach ($context['postgroups'] as $postgroup)
echo '
<tr class="windowbg">
<td>
', $postgroup['name'], '
</td>
<td class="centercol">
<input type="checkbox" name="postgroups[]" value="', $postgroup['id'], '" checked>
</td>
</tr>';
echo '
<tr class="windowbg">
<td>
<em>', $txt['check_all'], '</em>
</td>
<td class="centercol">
<input type="checkbox" onclick="invertAll(this, this.form, \'postgroups[]\');" checked>
</td>
</tr>
</tbody>
</table>
<br>
<input type="submit" value="', $txt['search'], '" class="button">
</form>';
}
/**
* The admin member list.
*/
function template_admin_browse()
{
global $context, $scripturl, $txt;
template_show_list('approve_list');
// If we have lots of outstanding members try and make the admin's life easier.
if ($context['approve_list']['total_num_items'] > 20)
{
echo '
<br>
<form id="admin_form_wrapper" action="', $scripturl, '?action=admin;area=viewmembers" method="post" accept-charset="', $context['character_set'], '" name="postFormOutstanding" id="postFormOutstanding" onsubmit="return onOutstandingSubmit();">
<div class="cat_bar">
<h2 class="catbg">', $txt['admin_browse_outstanding'], '</h2>
</div>
<script>
function onOutstandingSubmit()
{
if (document.forms.postFormOutstanding.todo.value == "")
return;
var message = "";
if (document.forms.postFormOutstanding.todo.value.indexOf("delete") != -1)
message = "', $txt['admin_browse_w_delete'], '";
else if (document.forms.postFormOutstanding.todo.value.indexOf("reject") != -1)
message = "', $txt['admin_browse_w_reject'], '";
else if (document.forms.postFormOutstanding.todo.value == "remind")
message = "', $txt['admin_browse_w_remind'], '";
else
message = "', $context['browse_type'] == 'approve' ? $txt['admin_browse_w_approve'] : $txt['admin_browse_w_activate'], '";
if (confirm(message + " ', $txt['admin_browse_outstanding_warn'], '"))
return true;
else
return false;
}
</script>
<div class="windowbg">
<dl class="settings">
<dt>
', $txt['admin_browse_outstanding_days_1'], ':
</dt>
<dd>
<input type="text" name="time_passed" value="14" maxlength="4" size="3"> ', $txt['admin_browse_outstanding_days_2'], '.
</dd>
<dt>
', $txt['admin_browse_outstanding_perform'], ':
</dt>
<dd>
<select name="todo">
', $context['browse_type'] == 'activate' ? '
<option value="ok">' . $txt['admin_browse_w_activate'] . '</option>' : '', '
<option value="okemail">', $context['browse_type'] == 'approve' ? $txt['admin_browse_w_approve'] : $txt['admin_browse_w_activate'], ' ', $txt['admin_browse_w_email'], '</option>', $context['browse_type'] == 'activate' ? '' : '
<option value="require_activation">' . $txt['admin_browse_w_approve_require_activate'] . '</option>', '
<option value="reject">', $txt['admin_browse_w_reject'], '</option>
<option value="rejectemail">', $txt['admin_browse_w_reject'], ' ', $txt['admin_browse_w_email'], '</option>
<option value="delete">', $txt['admin_browse_w_delete'], '</option>
<option value="deleteemail">', $txt['admin_browse_w_delete'], ' ', $txt['admin_browse_w_email'], '</option>', $context['browse_type'] == 'activate' ? '
<option value="remind">' . $txt['admin_browse_w_remind'] . '</option>' : '', '
</select>
</dd>
</dl>
<input type="submit" value="', $txt['admin_browse_outstanding_go'], '" class="button">
<input type="hidden" name="type" value="', $context['browse_type'], '">
<input type="hidden" name="sort" value="', $context['approve_list']['sort']['id'], '">
<input type="hidden" name="start" value="', $context['approve_list']['start'], '">
<input type="hidden" name="orig_filter" value="', $context['current_filter'], '">
<input type="hidden" name="sa" value="approve">', !empty($context['approve_list']['sort']['desc']) ? '
<input type="hidden" name="desc" value="1">' : '', '
</div><!-- .windowbg -->
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
</form>';
}
}
?>

446
ManageNews.template.php Normal file
View file

@ -0,0 +1,446 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* The template for sending newsletters
*/
function template_email_members()
{
global $context, $txt, $scripturl;
// Are we done sending the newsletter?
if (!empty($context['newsletter_sent']))
echo '
<div class="infobox">', $txt['admin_news_newsletter_' . $context['newsletter_sent']], '</div>';
echo '
<form action="', $scripturl, '?action=admin;area=news;sa=mailingcompose" method="post" id="admin_newsletters" class="flow_hidden" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">', $txt['admin_newsletters'], '</h2>
</div>
<div class="information noup">
', $txt['admin_news_select_recipients'], '
</div>
<div class="windowbg noup">
<dl class="settings">
<dt>
<strong>', $txt['admin_news_select_group'], ':</strong><br>
<span class="smalltext">', $txt['admin_news_select_group_desc'], '</span>
</dt>
<dd>';
foreach ($context['groups'] as $group)
echo '
<label for="groups_', $group['id'], '"><input type="checkbox" name="groups[', $group['id'], ']" id="groups_', $group['id'], '" value="', $group['id'], '" checked> ', $group['name'], '</label> <em>(', $group['member_count'], ')</em><br>';
echo '
<br>
<label for="checkAllGroups"><input type="checkbox" id="checkAllGroups" checked onclick="invertAll(this, this.form, \'groups\');"> <em>', $txt['check_all'], '</em></label>
</dd>
</dl>
<div id="advanced_panel_header" class="title_bar">
<h2 class="titlebg">
<span id="advanced_panel_toggle" class="toggle_down floatright" style="display: none;"></span>
<a href="#" id="advanced_panel_link">', $txt['advanced'], '</a>
</h2>
</div>
<div id="advanced_panel_div" class="padding">
<dl class="settings">
<dt>
<strong>', $txt['admin_news_select_email'], ':</strong><br>
<span class="smalltext">', $txt['admin_news_select_email_desc'], '</span>
</dt>
<dd>
<textarea name="emails" rows="5" cols="30" style="width: 98%;"></textarea>
</dd>
<dt>
<strong>', $txt['admin_news_select_members'], ':</strong><br>
<span class="smalltext">', $txt['admin_news_select_members_desc'], '</span>
</dt>
<dd>
<input type="text" name="members" id="members" value="" size="30">
<span id="members_container"></span>
</dd>
</dl>
<hr class="bordercolor">
<dl class="settings">
<dt>
<strong>', $txt['admin_news_select_excluded_groups'], ':</strong><br>
<span class="smalltext">', $txt['admin_news_select_excluded_groups_desc'], '</span>
</dt>
<dd>';
foreach ($context['groups'] as $group)
echo '
<label for="exclude_groups_', $group['id'], '"><input type="checkbox" name="exclude_groups[', $group['id'], ']" id="exclude_groups_', $group['id'], '" value="', $group['id'], '"> ', $group['name'], '</label> <em>(', $group['member_count'], ')</em><br>';
echo '
<br>
<label for="checkAllGroupsExclude"><input type="checkbox" id="checkAllGroupsExclude" onclick="invertAll(this, this.form, \'exclude_groups\');"> <em>', $txt['check_all'], '</em></label><br>
</dd>
<dt>
<strong>', $txt['admin_news_select_excluded_members'], ':</strong><br>
<span class="smalltext">', $txt['admin_news_select_excluded_members_desc'], '</span>
</dt>
<dd>
<input type="text" name="exclude_members" id="exclude_members" value="" size="30">
<span id="exclude_members_container"></span>
</dd>
</dl>
<hr class="bordercolor">
<dl class="settings">
<dt>
<label for="email_force"><strong>', $txt['admin_news_select_override_notify'], ':</strong></label><br>
<span class="smalltext">', $txt['email_force'], '</span>
</dt>
<dd>
<input type="checkbox" name="email_force" id="email_force" value="1">
</dd>
</dl>
</div><!-- #advanced_panel_div -->
<br>
<input type="submit" value="', $txt['admin_next'], '" class="button">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
</div><!-- .windowbg -->
</form>';
// This is some javascript for the simple/advanced toggling and member suggest
echo '
<script>
var oAdvancedPanelToggle = new smc_Toggle({
bToggleEnabled: true,
bCurrentlyCollapsed: true,
aSwappableContainers: [
\'advanced_panel_div\'
],
aSwapImages: [
{
sId: \'advanced_panel_toggle\',
altExpanded: ', JavaScriptEscape($txt['hide']), ',
altCollapsed: ', JavaScriptEscape($txt['show']), '
}
],
aSwapLinks: [
{
sId: \'advanced_panel_link\',
msgExpanded: ', JavaScriptEscape($txt['advanced']), ',
msgCollapsed: ', JavaScriptEscape($txt['advanced']), '
}
]
});
</script>
<script>
var oMemberSuggest = new smc_AutoSuggest({
sSelf: \'oMemberSuggest\',
sSessionId: smf_session_id,
sSessionVar: smf_session_var,
sSuggestId: \'members\',
sControlId: \'members\',
sSearchType: \'member\',
bItemList: true,
sPostName: \'member_list\',
sURLMask: \'action=profile;u=%item_id%\',
sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
sItemListContainerId: \'members_container\',
aListItems: []
});
var oExcludeMemberSuggest = new smc_AutoSuggest({
sSelf: \'oExcludeMemberSuggest\',
sSessionId: \'', $context['session_id'], '\',
sSessionVar: \'', $context['session_var'], '\',
sSuggestId: \'exclude_members\',
sControlId: \'exclude_members\',
sSearchType: \'member\',
bItemList: true,
sPostName: \'exclude_member_list\',
sURLMask: \'action=profile;u=%item_id%\',
sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
sItemListContainerId: \'exclude_members_container\',
aListItems: []
});
</script>';
}
/**
* The form for composing a newsletter
*/
function template_email_members_compose()
{
global $context, $txt, $scripturl;
echo '
<div id="preview_section"', isset($context['preview_message']) ? '' : ' class="hidden"', '>
<div class="cat_bar">
<h2 class="catbg">
<span id="preview_subject">', empty($context['preview_subject']) ? '' : $context['preview_subject'], '</span>
</h2>
</div>
<div class="windowbg">
<div class="post" id="preview_body">
', empty($context['preview_message']) ? '<br>' : $context['preview_message'], '
</div>
</div>
</div>
<br>';
echo '
<form name="newsmodify" action="', $scripturl, '?action=admin;area=news;sa=mailingsend" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">
<a href="', $scripturl, '?action=helpadmin;help=email_members" onclick="return reqOverlayDiv(this.href);" class="help"><span class="main_icons help" title="', $txt['help'], '"></span></a> ', $txt['admin_newsletters'], '
</h2>
</div>
<div class="information noup">
', sprintf($txt['email_variables'], $scripturl), '
</div>
<div class="windowbg noup">
<div class="', empty($context['error_type']) || $context['error_type'] != 'serious' ? 'noticebox' : 'errorbox', '"', empty($context['post_error']['messages']) ? ' style="display: none"' : '', ' id="errors">
<dl>
<dt>
<strong id="error_serious">', $txt['error_while_submitting'], '</strong>
</dt>
<dd class="error" id="error_list">
', empty($context['post_error']['messages']) ? '' : implode('<br>', $context['post_error']['messages']), '
</dd>
</dl>
</div>
<dl id="post_header">
<dt>
<label', (isset($context['post_error']['no_subject']) ? ' class="error"' : ''), ' for="subject" id="caption_subject">', $txt['subject'], '</label>
</dt>
<dd id="pm_subject">
<input type="text" id="subject" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="84"', isset($context['post_error']['no_subject']) ? ' class="error"' : '', '>
</dd>
</dl>
<div id="bbcBox_message"></div>';
// What about smileys?
if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup']))
echo '
<div id="smileyBox_message"></div>';
// Show BBC buttons, smileys and textbox.
echo '
', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message');
echo '
<ul>
<li><label for="send_pm"><input type="checkbox" name="send_pm" id="send_pm"', !empty($context['send_pm']) ? ' checked' : '', ' onclick="checkboxes_status(this);"> ', $txt['email_as_pms'], '</label></li>
<li><label for="send_html"><input type="checkbox" name="send_html" id="send_html"', !empty($context['send_html']) ? ' checked' : '', ' onclick="checkboxes_status(this);"> ', $txt['email_as_html'], '</label></li>
<li><label for="parse_html"><input type="checkbox" name="parse_html" id="parse_html" checked disabled> ', $txt['email_parsed_html'], '</label></li>
</ul>
<span id="post_confirm_buttons">
', template_control_richedit_buttons($context['post_box_name']), '
</span>
</div><!-- .windowbg -->
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="email_force" value="', $context['email_force'], '">
<input type="hidden" name="total_emails" value="', $context['total_emails'], '">';
foreach ($context['recipients'] as $key => $values)
echo '
<input type="hidden" name="', $key, '" value="', implode(($key == 'emails' ? ';' : ','), $values), '">';
echo '
<script>';
// The functions used to preview a posts without loading a new page.
echo '
var txt_preview_title = "', $txt['preview_title'], '";
var txt_preview_fetch = "', $txt['preview_fetch'], '";
function previewPost()
{
if (window.XMLHttpRequest)
{
// Opera didn\'t support setRequestHeader() before 8.01.
// @todo Remove support for old browsers
if (\'opera\' in window)
{
// Handle the WYSIWYG editor.
if (textFields[i] == ', JavaScriptEscape($context['post_box_name']), ' && ', JavaScriptEscape('oEditorHandle_' . $context['post_box_name']), ' in window && oEditorHandle_', $context['post_box_name'], '.bRichTextEnabled)
x[x.length] = \'message_mode=1&\' + textFields[i] + \'=\' + oEditorHandle_', $context['post_box_name'], '.getText(false).php_to8bit().php_urlencode();
else
x[x.length] = textFields[i] + \'=\' + document.forms.newsmodify[textFields[i]].value.php_to8bit().php_urlencode();
}
// @todo Currently not sending poll options and option checkboxes.
var x = new Array();
var textFields = [\'subject\', ', JavaScriptEscape($context['post_box_name']), '];
var checkboxFields = [\'send_html\', \'send_pm\'];
for (var i = 0, n = textFields.length; i < n; i++)
if (textFields[i] in document.forms.newsmodify)
{
// Handle the WYSIWYG editor.
if (textFields[i] == ', JavaScriptEscape($context['post_box_name']), ' && ', JavaScriptEscape('oEditorHandle_' . $context['post_box_name']), ' in window && oEditorHandle_', $context['post_box_name'], '.bRichTextEnabled)
x[x.length] = \'message_mode=1&\' + textFields[i] + \'=\' + oEditorHandle_', $context['post_box_name'], '.getText(false).replace(/&#/g, \'&#38;#\').php_to8bit().php_urlencode();
else
x[x.length] = textFields[i] + \'=\' + document.forms.newsmodify[textFields[i]].value.replace(/&#/g, \'&#38;#\').php_to8bit().php_urlencode();
}
for (var i = 0, n = checkboxFields.length; i < n; i++)
if (checkboxFields[i] in document.forms.newsmodify && document.forms.newsmodify.elements[checkboxFields[i]].checked)
x[x.length] = checkboxFields[i] + \'=\' + document.forms.newsmodify.elements[checkboxFields[i]].value;
x[x.length] = \'item=newsletterpreview\';
sendXMLDocument(smf_prepareScriptUrl(smf_scripturl) + \'action=xmlhttp;sa=previews;xml\', x.join(\'&\'), onDocSent);
document.getElementById(\'preview_section\').style.display = \'\';
setInnerHTML(document.getElementById(\'preview_subject\'), txt_preview_title);
setInnerHTML(document.getElementById(\'preview_body\'), txt_preview_fetch);
return false;
}
else
return submitThisOnce(document.forms.newsmodify);
}
function onDocSent(XMLDoc)
{
if (!XMLDoc)
{
document.forms.newsmodify.preview.onclick = new function ()
{
return true;
}
document.forms.newsmodify.preview.click();
}
// Show the preview section.
var preview = XMLDoc.getElementsByTagName(\'smf\')[0].getElementsByTagName(\'preview\')[0];
setInnerHTML(document.getElementById(\'preview_subject\'), preview.getElementsByTagName(\'subject\')[0].firstChild.nodeValue);
var bodyText = \'\';
for (var i = 0, n = preview.getElementsByTagName(\'body\')[0].childNodes.length; i < n; i++)
bodyText += preview.getElementsByTagName(\'body\')[0].childNodes[i].nodeValue;
setInnerHTML(document.getElementById(\'preview_body\'), bodyText);
document.getElementById(\'preview_body\').className = \'post\';
// Show a list of errors (if any).
var errors = XMLDoc.getElementsByTagName(\'smf\')[0].getElementsByTagName(\'errors\')[0];
var errorList = new Array();
for (var i = 0, numErrors = errors.getElementsByTagName(\'error\').length; i < numErrors; i++)
errorList[errorList.length] = errors.getElementsByTagName(\'error\')[i].firstChild.nodeValue;
document.getElementById(\'errors\').style.display = numErrors == 0 ? \'none\' : \'\';
setInnerHTML(document.getElementById(\'error_list\'), numErrors == 0 ? \'\' : errorList.join(\'<br>\'));
// Adjust the color of captions if the given data is erroneous.
var captions = errors.getElementsByTagName(\'caption\');
for (var i = 0, numCaptions = errors.getElementsByTagName(\'caption\').length; i < numCaptions; i++)
if (document.getElementById(\'caption_\' + captions[i].getAttribute(\'name\')))
document.getElementById(\'caption_\' + captions[i].getAttribute(\'name\')).className = captions[i].getAttribute(\'class\');
if (errors.getElementsByTagName(\'post_error\').length == 1)
document.forms.newsmodify.', $context['post_box_name'], '.style.border = \'1px solid red\';
else if (document.forms.newsmodify.', $context['post_box_name'], '.style.borderColor == \'red\' || document.forms.newsmodify.', $context['post_box_name'], '.style.borderColor == \'red red red red\')
{
if (\'runtimeStyle\' in document.forms.newsmodify.', $context['post_box_name'], ')
document.forms.newsmodify.', $context['post_box_name'], '.style.borderColor = \'\';
else
document.forms.newsmodify.', $context['post_box_name'], '.style.border = null;
}
location.hash = \'#\' + \'preview_section\';
}
</script>';
echo '
<script>
function checkboxes_status (item)
{
if (item.id == \'send_html\')
document.getElementById(\'parse_html\').disabled = !document.getElementById(\'parse_html\').disabled;
if (item.id == \'send_pm\')
{
if (!document.getElementById(\'send_html\').checked)
document.getElementById(\'parse_html\').disabled = true;
else
document.getElementById(\'parse_html\').disabled = false;
document.getElementById(\'send_html\').disabled = !document.getElementById(\'send_html\').disabled;
}
}
</script>
</form>';
}
/**
* The page shown while the newsletter is being sent
*/
function template_email_members_send()
{
global $context, $txt, $scripturl;
echo '
<form action="', $scripturl, '?action=admin;area=news;sa=mailingsend" method="post" accept-charset="', $context['character_set'], '" name="autoSubmit" id="autoSubmit">
<div class="cat_bar">
<h2 class="catbg">
<a href="', $scripturl, '?action=helpadmin;help=email_members" onclick="return reqOverlayDiv(this.href);" class="help"><span class="main_icons help" title="', $txt['help'], '"></span></a> ', $txt['admin_newsletters'], '
</h2>
</div>
<div class="windowbg">
<div class="progress_bar">
<span>', $context['percentage_done'], '% ', $txt['email_done'], '</span>
<div class="bar" style="width: ', $context['percentage_done'], '%;"></div>
</div>
<hr>
<input type="submit" name="b" value="', $txt['email_continue'], '" class="button">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="subject" value="', $context['subject'], '">
<input type="hidden" name="message" value="', $context['message'], '">
<input type="hidden" name="start" value="', $context['start'], '">
<input type="hidden" name="total_members" value="', $context['total_members'], '">
<input type="hidden" name="total_emails" value="', $context['total_emails'], '">
<input type="hidden" name="send_pm" value="', $context['send_pm'], '">
<input type="hidden" name="send_html" value="', $context['send_html'], '">
<input type="hidden" name="parse_html" value="', $context['parse_html'], '">';
// All the things we must remember!
foreach ($context['recipients'] as $key => $values)
echo '
<input type="hidden" name="', $key, '" value="', implode(($key == 'emails' ? ';' : ','), $values), '">';
echo '
</div><!-- .windowbg -->
</form>
<script>
var countdown = 2;
doAutoSubmit();
function doAutoSubmit()
{
if (countdown == 0)
document.forms.autoSubmit.submit();
else if (countdown == -1)
return;
document.forms.autoSubmit.b.value = "', $txt['email_continue'], ' (" + countdown + ")";
countdown--;
setTimeout("doAutoSubmit();", 1000);
}
</script>';
}
/**
* The settings page.
*/
function template_news_lists()
{
global $context, $txt;
if (!empty($context['saved_successful']))
echo '
<div class="infobox">', $txt['settings_saved'], '</div>';
template_show_list('news_lists');
}
?>

589
ManagePaid.template.php Normal file
View file

@ -0,0 +1,589 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* The template for adding or editing a subscription.
*/
function template_modify_subscription()
{
global $context, $scripturl, $txt, $modSettings;
echo '
<form action="', $scripturl, '?action=admin;area=paidsubscribe;sa=modify;sid=', $context['sub_id'], '" method="post">';
if (!empty($context['disable_groups']))
echo '
<div class="noticebox">', $txt['paid_mod_edit_note'], '</div>';
echo '
<div class="cat_bar">
<h2 class="catbg">', $txt['paid_' . $context['action_type'] . '_subscription'], '</h2>
</div>
<div class="windowbg">
<dl class="settings">
<dt>
', $txt['paid_mod_name'], ':
</dt>
<dd>
<input type="text" name="name" value="', $context['sub']['name'], '" size="30">
</dd>
<dt>
', $txt['paid_mod_desc'], ':
</dt>
<dd>
<textarea name="desc" rows="3" cols="40">', $context['sub']['desc'], '</textarea>
</dd>
<dt>
<label for="repeatable_check">', $txt['paid_mod_repeatable'], '</label>:
</dt>
<dd>
<input type="checkbox" name="repeatable" id="repeatable_check"', empty($context['sub']['repeatable']) ? '' : ' checked', '>
</dd>
<dt>
<label for="activated_check">', $txt['paid_mod_active'], '</label>:<br><span class="smalltext">', $txt['paid_mod_active_desc'], '</span>
</dt>
<dd>
<input type="checkbox" name="active" id="activated_check"', empty($context['sub']['active']) ? '' : ' checked', '>
</dd>
</dl>
<hr>
<dl class="settings">
<dt>
', $txt['paid_mod_prim_group'], ':<br>
<span class="smalltext">', $txt['paid_mod_prim_group_desc'], '</span>
</dt>
<dd>
<select name="prim_group"', !empty($context['disable_groups']) ? ' disabled' : '', '>
<option value="0"', $context['sub']['prim_group'] == 0 ? ' selected' : '', '>', $txt['paid_mod_no_group'], '</option>';
// Put each group into the box.
foreach ($context['groups'] as $id => $name)
echo '
<option value="', $id, '"', $context['sub']['prim_group'] == $id ? ' selected' : '', '>', $name, '</option>';
echo '
</select>
</dd>
<dt>
', $txt['paid_mod_add_groups'], ':<br>
<span class="smalltext">', $txt['paid_mod_add_groups_desc'], '</span>
</dt>
<dd>';
// Put a checkbox in for each group
foreach ($context['groups'] as $id => $name)
echo '
<label for="addgroup_', $id, '">
<input type="checkbox" id="addgroup_', $id, '" name="addgroup[', $id, ']"', in_array($id, $context['sub']['add_groups']) ? ' checked' : '', !empty($context['disable_groups']) ? ' disabled' : '', '>
<span class="smalltext">', $name, '</span>
</label><br>';
echo '
</dd>
<dt>
', $txt['paid_mod_reminder'], ':<br>
<span class="smalltext">', $txt['paid_mod_reminder_desc'], ' ', $txt['zero_to_disable'], '</span>
</dt>
<dd>
<input type="number" name="reminder" value="', $context['sub']['reminder'], '" size="6">
</dd>
<dt>
', $txt['paid_mod_email'], ':<br>
<span class="smalltext">', $txt['paid_mod_email_desc'], '</span>
</dt>
<dd>
<textarea name="emailcomplete" rows="6" cols="40">', $context['sub']['email_complete'], '</textarea>
</dd>
</dl>
<hr>
<input type="radio" name="duration_type" id="duration_type_fixed" value="fixed"', empty($context['sub']['duration']) || $context['sub']['duration'] == 'fixed' ? ' checked' : '', ' onclick="toggleDuration(\'fixed\');">
<strong><label for="duration_type_fixed">', $txt['paid_mod_fixed_price'], '</label></strong>
<br>
<div id="fixed_area" ', empty($context['sub']['duration']) || $context['sub']['duration'] == 'fixed' ? '' : 'style="display: none;"', '>
<fieldset>
<dl class="settings">
<dt>
', $txt['paid_cost'], ' (', str_replace('%1.2f', '', $modSettings['paid_currency_symbol']), '):
</dt>
<dd>
<input type="number" step="0.01" name="cost" value="', empty($context['sub']['cost']['fixed']) ? '' : $context['sub']['cost']['fixed'], '" placeholder="0.00" size="4">
</dd>
<dt>
', $txt['paid_mod_span'], ':
</dt>
<dd>
<input type="number" name="span_value" value="', $context['sub']['span']['value'], '" size="4">
<select name="span_unit">
<option value="D"', $context['sub']['span']['unit'] == 'D' ? ' selected' : '', '>', $txt['paid_mod_span_days'], '</option>
<option value="W"', $context['sub']['span']['unit'] == 'W' ? ' selected' : '', '>', $txt['paid_mod_span_weeks'], '</option>
<option value="M"', $context['sub']['span']['unit'] == 'M' ? ' selected' : '', '>', $txt['paid_mod_span_months'], '</option>
<option value="Y"', $context['sub']['span']['unit'] == 'Y' ? ' selected' : '', '>', $txt['paid_mod_span_years'], '</option>
</select>
</dd>
</dl>
</fieldset>
</div><!-- #fixed_area -->
<input type="radio" name="duration_type" id="duration_type_flexible" value="flexible"', !empty($context['sub']['duration']) && $context['sub']['duration'] == 'flexible' ? ' checked' : '', ' onclick="toggleDuration(\'flexible\');">
<strong><label for="duration_type_flexible">', $txt['paid_mod_flexible_price'], '</label></strong>
<br>
<div id="flexible_area" ', !empty($context['sub']['duration']) && $context['sub']['duration'] == 'flexible' ? '' : 'style="display: none;"', '>
<fieldset>';
echo '
<div class="information">
<strong>', $txt['paid_mod_price_breakdown'], '</strong><br>
', $txt['paid_mod_price_breakdown_desc'], '
</div>
<dl class="settings">
<dt>
<strong>', $txt['paid_duration'], '</strong>
</dt>
<dd>
<strong>', $txt['paid_cost'], ' (', preg_replace('~%[df\.\d]+~', '', $modSettings['paid_currency_symbol']), ')</strong>
</dd>
<dt>
', $txt['paid_per_day'], ':
</dt>
<dd>
<input type="number" step="0.01" name="cost_day" value="', empty($context['sub']['cost']['day']) ? '0' : $context['sub']['cost']['day'], '" size="5">
</dd>
<dt>
', $txt['paid_per_week'], ':
</dt>
<dd>
<input type="number" step="0.01" name="cost_week" value="', empty($context['sub']['cost']['week']) ? '0' : $context['sub']['cost']['week'], '" size="5">
</dd>
<dt>
', $txt['paid_per_month'], ':
</dt>
<dd>
<input type="number" step="0.01" name="cost_month" value="', empty($context['sub']['cost']['month']) ? '0' : $context['sub']['cost']['month'], '" size="5">
</dd>
<dt>
', $txt['paid_per_year'], ':
</dt>
<dd>
<input type="number" step="0.01" name="cost_year" value="', empty($context['sub']['cost']['year']) ? '0' : $context['sub']['cost']['year'], '" size="5">
</dd>
</dl>
</fieldset>
</div><!-- #flexible_area -->
<input type="submit" name="save" value="', $txt['paid_settings_save'], '" class="button">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-pms_token_var'], '" value="', $context['admin-pms_token'], '">
</div><!-- .windowbg -->
</form>';
}
/**
* The page for deleting a subscription.
*/
function template_delete_subscription()
{
global $context, $scripturl, $txt;
echo '
<form action="', $scripturl, '?action=admin;area=paidsubscribe;sa=modify;sid=', $context['sub_id'], ';delete" method="post">
<div class="cat_bar">
<h2 class="catbg">', $txt['paid_delete_subscription'], '</h2>
</div>
<div class="windowbg">
<p>', $txt['paid_mod_delete_warning'], '</p>
<input type="submit" name="delete_confirm" value="', $txt['paid_delete_subscription'], '" class="button">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-pmsd_token_var'], '" value="', $context['admin-pmsd_token'], '">
</div>
</form>';
}
/**
* Add or edit an existing subscriber.
*/
function template_modify_user_subscription()
{
global $context, $scripturl, $txt;
// Some quickly stolen javascript from Post, could do with being more efficient :)
echo '
<script>
var monthLength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
</script>';
echo '
<form action="', $scripturl, '?action=admin;area=paidsubscribe;sa=modifyuser;sid=', $context['sub_id'], ';lid=', $context['log_id'], '" method="post">
<div class="cat_bar">
<h2 class="catbg">
', $txt['paid_' . $context['action_type'] . '_subscription'], ' - ', $context['current_subscription']['name'], '
', empty($context['sub']['username']) ? '' : ' (' . $txt['user'] . ': ' . $context['sub']['username'] . ')', '
</h2>
</div>
<div class="windowbg">
<dl class="settings">';
// Do we need a username?
if ($context['action_type'] == 'add')
echo '
<dt>
<strong>', $txt['paid_username'], ':</strong><br>
<span class="smalltext">', $txt['one_username'], '</span>
</dt>
<dd>
<input type="text" name="name" id="name_control" value="', $context['sub']['username'], '" size="30">
</dd>';
echo '
<dt>
<strong>', $txt['paid_status'], ':</strong>
</dt>
<dd>
<select name="status">
<option value="0"', $context['sub']['status'] == 0 ? ' selected' : '', '>', $txt['paid_finished'], '</option>
<option value="1"', $context['sub']['status'] == 1 ? ' selected' : '', '>', $txt['paid_active'], '</option>
</select>
</dd>
</dl>
<fieldset>
<legend>', $txt['start_date_and_time'], '</legend>
<select name="year" id="year" onchange="generateDays();">';
// Show a list of all the years we allow...
for ($year = 2005; $year <= 2030; $year++)
echo '
<option value="', $year, '"', $year == $context['sub']['start']['year'] ? ' selected' : '', '>', $year, '</option>';
echo '
</select>&nbsp;
', (isset($txt['calendar_month']) ? $txt['calendar_month'] : $txt['calendar_month']), '&nbsp;
<select name="month" id="month" onchange="generateDays();">';
// There are 12 months per year - ensure that they all get listed.
for ($month = 1; $month <= 12; $month++)
echo '
<option value="', $month, '"', $month == $context['sub']['start']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>';
echo '
</select>&nbsp;
', (isset($txt['calendar_day']) ? $txt['calendar_day'] : $txt['calendar_day']), '&nbsp;
<select name="day" id="day">';
// This prints out all the days in the current month - this changes dynamically as we switch months.
for ($day = 1; $day <= $context['sub']['start']['last_day']; $day++)
echo '
<option value="', $day, '"', $day == $context['sub']['start']['day'] ? ' selected' : '', '>', $day, '</option>';
echo '
</select>
', $txt['hour'], ': <input type="text" name="hour" value="', $context['sub']['start']['hour'], '" size="2">
', $txt['minute'], ': <input type="text" name="minute" value="', $context['sub']['start']['min'], '" size="2">
</fieldset>
<fieldset>
<legend>', $txt['end_date_and_time'], '</legend>
<select name="yearend" id="yearend" onchange="generateDays(\'end\');">';
// Show a list of all the years we allow...
for ($year = 2005; $year <= 2030; $year++)
echo '
<option value="', $year, '"', $year == $context['sub']['end']['year'] ? ' selected' : '', '>', $year, '</option>';
echo '
</select>&nbsp;
', (isset($txt['calendar_month']) ? $txt['calendar_month'] : $txt['calendar_month']), '&nbsp;
<select name="monthend" id="monthend" onchange="generateDays(\'end\');">';
// There are 12 months per year - ensure that they all get listed.
for ($month = 1; $month <= 12; $month++)
echo '
<option value="', $month, '"', $month == $context['sub']['end']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>';
echo '
</select>&nbsp;
', (isset($txt['calendar_day']) ? $txt['calendar_day'] : $txt['calendar_day']), '&nbsp;
<select name="dayend" id="dayend">';
// This prints out all the days in the current month - this changes dynamically as we switch months.
for ($day = 1; $day <= $context['sub']['end']['last_day']; $day++)
echo '
<option value="', $day, '"', $day == $context['sub']['end']['day'] ? ' selected' : '', '>', $day, '</option>';
echo '
</select>
', $txt['hour'], ': <input type="number" name="hourend" value="', $context['sub']['end']['hour'], '" size="2">
', $txt['minute'], ': <input type="number" name="minuteend" value="', $context['sub']['end']['min'], '" size="2">
</fieldset>
<input type="submit" name="save_sub" value="', $txt['paid_settings_save'], '" class="button">
</div><!-- .windowbg -->
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
</form>
<script>
var oAddMemberSuggest = new smc_AutoSuggest({
sSelf: \'oAddMemberSuggest\',
sSessionId: smf_session_id,
sSessionVar: smf_session_var,
sSuggestId: \'name_subscriber\',
sControlId: \'name_control\',
sSearchType: \'member\',
sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
bItemList: false
});
</script>';
if (!empty($context['pending_payments']))
{
echo '
<div class="cat_bar">
<h2 class="catbg">', $txt['pending_payments'], '</h2>
</div>
<div class="information">
', $txt['pending_payments_desc'], '
</div>
<div class="cat_bar">
<h2 class="catbg">', $txt['pending_payments_value'], '</h2>
</div>
<div class="windowbg">
<ul>';
foreach ($context['pending_payments'] as $id => $payment)
echo '
<li>
', $payment['desc'], '
<span class="floatleft">
<a href="', $scripturl, '?action=admin;area=paidsubscribe;sa=modifyuser;lid=', $context['log_id'], ';pending=', $id, ';accept">', $txt['pending_payments_accept'], '</a>
</span>
<span class="floatright">
<a href="', $scripturl, '?action=admin;area=paidsubscribe;sa=modifyuser;lid=', $context['log_id'], ';pending=', $id, ';remove">', $txt['pending_payments_remove'], '</a>
</span>
</li>';
echo '
</ul>';
}
echo '
</div>';
}
/**
* Template for a user to edit/pick their subscriptions.
*/
function template_user_subscription()
{
global $context, $txt, $scripturl, $modSettings;
echo '
<div id="paid_subscription">
<form action="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=subscriptions;confirm" method="post">
<div class="cat_bar">
<h2 class="catbg">', $txt['subscriptions'], '</h2>
</div>';
if (empty($context['subscriptions']))
echo '
<div class="information">
', $txt['paid_subs_none'], '
</div>';
else
{
echo '
<div class="information">
', $txt['paid_subs_desc'], '
</div>';
// Print out all the subscriptions.
foreach ($context['subscriptions'] as $id => $subscription)
{
// Ignore the inactive ones...
if (empty($subscription['active']))
continue;
echo '
<div class="cat_bar">
<h2 class="catbg">', $subscription['name'], '</h2>
</div>
<div class="windowbg">
<p><strong>', $subscription['name'], '</strong></p>
<p class="smalltext">', $subscription['desc'], '</p>';
if (!$subscription['flexible'])
echo '
<div><strong>', $txt['paid_duration'], ':</strong> ', $subscription['length'], '</div>';
if ($context['user']['is_owner'])
{
echo '
<strong>', $txt['paid_cost'], ':</strong>';
if ($subscription['flexible'])
{
echo '
<select name="cur[', $subscription['id'], ']">';
// Print out the costs for this one.
foreach ($subscription['costs'] as $duration => $value)
echo '
<option value="', $duration, '">', sprintf($modSettings['paid_currency_symbol'], $value), '/', $txt[$duration], '</option>';
echo '
</select>';
}
else
echo '
', sprintf($modSettings['paid_currency_symbol'], $subscription['costs']['fixed']);
echo '
<hr>
<input type="submit" name="sub_id[', $subscription['id'], ']" value="', $txt['paid_order'], '" class="button">';
}
else
echo '
<a href="', $scripturl, '?action=admin;area=paidsubscribe;sa=modifyuser;sid=', $subscription['id'], ';uid=', $context['member']['id'], (empty($context['current'][$subscription['id']]) ? '' : ';lid=' . $context['current'][$subscription['id']]['id']), '">', empty($context['current'][$subscription['id']]) ? $txt['paid_admin_add'] : $txt['paid_edit_subscription'], '</a>';
echo '
</div><!-- .windowbg -->';
}
}
echo '
</form>
<br class="clear">
<div class="cat_bar">
<h2 class="catbg">', $txt['paid_current'], '</h2>
</div>
<div class="information">
', $txt['paid_current_desc'], '
</div>
<table class="table_grid">
<thead>
<tr class="title_bar">
<th style="width: 30%">', $txt['paid_name'], '</th>
<th>', $txt['paid_status'], '</th>
<th>', $txt['start_date'], '</th>
<th>', $txt['end_date'], '</th>
</tr>
</thead>
<tbody>';
if (empty($context['current']))
echo '
<tr class="windowbg">
<td colspan="4">
', $txt['paid_none_yet'], '
</td>
</tr>';
foreach ($context['current'] as $sub)
{
if (!$sub['hide'])
echo '
<tr class="windowbg">
<td>
', ($context['user']['is_admin'] ? '<a href="' . $scripturl . '?action=admin;area=paidsubscribe;sa=modifyuser;lid=' . $sub['id'] . '">' . $sub['name'] . '</a>' : $sub['name']), '
</td>
<td>
<span style="color: ', ($sub['status'] == 2 ? 'green' : ($sub['status'] == 1 ? 'red' : 'orange')), '"><strong>', $sub['status_text'], '</strong></span>
</td>
<td>', $sub['start'], '</td>
<td>', $sub['end'], '</td>
</tr>';
}
echo '
</tbody>
</table>
</div><!-- #paid_subscription -->';
}
/**
* The "choose payment" dialog.
*/
function template_choose_payment()
{
global $context, $txt;
echo '
<div id="paid_subscription">
<div class="cat_bar">
<h2 class="catbg">', $txt['paid_confirm_payment'], '</h2>
</div>
<div class="information">
', $txt['paid_confirm_desc'], '
</div>
<div class="windowbg">
<dl class="settings">
<dt>
<strong>', $txt['subscription'], ':</strong>
</dt>
<dd>
', $context['sub']['name'], '
</dd>
<dt>
<strong>', $txt['paid_cost'], ':</strong>
</dt>
<dd>
', $context['cost'], '
</dd>
</dl>
</div>';
// Do all the gateway options.
foreach ($context['gateways'] as $gateway)
{
echo '
<div class="cat_bar">
<h2 class="catbg">', $gateway['title'], '</h2>
</div>
<div class="windowbg">
', $gateway['desc'], '<br>
<form action="', $gateway['form'], '" method="post">';
if (!empty($gateway['javascript']))
echo '
<script>
', $gateway['javascript'], '
</script>';
foreach ($gateway['hidden'] as $name => $value)
echo '
<input type="hidden" id="', $gateway['id'], '_', $name, '" name="', $name, '" value="', $value, '">';
echo '
<br>
<input type="submit" value="', $gateway['submit'], '" class="button">
</form>
</div>';
}
echo '
</div><!-- #paid_subscription -->
<br class="clear">';
}
/**
* The "thank you" bit...
*/
function template_paid_done()
{
global $context, $txt, $scripturl;
echo '
<div id="paid_subscription">
<div class="cat_bar">
<h2 class="catbg">', $txt['paid_done'], '</h2>
</div>
<div class="windowbg">
<p>', $txt['paid_done_desc'], '</p>
<br>
<a href="', $scripturl, '?action=profile;u=', $context['member']['id'], ';area=subscriptions">', $txt['paid_sub_return'], '</a>
</div>
</div>';
}
?>

View file

@ -0,0 +1,939 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* The main manage permissions page
*/
function template_permission_index()
{
global $context, $settings, $scripturl, $txt, $modSettings;
// Not allowed to edit?
if (!$context['can_modify'])
echo '
<div class="errorbox">
', sprintf($txt['permission_cannot_edit'], $scripturl . '?action=admin;area=permissions;sa=profiles'), '
</div>';
echo '
<div id="admin_form_wrapper">
<form action="', $scripturl, '?action=admin;area=permissions;sa=quick" method="post" accept-charset="', $context['character_set'], '" name="permissionForm" id="permissionForm">';
if (!empty($context['profile']))
echo '
<div class="cat_bar">
<h2 class="catbg">', $txt['permissions_for_profile'], ': &quot;', $context['profile']['name'], '&quot;</h2>
</div>';
else
echo '
<div class="cat_bar">
<h2 class="catbg">', $txt['permissions_title'], '</h2>
</div>';
echo '
<table class="table_grid">
<thead>
<tr class="title_bar">
<th>', $txt['membergroups_name'], '</th>
<th class="small_table">', $txt['membergroups_members_top'], '</th>';
if (empty($modSettings['permission_enable_deny']))
echo '
<th class="small_table">', $txt['membergroups_permissions'], '</th>';
else
echo '
<th class="small_table">', $txt['permissions_allowed'], '</th>
<th class="small_table">', $txt['permissions_denied'], '</th>';
echo '
<th class="small_table">', $context['can_modify'] ? $txt['permissions_modify'] : $txt['permissions_view'], '</th>
<th class="table_icon centercol">
', $context['can_modify'] ? '<input type="checkbox" onclick="invertAll(this, this.form, \'group\');">' : '', '
</th>
</tr>
</thead>
<tbody>';
foreach ($context['groups'] as $group)
{
echo '
<tr class="windowbg">
<td>
', !empty($group['help']) ? ' <a class="help" href="' . $scripturl . '?action=helpadmin;help=' . $group['help'] . '" onclick="return reqOverlayDiv(this.href);"><span class="main_icons help" title="' . $txt['help'] . '"></span></a> ' : '<img class="icon" src="' . $settings['images_url'] . '/blank.png" alt="' . $txt['help'] . '">', '<span>', $group['name'], '</span>';
if (!empty($group['children']))
echo '
<br>
<span class="smalltext">', $txt['permissions_includes_inherited'], ': &quot;', implode('&quot;, &quot;', $group['children']), '&quot;</span>';
echo '
</td>
<td>', $group['can_search'] ? $group['link'] : $group['num_members'], '</td>';
if (empty($modSettings['permission_enable_deny']))
echo '
<td>', $group['num_permissions']['allowed'], '</td>';
else
echo '
<td ', $group['id'] == 1 ? ' style="font-style: italic;"' : '', '>
', $group['num_permissions']['allowed'], '
</td>
<td ', $group['id'] == 1 || $group['id'] == -1 ? ' style="font-style: italic;"' : (!empty($group['num_permissions']['denied']) ? ' class="red"' : ''), '>
', $group['num_permissions']['denied'], '
</td>';
echo '
<td>
', $group['allow_modify'] ? '<a href="' . $scripturl . '?action=admin;area=permissions;sa=modify;group=' . $group['id'] . (empty($context['profile']) ? '' : ';pid=' . $context['profile']['id']) . '">' . ($context['can_modify'] ? $txt['permissions_modify'] : $txt['permissions_view']) . '</a>' : '', '
</td>
<td class="centercol">
', $group['allow_modify'] && $context['can_modify'] ? '<input type="checkbox" name="group[]" value="' . $group['id'] . '">' : '', '
</td>
</tr>';
}
echo '
</tbody>
</table>
<br>';
// Advanced stuff...
if ($context['can_modify'])
{
echo '
<div class="cat_bar">
<h2 class="catbg">
<span id="permissions_panel_toggle" class="', empty($context['show_advanced_options']) ? 'toggle_down' : 'toggle_up', ' floatright" style="display: none;"></span>
<a href="#" id="permissions_panel_link">', $txt['permissions_advanced_options'], '</a>
</h2>
</div>
<div id="permissions_panel_advanced" class="windowbg">
<fieldset>
<legend>', $txt['permissions_with_selection'], '</legend>
<dl class="settings">
<dt>
<a class="help" href="', $scripturl, '?action=helpadmin;help=permissions_quickgroups" onclick="return reqOverlayDiv(this.href);"><span class="main_icons help" title="', $txt['help'], '"></span></a>
', $txt['permissions_apply_pre_defined'], ':
</dt>
<dd>
<select name="predefined">
<option value="">(', $txt['permissions_select_pre_defined'], ')</option>
<option value="restrict">', $txt['permitgroups_restrict'], '</option>
<option value="standard">', $txt['permitgroups_standard'], '</option>
<option value="moderator">', $txt['permitgroups_moderator'], '</option>
<option value="maintenance">', $txt['permitgroups_maintenance'], '</option>
</select>
</dd>
<dt>
', $txt['permissions_like_group'], ':
</dt>
<dd>
<select name="copy_from">
<option value="empty">(', $txt['permissions_select_membergroup'], ')</option>';
foreach ($context['groups'] as $group)
if ($group['id'] != 1)
echo '
<option value="', $group['id'], '">', $group['name'], '</option>';
echo '
</select>
</dd>
<dt>
<select name="add_remove">
<option value="add">', $txt['permissions_add'], '...</option>
<option value="clear">', $txt['permissions_remove'], '...</option>';
if (!empty($modSettings['permission_enable_deny']))
echo '
<option value="deny">', $txt['permissions_deny'], '...</option>';
echo '
</select>
</dt>
<dd style="overflow:auto;">
<select name="permissions">
<option value="">(', $txt['permissions_select_permission'], ')</option>';
foreach ($context['permissions'] as $permissionType)
{
if ($permissionType['id'] == 'membergroup' && !empty($context['profile']))
continue;
foreach ($permissionType['columns'] as $column)
{
foreach ($column as $permissionGroup)
{
if ($permissionGroup['hidden'])
continue;
echo '
<option value="" disabled>[', $permissionGroup['name'], ']</option>';
foreach ($permissionGroup['permissions'] as $perm)
{
if ($perm['hidden'])
continue;
if ($perm['has_own_any'])
echo '
<option value="', $permissionType['id'], '/', $perm['own']['id'], '">&nbsp;&nbsp;&nbsp;', $perm['name'], ' (', $perm['own']['name'], ')</option>
<option value="', $permissionType['id'], '/', $perm['any']['id'], '">&nbsp;&nbsp;&nbsp;', $perm['name'], ' (', $perm['any']['name'], ')</option>';
else
echo '
<option value="', $permissionType['id'], '/', $perm['id'], '">&nbsp;&nbsp;&nbsp;', $perm['name'], '</option>';
}
}
}
}
echo '
</select>
</dd>
</dl>
</fieldset>
<input type="submit" value="', $txt['permissions_set_permissions'], '" onclick="return checkSubmit();" class="button">
</div><!-- #permissions_panel_advanced -->';
// Javascript for the advanced stuff.
echo '
<script>
var oPermissionsPanelToggle = new smc_Toggle({
bToggleEnabled: true,
bCurrentlyCollapsed: ', empty($context['show_advanced_options']) ? 'true' : 'false', ',
aSwappableContainers: [
\'permissions_panel_advanced\'
],
aSwapImages: [
{
sId: \'permissions_panel_toggle\',
altExpanded: ', JavaScriptEscape($txt['hide']), ',
altCollapsed: ', JavaScriptEscape($txt['show']), '
}
],
aSwapLinks: [
{
sId: \'permissions_panel_link\',
msgExpanded: ', JavaScriptEscape($txt['permissions_advanced_options']), ',
msgCollapsed: ', JavaScriptEscape($txt['permissions_advanced_options']), '
}
],
oThemeOptions: {
bUseThemeSettings: true,
sOptionName: \'admin_preferences\',
sSessionVar: smf_session_var,
sSessionId: smf_session_id,
sThemeId: \'1\',
sAdditionalVars: \';admin_key=app\'
}
});
function checkSubmit()
{
if ((document.forms.permissionForm.predefined.value != "" && (document.forms.permissionForm.copy_from.value != "empty" || document.forms.permissionForm.permissions.value != "")) || (document.forms.permissionForm.copy_from.value != "empty" && document.forms.permissionForm.permissions.value != ""))
{
alert("', $txt['permissions_only_one_option'], '");
return false;
}
if (document.forms.permissionForm.predefined.value == "" && document.forms.permissionForm.copy_from.value == "" && document.forms.permissionForm.permissions.value == "")
{
alert("', $txt['permissions_no_action'], '");
return false;
}
if (document.forms.permissionForm.permissions.value != "" && document.forms.permissionForm.add_remove.value == "deny")
return confirm("', $txt['permissions_deny_dangerous'], '");
return true;
}
</script>';
if (!empty($context['profile']))
echo '
<input type="hidden" name="pid" value="', $context['profile']['id'], '">';
echo '
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-mpq_token_var'], '" value="', $context['admin-mpq_token'], '">';
}
echo '
</form>
</div><!-- #admin_form_wrapper -->';
}
/**
* THe page that shows which permissions profile applies to each board
*/
function template_by_board()
{
global $context, $scripturl, $txt;
echo '
<form id="admin_form_wrapper" action="', $scripturl, '?action=admin;area=permissions;sa=board" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">', $txt['permissions_boards'], '</h2>
</div>
<div class="information">
', $txt['permissions_boards_desc'], '
</div>
<div class="cat_bar">
<h2 id="board_permissions" class="catbg flow_hidden">
<span class="perm_name floatleft">', $txt['board_name'], '</span>
<span class="perm_profile floatleft">', $txt['permission_profile'], '</span>';
echo '
</h2>
</div>
<div class="windowbg">';
foreach ($context['categories'] as $category)
{
echo '
<div class="sub_bar">
<h2 class="subbg">', $category['name'], '</h2>
</div>';
if (!empty($category['boards']))
echo '
<ul class="perm_boards flow_hidden">';
foreach ($category['boards'] as $board)
{
echo '
<li class="flow_hidden">
<span class="perm_board floatleft">
<a href="', $scripturl, '?action=admin;area=manageboards;sa=board;boardid=', $board['id'], ';rid=permissions;', $context['session_var'], '=', $context['session_id'], '">', str_repeat('-', $board['child_level']), ' ', $board['name'], '</a>
</span>
<span class="perm_boardprofile floatleft">';
if ($context['edit_all'])
{
echo '
<select name="boardprofile[', $board['id'], ']">';
foreach ($context['profiles'] as $id => $profile)
echo '
<option value="', $id, '"', $id == $board['profile'] ? ' selected' : '', '>', $profile['name'], '</option>';
echo '
</select>';
}
else
echo '
<a href="', $scripturl, '?action=admin;area=permissions;sa=index;pid=', $board['profile'], ';', $context['session_var'], '=', $context['session_id'], '">', $board['profile_name'], '</a>';
echo '
</span>
</li>';
}
if (!empty($category['boards']))
echo '
</ul>';
}
if ($context['edit_all'])
echo '
<input type="submit" name="save_changes" value="', $txt['save'], '" class="button">';
else
echo '
<a class="button" href="', $scripturl, '?action=admin;area=permissions;sa=board;edit;', $context['session_var'], '=', $context['session_id'], '">', $txt['permissions_board_all'], '</a>';
echo '
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-mpb_token_var'], '" value="', $context['admin-mpb_token'], '">
</div><!-- .windowbg -->
</form>';
}
/**
* Edit permission profiles (predefined).
*/
function template_edit_profiles()
{
global $context, $scripturl, $txt;
echo '
<div id="admin_form_wrapper">
<form action="', $scripturl, '?action=admin;area=permissions;sa=profiles" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">', $txt['permissions_profile_edit'], '</h2>
</div>
<table class="table_grid">
<thead>
<tr class="title_bar">
<th>', $txt['permissions_profile_name'], '</th>
<th>', $txt['permissions_profile_used_by'], '</th>
<th class="table_icon"', !empty($context['show_rename_boxes']) ? ' style="display:none"' : '', '>', $txt['delete'], '</th>
</tr>
</thead>
<tbody>';
foreach ($context['profiles'] as $profile)
{
echo '
<tr class="windowbg">
<td>';
if (!empty($context['show_rename_boxes']) && $profile['can_edit'])
echo '
<input type="text" name="rename_profile[', $profile['id'], ']" value="', $profile['name'], '">';
else
echo '
<a href="', $scripturl, '?action=admin;area=permissions;sa=index;pid=', $profile['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $profile['name'], '</a>';
echo '
</td>
<td>
', !empty($profile['boards_text']) ? $profile['boards_text'] : $txt['permissions_profile_used_by_none'], '
</td>
<td', !empty($context['show_rename_boxes']) ? ' style="display:none"' : '', '>
<input type="checkbox" name="delete_profile[]" value="', $profile['id'], '" ', $profile['can_delete'] ? '' : 'disabled', '>
</td>
</tr>';
}
echo '
</tbody>
</table>
<div class="flow_auto righttext padding">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-mpp_token_var'], '" value="', $context['admin-mpp_token'], '">';
if ($context['can_edit_something'])
echo '
<input type="submit" name="rename" value="', empty($context['show_rename_boxes']) ? $txt['permissions_profile_rename'] : $txt['permissions_commit'], '" class="button">';
echo '
<input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" class="button" ', !empty($context['show_rename_boxes']) ? ' style="display:none"' : '', '>
</div>
</form>
<br>
<form action="', $scripturl, '?action=admin;area=permissions;sa=profiles" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">', $txt['permissions_profile_new'], '</h2>
</div>
<div class="windowbg">
<dl class="settings">
<dt>
<strong>', $txt['permissions_profile_name'], ':</strong>
</dt>
<dd>
<input type="text" name="profile_name" value="">
</dd>
<dt>
<strong>', $txt['permissions_profile_copy_from'], ':</strong>
</dt>
<dd>
<select name="copy_from">';
foreach ($context['profiles'] as $id => $profile)
echo '
<option value="', $id, '">', $profile['name'], '</option>';
echo '
</select>
</dd>
</dl>
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-mpp_token_var'], '" value="', $context['admin-mpp_token'], '">
<input type="submit" name="create" value="', $txt['permissions_profile_new_create'], '" class="button">
</div><!-- .windowbg -->
</form>
</div><!-- #admin_form_wrapper -->';
}
/**
* Modify a group's permissions
*/
function template_modify_group()
{
global $context, $scripturl, $txt, $modSettings;
// Cannot be edited?
if (!$context['profile']['can_modify'])
echo '
<div class="errorbox">
', sprintf($txt['permission_cannot_edit'], $scripturl . '?action=admin;area=permissions;sa=profiles'), '
</div>';
else
echo '
<script>
window.smf_usedDeny = false;
function warnAboutDeny()
{
if (window.smf_usedDeny)
return confirm("', $txt['permissions_deny_dangerous'], '");
else
return true;
}
</script>';
echo '
<form id="permissions" action="', $scripturl, '?action=admin;area=permissions;sa=modify2;group=', $context['group']['id'], ';pid=', $context['profile']['id'], '" method="post" accept-charset="', $context['character_set'], '" name="permissionForm" onsubmit="return warnAboutDeny();">';
if (!empty($modSettings['permission_enable_deny']) && $context['group']['id'] != -1)
echo '
<div class="noticebox">
', $txt['permissions_option_desc'], '
</div>';
echo '
<div class="cat_bar">
<h2 class="catbg">';
if ($context['permission_type'] == 'board')
echo '
', $txt['permissions_local_for'], ' &quot;', $context['group']['name'], '&quot; ', $txt['permissions_on'], ' &quot;', $context['profile']['name'], '&quot;';
else
echo '
', $context['permission_type'] == 'membergroup' ? $txt['permissions_general'] : $txt['permissions_board'], ' - &quot;', $context['group']['name'], '&quot;';
echo '
</h2>
</div>';
// Draw out the main bits.
template_modify_group_display($context['permission_type']);
// If this is general permissions also show the default profile.
if ($context['permission_type'] == 'membergroup')
{
echo '
<br>
<div class="cat_bar">
<h2 class="catbg">', $txt['permissions_board'], '</h2>
</div>
<div class="information">
', $txt['permissions_board_desc'], '
</div>';
template_modify_group_display('board');
}
if ($context['profile']['can_modify'])
echo '
<div class="padding">
<input type="submit" value="', $txt['permissions_commit'], '" class="button">
</div>';
foreach ($context['hidden_perms'] as $hidden_perm)
echo '
<input type="hidden" name="perm[', $hidden_perm[0], '][', $hidden_perm[1], ']" value="', $hidden_perm[2], '">';
echo '
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-mp_token_var'], '" value="', $context['admin-mp_token'], '">
</form>';
}
/**
* The way of looking at permissions.
*
* @param string $type The permissions type
*/
function template_modify_group_display($type)
{
global $context, $scripturl, $txt, $modSettings;
$permission_type = &$context['permissions'][$type];
$disable_field = $context['profile']['can_modify'] ? '' : 'disabled ';
foreach ($permission_type['columns'] as $column)
{
echo '
<table class="table_grid half_content">';
foreach ($column as $permissionGroup)
{
if (empty($permissionGroup['permissions']))
continue;
// Are we likely to have something in this group to display or is it all hidden?
$has_display_content = false;
if (!$permissionGroup['hidden'])
{
// Before we go any further check we are going to have some data to print otherwise we just have a silly heading.
foreach ($permissionGroup['permissions'] as $permission)
if (!$permission['hidden'])
$has_display_content = true;
if ($has_display_content)
{
echo '
<tr class="title_bar">
<th></th>
<th', $context['group']['id'] == -1 ? ' colspan="2"' : '', ' class="smalltext">', $permissionGroup['name'], '</th>';
if ($context['group']['id'] != -1)
echo '
<th>', $txt['permissions_option_own'], '</th>
<th>', $txt['permissions_option_any'], '</th>';
echo '
</tr>';
}
}
foreach ($permissionGroup['permissions'] as $permission)
{
if (!$permission['hidden'] && !$permissionGroup['hidden'])
{
echo '
<tr class="windowbg">
<td>
', $permission['show_help'] ? '<a href="' . $scripturl . '?action=helpadmin;help=permissionhelp_' . $permission['id'] . '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="main_icons help" title="' . $txt['help'] . '"></span></a>' : '', '
</td>
<td class="lefttext full_width">
', $permission['name'], (!empty($permission['note']) ? '<br>
<strong class="smalltext">' . $permission['note'] . '</strong>' : ''), '
</td>
<td>';
if ($permission['has_own_any'])
{
// Guests can't do their own thing.
if ($context['group']['id'] != -1)
{
if (empty($modSettings['permission_enable_deny']))
echo '
<input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['own']['id'], ']"', $permission['own']['select'] == 'on' ? ' checked="checked"' : '', ' value="on" id="', $permission['own']['id'], '_on" ', $disable_field, '>';
else
{
echo '
<select name="perm[', $permission_type['id'], '][', $permission['own']['id'], ']" ', $disable_field, '>';
foreach (array('on', 'off', 'deny') as $c)
echo '
<option ', $permission['own']['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>';
echo '
</select>';
}
echo '
</td>
<td>';
}
if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1)
echo '
<input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['any']['id'], ']"', $permission['any']['select'] == 'on' ? ' checked="checked"' : '', ' value="on" ', $disable_field, '>';
else
{
echo '
<select name="perm[', $permission_type['id'], '][', $permission['any']['id'], ']" ', $disable_field, '>';
foreach (array('on', 'off', 'deny') as $c)
echo '
<option ', $permission['any']['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>';
echo '
</select>';
}
}
else
{
if ($context['group']['id'] != -1)
echo '
</td>
<td>';
if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1)
echo '
<input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['id'], ']"', $permission['select'] == 'on' ? ' checked="checked"' : '', ' value="on" ', $disable_field, '>';
else
{
echo '
<select name="perm[', $permission_type['id'], '][', $permission['id'], ']" ', $disable_field, '>';
foreach (array('on', 'off', 'deny') as $c)
echo '
<option ', $permission['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>';
echo '
</select>';
}
}
echo '
</td>
</tr>';
}
}
}
echo '
</table>';
}
echo '
<br class="clear">';
}
/**
* A form for displaying inline permissions, such as on a settings page.
*/
function template_inline_permissions()
{
global $context, $txt, $modSettings;
// This looks really weird, but it keeps things nested properly...
echo '
<fieldset id="', $context['current_permission'], '">
<legend><a href="javascript:void(0);" onclick="document.getElementById(\'', $context['current_permission'], '\').style.display = \'none\';document.getElementById(\'', $context['current_permission'], '_groups_link\').style.display = \'block\'; return false;" class="toggle_up"> ', $txt['avatar_select_permission'], '</a></legend>';
if (empty($modSettings['permission_enable_deny']))
echo '
<ul>';
else
echo '
<div class="information">', $txt['permissions_option_desc'], '</div>
<dl class="settings">
<dt>
<span class="perms"><strong>', $txt['permissions_option_on'], '</strong></span>
<span class="perms"><strong>', $txt['permissions_option_off'], '</strong></span>
<span class="perms red"><strong>', $txt['permissions_option_deny'], '</strong></span>
</dt>
<dd>
</dd>';
foreach ($context['member_groups'] as $group)
{
if (!empty($modSettings['permission_enable_deny']))
echo '
<dt>';
else
echo '
<li>';
if (empty($modSettings['permission_enable_deny']))
echo '
<input type="checkbox" name="', $context['current_permission'], '[', $group['id'], ']" value="on"', $group['status'] == 'on' ? ' checked' : '', '>';
else
echo '
<span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="on"', $group['status'] == 'on' ? ' checked' : '', '></span>
<span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="off"', $group['status'] == 'off' ? ' checked' : '', '></span>
<span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="deny"', $group['status'] == 'deny' ? ' checked' : '', '></span>';
if (!empty($modSettings['permission_enable_deny']))
echo '
</dt>
<dd>
<span', $group['is_postgroup'] ? ' style="font-style: italic;"' : '', '>', $group['name'], '</span>
</dd>';
else
echo '
<span', $group['is_postgroup'] ? ' style="font-style: italic;"' : '', '>', $group['name'], '</span>
</li>';
}
if (empty($modSettings['permission_enable_deny']))
echo '
<li>
<input type="checkbox" onclick="invertAll(this, this.form, \'' . $context['current_permission'] . '[\');">
<span>', $txt['check_all'], '</span>
</li>
</ul>';
else
echo '
</dl>';
echo '
</fieldset>
<a href="javascript:void(0);" onclick="document.getElementById(\'', $context['current_permission'], '\').style.display = \'block\'; document.getElementById(\'', $context['current_permission'], '_groups_link\').style.display = \'none\'; return false;" id="', $context['current_permission'], '_groups_link" style="display: none;" class="toggle_down"> ', $txt['avatar_select_permission'], '</a>
<script>
document.getElementById("', $context['current_permission'], '").style.display = "none";
document.getElementById("', $context['current_permission'], '_groups_link").style.display = "";
</script>';
}
/**
* Edit post moderation permissions.
*/
function template_postmod_permissions()
{
global $context, $scripturl, $txt, $modSettings;
echo '
<div id="admin_form_wrapper">
<form action="', $scripturl, '?action=admin;area=permissions;sa=postmod;', $context['session_var'], '=', $context['session_id'], '" method="post" name="postmodForm" id="postmodForm" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">', $txt['permissions_post_moderation'], '</h2>
</div>';
// First, we have the bit where we can enable or disable this bad boy.
echo '
<div class="windowbg">
<dl class="settings">
<dt>', $txt['permissions_post_moderation_enable'], '</dt>
<dd><input type="checkbox" name="postmod_active"', !empty($modSettings['postmod_active']) ? ' checked' : '', '></dd>
</dl>
</div>';
// If we're not active, there's a bunch of stuff we don't need to show.
if (!empty($modSettings['postmod_active']))
{
// Got advanced permissions - if so warn!
if (!empty($modSettings['permission_enable_deny']))
echo '
<div class="information">', $txt['permissions_post_moderation_deny_note'], '</div>';
echo '
<div class="padding">
<ul class="floatleft smalltext block">
<strong>', $txt['permissions_post_moderation_legend'], ':</strong>
<li><span class="main_icons post_moderation_allow"></span>', $txt['permissions_post_moderation_allow'], '</li>
<li><span class="main_icons post_moderation_moderate"></span>', $txt['permissions_post_moderation_moderate'], '</li>
<li><span class="main_icons post_moderation_deny"></span>', $txt['permissions_post_moderation_disallow'], '</li>
</ul>
<p class="righttext floatright block">
<br><br><br>
', $txt['permissions_post_moderation_select'], ':
<select name="pid" onchange="document.forms.postmodForm.submit();">';
foreach ($context['profiles'] as $profile)
if ($profile['can_modify'])
echo '
<option value="', $profile['id'], '"', $profile['id'] == $context['current_profile'] ? ' selected' : '', '>', $profile['name'], '</option>';
echo '
</select>
<input type="submit" value="', $txt['go'], '" class="button">
</p>
</div><!-- .padding -->
<table class="table_grid" id="postmod">
<thead>
<tr class="title_bar">
<th></th>
<th class="centercol" colspan="3">
', $txt['permissions_post_moderation_new_topics'], '
</th>
<th class="centercol" colspan="3">
', $txt['permissions_post_moderation_replies_own'], '
</th>
<th class="centercol" colspan="3">
', $txt['permissions_post_moderation_replies_any'], '
</th>';
if ($modSettings['attachmentEnable'] == 1)
echo '
<th class="centercol" colspan="3">
', $txt['permissions_post_moderation_attachments'], '
</th>';
echo '
</tr>
<tr class="windowbg">
<th class="quarter_table">
', $txt['permissions_post_moderation_group'], '
</th>
<th><span class="main_icons post_moderation_allow"></span></th>
<th><span class="main_icons post_moderation_moderate"></span></th>
<th><span class="main_icons post_moderation_deny"></span></th>
<th><span class="main_icons post_moderation_allow"></span></th>
<th><span class="main_icons post_moderation_moderate"></span></th>
<th><span class="main_icons post_moderation_deny"></span></th>
<th><span class="main_icons post_moderation_allow"></span></th>
<th><span class="main_icons post_moderation_moderate"></span></th>
<th><span class="main_icons post_moderation_deny"></span></th>';
if ($modSettings['attachmentEnable'] == 1)
echo '
<th><span class="main_icons post_moderation_allow"></span></th>
<th><span class="main_icons post_moderation_moderate"></span></th>
<th><span class="main_icons post_moderation_deny"></span></th>';
echo '
</tr>
</thead>
<tbody>';
foreach ($context['profile_groups'] as $group)
{
echo '
<tr class="windowbg">
<td class="half_table">
<span ', ($group['color'] ? 'style="color: ' . $group['color'] . '"' : ''), '>', $group['name'], '</span>';
if (!empty($group['children']))
echo '
<br>
<span class="smalltext">', $txt['permissions_includes_inherited'], ': &quot;', implode('&quot;, &quot;', $group['children']), '&quot;</span>';
echo '
</td>
<td class="centercol">
<input type="radio" name="new_topic[', $group['id'], ']" value="allow"', $group['new_topic'] == 'allow' ? ' checked' : '', '>
</td>
<td class="centercol">
<input type="radio" name="new_topic[', $group['id'], ']" value="moderate"', $group['new_topic'] == 'moderate' ? ' checked' : '', '>
</td>
<td class="centercol">
<input type="radio" name="new_topic[', $group['id'], ']" value="disallow"', $group['new_topic'] == 'disallow' ? ' checked' : '', '>
</td>';
// Guests can't have "own" permissions
if ($group['id'] == '-1')
echo '
<td colspan="3"></td>';
else
echo '
<td class="centercol">
<input type="radio" name="replies_own[', $group['id'], ']" value="allow"', $group['replies_own'] == 'allow' ? ' checked' : '', '>
</td>
<td class="centercol">
<input type="radio" name="replies_own[', $group['id'], ']" value="moderate"', $group['replies_own'] == 'moderate' ? ' checked' : '', '>
</td>
<td class="centercol">
<input type="radio" name="replies_own[', $group['id'], ']" value="disallow"', $group['replies_own'] == 'disallow' ? ' checked' : '', '>
</td>';
echo '
<td class="centercol">
<input type="radio" name="replies_any[', $group['id'], ']" value="allow"', $group['replies_any'] == 'allow' ? ' checked' : '', '>
</td>
<td class="centercol">
<input type="radio" name="replies_any[', $group['id'], ']" value="moderate"', $group['replies_any'] == 'moderate' ? ' checked' : '', '>
</td>
<td class="centercol">
<input type="radio" name="replies_any[', $group['id'], ']" value="disallow"', $group['replies_any'] == 'disallow' ? ' checked' : '', '>
</td>';
if ($modSettings['attachmentEnable'] == 1)
echo '
<td class="centercol">
<input type="radio" name="attachment[', $group['id'], ']" value="allow"', $group['attachment'] == 'allow' ? ' checked' : '', '>
</td>
<td class="centercol">
<input type="radio" name="attachment[', $group['id'], ']" value="moderate"', $group['attachment'] == 'moderate' ? ' checked' : '', '>
</td>
<td class="centercol">
<input type="radio" name="attachment[', $group['id'], ']" value="disallow"', $group['attachment'] == 'disallow' ? ' checked' : '', '>
</td>';
echo '
</tr>';
}
echo '
</tbody>
</table>';
}
echo '
<input type="submit" name="save_changes" value="', $txt['permissions_commit'], '" class="button">
<input type="hidden" name="', $context['admin-mppm_token_var'], '" value="', $context['admin-mppm_token'], '">
</form>
</div><!-- #admin_form_wrapper -->';
}
?>

View file

@ -0,0 +1,117 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* Template for listing all scheduled tasks.
*/
function template_view_scheduled_tasks()
{
global $context, $txt;
// We completed some tasks?
if (!empty($context['tasks_were_run']))
{
if (empty($context['scheduled_errors']))
echo '
<div class="infobox">
', $txt['scheduled_tasks_were_run'], '
</div>';
else
{
echo '
<div class="errorbox" id="errors">
<dl>
<dt>
<strong id="error_serious">', $txt['scheduled_tasks_were_run_errors'], '</strong>
</dt>';
foreach ($context['scheduled_errors'] as $task => $errors)
echo '
<dd class="error">
<strong>', isset($txt['scheduled_task_' . $task]) ? $txt['scheduled_task_' . $task] : $task, '</strong>
<ul>
<li>', implode('</li><li>', $errors), '</li>
</ul>
</dd>';
echo '
</dl>
</div>';
}
}
template_show_list('scheduled_tasks');
}
/**
* A template for, you guessed it, editing a task!
*/
function template_edit_scheduled_tasks()
{
global $context, $txt, $scripturl;
// Starts off with general maintenance procedures.
echo '
<form action="', $scripturl, '?action=admin;area=scheduledtasks;sa=taskedit;save;tid=', $context['task']['id'], '" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">', $txt['scheduled_task_edit'], '</h2>
</div>
<div class="information">
<em>', sprintf($txt['scheduled_task_time_offset'], $context['server_time']), ' </em>
</div>
<div class="windowbg">
<dl class="settings">
<dt>
<strong>', $txt['scheduled_tasks_name'], ':</strong>
</dt>
<dd>
', $context['task']['name'], '<br>
<span class="smalltext">', $context['task']['desc'], '</span>
</dd>
<dt>
<strong><label for="regularity">', $txt['scheduled_task_edit_interval'], ':</label></strong>
</dt>
<dd>
', $txt['scheduled_task_edit_repeat'], '
<input type="text" name="regularity" id="regularity" value="', empty($context['task']['regularity']) ? 1 : $context['task']['regularity'], '" onchange="if (this.value < 1) this.value = 1;" size="2" maxlength="2">
<select name="unit">
<option value="m"', empty($context['task']['unit']) || $context['task']['unit'] == 'm' ? ' selected' : '', '>', $txt['scheduled_task_reg_unit_m'], '</option>
<option value="h"', $context['task']['unit'] == 'h' ? ' selected' : '', '>', $txt['scheduled_task_reg_unit_h'], '</option>
<option value="d"', $context['task']['unit'] == 'd' ? ' selected' : '', '>', $txt['scheduled_task_reg_unit_d'], '</option>
<option value="w"', $context['task']['unit'] == 'w' ? ' selected' : '', '>', $txt['scheduled_task_reg_unit_w'], '</option>
</select>
</dd>
<dt>
<strong><label for="start_time">', $txt['scheduled_task_edit_start_time'], ':</label></strong><br>
<span class="smalltext">', $txt['scheduled_task_edit_start_time_desc'], '</span>
</dt>
<dd>
<input type="text" name="offset" id="start_time" value="', $context['task']['offset_formatted'], '" size="6" maxlength="5">
</dd>
<dt>
<strong><label for="enabled">', $txt['scheduled_tasks_enabled'], ':</label></strong>
</dt>
<dd>
<input type="checkbox" name="enabled" id="enabled"', !$context['task']['disabled'] ? ' checked' : '', '>
</dd>
</dl>
<div class="righttext">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-st_token_var'], '" value="', $context['admin-st_token'], '">
<input type="submit" name="save" value="', $txt['scheduled_tasks_save_changes'], '" class="button">
</div>
</div><!-- .windowbg -->
</form>';
}
?>

438
ManageSearch.template.php Normal file
View file

@ -0,0 +1,438 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* Modify the search weights.
*/
function template_modify_weights()
{
global $context, $scripturl, $txt, $modSettings;
echo '
<form id="admin_form_wrapper" action="', $scripturl, '?action=admin;area=managesearch;sa=weights" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">', $txt['search_weights'], '</h2>
</div>
<div class="windowbg">
<dl class="settings">
<dt>
<a href="', $scripturl, '?action=helpadmin;help=search_weight_frequency" onclick="return reqOverlayDiv(this.href);" class="help"><span class="main_icons help" title="', $txt['help'], '"></span></a><label for="weight1_val">
', $txt['search_weight_frequency'], ':</label>
</dt>
<dd>
<span class="search_weight">
<input type="text" name="search_weight_frequency" id="weight1_val" value="', empty($modSettings['search_weight_frequency']) ? '0' : $modSettings['search_weight_frequency'], '" onchange="calculateNewValues()" size="3">
</span>
<span id="weight1" class="search_weight">', $context['relative_weights']['search_weight_frequency'], '%</span>
</dd>
<dt>
<a href="', $scripturl, '?action=helpadmin;help=search_weight_age" onclick="return reqOverlayDiv(this.href);" class="help"><span class="main_icons help" title="', $txt['help'], '"></span></a>
<label for="weight2_val">', $txt['search_weight_age'], ':</label>
</dt>
<dd>
<span class="search_weight">
<input type="text" name="search_weight_age" id="weight2_val" value="', empty($modSettings['search_weight_age']) ? '0' : $modSettings['search_weight_age'], '" onchange="calculateNewValues()" size="3">
</span>
<span id="weight2" class="search_weight">', $context['relative_weights']['search_weight_age'], '%</span>
</dd>
<dt>
<a href="', $scripturl, '?action=helpadmin;help=search_weight_length" onclick="return reqOverlayDiv(this.href);" class="help"><span class="main_icons help" title="', $txt['help'], '"></span></a>
<label for="weight3_val">', $txt['search_weight_length'], ':</label>
</dt>
<dd>
<span class="search_weight">
<input type="text" name="search_weight_length" id="weight3_val" value="', empty($modSettings['search_weight_length']) ? '0' : $modSettings['search_weight_length'], '" onchange="calculateNewValues()" size="3">
</span>
<span id="weight3" class="search_weight">', $context['relative_weights']['search_weight_length'], '%</span>
</dd>
<dt>
<a href="', $scripturl, '?action=helpadmin;help=search_weight_subject" onclick="return reqOverlayDiv(this.href);" class="help"><span class="main_icons help" title="', $txt['help'], '"></span></a>
<label for="weight4_val">', $txt['search_weight_subject'], ':</label>
</dt>
<dd>
<span class="search_weight">
<input type="text" name="search_weight_subject" id="weight4_val" value="', empty($modSettings['search_weight_subject']) ? '0' : $modSettings['search_weight_subject'], '" onchange="calculateNewValues()" size="3">
</span>
<span id="weight4" class="search_weight">', $context['relative_weights']['search_weight_subject'], '%</span>
</dd>
<dt>
<a href="', $scripturl, '?action=helpadmin;help=search_weight_first_message" onclick="return reqOverlayDiv(this.href);" class="help"><span class="main_icons help" title="', $txt['help'], '"></span></a>
<label for="weight5_val">', $txt['search_weight_first_message'], ':</label>
</dt>
<dd>
<span class="search_weight">
<input type="text" name="search_weight_first_message" id="weight5_val" value="', empty($modSettings['search_weight_first_message']) ? '0' : $modSettings['search_weight_first_message'], '" onchange="calculateNewValues()" size="3">
</span>
<span id="weight5" class="search_weight">', $context['relative_weights']['search_weight_first_message'], '%</span>
</dd>
<dt>
<a href="', $scripturl, '?action=helpadmin;help=search_weight_sticky" onclick="return reqOverlayDiv(this.href);" class="help"><span class="main_icons help" title="', $txt['help'], '"></span></a>
<label for="weight6_val">', $txt['search_weight_sticky'], ':</label>
</dt>
<dd>
<span class="search_weight">
<input type="text" name="search_weight_sticky" id="weight6_val" value="', empty($modSettings['search_weight_sticky']) ? '0' : $modSettings['search_weight_sticky'], '" onchange="calculateNewValues()" size="3">
</span>
<span id="weight6" class="search_weight">', $context['relative_weights']['search_weight_sticky'], '%</span>
</dd>
<dt>
<strong>', $txt['search_weights_total'], '</strong>
</dt>
<dd>
<span id="weighttotal" class="search_weight">
<strong>', $context['relative_weights']['total'], '</strong>
</span>
<span class="search_weight"><strong>100%</strong></span>
</dd>
</dl>
<input type="submit" name="save" value="', $txt['search_weights_save'], '" class="button">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-msw_token_var'], '" value="', $context['admin-msw_token'], '">
</div><!-- .windowbg -->
</form>';
}
/**
* Select the search method.
*/
function template_select_search_method()
{
global $context, $scripturl, $txt, $modSettings;
echo '
<div class="cat_bar">
<h2 class="catbg">', $txt['search_method'], '</h2>
</div>
<div class="information">
<div class="smalltext">
<a href="', $scripturl, '?action=helpadmin;help=search_why_use_index" onclick="return reqOverlayDiv(this.href);">', $txt['search_create_index_why'], '</a>
</div>
</div>
<form id="admin_form_wrapper" action="', $scripturl, '?action=admin;area=managesearch;sa=method" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">', $txt['search_method'], '</h2>
</div>
<div class="windowbg">
<dl class="settings">';
if (!empty($context['table_info']))
echo '
<dt>
<strong>', $txt['search_method_messages_table_space'], ':</strong>
</dt>
<dd>
', $context['table_info']['data_length'], '
</dd>
<dt>
<strong>', $txt['search_method_messages_index_space'], ':</strong>
</dt>
<dd>
', $context['table_info']['index_length'], '
</dd>';
echo '
</dl>
', $context['double_index'] ? '<div class="noticebox">
' . $txt['search_double_index'] . '</div>' : '', '
<fieldset class="search_settings floatleft">
<legend>', $txt['search_index'], '</legend>
<dl>
<dt>
<input type="radio" name="search_index" value=""', empty($modSettings['search_index']) ? ' checked' : '', '>
', $txt['search_index_none'], '
</dt>';
if ($context['supports_fulltext'])
{
echo '
<dt>
<input type="radio" name="search_index" value="fulltext"', !empty($modSettings['search_index']) && $modSettings['search_index'] == 'fulltext' ? ' checked' : '', empty($context['fulltext_index']) ? ' onclick="alert(\'' . $txt['search_method_fulltext_warning'] . '\'); selectRadioByName(this.form.search_index, \'fulltext\');"' : '', '>
', $txt['search_method_fulltext_index'], '
</dt>
<dd>
<span class="smalltext">';
if (empty($context['fulltext_index']) && empty($context['cannot_create_fulltext']))
echo '
<strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_no_index_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createfulltext;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_method_fulltext_create'], '</a>]';
elseif (empty($context['fulltext_index']) && !empty($context['cannot_create_fulltext']))
echo '
<strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_fulltext_cannot_create'];
else
echo '
<strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_already_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removefulltext;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_method_fulltext_remove'], '</a>]<br>
<strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['fulltext_length'];
echo '
</span>
</dd>';
}
echo '
<dt>
<input type="radio" name="search_index" value="custom"', !empty($modSettings['search_index']) && $modSettings['search_index'] == 'custom' ? ' checked' : '', $context['custom_index'] ? '' : ' onclick="alert(\'' . $txt['search_index_custom_warning'] . '\'); selectRadioByName(this.form.search_method, \'1\');"', '>
', $txt['search_index_custom'], '
</dt>
<dd>
<span class="smalltext">';
if ($context['custom_index'])
echo '
<strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_already_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removecustom;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_remove'], '</a>]<br>
<strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['custom_index_length'];
elseif ($context['partial_custom_index'])
echo '
<strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_partial'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removecustom;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_remove'], '</a>] [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createmsgindex;resume;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_resume'], '</a>]<br>
<strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['custom_index_length'];
else
echo '
<strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_no_index_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createmsgindex">', $txt['search_index_create_custom'], '</a>]';
echo '
</span>
</dd>';
foreach ($context['search_apis'] as $api)
{
if (empty($api['label']) || $api['has_template'])
continue;
echo '
<dt>
<input type="radio" name="search_index" value="', $api['setting_index'], '"', !empty($modSettings['search_index']) && $modSettings['search_index'] == $api['setting_index'] ? ' checked' : '', '>
', $api['label'], '
</dt>';
if ($api['desc'])
echo '
<dd>
<span class="smalltext">', $api['desc'], '</span>
</dd>';
}
echo '
</dl>
</fieldset>
<fieldset class="search_settings floatright">
<legend>', $txt['search_method'], '</legend>
<input type="checkbox" name="search_force_index" id="search_force_index_check" value="1"', empty($modSettings['search_force_index']) ? '' : ' checked', '><label for="search_force_index_check">', $txt['search_force_index'], '</label><br>
<input type="checkbox" name="search_match_words" id="search_match_words_check" value="1"', empty($modSettings['search_match_words']) ? '' : ' checked', '><label for="search_match_words_check">', $txt['search_match_words'], '</label>
</fieldset>
<br class="clear">
<input type="submit" name="save" value="', $txt['search_method_save'], '" class="button">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-msmpost_token_var'], '" value="', $context['admin-msmpost_token'], '">
</div><!-- .windowbg -->
</form>';
}
/**
* Create a search index.
*/
function template_create_index()
{
global $context, $scripturl, $txt;
echo '
<form action="', $scripturl, '?action=admin;area=managesearch;sa=createmsgindex;step=1" method="post" accept-charset="', $context['character_set'], '" name="create_index">
<div class="cat_bar">
<h2 class="catbg">', $txt['search_create_index'], '</h2>
</div>
<div class="windowbg">
<dl class="settings">
<dt>
<label for="predefine_select">', $txt['search_predefined'], ':</label>
</dt>
<dd>
<select name="bytes_per_word" id="predefine_select">
<option value="2">', $txt['search_predefined_small'], '</option>
<option value="4" selected>', $txt['search_predefined_moderate'], '</option>
<option value="5">', $txt['search_predefined_large'], '</option>
</select>
</dd>
</dl>
<hr>
<input type="submit" name="save" value="', $txt['search_create_index_start'], '" class="button">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
</div>
</form>';
}
/**
* Display a progress page while creating a search index.
*/
function template_create_index_progress()
{
global $context, $scripturl, $txt;
echo '
<form action="', $scripturl, '?action=admin;area=managesearch;sa=createmsgindex;step=1" name="autoSubmit" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">', $txt['search_create_index'], '</h2>
</div>
<div class="windowbg">
<div>
<p>', $txt['search_create_index_not_ready'], '</p>
<div class="progress_bar">
<span>', $context['percentage'], '%</span>
<div class="bar" style="width: ', $context['percentage'], '%;"></div>
</div>
</div>
<hr>
<input type="submit" name="b" value="', $txt['search_create_index_continue'], '" class="button">
</div>
<input type="hidden" name="step" value="', $context['step'], '">
<input type="hidden" name="start" value="', $context['start'], '">
<input type="hidden" name="bytes_per_word" value="', $context['index_settings']['bytes_per_word'], '">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
</form>
<script>
var countdown = 10;
doAutoSubmit();
function doAutoSubmit()
{
if (countdown == 0)
document.forms.autoSubmit.submit();
else if (countdown == -1)
return;
document.forms.autoSubmit.b.value = "', $txt['search_create_index_continue'], ' (" + countdown + ")";
countdown--;
setTimeout("doAutoSubmit();", 1000);
}
</script>';
}
/**
* Done creating a search index.
*/
function template_create_index_done()
{
global $scripturl, $txt;
echo '
<div class="cat_bar">
<h2 class="catbg">', $txt['search_create_index'], '</h2>
</div>
<div class="windowbg">
<p>', $txt['search_create_index_done'], '</p>
<p>
<strong><a href="', $scripturl, '?action=admin;area=managesearch;sa=method">', $txt['search_create_index_done_link'], '</a></strong>
</p>
</div>';
}
/**
* Add or edit a search engine spider.
*/
function template_spider_edit()
{
global $context, $scripturl, $txt;
echo '
<form id="admin_form_wrapper" action="', $scripturl, '?action=admin;area=sengines;sa=editspiders;sid=', $context['spider']['id'], '" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">', $context['page_title'], '</h2>
</div>
<div class="information noup">
', $txt['add_spider_desc'], '
</div>
<div class="windowbg noup">
<dl class="settings">
<dt>
<strong><label for="spider_name">', $txt['spider_name'], ':</label></strong><br>
<span class="smalltext">', $txt['spider_name_desc'], '</span>
</dt>
<dd>
<input type="text" name="spider_name" id="spider_name" value="', $context['spider']['name'], '">
</dd>
<dt>
<strong><label for="spider_agent">', $txt['spider_agent'], ':</label></strong><br>
<span class="smalltext">', $txt['spider_agent_desc'], '</span>
</dt>
<dd>
<input type="text" name="spider_agent" id="spider_agent" value="', $context['spider']['agent'], '">
</dd>
<dt>
<strong><label for="spider_ip">', $txt['spider_ip_info'], ':</label></strong><br>
<span class="smalltext">', $txt['spider_ip_info_desc'], '</span>
</dt>
<dd>
<textarea name="spider_ip" id="spider_ip" rows="4" cols="20">', $context['spider']['ip_info'], '</textarea>
</dd>
</dl>
<hr>
<input type="submit" name="save" value="', $context['page_title'], '" class="button">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-ses_token_var'], '" value="', $context['admin-ses_token'], '">
</div><!-- .windowbg -->
</form>';
}
/**
* Show... spider... logs...
*/
function template_show_spider_logs()
{
global $context, $txt, $scripturl;
// Standard fields.
template_show_list('spider_logs');
echo '
<form id="admin_form_wrapper" action="', $scripturl, '?action=admin;area=sengines;sa=logs" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">', $txt['spider_logs_delete'], '</h2>
</div>
<div class="windowbg">
<p>
', $txt['spider_logs_delete_older'], '
<input type="text" name="older" id="older" value="7" size="3">
', $txt['spider_logs_delete_day'], '
</p>
<input type="submit" name="delete_entries" value="', $txt['spider_logs_delete_submit'], '" onclick="if (document.getElementById(\'older\').value &lt; 1 &amp;&amp; !confirm(\'' . addcslashes($txt['spider_logs_delete_confirm'], "'") . '\')) return false; return true;" class="button">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-sl_token_var'], '" value="', $context['admin-sl_token'], '">
</div>
</form>';
}
/**
* Show... spider... stats...
*/
function template_show_spider_stats()
{
global $context, $txt, $scripturl;
// Standard fields.
template_show_list('spider_stat_list');
echo '
<form id="admin_form_wrapper" action="', $scripturl, '?action=admin;area=sengines;sa=stats" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">', $txt['spider_logs_delete'], '</h2>
</div>
<div class="windowbg">
<p>
', sprintf($txt['spider_stats_delete_older'], '<input type="text" name="older" id="older" value="90" size="3">'), '
</p>
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-ss_token_var'], '" value="', $context['admin-ss_token'], '">
<input type="submit" name="delete_entries" value="', $txt['spider_logs_delete_submit'], '" onclick="if (document.getElementById(\'older\').value &lt; 1 &amp;&amp; !confirm(\'' . addcslashes($txt['spider_logs_delete_confirm'], "'") . '\')) return false; return true;" class="button">
<br>
</div>
</form>';
}
?>

488
ManageSmileys.template.php Normal file
View file

@ -0,0 +1,488 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* Shows a list of smiley sets so you can edit them.
*/
function template_editsets()
{
template_show_list('smiley_set_list');
}
/**
* Modifying a smiley set.
*/
function template_modifyset()
{
global $context, $scripturl, $txt, $modSettings;
echo '
<form action="', $scripturl, '?action=admin;area=smileys;sa=editsets" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">
', $context['current_set']['is_new'] ? $txt['smiley_set_new'] : $txt['smiley_set_modify_existing'], '
</h2>
</div>';
if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable']))
{
echo '
<div class="information noup">
', $txt['smiley_set_import_info'], '
</div>';
}
// If this is an existing set, and there are still un-added smileys - offer an import opportunity.
elseif (!empty($context['current_set']['can_import']))
{
echo '
<div class="information noup">
', $context['smiley_set_unused_message'], '
</div>';
}
echo '
<div class="windowbg noup">
<dl class="settings">
<dt>
<strong><label for="smiley_sets_name">', $txt['smiley_sets_name'], '</label>: </strong>
</dt>
<dd>
<input type="text" name="smiley_sets_name" id="smiley_sets_name" value="', $context['current_set']['name'], '">
</dd>
<dt>
<strong><label for="smiley_sets_path">', $txt['smiley_sets_url'], '</label>: </strong>
</dt>
<dd>
', $modSettings['smileys_url'], '/';
if (empty($context['smiley_set_dirs']))
echo '
<input type="text" name="smiley_sets_path" id="smiley_sets_path" value="', $context['current_set']['path'], '"> ';
else
{
echo '
<select name="smiley_sets_path" id="smiley_sets_path">';
foreach ($context['smiley_set_dirs'] as $smiley_set_dir)
echo '
<option value="', $smiley_set_dir['id'], '"', $smiley_set_dir['current'] ? ' selected' : '', $smiley_set_dir['selectable'] ? '' : ' disabled', '>', $smiley_set_dir['id'], '</option>';
echo '
</select> ';
}
echo '
/..
</dd>
<dt>
<strong><label for="smiley_sets_default">', $txt['smiley_set_select_default'], '</label>: </strong>
</dt>
<dd>
<input type="checkbox" name="smiley_sets_default" id="smiley_sets_default" value="1"', $context['current_set']['selected'] ? ' checked' : '', '>
</dd>
</dl>
<input type="submit" name="smiley_save" value="', $txt['smiley_sets_save'], '" class="button">
</div><!-- .windowbg -->
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-mss_token_var'], '" value="', $context['admin-mss_token'], '">
<input type="hidden" name="set" value="', $context['current_set']['id'], '">
</form>';
}
/**
* Editing an individual smiley
*/
function template_modifysmiley()
{
global $context, $scripturl, $txt, $modSettings;
echo '
<form action="', $scripturl, '?action=admin;area=smileys;sa=editsmileys" method="post" accept-charset="', $context['character_set'], '" name="smileyForm" id="smileyForm" enctype="multipart/form-data">
<div class="cat_bar">
<h2 class="catbg">', $txt['smiley_modify_existing'], '</h2>
</div>
<div class="windowbg">
<dl class="settings">
<dt>
<strong>', $txt['smiley_preview_using_set'], ': </strong>
<select id="set" onchange="updatePreview($(\'#smiley_filename_\' + $(\'#set\').val()).val(), $(\'#set\').val());">';
foreach ($context['smiley_sets'] as $smiley_set)
echo '
<option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>';
echo '
</select>
</dt>
<dd>
<img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $context['current_smiley']['filename'], '" id="preview" alt="">
</dd>
<dt>
<strong><label for="smiley_filename">', $txt['smileys_filename'], '</label>: </strong>
</dt>';
if (empty($context['filenames']))
{
echo '
<dd>
<input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '">
</dd>';
}
else
{
foreach ($context['smiley_sets'] as $set => $smiley_set)
{
echo '
<dt>
', $smiley_set['name'], '
</dt>
<dd', in_array($set, $context['missing_sets']) ? ' class="errorbox"' : '', '>
<select name="smiley_filename[', $set, ']" id="smiley_filename_', $set, '" onchange="$(\'#set\').val(\'', $set, '\');updatePreview($(\'#smiley_filename_\' + $(\'#set\').val()).val(), $(\'#set\').val());">';
foreach ($context['filenames'][$set] as $filename)
echo '
<option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', $filename['disabled'] ? ' disabled' : '', '>', $filename['id'], '</option>';
echo '
</select>
<input type="file" name="smiley_upload[', $set, ']" id="smiley_upload_', $set, '">
</dd>';
}
}
echo '
</dl>
<dl class="settings">
<dt>
<strong><label for="smiley_code">', $txt['smileys_code'], '</label>: </strong>
</dt>
<dd>
<input type="text" name="smiley_code" id="smiley_code" value="', $context['current_smiley']['code'], '">
</dd>
<dt>
<strong><label for="smiley_description">', $txt['smileys_description'], '</label>: </strong>
</dt>
<dd>
<input type="text" name="smiley_description" id="smiley_description" value="', $context['current_smiley']['description'], '">
</dd>
<dt>
<strong><label for="smiley_location">', $txt['smileys_location'], '</label>: </strong>
</dt>
<dd>
<select name="smiley_location" id="smiley_location">
<option value="0"', $context['current_smiley']['location'] == 0 ? ' selected' : '', '>
', $txt['smileys_location_form'], '
</option>
<option value="1"', $context['current_smiley']['location'] == 1 ? ' selected' : '', '>
', $txt['smileys_location_hidden'], '
</option>
<option value="2"', $context['current_smiley']['location'] == 2 ? ' selected' : '', '>
', $txt['smileys_location_popup'], '
</option>
</select>
</dd>
</dl>
<input type="submit" name="smiley_save" value="', $txt['smileys_save'], '" class="button">
<input type="submit" name="deletesmiley" value="', $txt['smileys_delete'], '" data-confirm="', $txt['smileys_delete_confirm'], '" class="button you_sure">
</div><!-- .windowbg -->
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="smiley" value="', $context['current_smiley']['id'], '">
</form>';
}
/**
* Adding a new smiley.
*/
function template_addsmiley()
{
global $context, $scripturl, $txt, $modSettings;
echo '
<form action="', $scripturl, '?action=admin;area=smileys;sa=addsmiley" method="post" accept-charset="', $context['character_set'], '" name="smileyForm" id="smileyForm" enctype="multipart/form-data">
<div class="cat_bar">
<h2 class="catbg">', $txt['smileys_add_method'], '</h2>
</div>
<div class="windowbg">
<ul>
<li>
<label for="method-existing"><input type="radio" onclick="switchType();" name="method" id="method-existing" value="existing" checked> ', $txt['smileys_add_existing'], '</label>
</li>
<li>
<label for="method-upload"><input type="radio" onclick="switchType();" name="method" id="method-upload" value="upload"> ', $txt['smileys_add_upload'], '</label>
</li>
</ul>
<br>
<fieldset id="ex_settings">
<dl class="settings">
<dt>
<strong><label for="preview">', $txt['smiley_preview'], '</label>: </strong>
</dt>
<dd>
<img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $context['filenames'][$context['selected_set']]['smiley']['id'], '" id="preview" alt="">
</dd>
<dt>
<strong><label for="smiley_filename">', $txt['smileys_filename'], '</label>: </strong>
</dt>
<dd>';
if (empty($context['filenames']))
echo '
<input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '" onchange="selectMethod(\'existing\');">';
else
{
echo '
<select name="smiley_filename" id="smiley_filename" onchange="updatePreview($(\'#smiley_filename\').val());selectMethod(\'existing\');">';
foreach ($context['smiley_sets'] as $smiley_set)
{
echo '
<optgroup label="', $smiley_set['name'], '">';
if (!empty($context['filenames'][$smiley_set['path']]))
{
foreach ($context['filenames'][$smiley_set['path']] as $filename)
echo '
<option value="', $smiley_set['path'], '/', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>';
}
echo '
</optgroup>';
}
echo '
</select>';
}
echo '
</dd>
</dl>
</fieldset>
<fieldset id="ul_settings" style="display: none;">
<dl class="settings">
<dt>
<a href="', $scripturl, '?action=helpadmin;help=smiley_sameall" onclick="return reqOverlayDiv(this.href);" class="help"><span class="main_icons help" title="', $txt['help'], '"></span></a>
<strong><label for="sameall">', $txt['smileys_add_upload_all'], ':</label></strong>
</dt>
<dd>
<input type="checkbox" name="sameall" id="sameall" onclick="swapUploads(); selectMethod(\'upload\');" checked>
</dd>
<dt>
<strong>', $txt['smileys_add_upload_choose'], ':</strong>
</dt>
<dt class="upload_sameall">
', $txt['smileys_add_upload_choose_desc'], '
</dt>
<dd class="upload_sameall">
<input type="file" name="uploadSmiley" id="uploadSmiley" onchange="selectMethod(\'upload\');">
</dd>';
foreach ($context['smiley_sets'] as $smiley_set)
echo '
<dt class="upload_more" style="display: none;">
', sprintf($txt['smileys_add_upload_for'], '<strong>' . $smiley_set['name'] . '</strong>'), ':
</dt>
<dd class="upload_more" style="display: none;">
<input type="file" name="individual_', $smiley_set['path'], '" disabled onchange="selectMethod(\'upload\');">
</dd>';
echo '
</dl>
</fieldset>
</div><!-- .windowbg -->
<div class="cat_bar">
<h2 class="catbg">', $txt['smiley_new'], '</h2>
</div>
<div class="windowbg">
<dl class="settings">
<dt>
<strong><label for="smiley_code">', $txt['smileys_code'], '</label>: </strong>
</dt>
<dd>
<input type="text" name="smiley_code" id="smiley_code" value="">
</dd>
<dt>
<strong><label for="smiley_description">', $txt['smileys_description'], '</label>: </strong>
</dt>
<dd>
<input type="text" name="smiley_description" id="smiley_description" value="">
</dd>
<dt>
<strong><label for="smiley_location">', $txt['smileys_location'], '</label>: </strong>
</dt>
<dd>
<select name="smiley_location" id="smiley_location">
<option value="0" selected>
', $txt['smileys_location_form'], '
</option>
<option value="1">
', $txt['smileys_location_hidden'], '
</option>
<option value="2">
', $txt['smileys_location_popup'], '
</option>
</select>
</dd>
</dl>
<input type="submit" name="smiley_save" value="', $txt['smileys_save'], '" class="button">
</div><!-- .windowbg -->
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
</form>';
}
/**
* Ordering smileys.
*/
function template_setorder()
{
global $context, $scripturl, $txt, $modSettings;
foreach ($context['smileys'] as $location)
{
echo '
<form action="', $scripturl, '?action=admin;area=smileys;sa=editsmileys" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">', $location['title'], '</h2>
</div>
<div class="information noup">
', $location['description'], '
</div>
<div class="move_smileys windowbg noup">
<strong>', empty($context['move_smiley']) ? $txt['smileys_move_select_smiley'] : $txt['smileys_move_select_destination'], '...</strong><br>';
foreach ($location['rows'] as $row)
{
if (!empty($context['move_smiley']))
echo '
<a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';row=', $row[0]['row'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '"><span class="main_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>';
foreach ($row as $smiley)
{
if (empty($context['move_smiley']))
echo '
<a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;move=', $smiley['id'], '"><img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" alt="', $smiley['description'], '"></a>';
else
echo '
<img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" alt="', $smiley['description'], '" ', $smiley['selected'] ? 'class="selected_item"' : '', '>
<a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';after=', $smiley['id'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '" title="', $txt['smileys_move_here'], '"><span class="main_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>';
}
echo '
<br>';
}
if (!empty($context['move_smiley']))
echo '
<a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';row=', $location['last_row'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '"><span class="main_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>';
echo '
</div><!-- .windowbg -->
<input type="hidden" name="reorder" value="1">
</form>';
}
}
/**
* Editing Message Icons
*/
function template_editicons()
{
template_show_list('message_icon_list');
}
/**
* Editing an individual message icon
*/
function template_editicon()
{
global $context, $scripturl, $txt;
echo '
<form action="', $scripturl, '?action=admin;area=smileys;sa=editicon;icon=', $context['new_icon'] ? '0' : $context['icon']['id'], '" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">
', $context['new_icon'] ? $txt['icons_new_icon'] : $txt['icons_edit_icon'], '
</h2>
</div>
<div class="windowbg">
<dl class="settings">';
if (!$context['new_icon'])
echo '
<dt>
<strong>', $txt['smiley_preview'], ': </strong>
</dt>
<dd>
<img src="', $context['icon']['image_url'], '" alt="', $context['icon']['title'], '">
</dd>';
echo '
<dt>
<strong><label for="icon_filename">', $txt['smileys_filename'], '</label>: </strong><br><span class="smalltext">', sprintf($txt['icons_extension_must_be'], '.png'), '</span>
</dt>
<dd>
<input type="text" name="icon_filename" id="icon_filename" value="', !empty($context['icon']['filename']) ? $context['icon']['filename'] . '.png' : '', '">
</dd>
<dt>
<strong><label for="icon_description">', $txt['smileys_description'], '</label>: </strong>
</dt>
<dd>
<input type="text" name="icon_description" id="icon_description" value="', !empty($context['icon']['title']) ? $context['icon']['title'] : '', '">
</dd>
<dt>
<strong><label for="icon_board_select">', $txt['icons_board'], '</label>: </strong>
</dt>
<dd>
<select name="icon_board" id="icon_board_select">
<option value="0"', empty($context['icon']['board_id']) ? ' selected' : '', '>', $txt['icons_edit_icons_all_boards'], '</option>';
foreach ($context['categories'] as $category)
{
echo '
<optgroup label="', $category['name'], '">';
foreach ($category['boards'] as $board)
echo '
<option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=&gt;' : '', ' ', $board['name'], '</option>';
echo '
</optgroup>';
}
echo '
</select>
</dd>
<dt>
<strong><label for="icon_location">', $txt['smileys_location'], '</label>: </strong>
</dt>
<dd>
<select name="icon_location" id="icon_location">
<option value="0"', empty($context['icon']['after']) ? ' selected' : '', '>', $txt['icons_location_first_icon'], '</option>';
// Print the list of all the icons it can be put after...
foreach ($context['icons'] as $id => $data)
if (empty($context['icon']['id']) || $id != $context['icon']['id'])
echo '
<option value="', $id, '"', !empty($context['icon']['after']) && $id == $context['icon']['after'] ? ' selected' : '', '>', $txt['icons_location_after'], ': ', $data['title'], '</option>';
echo '
</select>
</dd>
</dl>';
if (!$context['new_icon'])
echo '
<input type="hidden" name="icon" value="', $context['icon']['id'], '">';
echo '
<input type="submit" name="icons_save" value="', $txt['smileys_save'], '" class="button">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
</div><!-- .windowbg -->
</form>';
}
?>

202
Memberlist.template.php Normal file
View file

@ -0,0 +1,202 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* Displays a sortable listing of all members registered on the forum.
*/
function template_main()
{
global $context, $settings, $scripturl, $txt;
echo '
<div class="main_section" id="memberlist">
<div class="pagesection">
', template_button_strip($context['memberlist_buttons'], 'right'), '
<div class="pagelinks floatleft">', $context['page_index'], '</div>
</div>
<div class="khbiseau_topright_color"></div>
<div class="cat_bar">
<h2 class="catbg">
<span class="floatleft">', $txt['members_list'], '</span>';
if (!isset($context['old_search']))
echo '
<span class="floatright">', $context['letter_links'], '</span>';
echo '
</h2>
</div>';
echo '
<div id="mlist">
<table class="table_grid">
<thead>
<tr class="title_bar">';
// Display each of the column headers of the table.
foreach ($context['columns'] as $key => $column)
{
// @TODO maybe find something nicer?
if ($key == 'email_address' && !$context['can_send_email'])
continue;
// This is a selected column, so underline it or some such.
if ($column['selected'])
echo '
<th scope="col" class="', $key, isset($column['class']) ? ' ' . $column['class'] : '', ' selected" style="width: auto;"' . (isset($column['colspan']) ? ' colspan="' . $column['colspan'] . '"' : '') . '>
<a href="' . $column['href'] . '" rel="nofollow">' . $column['label'] . '</a><span class="main_icons sort_' . $context['sort_direction'] . '"></span></th>';
// This is just some column... show the link and be done with it.
else
echo '
<th scope="col" class="', $key, isset($column['class']) ? ' ' . $column['class'] : '', '"', isset($column['width']) ? ' style="width: ' . $column['width'] . '"' : '', isset($column['colspan']) ? ' colspan="' . $column['colspan'] . '"' : '', '>
', $column['link'], '</th>';
}
echo '
</tr>
</thead>
<tbody>';
// Assuming there are members loop through each one displaying their data.
if (!empty($context['members']))
{
foreach ($context['members'] as $member)
{
echo '
<tr class="windowbg"', empty($member['sort_letter']) ? '' : ' id="letter' . $member['sort_letter'] . '"', '>';
/*On n'espionne pas les gens !
* <td class="is_online centertext test">
', $context['can_send_pm'] ? '<a href="' . $member['online']['href'] . '" title="' . $member['online']['text'] . '">' : '', $settings['use_image_buttons'] ? '<span class="' . ($member['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $member['online']['text'] . '"></span>' : $member['online']['label'], $context['can_send_pm'] ? '</a>' : '', '
</td>
* Mais il faut mettre quelque chose, car la colonne de titre est créée automatiquement et l'enlever fera buguer des mods
*/
echo '
<td>
</td>
<td class="real_name lefttext">', $member['link'], '</td>';
if (!isset($context['disabled_fields']['website']))
echo '
<td class="website_url centertext">', $member['website']['url'] != '' ? '<a href="' . $member['website']['url'] . '" target="_blank" rel="noopener"><span class="main_icons www" title="' . $member['website']['title'] . '"></span></a>' : '', '</td>';
// Group and date.
echo '
<td class="id_group centertext">', empty($member['group']) ? $member['post_group'] : $member['group'], '</td>
<td class="registered centertext">', $member['registered_date'], '</td>';
if (!isset($context['disabled_fields']['posts']))
{
echo '
<td class="post_count centertext">';
if (!empty($member['posts']))
echo '
<div class="generic_bar">
<div class="bar" style="width: ', $member['post_percent'], '%;"></div>
<span>', $member['posts'], '</span>
</div>';
echo '
</td>';
}
// Show custom fields marked to be shown here
if (!empty($context['custom_profile_fields']['columns']))
foreach ($context['custom_profile_fields']['columns'] as $key => $column)
echo '
<td class="', $key, ' centertext">', $member['options'][$key], '</td>';
echo '
</tr>';
}
}
// No members?
else
echo '
<tr>
<td colspan="', $context['colspan'], '" class="windowbg">', $txt['search_no_results'], '</td>
</tr>';
echo '
</tbody>
</table>
<div class="khbiseau_bottom_white"></div>
</div><!-- #mlist -->';
// Show the page numbers again. (makes 'em easier to find!)
echo '
<div class="pagesection">
<div class="pagelinks floatleft">', $context['page_index'], '</div>';
// If it is displaying the result of a search show a "search again" link to edit their criteria.
if (isset($context['old_search']))
echo '
<div class="buttonlist floatright">
<a class="button" href="', $scripturl, '?action=mlist;sa=search;search=', $context['old_search_value'], '">', $txt['mlist_search_again'], '</a>
</div>';
echo '
</div>
</div><!-- #memberlist -->';
}
/**
* A page allowing people to search the member list.
*/
function template_search()
{
global $context, $scripturl, $txt;
// Start the submission form for the search!
echo '
<form action="', $scripturl, '?action=mlist;sa=search" method="post" accept-charset="', $context['character_set'], '">
<div id="memberlist">
<div class="pagesection">
', template_button_strip($context['memberlist_buttons'], 'right'), '
</div>
<div class="cat_bar">
<h2 class="catbg mlist">
<span class="main_icons filter"></span>', $txt['mlist_search'], '
</h2>
</div>
<div id="advanced_search" class="roundframe">
<dl id="mlist_search" class="settings">
<dt>
<label><strong>', $txt['search_for'], ':</strong></label>
</dt>
<dd>
<input type="text" name="search" value="', $context['old_search'], '" size="40">
</dd>
<dt>
<label><strong>', $txt['mlist_search_filter'], ':</strong></label>
</dt>
<dd>
<ul>';
foreach ($context['search_fields'] as $id => $title)
echo '
<li>
<input type="checkbox" name="fields[]" id="fields-', $id, '" value="', $id, '"', in_array($id, $context['search_defaults']) ? ' checked' : '', '>
<label for="fields-', $id, '">', $title, '</label>
</li>';
echo '
</ul>
</dd>
</dl>
<input type="submit" name="submit" value="' . $txt['search'] . '" class="button floatright">
</div><!-- #advanced_search -->
</div><!-- #memberlist -->
</form>';
}
?>

592
MessageIndex.template.php Normal file
View file

@ -0,0 +1,592 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.2
*/
/**
* The main messageindex.
*/
function template_main()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;
echo '
<div class="khbiseau_topright_khcolor"></div>
<div id="display_head">
<h2 class="display_title">', $context['name'], '</h2>';
if (isset($context['description']) && $context['description'] != '')
echo '
<p>', $context['description'], '</p>';
if (!empty($context['moderators']))
echo '
<p>', count($context['moderators']) === 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $context['link_moderators']), '.</p>';
if (!empty($settings['display_who_viewing']))
{
echo '
<p>';
// Show just numbers...?
if ($settings['display_who_viewing'] == 1)
echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members'];
// Or show the actual people viewing the topic?
else
echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) || $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');
// Now show how many guests are here too.
echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_board'], '
</p>';
}
echo '
</div>
';
if (!empty($context['boards']) && (!empty($options['show_children']) || $context['start'] == 0))
{
// The child board TODO
echo '
<div id="board_', $context['current_board'], '_childboards" class="boardindex_table main_container">
<div class="cat_bar without_biseau">
<div class="info">
';
// Like collapse icon, but don't collapse because I don't know how. TODO !
echo'
<span class="not_toggle"></span>
<h2 class="catbg">', $txt['sub_boards'], '</h2>
</div><!--fin class info-->
<div class="board_stats">
<div>', $txt['board_topics'], '</div><div>', $txt['posts'], '</div></div>
<div class="lastpost">', $txt['last_post'], '</div>
</div>';
foreach ($context['boards'] as $board)
{
echo '
<div id="board_', $board['id'], '" class="up_contain ', (!empty($board['css_class']) ? $board['css_class'] : ''), '">
<div class="board_icon">
', function_exists('template_bi_' . $board['type'] . '_icon') ? call_user_func('template_bi_' . $board['type'] . '_icon', $board) : template_bi_board_icon($board), '
</div>
<div class="info">
', function_exists('template_bi_' . $board['type'] . '_info') ? call_user_func('template_bi_' . $board['type'] . '_info', $board) : template_bi_board_info($board), '
</div><!-- .info -->';
// Show some basic information about the number of posts, etc.
echo '
<div class="board_stats">
', function_exists('template_bi_' . $board['type'] . '_stats') ? call_user_func('template_bi_' . $board['type'] . '_stats', $board) : template_bi_board_stats($board), '
</div>';
// Show the last post if there is one.
echo '
<div class="lastpost">
', function_exists('template_bi_' . $board['type'] . '_lastpost') ? call_user_func('template_bi_' . $board['type'] . '_lastpost', $board) : template_bi_board_lastpost($board), '
</div>';
// Won't somebody think of the children!
if (function_exists('template_bi_' . $board['type'] . '_children'))
call_user_func('template_bi_' . $board['type'] . '_children', $board);
else
template_bi_board_children($board);
echo '
</div><!-- #board_[id] -->';
}
echo '
</div><!-- #board_[current_board]_childboards -->
<div class="khbiseau_bottom_white"></div>
';
}
// Let them know why their message became unapproved.
if ($context['becomesUnapproved'])
echo '
<div class="noticebox">
', $txt['post_becomes_unapproved'], '
</div>';
// If this person can approve items and we have some awaiting approval tell them.
if (!empty($context['unapproved_posts_message']))
echo '
<div class="noticebox">
', $context['unapproved_posts_message'], '
</div>';
if (!$context['no_topic_listing'])
{
echo '
<div class="pagesection">
', template_button_strip($context['normal_buttons'], ), '
', $context['menu_separator'], '
<div class="pagelinks">
<a href="#bot" class="button">', $txt['go_down'], '</a>
', $context['page_index'], '
</div>
';
// Mobile action buttons (top)
if (!empty($context['normal_buttons']))
echo '
<div class="mobile_buttons floatright">
<a class="button mobile_act">', $txt['mobile_action'], '</a>
</div>';
echo '
</div>';
// If Quick Moderation is enabled start the form.
if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics']))
echo '
<form action="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" class="clear" name="quickModForm" id="quickModForm">';
echo '
<div id="messageindex">';
echo '
<div class="title_bar" id="topic_header" title="', $txt['khbb_sort_board'], '">';
// Are there actually any topics to show?
if (!empty($context['topics']))
{
echo '
<div class="board_icon"></div>
<div class="info">', $context['topics_headers']['subject'], ' / ', $context['topics_headers']['starter'], '</div>
<div class="board_stats centertext">
<div>', $context['topics_headers']['replies'], ' </div>
<div> ', $context['topics_headers']['views'], ' </div>
</div>
<div class="lastpost">', $context['topics_headers']['last_post'], '</div>';
// Show a "select all" box for quick moderation?
if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1)
echo '
<div class="moderation">
<label for="label_select_all" class="khbb_label">', $txt['check_all'], '</label>
<input id="label_select_all" type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" title="', $txt['check_all'], '">
</div>';
// If it's on in "image" mode, don't show anything but the column.
elseif (!empty($context['can_quick_mod']))
echo '
<div class="moderation"></div>';
}
// No topics... just say, "sorry bub".
else
echo '
<h2 class="titlebg">', $txt['topic_alert_none'], '</h2>';
echo '
</div><!-- #topic_header -->';
// Contain the topic list
echo '
<div id="topic_container">';
foreach ($context['topics'] as $topic)
{
echo '
<div class="', $topic['css_class'], '">
<div class="board_icon">
<img src="', $topic['first_post']['icon_url'], '" alt="">
<div class="icons">
', $topic['is_posted_in'] ? '<span class="main_icons profile_sm"></span>' : '', '
';
// Now we handle the icons
if ($topic['is_watched'])
echo '
<span class="main_icons watch" title="', $txt['watching_this_topic'], '"></span>';
if ($topic['is_locked'])
echo '
<span class="main_icons lock"></span>';
if ($topic['is_sticky'])
echo '
<span class="main_icons sticky"></span>';
if ($topic['is_redirect'])
echo '
<span class="main_icons move"></span>';
if ($topic['is_poll'])
echo '
<span class="main_icons poll"></span>';
echo '</div>';
// End icon about topic
echo '</div><!-- End board_icon -->
<div class="info', !empty($context['can_quick_mod']) ? '' : ' info_block', '">
<div ', (!empty($topic['quick_mod']['modify']) ? 'id="topic_' . $topic['first_post']['id'] . '" ondblclick="oQuickModifyTopic.modify_topic(\'' . $topic['id'] . '\', \'' . $topic['first_post']['id'] . '\');"' : ''), '>';
echo '
<div class="message_index_title">
', $topic['new'] && $context['user']['is_logged'] ? '<a href="' . $topic['new_href'] . '" id="newicon' . $topic['first_post']['id'] . '" class="new_posts">' . $txt['new'] . '</a>' : '', '
<h3 class="preview', $topic['is_sticky'] ? ' bold_text' : '', '" title="', $topic[(empty($modSettings['message_index_preview_first']) ? 'last_post' : 'first_post')]['preview'], '">
<span id="msg_', $topic['first_post']['id'], '">', $topic['first_post']['link'], (!$topic['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '</span>
</h3>
</div>
<p class="floatleft">
', $txt['started_by'], ' ', $topic['first_post']['member']['link'], '
</p>
', !empty($topic['pages']) ? '<span id="pages' . $topic['first_post']['id'] . '" class="topic_pages">' . $topic['pages'] . '</span>' : '', '
</div><!-- #topic_[first_post][id] -->
</div><!-- .info -->
<div class="board_stats centertext">
<div> ', $topic['replies'], ' </div>
<div> ', $topic['views'], ' </div>
</div>
<div class="lastpost">
<p>', sprintf($txt['last_post_topic'], '<a href="' . $topic['last_post']['href'] . '">' . $topic['last_post']['time'] . '</a>', $topic['last_post']['member']['link']), '</p>
</div>';
// Show the quick moderation options?
if (!empty($context['can_quick_mod']))
{
echo '
<div class="moderation">';
if ($options['display_quick_mod'] == 1)
echo '
<label for="label_select', $topic['id'], '" class="khbb_label">', $txt['khbb_select_post'], ' " ', $topic['first_post']['link'], ' "
</label>
<input id="label_select', $topic['id'], '" type="checkbox" name="topics[]" value="', $topic['id'], '" title="', $txt['khbb_select_post'], '">';
else
{
// Check permissions on each and show only the ones they are allowed to use.
if ($topic['quick_mod']['remove'])
echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=remove;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="main_icons delete" title="', $txt['remove_topic'], '"></span></a>';
if ($topic['quick_mod']['lock'])
echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=lock;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="main_icons lock" title="', $topic['is_locked'] ? $txt['set_unlock'] : $txt['set_lock'], '"></span></a>';
if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove'])
echo '<br>';
if ($topic['quick_mod']['sticky'])
echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=sticky;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="main_icons sticky" title="', $topic['is_sticky'] ? $txt['set_nonsticky'] : $txt['set_sticky'], '"></span></a>';
if ($topic['quick_mod']['move'])
echo '<a href="', $scripturl, '?action=movetopic;current_board=', $context['current_board'], ';board=', $context['current_board'], '.', $context['start'], ';topic=', $topic['id'], '.0"><span class="main_icons move" title="', $txt['move_topic'], '"></span></a>';
}
echo '
</div><!-- .moderation -->';
}
echo '
</div><!-- $topic[css_class] -->';
}
echo '
</div><!-- #topic_container -->
<div class="khbiseau_bottom_white"></div>
';
echo '<div class="righttext" id="quick_actions">';
function message_index_jump_to()
{
global $context, $settings, $txt, $modSettings;
// Sauter à...
echo '<p id="message_index_jump_to"></p>';
if (!empty($context['jump_to']))
echo '
<script>
if (typeof(window.XMLHttpRequest) != "undefined")
aJumpTo[aJumpTo.length] = new JumpTo({
sContainerId: "message_index_jump_to",
sJumpToTemplate: "<label class=\"smalltext jump_to\" for=\"%select_id%\">', $context['jump_to']['label'], '<" + "/label> %dropdown_list%",
iCurBoardId: ', $context['current_board'], ',
iCurBoardChildLevel: ', $context['jump_to']['child_level'], ',
sCurBoardName: "', $context['jump_to']['board_name'], '",
sBoardChildLevelIndicator: "==",
sBoardPrefix: "=> ",
sCatSeparator: "-----------------------------",
sCatPrefix: "",
sGoButtonLabel: "', $txt['quick_mod_go'], '"
});
</script>';
}
message_index_jump_to();
if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']))
{
// Action de modération et de manipulation des sujets en masse
echo '<select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.move_to.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '>
<option value="">--------</option>';
foreach ($context['qmod_actions'] as $qmod_action)
if ($context['can_' . $qmod_action])
echo '
<option value="' . $qmod_action . '">' . $txt['quick_mod_' . $qmod_action] . '</option>';
echo '
</select>';
// Show a list of boards they can move the topic to.
if ($context['can_move'])
echo '
<span id="quick_mod_jump_to"></span>';
echo '
<input type="submit" value="', $txt['quick_mod_go'], '" onclick="return document.forms.quickModForm.qaction.value != \'\' &amp;&amp; confirm(\'', $txt['quickmod_confirm'], '\');" class="button qaction">
';
}
echo '</div><!-- #quick_actions -->';
echo '
</div><!-- #messageindex -->';
// Finish off the form - again.
if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics']))
echo '
<input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '">
</form>';
echo '
<div class="pagesection">
', template_button_strip($context['normal_buttons'], ), '
', $context['menu_separator'], '
<div class="pagelinks">
<a href="#main_content_section" class="button" id="bot">', $txt['go_up'], '</a>
', $context['page_index'], '
</div>';
// Mobile action buttons (bottom)
if (!empty($context['normal_buttons']))
echo '
<div class="mobile_buttons floatright">
<a class="button mobile_act">', $txt['mobile_action'], '</a>
</div>';
echo '
</div>';
}
if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move'])
echo '
<script>
if (typeof(window.XMLHttpRequest) != "undefined")
aJumpTo[aJumpTo.length] = new JumpTo({
sContainerId: "quick_mod_jump_to",
sClassName: "qaction",
sJumpToTemplate: "%dropdown_list%",
iCurBoardId: ', $context['current_board'], ',
iCurBoardChildLevel: ', $context['jump_to']['child_level'], ',
sCurBoardName: "', $context['jump_to']['board_name'], '",
sBoardChildLevelIndicator: "==",
sBoardPrefix: "=> ",
sCatSeparator: "-----------------------------",
sCatPrefix: "",
bNoRedirect: true,
bDisabled: true,
sCustomName: "move_to"
});
</script>';
// Javascript for inline editing.
echo '
<script>
var oQuickModifyTopic = new QuickModifyTopic({
aHidePrefixes: Array("lockicon", "stickyicon", "pages", "newicon"),
bMouseOnDiv: false,
});
</script>';
template_topic_legend();
// Lets pop the...
echo '
<div id="mobile_action" class="popup_container">
<div class="popup_window description">
<div class="popup_heading">', $txt['mobile_action'], '
<a href="javascript:void(0);" class="main_icons hide_popup"></a>
</div>
', template_button_strip($context['normal_buttons']), '
</div>
</div>';
}
/**
* Outputs the board icon for a standard board.
*
* @param array $board Current board information.
*/
function template_bi_board_icon($board)
{
global $context, $scripturl;
echo '
<a href="', ($context['user']['is_guest'] ? $board['href'] : $scripturl . '?action=unread;board=' . $board['id'] . '.0;children'), '" class="board_', $board['board_class'], '"', !empty($board['board_tooltip']) ? ' title="' . $board['board_tooltip'] . '"' : '', '></a>';
}
/**
* Outputs the board icon for a redirect.
*
* @param array $board Current board information.
*/
function template_bi_redirect_icon($board)
{
global $context, $scripturl;
echo '
<a href="', $board['href'], '" class="board_', $board['board_class'], '"', !empty($board['board_tooltip']) ? ' title="' . $board['board_tooltip'] . '"' : '', '></a>';
}
/**
* Outputs the board info for a standard board or redirect.
*
* @param array $board Current board information.
*/
function template_bi_board_info($board)
{
global $context, $scripturl, $txt;
echo '
<a class="subject mobile_subject" href="', $board['href'], '" id="b', $board['id'], '">
', $board['name'], '
</a>';
// Has it outstanding posts for approval?
if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics']))
echo '
<a href="', $scripturl, '?action=moderate;area=postmod;sa=', ($board['unapproved_topics'] > 0 ? 'topics' : 'posts'), ';brd=', $board['id'], ';', $context['session_var'], '=', $context['session_id'], '" title="', sprintf($txt['unapproved_posts'], $board['unapproved_topics'], $board['unapproved_posts']), '" class="moderation_link amt">!</a>';
echo '
<div class="board_description">', $board['description'], '</div>';
// Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.)
if (!empty($board['moderators']) || !empty($board['moderator_groups']))
echo '
<p class="moderators">', count($board['link_moderators']) === 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>';
}
/**
* Outputs the board stats for a standard board.
*
* @param array $board Current board information.
*/
function template_bi_board_stats($board)
{
global $txt;
echo '
<div> ', comma_format($board['topics']), ' </div>
<div> ', comma_format($board['posts']), ' </div>
';
}
/**
* Outputs the board stats for a redirect.
*
* @param array $board Current board information.
*/
function template_bi_redirect_stats($board)
{
global $txt;
echo '
<p>
', $txt['redirects'], ': ', comma_format($board['posts']), '
</p>';
}
/**
* Outputs the board lastposts for a standard board or a redirect.
* When on a mobile device, this may be hidden if no last post exists.
*
* @param array $board Current board information.
*/
function template_bi_board_lastpost($board)
{
if (!empty($board['last_post']['id']))
echo '
<p>', $board['last_post']['last_post_message'], '</p>';
}
/**
* Outputs the board children for a standard board.
*
* @param array $board Current board information.
*/
function template_bi_board_children($board)
{
global $txt, $scripturl, $context;
// Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
if (!empty($board['children']))
{
// Sort the links into an array with new boards bold so it can be imploded.
$children = array();
/* Each child in each board's children has:
id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
foreach ($board['children'] as $child)
{
if (!$child['is_redirect'])
$child['link'] = '' . ($child['new'] ? '<a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')" class="new_posts">' . $txt['new'] . '</a> ' : '') . '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . '</a>';
else
$child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . ' - ' . $child['short_description'] . '">' . $child['name'] . '</a>';
// Has it posts awaiting approval?
if ($child['can_approve_posts'] && ($child['unapproved_posts'] || $child['unapproved_topics']))
$child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link amt">!</a>';
$children[] = $child['new'] ? '<span class="strong">' . $child['link'] . '</span>' : '<span>' . $child['link'] . '</span>';
}
echo '
<div id="board_', $board['id'], '_children" class="children">
<p><strong id="child_list_', $board['id'], '">', $txt['sub_boards'], '</strong>', implode(' ', $children), '</p>
</div>';
}
}
/**
* Shows a legend for topic icons.
*/
function template_topic_legend()
{
global $context, $settings, $txt, $modSettings;
echo '
<div class="tborder" id="topic_icons">
<div class="information">
';
if (empty($context['no_topic_listing']))
echo '
<h2>' . $txt['khbb_caption'] . '</h2>
<ul>', !empty($modSettings['enableParticipation']) && $context['user']['is_logged'] ? '
<li><span class="main_icons profile_sm"></span> ' . $txt['participation_caption'] . '</li>' : '', '
' . ($modSettings['pollMode'] == '1' ? '<li><span class="main_icons poll"></span> ' . $txt['poll'] . '</li>' : '') . '
<li><span class="main_icons move"></span> ' . $txt['moved_topic'] . '</li>
<li><span class="main_icons lock"></span> ' . $txt['locked_topic'] . '</li>
<li><span class="main_icons sticky"></span> ' . $txt['sticky_topic'] . '</li>
<li><span class="main_icons watch"></span> ' . $txt['watching_topic'] . '</li>
</ul>';
echo '
</div><!-- .information -->
</div><!-- #topic_icons -->';
}
?>

View file

@ -0,0 +1,689 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.3
*/
/**
* The main moderation center.
*/
function template_moderation_center()
{
global $context;
// Show moderators notes.
template_notes();
// Show a welcome message to the user.
echo '
<div id="modcenter">';
// Show all the blocks they want to see.
foreach ($context['mod_blocks'] as $block)
{
$block_function = 'template_' . $block;
echo '
<div class="half_content">', function_exists($block_function) ? $block_function() : '', '</div>';
}
echo '
</div><!-- #modcenter -->';
}
/**
* Show all the group requests the user can see.
*/
function template_group_requests_block()
{
global $context, $txt, $scripturl;
echo '
<div class="cat_bar">
<h2 class="catbg">
<span id="group_requests_toggle" class="', !empty($context['admin_prefs']['mcgr']) ? 'toggle_down' : 'toggle_up', ' floatright" style="display: none;"></span>
<a href="', $scripturl, '?action=groups;sa=requests" id="group_requests_link">', $txt['mc_group_requests'], '</a>
</h2>
</div>
<div class="windowbg" id="group_requests_panel">
<ul>';
foreach ($context['group_requests'] as $request)
echo '
<li class="smalltext">
<a href="', $request['request_href'], '">', $request['group']['name'], '</a> ', $txt['mc_groupr_by'], ' ', $request['member']['link'], '
</li>';
// Don't have any watched users right now?
if (empty($context['group_requests']))
echo '
<li>
<strong class="smalltext">', $txt['mc_group_requests_none'], '</strong>
</li>';
echo '
</ul>
</div><!-- #group_requests_panel -->
<script>
var oGroupRequestsPanelToggle = new smc_Toggle({
bToggleEnabled: true,
bCurrentlyCollapsed: ', !empty($context['admin_prefs']['mcgr']) ? 'true' : 'false', ',
aSwappableContainers: [
\'group_requests_panel\'
],
aSwapImages: [
{
sId: \'group_requests_toggle\',
altExpanded: ', JavaScriptEscape($txt['hide']), ',
altCollapsed: ', JavaScriptEscape($txt['show']), '
}
],
aSwapLinks: [
{
sId: \'group_requests_link\',
msgExpanded: ', JavaScriptEscape($txt['mc_group_requests']), ',
msgCollapsed: ', JavaScriptEscape($txt['mc_group_requests']), '
}
],
oThemeOptions: {
bUseThemeSettings: true,
sOptionName: \'admin_preferences\',
sSessionVar: smf_session_var,
sSessionId: smf_session_id,
sThemeId: \'1\',
sAdditionalVars: \';admin_key=mcgr\'
}
});
</script>';
}
/**
* A list of watched users
*/
function template_watched_users()
{
global $context, $txt, $scripturl;
echo '
<div class="cat_bar">
<h2 class="catbg">
<span id="watched_users_toggle" class="', !empty($context['admin_prefs']['mcwu']) ? 'toggle_down' : 'toggle_up', ' floatright" style="display: none;"></span>
<a href="', $scripturl, '?action=moderate;area=userwatch" id="watched_users_link">', $txt['mc_watched_users'], '</a>
</h2>
</div>
<div class="windowbg" id="watched_users_panel">
<ul>';
foreach ($context['watched_users'] as $user)
echo '
<li>
<span class="smalltext">', sprintf(!empty($user['last_login']) ? $txt['mc_seen'] : $txt['mc_seen_never'], $user['link'], $user['last_login']), '</span>
</li>';
// Don't have any watched users right now?
if (empty($context['watched_users']))
echo '
<li>
<strong class="smalltext">', $txt['mc_watched_users_none'], '</strong>
</li>';
echo '
</ul>
</div><!-- #watched_users_panel -->
<script>
var oWatchedUsersToggle = new smc_Toggle({
bToggleEnabled: true,
bCurrentlyCollapsed: ', !empty($context['admin_prefs']['mcwu']) ? 'true' : 'false', ',
aSwappableContainers: [
\'watched_users_panel\'
],
aSwapImages: [
{
sId: \'watched_users_toggle\',
altExpanded: ', JavaScriptEscape($txt['hide']), ',
altCollapsed: ', JavaScriptEscape($txt['show']), '
}
],
aSwapLinks: [
{
sId: \'watched_users_link\',
msgExpanded: ', JavaScriptEscape($txt['mc_watched_users']), ',
msgCollapsed: ', JavaScriptEscape($txt['mc_watched_users']), '
}
],
oThemeOptions: {
bUseThemeSettings: true,
sOptionName: \'admin_preferences\',
sSessionVar: smf_session_var,
sSessionId: smf_session_id,
sThemeId: \'1\',
sAdditionalVars: \';admin_key=mcwu\'
}
});
</script>';
}
/**
* A list of reported posts
*/
function template_reported_posts_block()
{
global $context, $txt, $scripturl;
echo '
<div class="cat_bar">
<h2 class="catbg">
<span id="reported_posts_toggle" class="', !empty($context['admin_prefs']['mcrp']) ? 'toggle_down' : 'toggle_up', ' floatright" style="display: none;"></span>
<a href="', $scripturl, '?action=moderate;area=reportedposts" id="reported_posts_link">', $txt['mc_recent_reports'], '</a>
</h2>
</div>
<div class="windowbg" id="reported_posts_panel">
<ul>';
foreach ($context['reported_posts'] as $post)
echo '
<li>
<span class="smalltext">', sprintf($txt['mc_post_report'], $post['report_link'], $post['author']['link']), '</span>
</li>';
// Don't have any watched users right now?
if (empty($context['reported_posts']))
echo '
<li>
<strong class="smalltext">', $txt['mc_recent_reports_none'], '</strong>
</li>';
echo '
</ul>
</div><!-- #reported_posts_panel -->
<script>
var oWatchedUsersToggle = new smc_Toggle({
bToggleEnabled: true,
bCurrentlyCollapsed: ', !empty($context['admin_prefs']['mcrp']) ? 'true' : 'false', ',
aSwappableContainers: [
\'reported_posts_panel\'
],
aSwapImages: [
{
sId: \'reported_posts_toggle\',
altExpanded: ', JavaScriptEscape($txt['hide']), ',
altCollapsed: ', JavaScriptEscape($txt['show']), '
}
],
aSwapLinks: [
{
sId: \'reported_posts_link\',
msgExpanded: ', JavaScriptEscape($txt['mc_recent_reports']), ',
msgCollapsed: ', JavaScriptEscape($txt['mc_recent_reports']), '
}
],
oThemeOptions: {
bUseThemeSettings: true,
sOptionName: \'admin_preferences\',
sSessionVar: smf_session_var,
sSessionId: smf_session_id,
sThemeId: \'1\',
sAdditionalVars: \';admin_key=mcrp\'
}
});
</script>';
}
/**
* A list of reported users
*/
function template_reported_users_block()
{
global $context, $txt, $scripturl;
echo '
<div class="cat_bar">
<h2 class="catbg">
<span id="reported_users_toggle" class="', !empty($context['admin_prefs']['mcur']) ? 'toggle_down' : 'toggle_up', ' floatright" style="display: none;"></span>
<a href="', $scripturl, '?action=moderate;area=userwatch" id="reported_users_link">', $txt['mc_recent_user_reports'], '</a>
</h2>
</div>
<div class="windowbg" id="reported_users_panel">
<ul>';
foreach ($context['reported_users'] as $user)
echo '
<li>
<span class="smalltext">', $user['user']['link'], '</span>
</li>';
// Don't have any watched users right now?
if (empty($context['reported_users']))
echo '
<li>
<strong class="smalltext">', $txt['mc_reported_users_none'], '</strong>
</li>';
echo '
</ul>
</div><!-- #reported_users_panel -->
<script>
var oWatchedUsersToggle = new smc_Toggle({
bToggleEnabled: true,
bCurrentlyCollapsed: ', !empty($context['admin_prefs']['mcur']) ? 'true' : 'false', ',
aSwappableContainers: [
\'reported_users_panel\'
],
aSwapImages: [
{
sId: \'reported_users_toggle\',
altExpanded: ', JavaScriptEscape($txt['hide']), ',
altCollapsed: ', JavaScriptEscape($txt['show']), '
}
],
aSwapLinks: [
{
sId: \'reported_users_link\',
msgExpanded: ', JavaScriptEscape($txt['mc_recent_user_reports']), ',
msgCollapsed: ', JavaScriptEscape($txt['mc_recent_user_reports']), '
}
],
oThemeOptions: {
bUseThemeSettings: true,
sOptionName: \'admin_preferences\',
sSessionVar: smf_session_var,
sSessionId: smf_session_id,
sThemeId: \'1\',
sAdditionalVars: \';admin_key=mcur\'
}
});
</script>';
}
/**
* Little section for making... notes.
*/
function template_notes()
{
global $context, $txt, $scripturl;
// Let them know the action was a success.
if (!empty($context['report_post_action']))
echo '
<div class="infobox">
', $txt['report_action_' . $context['report_post_action']], '
</div>';
echo '
<div id="modnotes">
<form action="', $scripturl, '?action=moderate;area=index;modnote" method="post">
<div class="cat_bar">
<h2 class="catbg">', $txt['mc_notes'], '</h2>
</div>
<div class="windowbg">';
if (!empty($context['notes']))
{
echo '
<ul class="moderation_notes">';
// Cycle through the notes.
foreach ($context['notes'] as $note)
echo '
<li class="smalltext">
', ($note['can_delete'] ? '<a href="' . $note['delete_href'] . ';' . $context['mod-modnote-del_token_var'] . '=' . $context['mod-modnote-del_token'] . '" data-confirm="' . $txt['mc_reportedp_delete_confirm'] . '" class="you_sure"><span class="main_icons delete"></span></a>' : ''), $note['time'], ' <strong>', $note['author']['link'], ':</strong> ', $note['text'], '
</li>';
echo '
</ul>
<div class="pagesection notes">
<div class="pagelinks">', $context['page_index'], '</div>
</div>';
}
echo '
<div class="floatleft post_note">
<input type="text" name="new_note" placeholder="', $txt['mc_click_add_note'], '">
</div>
<input type="hidden" name="', $context['mod-modnote-add_token_var'], '" value="', $context['mod-modnote-add_token'], '">
<input type="submit" name="makenote" value="', $txt['mc_add_note'], '" class="button">
</div><!-- .windowbg -->
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
</form>
</div><!-- #modnotes -->';
}
/**
* Show a list of all the unapproved posts
*/
function template_unapproved_posts()
{
global $options, $context, $txt, $scripturl;
// Just a big table of it all really...
echo '
<div id="modcenter">
<form action="', $scripturl, '?action=moderate;area=postmod;start=', $context['start'], ';sa=', $context['current_view'], '" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar', !empty($context['unapproved_items']) ? ' cat_bar_round' : '', '">
<h2 class="catbg">', $txt['mc_unapproved_posts'], '</h2>
</div>';
// No posts?
if (empty($context['unapproved_items']))
{
echo '
<div class="windowbg">
<p class="centertext">
', $txt['mc_unapproved_' . $context['current_view'] . '_none_found'], '
</p>
</div>';
}
else
{
echo '
<div class="pagesection">';
if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
echo '
<ul class="buttonlist floatright">
<li class="inline_mod_check">
<input type="checkbox" onclick="invertAll(this, this.form, \'item[]\');" checked>
</li>
</ul>';
echo '
<div class="pagelinks">', $context['page_index'], '</div>
</div>';
}
foreach ($context['unapproved_items'] as $item)
{
// The buttons
$quickbuttons = array(
'approve' => array(
'label' => $txt['approve'],
'href' => $scripturl.'?action=moderate;area=postmod;sa='.$context['current_view'].';start='.$context['start'].';'.$context['session_var'].'='.$context['session_id'].';approve='.$item['id'],
'icon' => 'approve',
),
'delete' => array(
'label' => $txt['remove'],
'href' => $scripturl.'?action=moderate;area=postmod;sa='.$context['current_view'].';start='.$context['start'].';'.$context['session_var'].'='.$context['session_id'].';delete='.$item['id'],
'icon' => 'remove_button',
'show' => $item['can_delete']
),
'quickmod' => array(
'class' => 'inline_mod_check',
'content' => '<input type="checkbox" name="item[]" value="'.$item['id'].'" checked>',
'show' => !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1
),
);
echo '
<div class="windowbg clear">
<div class="page_number floatright"> #', $item['counter'], '</div>
<div class="topic_details">
<h5>
<strong>', $item['category']['link'], ' / ', $item['board']['link'], ' / ', $item['link'], '</strong>
</h5>
<span class="smalltext">', sprintf(str_replace('<br>', ' ', $txt['last_post_topic']), $item['time'], '<strong>' . $item['poster']['link'] . '</strong>'), '</span>
</div>
<div class="list_posts">
<div class="post">', $item['body'], '</div>
</div>
', template_quickbuttons($quickbuttons, 'unapproved_posts'), '
</div><!-- .windowbg -->';
}
echo '
<div class="pagesection">';
if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
echo '
<div class="floatright">
<select name="do" onchange="if (this.value != 0 &amp;&amp; confirm(\'', $txt['mc_unapproved_sure'], '\')) submit();">
<option value="0">', $txt['with_selected'], ':</option>
<option value="0" disabled>-------------------</option>
<option value="approve">&nbsp;--&nbsp;', $txt['approve'], '</option>
<option value="delete">&nbsp;--&nbsp;', $txt['delete'], '</option>
</select>
<noscript>
<input type="submit" name="mc_go" value="', $txt['go'], '" class="button">
</noscript>
</div>';
if (!empty($context['unapproved_items']))
echo '
<div class="pagelinks">', $context['page_index'], '</div>';
echo '
</div><!-- .pagesection -->
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
</form>
</div><!-- #modcenter -->';
}
/**
* Callback function for showing a watched users post in the table.
*
* @param array $post An array of data about the post.
* @return string An array of HTML for showing the post info.
*/
function template_user_watch_post_callback($post)
{
global $scripturl, $context, $txt, $delete_button;
// We'll have a delete and a checkbox please bob.
// @todo Discuss this with the team and rewrite if required.
$quickbuttons = array(
'delete' => array(
'label' => $txt['remove_message'],
'href' => $scripturl.'?action=moderate;area=userwatch;sa=post;delete='.$post['id'].';start='.$context['start'].';'.$context['session_var'].'='.$context['session_id'],
'javascript' => 'data-confirm="' . $txt['mc_watched_users_delete_post'] . '"',
'class' => 'you_sure',
'icon' => 'remove_button',
'show' => $post['can_delete']
),
'quickmod' => array(
'class' => 'inline_mod_check',
'content' => '<input type="checkbox" name="delete[]" value="' . $post['id'] . '">',
'show' => $post['can_delete']
)
);
$output_html = '
<div>
<div class="floatleft">
<strong><a href="' . $scripturl . '?topic=' . $post['id_topic'] . '.' . $post['id'] . '#msg' . $post['id'] . '">' . $post['subject'] . '</a></strong> ' . $txt['mc_reportedp_by'] . ' <strong>' . $post['author_link'] . '</strong>
</div>
</div>
<br>
<div class="smalltext">
' . $txt['mc_watched_users_posted'] . ': ' . $post['poster_time'] . '
</div>
<div class="list_posts">
' . $post['body'] . '
</div>';
$output_html .= template_quickbuttons($quickbuttons, 'user_watch_post', 'return');
return $output_html;
}
/**
* The moderation settings page.
*/
function template_moderation_settings()
{
global $context, $txt, $scripturl;
echo '
<div id="modcenter">';
echo '
<div class="windowbg">
<div class="centertext">', $txt['mc_no_settings'], '</div>
</div>';
echo '
</div><!-- #modcenter -->';
}
/**
* Show a notice sent to a user.
*/
function template_show_notice()
{
global $txt, $settings, $context, $modSettings;
// We do all the HTML for this one!
echo '<!DOCTYPE html>
<html', $context['right_to_left'] ? ' dir="rtl"' : '', '>
<head>
<meta charset="', $context['character_set'], '">
<title>', $context['page_title'], '</title>
', template_css(), '
</head>
<body>
<div class="cat_bar">
<h2 class="catbg">', $txt['show_notice'], '</h2>
</div>
<div class="title_bar">
<h2 class="titlebg">', $txt['show_notice_subject'], ': ', $context['notice_subject'], '</h2>
</div>
<div class="windowbg">
<dl>
<dt>
<strong>', $txt['show_notice_text'], ':</strong>
</dt>
<dd>
', $context['notice_body'], '
</dd>
</dl>
</div>
</body>
</html>';
}
/**
* Add or edit a warning template.
*/
function template_warn_template()
{
global $context, $txt, $scripturl;
echo '
<div id="modcenter">
<form action="', $scripturl, '?action=moderate;area=warnings;sa=templateedit;tid=', $context['id_template'], '" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">', $context['page_title'], '</h2>
</div>
<div class="information">
', $txt['mc_warning_template_desc'], '
</div>
<div class="windowbg">
<div class="errorbox"', empty($context['warning_errors']) ? ' style="display: none"' : '', ' id="errors">
<dl>
<dt>
<strong id="error_serious">', $txt['error_while_submitting'], '</strong>
</dt>
<dd class="error" id="error_list">
', empty($context['warning_errors']) ? '' : implode('<br>', $context['warning_errors']), '
</dd>
</dl>
</div>
<div id="box_preview"', !empty($context['template_preview']) ? '' : ' style="display:none"', '>
<dl class="settings">
<dt>
<strong>', $txt['preview'], '</strong>
</dt>
<dd id="template_preview">
', !empty($context['template_preview']) ? $context['template_preview'] : '', '
</dd>
</dl>
</div>
<dl class="settings">
<dt>
<strong><label for="template_title">', $txt['mc_warning_template_title'], '</label>:</strong>
</dt>
<dd>
<input type="text" id="template_title" name="template_title" value="', $context['template_data']['title'], '" size="30">
</dd>
<dt>
<strong><label for="template_body">', $txt['profile_warning_notify_body'], '</label>:</strong><br>
<span class="smalltext">', $txt['mc_warning_template_body_desc'], '</span>
</dt>
<dd>
<textarea id="template_body" name="template_body" rows="10" cols="45" class="smalltext">', $context['template_data']['body'], '</textarea>
</dd>
</dl>';
if ($context['template_data']['can_edit_personal'])
echo '
<input type="checkbox" name="make_personal" id="make_personal"', $context['template_data']['personal'] ? ' checked' : '', '>
<label for="make_personal">
<strong>', $txt['mc_warning_template_personal'], '</strong>
</label>
<p class="smalltext">', $txt['mc_warning_template_personal_desc'], '</p>';
echo '
<input type="submit" name="preview" id="preview_button" value="', $txt['preview'], '" class="button">
<input type="submit" name="save" value="', $context['page_title'], '" class="button">
</div><!-- .windowbg -->
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['mod-wt_token_var'], '" value="', $context['mod-wt_token'], '">
</form>
</div><!-- #modcenter -->
<script>
$(document).ready(function() {
$("#preview_button").click(function() {
return ajax_getTemplatePreview();
});
});
function ajax_getTemplatePreview ()
{
$.ajax({
type: "POST",
headers: {
"X-SMF-AJAX": 1
},
xhrFields: {
withCredentials: typeof allow_xhjr_credentials !== "undefined" ? allow_xhjr_credentials : false
},
url: "' . $scripturl . '?action=xmlhttp;sa=previews;xml",
data: {item: "warning_preview", title: $("#template_title").val(), body: $("#template_body").val(), user: $(\'input[name="u"]\').attr("value")},
context: document.body,
success: function(request){
$("#box_preview").css({display:""});
$("#template_preview").html($(request).find(\'body\').text());
if ($(request).find("error").text() != \'\')
{
$("#errors").css({display:""});
var errors_html = \'\';
var errors = $(request).find(\'error\').each(function() {
errors_html += $(this).text() + \'<br>\';
});
$(document).find("#error_list").html(errors_html);
}
else
{
$("#errors").css({display:"none"});
$("#error_list").html(\'\');
}
return false;
},
});
return false;
}
</script>';
}
?>

398
MoveTopic.template.php Normal file
View file

@ -0,0 +1,398 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* Show an interface for selecting which board to move a post to.
*/
function template_move()
{
global $context, $txt, $scripturl;
echo '
<div id="move_topic" class="lower_padding">
<form action="', $scripturl, '?action=movetopic2;current_board=' . $context['current_board'] . ';topic=', $context['current_topic'], '.0" method="post" accept-charset="', $context['character_set'], '" onsubmit="submitonce(this);">
<div class="cat_bar">
<h2 class="catbg">', $txt['move_topic'], '</h2>
</div>
<div class="windowbg centertext">
<div class="move_topic">
<dl class="settings">
<dt>
<strong>', $txt['move_to'], ':</strong>
</dt>
<dd>
<select name="toboard">';
foreach ($context['categories'] as $category)
{
echo '
<optgroup label="', $category['name'], '">';
foreach ($category['boards'] as $board)
echo '
<option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', $board['id'] == $context['current_board'] ? ' disabled' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=&gt; ' : '', $board['name'], '</option>';
echo '
</optgroup>';
}
echo '
</select>
</dd>';
// Disable the reason textarea when the postRedirect checkbox is unchecked...
echo '
</dl>
<label for="reset_subject">
<input type="checkbox" name="reset_subject" id="reset_subject" onclick="document.getElementById(\'subjectArea\').classList.toggle(\'hidden\');"> ', $txt['movetopic_change_subject'], '.
</label><br>
<fieldset id="subjectArea" class="hidden">
<dl class="settings">
<dt><strong>', $txt['movetopic_new_subject'], ':</strong></dt>
<dd><input type="text" name="custom_subject" size="30" value="', $context['subject'], '"></dd>
</dl>
<label for="enforce_subject"><input type="checkbox" name="enforce_subject" id="enforce_subject"> ', $txt['movetopic_change_all_subjects'], '.</label>
</fieldset>';
// Stick our "create a redirection topic" template in here...
template_redirect_options('move');
echo '
<input type="submit" value="', $txt['move_topic'], '" onclick="return submitThisOnce(this);" accesskey="s" class="button">
</div><!-- .move_topic -->
</div><!-- .windowbg -->';
if ($context['back_to_topic'])
echo '
<input type="hidden" name="goback" value="1">';
echo '
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '">
</form>
</div><!-- #move_topic -->';
}
/**
* Redirection topic options
*
* @param string $type What type of topic this is for - currently 'merge' or 'move'. Used to display appropriate text strings...
*/
function template_redirect_options($type)
{
global $txt, $context, $modSettings;
echo '
<label for="postRedirect">
<input type="checkbox" name="postRedirect" id="postRedirect"', $context['is_approved'] ? ' checked' : '', ' onclick="', $context['is_approved'] ? '' : 'if (this.checked && !confirm(\'' . $txt[$type . '_topic_unapproved_js'] . '\')) return false; ', 'document.getElementById(\'reasonArea\').classList.toggle(\'hidden\');"> ', $txt['post_redirection'], '.
</label>
<fieldset id="reasonArea"', $context['is_approved'] ? '' : 'class="hidden"', '>
<dl class="settings">
<dt>
', $txt[$type . '_why'], '
</dt>
<dd>
<textarea name="reason">', sprintf($txt[$type . 'topic_default'], $txt['movetopic_auto_board'], $txt['movetopic_auto_topic']), '</textarea>
</dd>
<dt>
<label for="redirect_topic">', $txt[$type . 'topic_redirect'], '</label>
</dt>
<dd>
<input type="checkbox" name="redirect_topic" id="redirect_topic" checked>
</dd>';
if (!empty($modSettings['allow_expire_redirect']))
{
echo '
<dt>
', $txt['redirect_topic_expires'], '
</dt>
<dd>
<select name="redirect_expires">
<option value="0">', $txt['never'], '</option>
<option value="1440">', $txt['one_day'], '</option>
<option value="10080" selected>', $txt['one_week'], '</option>
<option value="20160">', $txt['two_weeks'], '</option>
<option value="43200">', $txt['one_month'], '</option>
<option value="86400">', $txt['two_months'], '</option>
</select>
</dd>';
}
else
echo '
<input type="hidden" name="redirect_expires" value="0">';
echo '
</dl>
</fieldset>';
}
/**
* Confirmation page shown when finished merging topics.
*/
function template_merge_done()
{
global $context, $txt, $scripturl;
echo '
<div id="merge_topics">
<div class="cat_bar">
<h2 class="catbg">', $txt['merge'], '</h2>
</div>
<div class="windowbg">
<p>', $txt['merge_successful'], '</p>
<br>
<ul>
<li>
<a href="', $scripturl, '?board=', $context['target_board'], '.0">', $txt['message_index'], '</a>
</li>
<li>
<a href="', $scripturl, '?topic=', $context['target_topic'], '.0">', $txt['new_merged_topic'], '</a>
</li>
</ul>
</div>
</div>
<br class="clear">';
}
/**
* Merge topic page.
*/
function template_merge()
{
global $context, $txt, $scripturl;
echo '
<div id="merge_topics">
<div class="cat_bar">
<h2 class="catbg">', $txt['merge'], '</h2>
</div>
<div class="information">
', $txt['merge_desc'], '
</div>
<div class="windowbg">
<dl class="settings merge_topic">
<dt>
<strong>', $txt['topic_to_merge'], ':</strong>
</dt>
<dd>
', $context['origin_subject'], '
</dd>
</dl>
</div>
<br>
<div class="cat_bar">
<h2 class="catbg">', $txt['target_topic'], '</h2>
</div>
<div class="title_bar">
<h4 class="titlebg">';
if (isset($context['merge_categories']))
{
echo '
<form action="' . $scripturl . '?action=mergetopics;from=' . $context['origin_topic'] . ';targetboard=' . $context['target_board'] . ';board=' . $context['current_board'] . '.0" method="post" accept-charset="', $context['character_set'], '" id="mergeSelectBoard">
', $txt['target_below'], ' (', $txt['board'], ':
<select name="targetboard" onchange="this.form.submit();">';
foreach ($context['merge_categories'] as $cat)
{
echo '
<optgroup label="', $cat['name'], '">';
foreach ($cat['boards'] as $board)
echo '
<option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=&gt;' : '', ' ', $board['name'], '</option>';
echo '
</optgroup>';
}
echo '
</select>)
<input type="hidden" name="from" value="' . $context['origin_topic'] . '">
<input type="submit" value="', $txt['go'], '" class="button">
</form>';
}
else
echo $txt['target_below'];
echo ' </h4>
</div><!-- .title_bar -->
<form action="', $scripturl, '?action=mergetopics;sa=options" method="post" accept-charset="', $context['character_set'], '">';
// Don't show this if there aren't any topics...
if (!empty($context['topics']))
{
echo '
<div class="pagesection">
<div class="pagelinks">', $context['page_index'], '</div>
</div>
<div class="windowbg">
<ul class="merge_topics">';
foreach ($context['topics'] as $topic)
echo '
<li>
<a href="', $scripturl, '?action=mergetopics;sa=options;board=', $context['current_board'], '.0;from=', $context['origin_topic'], ';to=', $topic['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="main_icons merge"></span></a>
<a href="', $scripturl, '?topic=', $topic['id'], '.0" target="_blank" rel="noopener">', $topic['subject'], '</a> ', $txt['started_by'], ' ', $topic['poster']['link'], '
</li>';
echo '
</ul>
</div>
<div class="pagesection">
<div class="pagelinks">', $context['page_index'], '</div>
</div>';
}
// Just a nice "There aren't any topics" message
else
echo '
<div class="windowbg">', $txt['topic_alert_none'], '</div>';
echo '
<br>
<div class="title_bar">
<h4 class="titlebg">', $txt['target_id'], '</h4>
</div>
<div class="windowbg">
<dl class="settings merge_topic">
<dt>
<strong>', $txt['merge_to_topic_id'], ': </strong>
</dt>
<dd>
<input type="hidden" name="topics[]" value="', $context['origin_topic'], '">
<input type="text" name="topics[]">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
</dd>
</dl>
<input type="submit" value="', $txt['merge'], '" class="button">
</div>
</form>
</div><!-- #merge_topics -->';
}
/**
* Extra options related to merging topics.
*/
function template_merge_extra_options()
{
global $context, $txt, $scripturl;
echo '
<div id="merge_topics">
<form action="', $scripturl, '?action=mergetopics;sa=execute;" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">', $txt['merge_topic_list'], '</h2>
</div>
<table class="bordercolor table_grid">
<thead>
<tr class="title_bar">
<th scope="col" style="width:10px;">', $txt['merge_check'], '</th>
<th scope="col" class="lefttext">', $txt['subject'], '</th>
<th scope="col" class="lefttext">', $txt['started_by'], '</th>
<th scope="col" class="lefttext">', $txt['last_post'], '</th>
<th scope="col" style="width:20px;">' . $txt['merge_include_notifications'] . '</th>
</tr>
</thead>
<tbody>';
foreach ($context['topics'] as $topic)
echo '
<tr class="windowbg">
<td>
<input type="checkbox" name="topics[]" value="' . $topic['id'] . '" checked>
</td>
<td>
<a href="' . $scripturl . '?topic=' . $topic['id'] . '.0" target="_blank" rel="noopener">' . $topic['subject'] . '</a>
</td>
<td>
', $topic['started']['link'], '<br>
<span class="smalltext">', $topic['started']['time'], '</span>
</td>
<td>
' . $topic['updated']['link'] . '<br>
<span class="smalltext">', $topic['updated']['time'], '</span>
</td>
<td>
<input type="checkbox" name="notifications[]" value="' . $topic['id'] . '" checked>
</td>
</tr>';
echo '
</tbody>
</table>
<br>
<div class="windowbg">
<fieldset id="merge_subject" class="merge_options">
<legend>', $txt['merge_select_subject'], '</legend>
<select name="subject" onchange="this.form.custom_subject.style.display = (this.options[this.selectedIndex].value != 0) ? \'none\': \'\' ;">';
foreach ($context['topics'] as $topic)
echo '
<option value="', $topic['id'], '"' . ($topic['selected'] ? ' selected' : '') . '>', $topic['subject'], '</option>';
echo '
<option value="0">', $txt['merge_custom_subject'], ':</option>
</select>
<br>
<input type="text" name="custom_subject" size="60" id="custom_subject" class="custom_subject" style="display: none;"><br>
<label for="enforce_subject"><input type="checkbox" name="enforce_subject" id="enforce_subject" value="1"> ', $txt['movetopic_change_all_subjects'], '</label>
</fieldset>';
// Show an option to create a redirection topic as well...
template_redirect_options('merge');
if (!empty($context['boards']) && count($context['boards']) > 1)
{
echo '
<fieldset id="merge_board" class="merge_options">
<legend>', $txt['merge_select_target_board'], '</legend>
<ul>';
foreach ($context['boards'] as $board)
echo '
<li>
<input type="radio" name="board" value="' . $board['id'] . '"' . ($board['selected'] ? ' checked' : '') . '> ' . $board['name'] . '
</li>';
echo '
</ul>
</fieldset>';
}
if (!empty($context['polls']))
{
echo '
<fieldset id="merge_poll" class="merge_options">
<legend>' . $txt['merge_select_poll'] . '</legend>
<ul>';
foreach ($context['polls'] as $poll)
echo '
<li>
<input type="radio" name="poll" value="' . $poll['id'] . '"' . ($poll['selected'] ? ' checked' : '') . '> ' . $poll['question'] . ' (' . $txt['topic'] . ': <a href="' . $scripturl . '?topic=' . $poll['topic']['id'] . '.0" target="_blank" rel="noopener">' . $poll['topic']['subject'] . '</a>)
</li>';
echo '
<li>
<input type="radio" name="poll" value="-1"> (' . $txt['merge_no_poll'] . ')
</li>
</ul>
</fieldset>';
}
echo '
<div class="auto_flow">
<input type="submit" value="' . $txt['merge'] . '" class="button">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="sa" value="execute">
</div>
</div><!-- .windowbg -->
</form>
</div><!-- #merge_topics -->';
}
?>

98
Notify.template.php Normal file
View file

@ -0,0 +1,98 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* The main notification bar.
*/
function template_main()
{
global $context, $txt, $scripturl;
echo '
<div class="cat_bar">
<h2 class="catbg">
<span class="main_icons mail icon"></span>
', $txt['notify'], '
</h2>
</div>
<div class="roundframe centertext">
<p>', $txt['notify_topic_prompt'], '</p>
<p>
<strong><a href="', $scripturl, '?action=notify;sa=on;topic=', $context['current_topic'], '.', $context['start'], ';', (!empty($context['notify_info']['token']) ? 'u=' . $context['notify_info']['u'] . ';token=' . $context['notify_info']['token'] : $context['session_var'] . '=' . $context['session_id']), '">', $txt['yes'], '</a> - <a href="', $scripturl, '?action=notify;sa=off;topic=', $context['current_topic'], '.', $context['start'], ';', (!empty($context['notify_info']['token']) ? 'u=' . $context['notify_info']['u'] . ';token=' . $context['notify_info']['token'] : $context['session_var'] . '=' . $context['session_id']), '">', $txt['no'], '</a></strong>
</p>
</div>';
}
/**
* Board notification bar.
*/
function template_notify_board()
{
global $context, $txt, $scripturl;
echo '
<div class="cat_bar">
<h2 class="catbg">
<span class="main_icons mail icon"></span>
', $txt['notify'], '
</h2>
</div>
<div class="roundframe centertext">
<p>', $txt['notify_board_prompt'], '</p>
<p>
<strong><a href="', $scripturl, '?action=notifyboard;sa=on;board=', $context['current_board'], '.', $context['start'], ';', (!empty($context['notify_info']['token']) ? 'u=' . $context['notify_info']['u'] . ';token=' . $context['notify_info']['token'] : $context['session_var'] . '=' . $context['session_id']), '">', $txt['yes'], '</a> - <a href="', $scripturl, '?action=notifyboard;sa=off;board=', $context['current_board'], '.', $context['start'], ';', (!empty($context['notify_info']['token']) ? 'u=' . $context['notify_info']['u'] . ';token=' . $context['notify_info']['token'] : $context['session_var'] . '=' . $context['session_id']), '">', $txt['no'], '</a></strong>
</p>
</div>';
}
/**
*
*/
function template_notify_announcements()
{
global $context, $settings, $options, $txt, $scripturl;
echo '
<div class="cat_bar">
<h2 class="catbg">
<span class="main_icons mail icon"></span>
', $txt['notify'], '
</h2>
</div>
<div class="roundframe centertext">
<p>', $txt['notify_announcements_prompt'], '</p>
<p>
<strong><a href="', $scripturl, '?action=notifyannouncements;sa=on;', (!empty($context['notify_info']['token']) ? 'u=' . $context['notify_info']['u'] . ';token=' . $context['notify_info']['token'] : $context['session_var'] . '=' . $context['session_id']), '">', $txt['yes'], '</a> - <a href="', $scripturl, '?action=notifyannouncements;sa=off;', (!empty($context['notify_info']['token']) ? 'u=' . $context['notify_info']['u'] . ';token=' . $context['notify_info']['token'] : $context['session_var'] . '=' . $context['session_id']), '">', $txt['no'], '</a></strong>
</p>
</div>';
}
/**
* Displays a message indicating the user's notification preferences were successfully changed
*/
function template_notify_pref_changed()
{
global $context, $settings, $options, $txt, $scripturl;
echo '
<div class="cat_bar">
<h2 class="catbg">
<span class="main_icons mail icon"></span>
', $txt['notify'], '
</h2>
</div>
<div class="roundframe centertext">
<p>', $context['notify_success_msg'], '</p>
</div>';
}
?>

1868
Packages.template.php Normal file

File diff suppressed because it is too large Load diff

2013
PersonalMessage.template.php Normal file

File diff suppressed because it is too large Load diff

163
Poll.template.php Normal file
View file

@ -0,0 +1,163 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* A form for creating and/or editing a poll.
*/
function template_main()
{
global $context, $txt, $scripturl;
// Some javascript for adding more options.
echo '
<script>
var pollOptionNum = 0;
var pollOptionId = ', $context['last_choice_id'], ';
function addPollOption()
{
if (pollOptionNum == 0)
{
for (var i = 0; i < document.forms.postmodify.elements.length; i++)
if (document.forms.postmodify.elements[i].id.substr(0, 8) == "options-")
pollOptionNum++;
}
pollOptionNum++
pollOptionId++
setOuterHTML(document.getElementById("pollMoreOptions"), \'<dt><label for="options-\' + pollOptionId + \'" ', (isset($context['poll_error']['no_question']) ? ' class="error"' : ''), '>', $txt['option'], ' \' + pollOptionNum + \'</label>:</dt><dd><input type="text" name="options[\' + (pollOptionId) + \']" id="options-\' + (pollOptionId) + \'" value="" size="80" maxlength="255"></dd><p id="pollMoreOptions"></p\');
}
</script>';
if (!empty($context['poll_error']['messages']))
echo '
<div class="errorbox">
<dl class="poll_error">
<dt>
', $context['is_edit'] ? $txt['error_while_editing_poll'] : $txt['error_while_adding_poll'], ':
</dt>
<dt>
', empty($context['poll_error']['messages']) ? '' : implode('<br>', $context['poll_error']['messages']), '
</dt>
</dl>
</div>';
// Start the main poll form.
echo '
<div id="edit_poll">
<form action="' . $scripturl . '?action=editpoll2', $context['is_edit'] ? '' : ';add', ';topic=' . $context['current_topic'] . '.' . $context['start'] . '" method="post" accept-charset="', $context['character_set'], '" onsubmit="submitonce(this);" name="postmodify" id="postmodify">
<div class="khbiseau_topright_color"></div>
<div class="cat_bar">
<h2 class="catbg">', $context['page_title'], '</h2>
</div>';
echo '
<div>
<div class="roundframe">
<input type="hidden" name="poll" value="', $context['poll']['id'], '">
<fieldset id="poll_main">
<legend><span ', (isset($context['poll_error']['no_question']) ? ' class="error"' : ''), '>', $txt['poll_question'], ':</span></legend>
<dl class="settings poll_options">
<dt>', $txt['poll_question'], ':</dt>
<dd><input type="text" name="question" size="80" value="', $context['poll']['question'], '"></dd>';
foreach ($context['choices'] as $choice)
{
echo '
<dt>
<label for="options-', $choice['id'], '" ', (isset($context['poll_error']['poll_few']) ? ' class="error"' : ''), '>', $txt['option'], ' ', $choice['number'], '</label>:
</dt>
<dd>
<input type="text" name="options[', $choice['id'], ']" id="options-', $choice['id'], '" value="', $choice['label'], '" size="80" maxlength="255">';
// Does this option have a vote count yet, or is it new?
if ($choice['votes'] != -1)
echo ' (', $choice['votes'], ' ', $txt['votes'], ')';
echo '
</dd>';
}
echo '
<p id="pollMoreOptions"></p>
</dl>
<strong><a href="javascript:addPollOption(); void(0);">(', $txt['poll_add_option'], ')</a></strong>
</fieldset>
<fieldset id="poll_options">
<legend>', $txt['poll_options'], ':</legend>
<dl class="settings poll_options">';
if ($context['can_moderate_poll'])
{
echo '
<dt>
<label for="poll_max_votes">', $txt['poll_max_votes'], ':</label>
</dt>
<dd>
<input type="text" name="poll_max_votes" id="poll_max_votes" size="2" value="', $context['poll']['max_votes'], '">
</dd>
<dt>
<label for="poll_expire">', $txt['poll_run'], ':</label><br>
<em class="smalltext">', $txt['poll_run_limit'], '</em>
</dt>
<dd>
<input type="text" name="poll_expire" id="poll_expire" size="2" value="', $context['poll']['expiration'], '" onchange="this.form.poll_hide[2].disabled = isEmptyText(this) || this.value == 0; if (this.form.poll_hide[2].checked) this.form.poll_hide[1].checked = true;" maxlength="4"> ', $txt['days_word'], '
</dd>
<dt>
<label for="poll_change_vote">', $txt['poll_do_change_vote'], ':</label>
</dt>
<dd>
<input type="checkbox" id="poll_change_vote" name="poll_change_vote"', !empty($context['poll']['change_vote']) ? ' checked' : '', '>
</dd>';
if ($context['poll']['guest_vote_allowed'])
echo '
<dt>
<label for="poll_guest_vote">', $txt['poll_guest_vote'], ':</label>
</dt>
<dd>
<input type="checkbox" id="poll_guest_vote" name="poll_guest_vote"', !empty($context['poll']['guest_vote']) ? ' checked' : '', '>
</dd>';
}
echo '
<dt>
', $txt['poll_results_visibility'], ':
</dt>
<dd>
<input type="radio" name="poll_hide" id="poll_results_anyone" value="0"', $context['poll']['hide_results'] == 0 ? ' checked' : '', '> <label for="poll_results_anyone">', $txt['poll_results_anyone'], '</label><br>
<input type="radio" name="poll_hide" id="poll_results_voted" value="1"', $context['poll']['hide_results'] == 1 ? ' checked' : '', '> <label for="poll_results_voted">', $txt['poll_results_voted'], '</label><br>
<input type="radio" name="poll_hide" id="poll_results_expire" value="2"', $context['poll']['hide_results'] == 2 ? ' checked' : '', empty($context['poll']['expiration']) ? ' disabled' : '', '> <label for="poll_results_expire">', $txt['poll_results_after'], '</label>
</dd>
</dl>
</fieldset>';
// If this is an edit, we can allow them to reset the vote counts.
if ($context['is_edit'])
echo '
<fieldset id="poll_reset">
<legend>', $txt['reset_votes'], '</legend>
<input type="checkbox" name="resetVoteCount" value="on"> ' . $txt['reset_votes_check'] . '
</fieldset>';
echo '
<input type="submit" name="post" value="', $txt['save'], '" onclick="return submitThisOnce(this);" accesskey="s" class="button">
</div><!-- .roundframe -->
</div>
<input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '">
<input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '">
</form>
<div class="khbiseau_bottom_white"></div>
</div><!-- #edit_poll -->
';
}
?>

1231
Post.template.php Normal file

File diff suppressed because it is too large Load diff

238
Printpage.template.php Normal file
View file

@ -0,0 +1,238 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* The header. Defines the look and layout of the page as well as a form for choosing print options.
*/
function template_print_above()
{
global $context, $txt, $modSettings;
echo '<!DOCTYPE html>
<html', $context['right_to_left'] ? ' dir="rtl"' : '', '>
<head>
<meta charset="', $context['character_set'], '">
<meta name="robots" content="noindex">
<link rel="canonical" href="', $context['canonical_url'], '">
<title>', $txt['print_page'], ' - ', $context['topic_subject'], '</title>
<style>
body, a {
color: #000;
background: #fff;
}
body, td, .normaltext {
font-family: Verdana, arial, helvetica, serif;
font-size: small;
}
h1#title {
font-size: large;
font-weight: bold;
}
h2#linktree {
margin: 1em 0 2.5em 0;
font-size: small;
font-weight: bold;
}
dl#posts {
width: 90%;
margin: 0;
padding: 0;
list-style: none;
}
div.postheader, #poll_data {
border: solid #000;
border-width: 1px 0;
padding: 4px 0;
}
div.postbody {
margin: 1em 0 2em 2em;
}
table {
empty-cells: show;
}
blockquote {
margin: 0 0 8px 0;
padding: 6px 10px;
font-size: small;
border: 1px solid #d6dfe2;
border-left: 2px solid #aaa;
border-right: 2px solid #aaa;
}
blockquote cite {
display: block;
border-bottom: 1px solid #aaa;
font-size: 0.9em;
}
blockquote cite:before {
color: #aaa;
font-size: 22px;
font-style: normal;
margin-right: 5px;
}
code {
border: 1px solid #000;
margin: 3px;
padding: 1px;
display: block;
}
code {
font: x-small monospace;
}
.smalltext, .codeheader {
font-size: x-small;
}
.largetext {
font-size: large;
}
.centertext {
text-align: center;
}
hr {
height: 1px;
border: 0;
color: black;
background-color: black;
}
.voted {
font-weight: bold;
}
#footer {
font-family: Verdana, sans-serif;
}
@media print {
.print_options {
display: none;
}
}
@media screen {
.print_options {
margin: 1em 0;
}
}';
if (!empty($modSettings['max_image_width']))
echo '
.bbc_img {
max-width: ' . $modSettings['max_image_width'] . 'px;
}';
if (!empty($modSettings['max_image_height']))
echo '
.bbc_img {
max-height: ' . $modSettings['max_image_height'] . 'px;
}';
echo '
</style>
</head>
<body>';
template_print_options();
echo '
<h1 id="title">', $context['forum_name_html_safe'], '</h1>
<h2 id="linktree">', $context['category_name'], ' => ', (!empty($context['parent_boards']) ? implode(' => ', $context['parent_boards']) . ' => ' : ''), $context['board_name'], ' => ', $txt['topic_started'], ': ', $context['poster_name'], ' ', $txt['search_on'], ' ', $context['post_time'], '</h2>
<div id="posts">';
}
/**
* The main page. This shows the relevant info in a printer-friendly format
*/
function template_main()
{
global $context, $options, $txt, $scripturl, $topic;
if (!empty($context['poll']))
{
echo '
<div id="poll_data">', $txt['poll'], '
<div class="question">', $txt['poll_question'], ': <strong>', $context['poll']['question'], '</strong>';
$options = 1;
foreach ($context['poll']['options'] as $option)
echo '
<div class="', $option['voted_this'] ? 'voted' : '', '">', $txt['option'], ' ', $options++, ': <strong>', $option['option'], '</strong>
', $context['allow_poll_view'] ? $txt['votes'] . ': ' . $option['votes'] . '' : '', '
</div>';
echo '
</div>';
}
foreach ($context['posts'] as $post)
{
echo '
<div class="postheader">
', $txt['title'], ': <strong>', $post['subject'], '</strong><br>
', $txt['post_by'], ': <strong>', $post['member'], '</strong> ', $txt['search_on'], ' <strong>', $post['time'], '</strong>
</div>
<div class="postbody">
', $post['body'];
// Show attachment images
if (isset($_GET['images']) && !empty($context['printattach'][$post['id_msg']]))
{
echo '
<hr>';
foreach ($context['printattach'][$post['id_msg']] as $attach)
echo '
<img width="' . $attach['width'] . '" height="' . $attach['height'] . '" src="', $scripturl . '?action=dlattach;topic=' . $topic . '.0;attach=' . $attach['id_attach'] . '" alt="">';
}
echo '
</div><!-- .postbody -->';
}
}
/**
* The footer.
*/
function template_print_below()
{
echo '
</div><!-- #posts -->';
template_print_options();
echo '
<div id="footer" class="smalltext">', theme_copyright(), '</div>
</body>
</html>';
}
/**
* Displays the print page options
*/
function template_print_options()
{
global $scripturl, $topic, $txt;
$url_text = $scripturl . '?action=printpage;topic=' . $topic . '.0';
$url_images = $url_text . ';images';
echo '
<div class="print_options">';
// Which option is set, text or text&images
if (isset($_REQUEST['images']))
echo '
<a href="', $url_text, '">', $txt['print_page_text'], '</a> | <strong><a href="', $url_images, '">', $txt['print_page_images'], '</a></strong>';
else
echo '
<strong><a href="', $url_text, '">', $txt['print_page_text'], '</a></strong> | <a href="', $url_images, '">', $txt['print_page_images'], '</a>';
echo '
</div><!-- .print_options -->';
}
?>

3508
Profile.template.php Normal file

File diff suppressed because it is too large Load diff

443
Recent.template.php Normal file
View file

@ -0,0 +1,443 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* Template for showing recent posts
*/
function template_recent()
{
global $context, $txt;
echo '
<div id="recent" class="main_section">
<div class="khbiseau_topright_khcolor"></div>
<div id="display_head" class="information">
<h2 class="display_title">
<span id="top_subject">', $txt['recent_posts'], '</span>
</h2>
</div>';
if (!empty($context['page_index']))
echo '
<div class="pagesection">
<div class="pagelinks">' . $context['page_index'] . '</div>
</div>';
if (empty($context['posts']))
echo '
<div class="windowbg">', $txt['no_messages'], '</div>';
foreach ($context['posts'] as $post)
{
echo '
<div class="', $post['css_class'], '">
<div class="recent_title">
<div class="topic_details">
<div class="page_number"> #', $post['counter'], '</div>
<h5>', $post['board']['link'], ' / ', $post['link'], '</h5>
</div>
<span class="smalltext">', $txt['last_poster'], ' <strong>', $post['poster']['link'], ' </strong> - ', $post['time'], '</span>
</div>';
// affiche des derniers messages ; rendre cela fermé (collapse). Todo : à améliorer
echo '
<details>
<summary title="', $txt['khbb_collapse_recent_post'], '" style="cursor: pointer;">', $txt['khbb_collapse_recent_post'], '</summary>
<div class="list_posts">', $post['message'], '</div>
</details>
';
echo '
</div><!-- $post[css_class] -->';
}
echo '
<div class="khbiseau_bottom_white"></div>
<div class="pagesection">
<div class="pagelinks">', $context['page_index'], '</div>
</div>
</div><!-- #recent -->';
}
/**
* Template for showing unread posts
*/
function template_unread()
{
global $context, $txt, $scripturl, $modSettings, $board_info;
// User action pop on mobile screen (or actually small screen), this uses responsive css does not check mobile device.
if (!empty($context['recent_buttons']))
echo '
<div id="mobile_action" class="popup_container">
<div class="popup_window description">
<div class="popup_heading">
', $txt['mobile_action'], '
<a href="javascript:void(0);" class="main_icons hide_popup"></a>
</div>
', template_button_strip($context['recent_buttons']), '
</div>
</div>';
echo '
<div id="recent" class="main_content">
<div id="display_head" class="information">
<h2 class="display_title">
<span>', (!empty($board_info['name']) ? $board_info['name'] . ' - ' : '') . $context['page_title'], '</span>
</h2>
</div>';
if ($context['showCheckboxes'])
echo '
<form action="', $scripturl, '?action=quickmod" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="qaction" value="markread">
<input type="hidden" name="redirect_url" value="action=unread', (!empty($context['showing_all_topics']) ? ';all' : ''), $context['querystring_board_limits'], '">';
if (!empty($context['topics']))
{
echo '
<div class="pagesection">
', $context['menu_separator'], '
<div class="pagelinks floatleft">
<a href="#bot" class="button">', $txt['go_down'], '</a>
', $context['page_index'], '
</div>
', !empty($context['recent_buttons']) ? template_button_strip($context['recent_buttons'], 'right') : '';
// Mobile action (top)
if (!empty($context['recent_buttons']))
echo '
<div class="mobile_buttons floatright">
<a class="button mobile_act">', $txt['mobile_action'], '</a>
</div>';
echo '
</div>';
echo '
<div id="unread">
<div id="topic_header" class="title_bar">
<div class="board_icon"></div>
<div class="info">
<a href="', $scripturl, '?action=unread', $context['showing_all_topics'] ? ';all' : '', $context['querystring_board_limits'], ';sort=subject', $context['sort_by'] == 'subject' && $context['sort_direction'] == 'up' ? ';desc' : '', '">
', $txt['subject'], $context['sort_by'] == 'subject' ? '
<span class="main_icons sort_' . $context['sort_direction'] . '"></span>
' : '', '</a>
</div>
<div class="board_stats centertext">
<a href="', $scripturl, '?action=unread', $context['showing_all_topics'] ? ';all' : '', $context['querystring_board_limits'], ';sort=replies', $context['sort_by'] == 'replies' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['replies'], $context['sort_by'] == 'replies' ? ' <span class="main_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a>
</div>
<div class="lastpost">
<a href="', $scripturl, '?action=unread', $context['showing_all_topics'] ? ';all' : '', $context['querystring_board_limits'], ';sort=last_post', $context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['last_post'], $context['sort_by'] == 'last_post' ? ' <span class="main_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a>
</div>';
// Show a "select all" box for quick moderation?
if ($context['showCheckboxes'])
echo '
<div class="moderation">
<input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');">
</div>';
echo '
</div><!-- #topic_header -->
<div id="topic_container">';
foreach ($context['topics'] as $topic)
{
echo '
<div class="', $topic['css_class'], '">
<div class="board_icon">
<img src="', $topic['first_post']['icon_url'], '" alt="">
', $topic['is_posted_in'] ? '<span class="main_icons profile_sm"></span>' : '', '
</div>
<div class="info">';
// Now we handle the icons
echo '
<div class="icons floatright">';
if ($topic['is_locked'])
echo '
<span class="main_icons lock"></span>';
if ($topic['is_sticky'])
echo '
<span class="main_icons sticky"></span>';
if ($topic['is_poll'])
echo '
<span class="main_icons poll"></span>';
echo '
</div>';
echo '
<div class="recent_title">
<a href="', $topic['new_href'], '" id="newicon', $topic['first_post']['id'], '" class="new_posts">' . $txt['new'] . '</a>
', $topic['is_sticky'] ? '<strong>' : '', '<span class="preview" title="', $topic[(empty($modSettings['message_index_preview_first']) ? 'last_post' : 'first_post')]['preview'], '"><span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], '</span></span>', $topic['is_sticky'] ? '</strong>' : '', '
</div>
<p class="floatleft">
', $topic['first_post']['started_by'], '
</p>
', !empty($topic['pages']) ? '<span id="pages' . $topic['first_post']['id'] . '" class="topic_pages">' . $topic['pages'] . '</span>' : '', '
</div><!-- .info -->
<div class="board_stats centertext">
<p>
', $topic['replies'], ' ', $txt['replies'], '
<br>
', $topic['views'], ' ', $txt['views'], '
</p>
</div>
<div class="lastpost">
', sprintf($txt['last_post_topic'], '<a href="' . $topic['last_post']['href'] . '">' . $topic['last_post']['time'] . '</a>', $topic['last_post']['member']['link']), '
</div>';
if ($context['showCheckboxes'])
echo '
<div class="moderation">
<input type="checkbox" name="topics[]" value="', $topic['id'], '">
</div>';
echo '
</div><!-- $topic[css_class] -->';
}
if (empty($context['topics']))
echo '
<div style="display: none;"></div>';
echo '
</div><!-- #topic_container -->
</div><!-- #unread -->';
echo '
<div class="pagesection">
', !empty($context['recent_buttons']) ? template_button_strip($context['recent_buttons'], 'right') : '', '
', $context['menu_separator'], '
<div class="pagelinks floatleft">
<a href="#recent" class="button">', $txt['go_up'], '</a>
', $context['page_index'], '
</div>';
// Mobile action (bottom)
if (!empty($context['recent_buttons']))
echo '
<div class="mobile_buttons floatright">
<a class="button mobile_act">', $txt['mobile_action'], '</a>
</div>';
echo '
</div>';
}
else
echo '
<div class="infobox">
<p class="centertext">
', $context['showing_all_topics'] ? $txt['topic_alert_none'] : sprintf($txt['unread_topics_visit_none'], $scripturl), '
</p>
</div>';
if ($context['showCheckboxes'])
echo '
</form>';
echo '
</div><!-- #recent -->';
if (empty($context['no_topic_listing']))
template_topic_legend();
message_index_jump_to();
}
/**
* Template for showing unread replies (eg new replies to topics you've posted in)
*/
function template_replies()
{
global $context, $txt, $scripturl, $modSettings, $board_info;
// User action pop on mobile screen (or actually small screen), this uses responsive css does not check mobile device.
if (!empty($context['recent_buttons']))
echo '
<div id="mobile_action" class="popup_container">
<div class="popup_window description">
<div class="popup_heading">
', $txt['mobile_action'], '
<a href="javascript:void(0);" class="main_icons hide_popup"></a>
</div>
', template_button_strip($context['recent_buttons']), '
</div>
</div>';
echo '
<div id="recent">
<div id="display_head" class="information">
<h2 class="display_title">
<span>', (!empty($board_info['name']) ? $board_info['name'] . ' - ' : '') . $context['page_title'], '</span>
</h2>
</div>';
if ($context['showCheckboxes'])
echo '
<form action="', $scripturl, '?action=quickmod" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="qaction" value="markread">
<input type="hidden" name="redirect_url" value="action=unreadreplies', (!empty($context['showing_all_topics']) ? ';all' : ''), $context['querystring_board_limits'], '">';
if (!empty($context['topics']))
{
echo '
<div class="pagesection">
', $context['menu_separator'], '
<div class="pagelinks floatleft">
<a href="#bot" class="button">', $txt['go_down'], '</a>
', $context['page_index'], '
</div>
', !empty($context['recent_buttons']) ? template_button_strip($context['recent_buttons'], 'right') : '';
// Mobile action (top)
if (!empty($context['recent_buttons']))
echo '
<div class="mobile_buttons floatright">
<a class="button mobile_act">', $txt['mobile_action'], '</a>
</div>';
echo '
</div>';
echo '
<div id="unreadreplies">
<div id="topic_header" class="title_bar">
<div class="board_icon"></div>
<div class="info">
<a href="', $scripturl, '?action=unreadreplies', $context['querystring_board_limits'], ';sort=subject', $context['sort_by'] === 'subject' && $context['sort_direction'] === 'up' ? ';desc' : '', '">', $txt['subject'], $context['sort_by'] === 'subject' ? ' <span class="main_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a>
</div>
<div class="board_stats centertext">
<a href="', $scripturl, '?action=unreadreplies', $context['querystring_board_limits'], ';sort=replies', $context['sort_by'] === 'replies' && $context['sort_direction'] === 'up' ? ';desc' : '', '">', $txt['replies'], $context['sort_by'] === 'replies' ? ' <span class="main_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a>
</div>
<div class="lastpost">
<a href="', $scripturl, '?action=unreadreplies', $context['querystring_board_limits'], ';sort=last_post', $context['sort_by'] === 'last_post' && $context['sort_direction'] === 'up' ? ';desc' : '', '">', $txt['last_post'], $context['sort_by'] === 'last_post' ? ' <span class="main_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a>
</div>';
// Show a "select all" box for quick moderation?
if ($context['showCheckboxes'])
echo '
<div class="moderation">
<input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');">
</div>';
echo '
</div><!-- #topic_header -->
<div id="topic_container">';
foreach ($context['topics'] as $topic)
{
echo '
<div class="', $topic['css_class'], '">
<div class="board_icon">
<img src="', $topic['first_post']['icon_url'], '" alt="">
', $topic['is_posted_in'] ? '<span class="main_icons profile_sm"></span>' : '', '
</div>
<div class="info">';
// Now we handle the icons
echo '
<div class="icons floatright">';
if ($topic['is_locked'])
echo '
<span class="main_icons lock"></span>';
if ($topic['is_sticky'])
echo '
<span class="main_icons sticky"></span>';
if ($topic['is_poll'])
echo '
<span class="main_icons poll"></span>';
echo '
</div>';
echo '
<div class="recent_title">
<a href="', $topic['new_href'], '" id="newicon', $topic['first_post']['id'], '" class="new_posts">' . $txt['new'] . '</a>
', $topic['is_sticky'] ? '<strong>' : '', '<span title="', $topic[(empty($modSettings['message_index_preview_first']) ? 'last_post' : 'first_post')]['preview'], '"><span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], '</span>', $topic['is_sticky'] ? '</strong>' : '', '
</div>
<p class="floatleft">
', $topic['first_post']['started_by'], '
</p>
', !empty($topic['pages']) ? '<span id="pages' . $topic['first_post']['id'] . '" class="topic_pages">' . $topic['pages'] . '</span>' : '', '
</div><!-- .info -->
<div class="board_stats centertext">
<p>
', $topic['replies'], ' ', $txt['replies'], '
<br>
', $topic['views'], ' ', $txt['views'], '
</p>
</div>
<div class="lastpost">
', sprintf($txt['last_post_topic'], '<a href="' . $topic['last_post']['href'] . '">' . $topic['last_post']['time'] . '</a>', $topic['last_post']['member']['link']), '
</div>';
if ($context['showCheckboxes'])
echo '
<div class="moderation">
<input type="checkbox" name="topics[]" value="', $topic['id'], '">
</div>';
echo '
</div><!-- $topic[css_class] -->';
}
echo '
</div><!-- #topic_container -->
</div><!-- #unreadreplies -->
<div class="pagesection">
', !empty($context['recent_buttons']) ? template_button_strip($context['recent_buttons'], 'right') : '', '
', $context['menu_separator'], '
<div class="pagelinks floatleft">
<a href="#recent" class="button">', $txt['go_up'], '</a>
', $context['page_index'], '
</div>';
// Mobile action (bottom)
if (!empty($context['recent_buttons']))
echo '
<div class="mobile_buttons floatright">
<a class="button mobile_act">', $txt['mobile_action'], '</a>
</div>';
echo '
</div>';
}
else
echo '
<div class="infobox">
<p class="centertext">
', $context['showing_all_topics'] ? $txt['topic_alert_none'] : $txt['updated_topics_visit_none'], '
</p>
</div>';
if ($context['showCheckboxes'])
echo '
</form>';
echo '
</div><!-- #recent -->';
if (empty($context['no_topic_listing']))
template_topic_legend();
message_index_jump_to();
}
?>

791
Register.template.php Normal file
View file

@ -0,0 +1,791 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.3
*/
/**
* Before showing users a registration form, show them the registration agreement.
*/
function template_registration_agreement()
{
global $context, $scripturl, $txt;
echo '
<form action="', $scripturl, '?action=signup" method="post" accept-charset="', $context['character_set'], '" id="registration">';
if (!empty($context['agreement']))
echo '
<div class="khbiseau_topright_color"></div>
<div class="cat_bar">
<h2 class="catbg">', $txt['registration_agreement'], '</h2>
</div>
<div class="roundframe">
<div>', $context['agreement'], '</div>
</div>
<div class="khbiseau_bottom_white"></div>';
if (!empty($context['privacy_policy']))
echo '
<div class="cat_bar">
<h2 class="catbg">', $txt['privacy_policy'], '</h2>
</div>
<div class="roundframe">
<div>', $context['privacy_policy'], '</div>
</div>';
echo '
<div id="confirm_buttons">';
// Age restriction in effect?
if ($context['show_coppa'])
echo '
<input type="submit" name="accept_agreement" value="', $context['coppa_agree_above'], '" class="button"><br>
<br>
<input type="submit" name="accept_agreement_coppa" value="', $context['coppa_agree_below'], '" class="button">';
else
echo '
<input type="submit" name="accept_agreement" value="', $context['agree'], '" class="button" />';
echo '
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['register_token_var'], '" value="', $context['register_token'], '">
<input type="hidden" name="step" value="1">
</div>
</form>';
}
/**
* Before registering - get their information.
*/
function template_registration_form()
{
global $context, $scripturl, $txt, $modSettings;
echo '
<script>
function verifyAgree()
{
if (currentAuthMethod == \'passwd\' && document.forms.registration.smf_autov_pwmain.value != document.forms.registration.smf_autov_pwverify.value)
{
alert("', $txt['register_passwords_differ_js'], '");
return false;
}
return true;
}
var currentAuthMethod = \'passwd\';
</script>';
// Any errors?
if (!empty($context['registration_errors']))
{
echo '
<div class="errorbox">
<span>', $txt['registration_errors_occurred'], '</span>
<ul>';
// Cycle through each error and display an error message.
foreach ($context['registration_errors'] as $error)
echo '
<li>', $error, '</li>';
echo '
</ul>
</div>';
}
echo '
<form action="', !empty($modSettings['force_ssl']) ? strtr($scripturl, array('http://' => 'https://')) : $scripturl, '?action=signup2" method="post" accept-charset="', $context['character_set'], '" name="registration" id="registration" onsubmit="return verifyAgree();">
<div class="khbiseau_topright_color"></div>
<div class="cat_bar">
<h2 class="catbg">', $txt['registration_form'], '</h2>
</div>
<div class="title_bar">
<h2 class="titlebg">', $txt['required_info'], '</h2>
</div>
<div class="roundframe">
<fieldset>
<dl class="register_form">
<dt>
<strong><label for="smf_autov_username">', $txt['username'], ':</label></strong>
</dt>
<dd>
<input type="text" name="user" id="smf_autov_username" size="50" tabindex="', $context['tabindex']++, '" maxlength="25" value="', isset($context['username']) ? $context['username'] : '', '">
<span id="smf_autov_username_div" style="display: none;">
<a id="smf_autov_username_link" href="#">
<span id="smf_autov_username_img" class="main_icons check"></span>
</a>
</span>
</dd>
<dt><strong><label for="smf_autov_reserve1">', $txt['user_email_address'], ':</label></strong></dt>
<dd>
<input type="email" name="email" id="smf_autov_reserve1" size="50" tabindex="', $context['tabindex']++, '" value="', isset($context['email']) ? $context['email'] : '', '">
</dd>
</dl>
<dl class="register_form" id="password1_group">
<dt><strong><label for="smf_autov_pwmain">', $txt['choose_pass'], ':</label></strong></dt>
<dd>
<input type="password" name="passwrd1" id="smf_autov_pwmain" size="50" tabindex="', $context['tabindex']++, '">
<span id="smf_autov_pwmain_div" style="display: none;">
<span id="smf_autov_pwmain_img" class="main_icons invalid"></span>
</span>
</dd>
</dl>
<dl class="register_form" id="password2_group">
<dt>
<strong><label for="smf_autov_pwverify">', $txt['verify_pass'], ':</label></strong>
</dt>
<dd>
<input type="password" name="passwrd2" id="smf_autov_pwverify" size="50" tabindex="', $context['tabindex']++, '">
<span id="smf_autov_pwverify_div" style="display: none;">
<span id="smf_autov_pwverify_img" class="main_icons valid"></span>
</span>
</dd>
</dl>
<dl class="register_form" id="notify_announcements">
<dt>
<strong><label for="notify_announcements">', $txt['notify_announcements'], ':</label></strong>
</dt>
<dd>
<input type="checkbox" name="notify_announcements" id="notify_announcements" tabindex="', $context['tabindex']++, '"', $context['notify_announcements'] ? ' checked="checked"' : '', '>
</dd>
</dl>';
// If there is any field marked as required, show it here!
if (!empty($context['custom_fields_required']) && !empty($context['custom_fields']))
{
echo '
<dl class="register_form">';
foreach ($context['custom_fields'] as $field)
if ($field['show_reg'] > 1)
echo '
<dt>
<strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['name'], ':</strong>
<span class="smalltext">', $field['desc'], '</span>
</dt>
<dd>', str_replace('name="', 'tabindex="' . $context['tabindex']++ . '" name="', $field['input_html']), '</dd>';
echo '
</dl>';
}
echo '
</fieldset>
</div><!-- .roundframe -->
<div class="khbiseau_bottom_white"></div>';
// If we have either of these, show the extra group.
if (!empty($context['profile_fields']) || !empty($context['custom_fields']))
echo '
<div class="title_bar">
<h2 class="titlebg">', $txt['additional_information'], '</h2>
</div>
<div class="roundframe noup">
<fieldset>
<dl class="register_form" id="custom_group">';
if (!empty($context['profile_fields']))
{
// Any fields we particularly want?
foreach ($context['profile_fields'] as $key => $field)
{
if ($field['type'] == 'callback')
{
if (isset($field['callback_func']) && function_exists('template_profile_' . $field['callback_func']))
{
$callback_func = 'template_profile_' . $field['callback_func'];
$callback_func();
}
}
else
{
echo '
<dt>
<strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['label'], ':</strong>';
// Does it have any subtext to show?
if (!empty($field['subtext']))
echo '
<span class="smalltext">', $field['subtext'], '</span>';
echo '
</dt>
<dd>';
// Want to put something infront of the box?
if (!empty($field['preinput']))
echo '
', $field['preinput'];
// What type of data are we showing?
if ($field['type'] == 'label')
echo '
', $field['value'];
// Maybe it's a text box - very likely!
elseif (in_array($field['type'], array('int', 'float', 'text', 'password', 'url')))
echo '
<input type="', $field['type'] == 'password' ? 'password' : 'text', '" name="', $key, '" id="', $key, '" size="', empty($field['size']) ? 30 : $field['size'], '" value="', $field['value'], '" tabindex="', $context['tabindex']++, '" ', $field['input_attr'], '>';
// You "checking" me out? ;)
elseif ($field['type'] == 'check')
echo '
<input type="hidden" name="', $key, '" value="0"><input type="checkbox" name="', $key, '" id="', $key, '"', !empty($field['value']) ? ' checked' : '', ' value="1" tabindex="', $context['tabindex']++, '" ', $field['input_attr'], '>';
// Always fun - select boxes!
elseif ($field['type'] == 'select')
{
echo '
<select name="', $key, '" id="', $key, '" tabindex="', $context['tabindex']++, '">';
if (isset($field['options']))
{
// Is this some code to generate the options?
if (!is_array($field['options']))
$field['options'] = eval($field['options']);
// Assuming we now have some!
if (is_array($field['options']))
foreach ($field['options'] as $value => $name)
echo '
<option', (!empty($field['disabled_options']) && is_array($field['disabled_options']) && in_array($value, $field['disabled_options'], true) ? ' disabled' : ''), ' value="' . $value . '"', $value === $field['value'] ? ' selected' : '', '>', $name, '</option>';
}
echo '
</select>';
}
// Something to end with?
if (!empty($field['postinput']))
echo '
', $field['postinput'];
echo '
</dd>';
}
}
}
// Are there any custom fields?
if (!empty($context['custom_fields']))
{
foreach ($context['custom_fields'] as $field)
if ($field['show_reg'] < 2)
echo '
<dt>
<strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['name'], ':</strong>
<span class="smalltext">', $field['desc'], '</span>
</dt>
<dd>', $field['input_html'], '</dd>';
}
// If we have either of these, close the list like a proper gent.
if (!empty($context['profile_fields']) || !empty($context['custom_fields']))
echo '
</dl>
</fieldset>
</div><!-- .roundframe -->';
if ($context['visual_verification'])
echo '
<div class="title_bar">
<h2 class="titlebg">', $txt['verification'], '</h2>
</div>
<div class="roundframe noup">
<fieldset class="centertext">
', template_control_verification($context['visual_verification_id'], 'all'), '
</fieldset>
</div>';
echo '
<div id="confirm_buttons" class="flow_auto">';
// Age restriction in effect?
if (empty($context['agree']) && $context['show_coppa'])
echo '
<input type="submit" name="accept_agreement" value="', $context['coppa_agree_above'], '" class="button"><br>
<br>
<input type="submit" name="accept_agreement_coppa" value="', $context['coppa_agree_below'], '" class="button">';
else
echo '
<input type="submit" name="regSubmit" value="', $txt['register'], '" tabindex="', $context['tabindex']++, '" class="button" onclick="this.disabled = true;form.submit();">';
echo '
</div>
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['register_token_var'], '" value="', $context['register_token'], '">
<input type="hidden" name="step" value="2">
</form>
<script>
var regTextStrings = {
"username_valid": "', $txt['registration_username_available'], '",
"username_invalid": "', $txt['registration_username_unavailable'], '",
"username_check": "', $txt['registration_username_check'], '",
"password_short": "', $txt['registration_password_short'], '",
"password_reserved": "', $txt['registration_password_reserved'], '",
"password_numbercase": "', $txt['registration_password_numbercase'], '",
"password_no_match": "', $txt['registration_password_no_match'], '",
"password_valid": "', $txt['registration_password_valid'], '"
};
var verificationHandle = new smfRegister("registration", ', empty($modSettings['password_strength']) ? 0 : $modSettings['password_strength'], ', regTextStrings);
</script>';
}
/**
* After registration... all done ;).
*/
function template_after()
{
global $context;
// Not much to see here, just a quick... "you're now registered!" or what have you.
echo '
<div id="registration_success">
<div class="cat_bar">
<h2 class="catbg">', $context['title'], '</h2>
</div>
<div class="windowbg">
<p>', $context['description'], '</p>
</div>
</div>';
}
/**
* Template for giving instructions about COPPA activation.
*/
function template_coppa()
{
global $context, $txt, $scripturl;
// Formulate a nice complicated message!
echo '
<div class="title_bar">
<h2 class="titlebg">', $context['page_title'], '</h2>
</div>
<div id="coppa" class="roundframe noup">
<p>', $context['coppa']['body'], '</p>
<p>
<span><a href="', $scripturl, '?action=coppa;form;member=', $context['coppa']['id'], '" target="_blank" rel="noopener">', $txt['coppa_form_link_popup'], '</a> | <a href="', $scripturl, '?action=coppa;form;dl;member=', $context['coppa']['id'], '">', $txt['coppa_form_link_download'], '</a></span>
</p>
<p>', $context['coppa']['many_options'] ? $txt['coppa_send_to_two_options'] : $txt['coppa_send_to_one_option'], '</p>';
// Can they send by post?
if (!empty($context['coppa']['post']))
echo '
<h4>1) ', $txt['coppa_send_by_post'], '</h4>
<div class="coppa_contact">
', $context['coppa']['post'], '
</div>';
// Can they send by fax??
if (!empty($context['coppa']['fax']))
echo '
<h4>', !empty($context['coppa']['post']) ? '2' : '1', ') ', $txt['coppa_send_by_fax'], '</h4>
<div class="coppa_contact">
', $context['coppa']['fax'], '
</div>';
// Offer an alternative Phone Number?
if ($context['coppa']['phone'])
echo '
<p>', $context['coppa']['phone'], '</p>';
echo '
</div><!-- #coppa -->';
}
/**
* An easily printable form for giving permission to access the forum for a minor.
*/
function template_coppa_form()
{
global $context, $txt;
// Show the form (As best we can)
echo '
<table style="width: 100%; padding: 3px; border: 0" class="tborder">
<tr>
<td>', $context['forum_contacts'], '</td>
</tr>
<tr>
<td class="righttext">
<em>', $txt['coppa_form_address'], '</em>: ', $context['ul'], '<br>
', $context['ul'], '<br>
', $context['ul'], '<br>
', $context['ul'], '
</td>
</tr>
<tr>
<td class="righttext">
<em>', $txt['coppa_form_date'], '</em>: ', $context['ul'], '
<br><br>
</td>
</tr>
<tr>
<td>
', $context['coppa_body'], '
</td>
</tr>
</table>
<br>';
}
/**
* Show a window containing the spoken verification code.
*/
function template_verification_sound()
{
global $context, $settings, $txt, $modSettings;
echo '<!DOCTYPE html>
<html', $context['right_to_left'] ? ' dir="rtl"' : '', '>
<head>
<meta charset="', $context['character_set'], '">
<title>', $txt['visual_verification_sound'], '</title>
<meta name="robots" content="noindex">
', template_css(), '
<style>';
// Just show the help text and a "close window" link.
echo '
</style>
</head>
<body style="margin: 1ex;">
<div class="windowbg description" style="text-align: center;">';
if (isBrowser('is_ie') || isBrowser('is_ie11'))
echo '
<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" type="audio/x-wav">
<param name="AutoStart" value="1">
<param name="FileName" value="', $context['verification_sound_href'], '">
</object>';
else
echo '
<audio src="', $context['verification_sound_href'], '" controls>
<object type="audio/x-wav" data="', $context['verification_sound_href'], '">
<a href="', $context['verification_sound_href'], '" rel="nofollow">', $context['verification_sound_href'], '</a>
</object>
</audio>';
echo '
<br>
<a href="', $context['verification_sound_href'], ';sound" rel="nofollow">', $txt['visual_verification_sound_again'], '</a><br>
<a href="', $context['verification_sound_href'], '" rel="nofollow">', $txt['visual_verification_sound_direct'], '</a><br><br>
<a href="javascript:self.close();">', $txt['visual_verification_sound_close'], '</a><br>
</div><!-- .description -->
</body>
</html>';
}
/**
* The template for the form allowing an admin to register a user from the admin center.
*/
function template_admin_register()
{
global $context, $scripturl, $txt, $modSettings;
echo '
<div id="admin_form_wrapper">
<form id="postForm" action="', $scripturl, '?action=admin;area=regcenter" method="post" accept-charset="', $context['character_set'], '" name="postForm">
<div class="cat_bar">
<h2 class="catbg">', $txt['admin_browse_register_new'], '</h2>
</div>
<div id="register_screen" class="windowbg">';
if (!empty($context['registration_done']))
echo '
<div class="infobox">
', $context['registration_done'], '
</div>';
echo '
<dl class="register_form" id="admin_register_form">
<dt>
<strong><label for="user_input">', $txt['admin_register_username'], ':</label></strong>
<span class="smalltext">', $txt['admin_register_username_desc'], '</span>
</dt>
<dd>
<input type="text" name="user" id="user_input" tabindex="', $context['tabindex']++, '" size="50" maxlength="25">
</dd>
<dt>
<strong><label for="email_input">', $txt['admin_register_email'], ':</label></strong>
<span class="smalltext">', $txt['admin_register_email_desc'], '</span>
</dt>
<dd>
<input type="email" name="email" id="email_input" tabindex="', $context['tabindex']++, '" size="50">
</dd>
<dt>
<strong><label for="password_input">', $txt['admin_register_password'], ':</label></strong>
<span class="smalltext">', $txt['admin_register_password_desc'], '</span>
</dt>
<dd>
<input type="password" name="password" id="password_input" tabindex="', $context['tabindex']++, '" size="50" onchange="onCheckChange();">
</dd>';
if (!empty($context['member_groups']))
{
echo '
<dt>
<strong><label for="group_select">', $txt['admin_register_group'], ':</label></strong>
<span class="smalltext">', $txt['admin_register_group_desc'], '</span>
</dt>
<dd>
<select name="group" id="group_select" tabindex="', $context['tabindex']++, '">';
foreach ($context['member_groups'] as $id => $name)
echo '
<option value="', $id, '">', $name, '</option>';
echo '
</select>
</dd>';
}
// If there is any field marked as required, show it here!
if (!empty($context['custom_fields_required']) && !empty($context['custom_fields']))
foreach ($context['custom_fields'] as $field)
if ($field['show_reg'] > 1)
echo '
<dt>
<strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['name'], ':</strong>
<span class="smalltext">', $field['desc'], '</span>
</dt>
<dd>
', str_replace('name="', 'tabindex="' . $context['tabindex']++ . '" name="', $field['input_html']), '
</dd>';
echo '
<dt>
<strong><label for="emailPassword_check">', $txt['admin_register_email_detail'], ':</label></strong>
<span class="smalltext">', $txt['admin_register_email_detail_desc'], '</span>
</dt>
<dd>
<input type="checkbox" name="emailPassword" id="emailPassword_check" tabindex="', $context['tabindex']++, '" checked disabled>
</dd>
<dt>
<strong><label for="emailActivate_check">', $txt['admin_register_email_activate'], ':</label></strong>
</dt>
<dd>
<input type="checkbox" name="emailActivate" id="emailActivate_check" tabindex="', $context['tabindex']++, '"', !empty($modSettings['registration_method']) && $modSettings['registration_method'] == 1 ? ' checked' : '', ' onclick="onCheckChange();">
</dd>
</dl>
<div class="flow_auto">
<input type="submit" name="regSubmit" value="', $txt['register'], '" tabindex="', $context['tabindex']++, '" class="button">
<input type="hidden" name="sa" value="register">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-regc_token_var'], '" value="', $context['admin-regc_token'], '">
</div>
</div><!-- #register_screen -->
</form>
</div><!-- #admin_form_wrapper -->
<br class="clear">';
}
/**
* Form for editing the agreement shown for people registering to the forum.
*/
function template_edit_agreement()
{
global $context, $scripturl, $txt;
if (!empty($context['saved_successful']))
echo '
<div class="infobox">', $txt['settings_saved'], '</div>';
elseif (!empty($context['could_not_save']))
echo '
<div class="errorbox">', $txt['admin_agreement_not_saved'], '</div>';
// Warning for if the file isn't writable.
if (!empty($context['warning']))
echo '
<div class="errorbox">', $context['warning'], '</div>';
// Just a big box to edit the text file ;)
echo '
<div id="admin_form_wrapper">
<div class="cat_bar">
<h2 class="catbg">', $txt['registration_agreement'], '</h2>
</div>
<div class="windowbg" id="registration_agreement">';
// Is there more than one language to choose from?
if (count($context['editable_agreements']) > 1)
{
echo '
<div class="cat_bar">
<h2 class="catbg">', $txt['language_configuration'], '</h2>
</div>
<div class="information">
<form action="', $scripturl, '?action=admin;area=regcenter" id="change_reg" method="post" accept-charset="', $context['character_set'], '" style="display: inline;">
<strong>', $txt['admin_agreement_select_language'], ':</strong>
<select name="agree_lang" onchange="document.getElementById(\'change_reg\').submit();" tabindex="', $context['tabindex']++, '">';
foreach ($context['editable_agreements'] as $file => $name)
echo '
<option value="', $file, '"', $context['current_agreement'] == $file ? ' selected' : '', '>', $name, '</option>';
echo '
</select>
<div class="righttext">
<input type="hidden" name="sa" value="agreement">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-rega_token_var'], '" value="', $context['admin-rega_token'], '">
<input type="submit" name="change" value="', $txt['admin_agreement_select_language_change'], '" tabindex="', $context['tabindex']++, '" class="button">
</div>
</form>
</div><!-- .information -->';
}
// Show the actual agreement in an oversized text box.
echo '
<form action="', $scripturl, '?action=admin;area=regcenter" method="post" accept-charset="', $context['character_set'], '">
<textarea cols="70" rows="20" name="agreement" id="agreement">', $context['agreement'], '</textarea>
<div class="information">
<span>', $context['agreement_info'], '</span>
</div>
<div class="righttext"><input type="submit" value="', $txt['save'], '" tabindex="', $context['tabindex']++, '" class="button" onclick="return resetAgreementConfirm()" />
<input type="hidden" name="agree_lang" value="', $context['current_agreement'], '">
<input type="hidden" name="sa" value="agreement">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<script>
function resetAgreementConfirm()
{
return true;
}
</script>
<input type="hidden" name="', $context['admin-rega_token_var'], '" value="', $context['admin-rega_token'], '">
</form>
</div><!-- #registration_agreement -->
</div><!-- #admin_form_wrapper -->';
}
/**
* Template for editing reserved words.
*/
function template_edit_reserved_words()
{
global $context, $scripturl, $txt;
if (!empty($context['saved_successful']))
echo '
<div class="infobox">', $txt['settings_saved'], '</div>';
echo '
<form id="admin_form_wrapper" action="', $scripturl, '?action=admin;area=regcenter" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">', $txt['admin_reserved_set'], '</h2>
</div>
<div class="windowbg">
<h4>', $txt['admin_reserved_line'], '</h4>
<textarea cols="30" rows="6" name="reserved" id="reserved">', implode("\n", $context['reserved_words']), '</textarea>
<dl class="settings">
<dt>
<label for="matchword">', $txt['admin_match_whole'], '</label>
</dt>
<dd>
<input type="checkbox" name="matchword" id="matchword" tabindex="', $context['tabindex']++, '"', $context['reserved_word_options']['match_word'] ? ' checked' : '', '>
</dd>
<dt>
<label for="matchcase">', $txt['admin_match_case'], '</label>
</dt>
<dd>
<input type="checkbox" name="matchcase" id="matchcase" tabindex="', $context['tabindex']++, '"', $context['reserved_word_options']['match_case'] ? ' checked' : '', '>
</dd>
<dt>
<label for="matchuser">', $txt['admin_check_user'], '</label>
</dt>
<dd>
<input type="checkbox" name="matchuser" id="matchuser" tabindex="', $context['tabindex']++, '"', $context['reserved_word_options']['match_user'] ? ' checked' : '', '>
</dd>
<dt>
<label for="matchname">', $txt['admin_check_display'], '</label>
</dt>
<dd>
<input type="checkbox" name="matchname" id="matchname" tabindex="', $context['tabindex']++, '"', $context['reserved_word_options']['match_name'] ? ' checked' : '', '>
</dd>
</dl>
<div class="flow_auto">
<input type="submit" value="', $txt['save'], '" name="save_reserved_names" tabindex="', $context['tabindex']++, '" class="button">
<input type="hidden" name="sa" value="reservednames">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['admin-regr_token_var'], '" value="', $context['admin-regr_token'], '">
</div>
</div><!-- .windowbg -->
</form>';
}
// Form for editing the privacy policy shown to people registering to the forum.
function template_edit_privacy_policy()
{
global $context, $settings, $options, $scripturl, $txt;
if (!empty($context['saved_successful']))
echo '
<div class="infobox">', $txt['settings_saved'], '</div>';
// Just a big box to edit the text file ;).
echo '
<div class="cat_bar">
<h2 class="catbg">', $txt['privacy_policy'], '</h2>
</div>
<div class="windowbg" id="privacy_policy">';
// Is there more than one language to choose from?
if (count($context['editable_policies']) > 1)
{
echo '
<div class="information">
<form action="', $scripturl, '?action=admin;area=regcenter" id="change_policy" method="post" accept-charset="', $context['character_set'], '" style="display: inline;">
<strong>', $txt['admin_agreement_select_language'], ':</strong>
<select name="policy_lang" onchange="document.getElementById(\'change_policy\').submit();" tabindex="', $context['tabindex']++, '">';
foreach ($context['editable_policies'] as $lang => $name)
echo '
<option value="', $lang, '" ', $context['current_policy_lang'] == $lang ? 'selected="selected"' : '', '>', $name, '</option>';
echo '
</select>
<div class="righttext">
<input type="hidden" name="sa" value="policy">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="submit" name="change" value="', $txt['admin_agreement_select_language_change'], '" tabindex="', $context['tabindex']++, '" class="button">
</div>
</form>
</div>';
}
echo '
<form action="', $scripturl, '?action=admin;area=regcenter" method="post" accept-charset="', $context['character_set'], '">';
// Show the actual policy in an oversized text box.
echo '
<textarea cols="70" rows="20" name="policy" id="agreement">', $context['privacy_policy'], '</textarea>
<div class="information">', $context['privacy_policy_info'], '</div>
<div class="righttext">
<input type="submit" value="', $txt['save'], '" tabindex="', $context['tabindex']++, '" class="button" onclick="return resetPolicyConfirm()" />
<input type="hidden" name="policy_lang" value="', $context['current_policy_lang'], '" />
<input type="hidden" name="sa" value="policy" />
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
<input type="hidden" name="', $context['admin-regp_token_var'], '" value="', $context['admin-regp_token'], '" />
<script>
function resetPolicyConfirm()
{
return true;
}
</script>
</div>
</form>
</div>';
}
?>

205
Reminder.template.php Normal file
View file

@ -0,0 +1,205 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* The main "Here's how you can reset your password" page
*/
function template_main()
{
global $context, $txt, $scripturl;
echo '
<br>
<form action="', $scripturl, '?action=reminder;sa=picktype" method="post" accept-charset="', $context['character_set'], '">
<div class="tborder login">
<div class="cat_bar">
<h2 class="catbg">', $txt['authentication_reminder'], '</h2>
</div>
<div class="roundframe">
<p class="smalltext centertext">', $txt['password_reminder_desc'], '</p>
<dl>
<dt>', $txt['user_email'], ':</dt>
<dd><input type="text" name="user" size="30"></dd>
</dl>
<input type="submit" value="', $txt['reminder_continue'], '" class="button">
<br class="clear">
</div>
</div>
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['remind_token_var'], '" value="', $context['remind_token'], '">
</form>';
}
/**
* The page to pick an option - secret question/answer (if set) or email
*/
function template_reminder_pick()
{
global $context, $txt, $scripturl;
echo '
<br>
<form action="', $scripturl, '?action=reminder;sa=picktype" method="post" accept-charset="', $context['character_set'], '">
<div class="tborder login">
<div class="cat_bar">
<h2 class="catbg">', $txt['authentication_reminder'], '</h2>
</div>
<div class="roundframe">
<p><strong>', $txt['authentication_options'], ':</strong></p>
<p>
<input type="radio" name="reminder_type" id="reminder_type_email" value="email" checked></dt>
<label for="reminder_type_email">', $txt['authentication_password_email'], '</label></dd>
</p>
<p>
<input type="radio" name="reminder_type" id="reminder_type_secret" value="secret">
<label for="reminder_type_secret">', $txt['authentication_password_secret'], '</label>
</p>
<div class="flow_auto">
<input type="submit" value="', $txt['reminder_continue'], '" class="button">
<input type="hidden" name="uid" value="', $context['current_member']['id'], '">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['remind_token_var'], '" value="', $context['remind_token'], '">
</div>
</div><!-- .roundframe -->
</div><!-- .login -->
</form>';
}
/**
* Just a simple "We sent you an email. Click the link in it to continue." message
*/
function template_sent()
{
global $context;
echo '
<br>
<div class="tborder login" id="reminder_sent">
<div class="cat_bar">
<h2 class="catbg">' . $context['page_title'] . '</h2>
</div>
<p class="information">' . $context['description'] . '</p>
</div>';
}
/**
* Template for setting the new password
*/
function template_set_password()
{
global $context, $txt, $scripturl, $modSettings;
echo '
<br>
<form action="', $scripturl, '?action=reminder;sa=setpassword2" name="reminder_form" id="reminder_form" method="post" accept-charset="', $context['character_set'], '">
<div class="tborder login">
<div class="cat_bar">
<h2 class="catbg">', $context['page_title'], '</h2>
</div>
<div class="roundframe">
<dl>
<dt>', $txt['choose_pass'], ': </dt>
<dd>
<input type="password" name="passwrd1" id="smf_autov_pwmain" size="22">
<span id="smf_autov_pwmain_div" style="display: none;">
<span id="smf_autov_pwmain_img" class="main_icons invalid"></span>
</span>
</dd>
<dt>', $txt['verify_pass'], ': </dt>
<dd>
<input type="password" name="passwrd2" id="smf_autov_pwverify" size="22">
<span id="smf_autov_pwverify_div" style="display: none;">
<span id="smf_autov_pwverify_img" class="main_icons invalid"></span>
</span>
</dd>
</dl>
<p class="align_center">
<input type="submit" value="', $txt['save'], '" class="button">
</p>
</div><!-- .roundframe -->
</div><!-- .login -->
<input type="hidden" name="code" value="', $context['code'], '">
<input type="hidden" name="u" value="', $context['memID'], '">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['remind-sp_token_var'], '" value="', $context['remind-sp_token'], '">
</form>
<script>
var regTextStrings = {
"password_short": "', $txt['registration_password_short'], '",
"password_reserved": "', $txt['registration_password_reserved'], '",
"password_numbercase": "', $txt['registration_password_numbercase'], '",
"password_no_match": "', $txt['registration_password_no_match'], '",
"password_valid": "', $txt['registration_password_valid'], '"
};
var verificationHandle = new smfRegister("reminder_form", ', empty($modSettings['password_strength']) ? 0 : $modSettings['password_strength'], ', regTextStrings);
</script>';
}
/**
* The page that asks a user to answer their secret question
*/
function template_ask()
{
global $context, $txt, $scripturl, $modSettings;
echo '
<br>
<form action="', $scripturl, '?action=reminder;sa=secret2" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator">
<div class="tborder login">
<div class="cat_bar">
<h2 class="catbg">', $txt['authentication_reminder'], '</h2>
</div>
<div class="roundframe">
<p class="smalltext">', $txt['enter_new_password'], '</p>
<dl>
<dt>', $txt['secret_question'], ':</dt>
<dd>', $context['secret_question'], '</dd>
<dt>', $txt['secret_answer'], ':</dt>
<dd><input type="text" name="secret_answer" size="22"></dd>
<dt>', $txt['choose_pass'], ': </dt>
<dd>
<input type="password" name="passwrd1" id="smf_autov_pwmain" size="22">
<span id="smf_autov_pwmain_div" style="display: none;">
<span id="smf_autov_pwmain_img" class="main_icons invalid"></span>
</span>
</dd>
<dt>', $txt['verify_pass'], ': </dt>
<dd>
<input type="password" name="passwrd2" id="smf_autov_pwverify" size="22">
<span id="smf_autov_pwverify_div" style="display: none;">
<span id="smf_autov_pwverify_img" class="main_icons valid"></span>
</span>
</dd>
</dl>
<div class="auto_flow">
<input type="submit" value="', $txt['save'], '" class="button">
<input type="hidden" name="uid" value="', $context['remind_user'], '">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['remind-sai_token_var'], '" value="', $context['remind-sai_token'], '">
</div>
</div><!-- .roundframe -->
</div><!-- .login -->
</form>
<script>
var regTextStrings = {
"password_short": "', $txt['registration_password_short'], '",
"password_reserved": "', $txt['registration_password_reserved'], '",
"password_numbercase": "', $txt['registration_password_numbercase'], '",
"password_no_match": "', $txt['registration_password_no_match'], '",
"password_valid": "', $txt['registration_password_valid'], '"
};
var verificationHandle = new smfRegister("creator", ', empty($modSettings['password_strength']) ? 0 : $modSettings['password_strength'], ', regTextStrings);
</script>';
}
?>

97
ReportToMod.template.php Normal file
View file

@ -0,0 +1,97 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
//------------------------------------------------------------------------------
/* This template contains two humble sub templates - main. Its job is pretty
simple: it collects the information we need to actually send the topic.
The report sub template gets shown from:
'?action=reporttm;topic=##.##;msg=##'
'?action=reporttm;u=#'
It should submit to:
'?action=reporttm;topic=' . $context['current_topic'] . '.' . $context['start']
'?action=reporttm;u=#'
It only needs to send the following fields:
comment: an additional comment to give the moderator.
sc: the session id, or $context['session_id'].
*/
/**
* The main "report this to the moderator" page
*/
function template_main()
{
global $context, $txt;
// Want to see your master piece?
echo '
<div id="preview_section"', isset($context['preview_message']) ? '' : ' class="hidden"', '>
<div class="cat_bar">
<h2 class="catbg">
<span>', $txt['preview'], '</span>
</h2>
</div>
<div class="windowbg">
<div class="post" id="preview_body">
', empty($context['preview_message']) ? '<br>' : $context['preview_message'], '
</div>
</div>
</div>';
echo '
<div id="report_form">
<form action="', $context['submit_url'], '" method="post" accept-charset="', $context['character_set'], '">
<input type="hidden" name="', $context['report_type'], '" value="', $context['reported_item'], '">
<div class="cat_bar">
<h2 class="catbg">', $context['page_title'], '</h2>
</div>
<div class="windowbg">';
if (!empty($context['post_errors']))
{
echo '
<div id="error_box" class="errorbox">
<ul id="error_list">';
foreach ($context['post_errors'] as $key => $error)
echo '
<li id="error_', $key, '" class="error">', $error, '</li>';
echo '
</ul>';
}
else
echo '
<div id="error_box" class="errorbox hidden">';
echo '
</div>';
echo '
<p class="noticebox">', $context['notice'], '</p>
<dl class="settings" id="report_post">
<dt>
<label for="report_comment">', $txt['enter_comment'], '</label>:
</dt>
<dd>
<textarea type="text" id="report_comment" name="comment" rows="5">', $context['comment_body'], '</textarea>
</dd>
</dl>
<input type="submit" name="preview" value="', $txt['preview'], '" class="button">
<input type="submit" name="save" value="', $txt['report_submit'], '" class="button">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
</div><!-- .windowbg -->
</form>
</div><!-- #report_form -->';
}
?>

View file

@ -0,0 +1,573 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* Displays all reported posts.
*/
function template_reported_posts()
{
global $context, $txt, $scripturl, $options;
// Let them know the action was a success.
if (!empty($context['report_post_action']))
echo '
<div class="infobox">
', $txt['report_action_' . $context['report_post_action']], '
</div>';
echo '
<form id="reported_posts" action="', $scripturl, '?action=moderate;area=reportedposts;sa=show', $context['view_closed'] ? ';closed' : '', ';start=', $context['start'], '" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">
', $context['view_closed'] ? $txt['mc_reportedp_closed'] : $txt['mc_reportedp_active'], '
</h2>
</div>
<div class="pagesection">';
if (!empty($context['reports']) && !$context['view_closed'] && !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
echo '
<ul class="buttonlist floatright">
<li class="inline_mod_check">
<input type="checkbox" onclick="invertAll(this, this.form, \'close[]\');">
</li>
</ul>';
echo '
<div class="pagelinks floatleft">' . $context['page_index'] . '</div>
</div>';
foreach ($context['reports'] as $report)
{
echo '
<div class="windowbg">
<h5>
<strong>', !empty($report['topic']['board_name']) ? '<a href="' . $scripturl . '?board=' . $report['topic']['id_board'] . '.0">' . $report['topic']['board_name'] . '</a>' : '??', ' / <a href="', $report['topic']['href'], '">', $report['subject'], '</a></strong> ', $txt['mc_reportedp_by'], ' <strong>', $report['author']['link'], '</strong>
</h5>
<div class="smalltext">
', $txt['mc_reportedp_last_reported'], ': ', $report['last_updated'], '&nbsp;-&nbsp;';
// Prepare the comments...
$comments = array();
foreach ($report['comments'] as $comment)
$comments[$comment['member']['id']] = $comment['member']['link'];
echo '
', $txt['mc_reportedp_reported_by'], ': ', implode(', ', $comments), '
</div>
<hr>
', $report['body'], '
<br>';
// Reported post options
template_quickbuttons($report['quickbuttons'], 'reported_posts');
echo '
</div><!-- .windowbg -->';
}
// Were none found?
if (empty($context['reports']))
echo '
<div class="windowbg">
<p class="centertext">', $txt['mc_reportedp_none_found'], '</p>
</div>';
echo '
<div class="pagesection">
<div class="pagelinks floatleft">' . $context['page_index'] . '</div>';
if (!empty($context['reports']) && !$context['view_closed'] && !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
echo '
<div class="floatright">
<input type="hidden" name="' . $context['mod-report-close-all_token_var'] . '" value="' . $context['mod-report-close-all_token'] . '">
<input type="submit" name="close_selected" value="' . $txt['mc_reportedp_close_selected'] . '" class="button">
</div>';
echo '
</div>
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
</form>';
}
/**
* A block to show the current top reported posts.
*/
function template_reported_posts_block()
{
global $context, $txt, $scripturl;
echo '
<div class="cat_bar">
<h2 class="catbg">
<span id="reported_posts_toggle" class="', !empty($context['admin_prefs']['mcrp']) ? 'toggle_down' : 'toggle_up', ' floatright" style="display: none;"></span>
<a href="', $scripturl, '?action=moderate;area=reportedposts" id="reported_posts_link">', $txt['mc_recent_reports'], '</a>
</h2>
</div>
<div class="windowbg" id="reported_posts_panel">
<div class="modbox">
<ul>';
foreach ($context['reported_posts'] as $report)
echo '
<li class="smalltext">
<a href="', $report['report_href'], '">', $report['subject'], '</a> ', $txt['mc_reportedp_by'], ' ', $report['author']['link'], '
</li>';
// Don't have any watched users right now?
if (empty($context['reported_posts']))
echo '
<li>
<strong class="smalltext">', $txt['mc_recent_reports_none'], '</strong>
</li>';
echo '
</ul>
</div><!-- .modbox -->
</div><!-- #reported_posts_panel -->
<script>
var oReportedPostsPanelToggle = new smc_Toggle({
bToggleEnabled: true,
bCurrentlyCollapsed: ', !empty($context['admin_prefs']['mcrp']) ? 'true' : 'false', ',
aSwappableContainers: [
\'reported_posts_panel\'
],
aSwapImages: [
{
sId: \'reported_posts_toggle\',
altExpanded: ', JavaScriptEscape($txt['hide']), ',
altCollapsed: ', JavaScriptEscape($txt['show']), '
}
],
aSwapLinks: [
{
sId: \'reported_posts_link\',
msgExpanded: ', JavaScriptEscape($txt['mc_recent_reports']), ',
msgCollapsed: ', JavaScriptEscape($txt['mc_recent_reports']), '
}
],
oThemeOptions: {
bUseThemeSettings: true,
sOptionName: \'admin_preferences\',
sSessionVar: smf_session_var,
sSessionId: smf_session_id,
sThemeId: \'1\',
sAdditionalVars: \';admin_key=mcrp\'
}
});
</script>';
}
/**
* Handles viewing details of and managing a specific report
*/
function template_viewmodreport()
{
global $context, $scripturl, $txt;
// Let them know the action was a success.
if (!empty($context['report_post_action']))
echo '
<div class="infobox">
', $txt['report_action_' . $context['report_post_action']], '
</div>';
echo '
<div id="modcenter">
<form action="', $scripturl, '?action=moderate;area=reportedposts;sa=handlecomment;rid=', $context['report']['id'], '" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">
', sprintf($txt['mc_viewmodreport'], $context['report']['message_link'], $context['report']['author']['link']), '
</h2>
</div>
<div class="title_bar">
<h2 class="titlebg">
<span class="">
', sprintf($txt['mc_modreport_summary'], $context['report']['num_reports'], $context['report']['last_updated']), '
</span>';
$report_buttons = array(
'ignore' => array(
'text' => !$context['report']['ignore'] ? 'mc_reportedp_ignore' : 'mc_reportedp_unignore',
'url' => $scripturl.'?action=moderate;area=reportedposts;sa=handle;ignore='.(int) !$context['report']['ignore'].';rid='.$context['report']['id'].';'.$context['session_var'].'='.$context['session_id'].';'.$context['mod-report-ignore_token_var'].'='.$context['mod-report-ignore_token'],
'class' => !$context['report']['ignore'] ? ' you_sure' : '',
'custom' => !$context['report']['ignore'] ? ' data-confirm="' . $txt['mc_reportedp_ignore_confirm'] . '"' : '',
'icon' => 'ignore'
),
'close' => array(
'text' => $context['report']['closed'] ? 'mc_reportedp_open' : 'mc_reportedp_close',
'url' => $scripturl.'?action=moderate;area=reportedposts;sa=handle;closed='.(int) !$context['report']['closed'].';rid='.$context['report']['id'].';'.$context['session_var'].'='.$context['session_id'].';'.$context['mod-report-closed_token_var'].'='.$context['mod-report-closed_token'],
'icon' => 'close'
)
);
// Report buttons
template_button_strip($report_buttons, 'right');
echo '
</h2>
</div><!-- .title_bar -->
<div class="windowbg">
', $context['report']['body'], '
</div>
<br>
<div class="cat_bar">
<h2 class="catbg">', $txt['mc_modreport_whoreported_title'], '</h2>
</div>';
foreach ($context['report']['comments'] as $comment)
echo '
<div class="windowbg">
<p class="smalltext">
', sprintf($txt['mc_modreport_whoreported_data'], $comment['member']['link'] . (empty($comment['member']['id']) && !empty($comment['member']['ip']) ? ' (' . $comment['member']['ip'] . ')' : ''), $comment['time']), '
</p>
<p>', $comment['message'], '</p>
</div>';
echo '
<br>
<div class="cat_bar">
<h2 class="catbg">', $txt['mc_modreport_mod_comments'], '</h2>
</div>
<div>';
if (empty($context['report']['mod_comments']))
echo '
<div class="information">
<p class="centertext">', $txt['mc_modreport_no_mod_comment'], '</p>
</div>';
foreach ($context['report']['mod_comments'] as $comment)
{
echo '
<div class="title_bar">
<h2 class="titlebg">
', $comment['member']['link'], ': <em class="smalltext">(', $comment['time'], ')</em>', ($comment['can_edit'] ? '<span class=""><a href="' . $scripturl . '?action=moderate;area=reportedposts;sa=editcomment;rid=' . $context['report']['id'] . ';mid=' . $comment['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" class="button">' . $txt['mc_reportedp_comment_edit'] . '</a><a href="' . $scripturl . '?action=moderate;area=reportedposts;sa=handlecomment;rid=' . $context['report']['id'] . ';mid=' . $comment['id'] . ';delete;' . $context['session_var'] . '=' . $context['session_id'] . ';' . $context['mod-reportC-delete_token_var'] . '=' . $context['mod-reportC-delete_token'] . '" class="button">' . $txt['mc_reportedp_comment_delete'] . '</a></span>' : ''), '
</h2>
</div>';
echo '
<div class="windowbg">
<p>', $comment['message'], '</p>
</div>';
}
echo '
<div class="cat_bar">
<h2 class="catbg">
<span class="">
', $txt['mc_reportedp_new_comment'], '
</span>
</h2>
</div>
<textarea rows="5" cols="60" name="mod_comment" class="mod_comment"></textarea>
<div class="padding">
<input type="submit" name="add_comment" value="', $txt['mc_modreport_add_mod_comment'], '" class="button">
<input type="hidden" name="', $context['mod-reportC-add_token_var'], '" value="', $context['mod-reportC-add_token'], '">
</div>
</div>
<br>';
template_show_list('moderation_actions_list');
echo '
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
</form>
</div><!-- #modcenter -->';
}
/**
* Template for editing a mod comment.
*/
function template_edit_comment()
{
global $context, $scripturl, $txt;
echo '
<div id="modcenter">
<form action="', $scripturl, '?action=moderate;area=reported', $context['report_type'], ';sa=editcomment;mid=', $context['comment_id'], ';rid=', $context['report_id'], ';save" method="post" accept-charset="', $context['character_set'], '">
<br>
<div class="cat_bar">
<h2 class="catbg">', $txt['mc_modreport_edit_mod_comment'], '</h2>
</div>
<div class="windowbg">
<textarea rows="6" cols="60" class="mod_comment" name="mod_comment">', $context['comment']['body'], '</textarea>
<div>
<input type="submit" name="edit_comment" value="', $txt['mc_modreport_edit_mod_comment'], '" class="button">
</div>
</div>
<br>
<input type="hidden" name="', $context['mod-reportC-edit_token_var'], '" value="', $context['mod-reportC-edit_token'], '">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
</form>
</div><!-- #modcenter -->';
}
/**
* A block to show the current top reported member profiles.
*/
function template_reported_members_block()
{
global $context, $txt, $scripturl;
echo '
<div class="cat_bar">
<h2 class="catbg">
<span id="reported_members_toggle" class="', !empty($context['admin_prefs']['mcru']) ? 'toggle_down' : 'toggle_up', ' floatright" style="display: none;"></span>
<a href="', $scripturl, '?action=moderate;area=reportedmembers" id="reported_members_link">', $txt['mc_recent_member_reports'], '</a>
</h2>
</div>
<div class="windowbg" id="reported_users_panel">
<div class="modbox">
<ul>';
foreach ($context['reported_members'] as $report)
echo '
<li class="smalltext">
<a href="', $report['report_href'], '">', $report['user_name'], '</a>
</li>';
// Don't have any reported members right now?
if (empty($context['reported_members']))
echo '
<li>
<strong class="smalltext">', $txt['mc_recent_reports_none'], '</strong>
</li>';
echo '
</ul>
</div><!-- .modbox -->
</div><!-- #reported_users_panel -->
<script>
var oReportedPostsPanelToggle = new smc_Toggle({
bToggleEnabled: true,
bCurrentlyCollapsed: ', !empty($context['admin_prefs']['mcrm']) ? 'true' : 'false', ',
aSwappableContainers: [
\'reported_members_panel\'
],
aSwapImages: [
{
sId: \'reported_members_toggle\',
altExpanded: ', JavaScriptEscape($txt['hide']), ',
altCollapsed: ', JavaScriptEscape($txt['show']), '
}
],
aSwapLinks: [
{
sId: \'reported_members_link\',
msgExpanded: ', JavaScriptEscape($txt['mc_recent_member_reports']), ',
msgCollapsed: ', JavaScriptEscape($txt['mc_recent_member_reports']), '
}
],
oThemeOptions: {
bUseThemeSettings: true,
sOptionName: \'admin_preferences\',
sSessionVar: smf_session_var,
sSessionId: smf_session_id,
sThemeId: \'1\',
sAdditionalVars: \';admin_key=mcrm\'
}
});
</script>';
}
/**
* Lists all reported members
*/
function template_reported_members()
{
global $context, $txt, $scripturl, $options;
// Let them know the action was a success.
if (!empty($context['report_post_action']) && !empty($txt['report_action_' . $context['report_post_action']]))
echo '
<div class="infobox">
', $txt['report_action_' . $context['report_post_action']], '
</div>';
echo '
<form id="reported_members" action="', $scripturl, '?action=moderate;area=reportedmembers;sa=show', $context['view_closed'] ? ';closed' : '', ';start=', $context['start'], '" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar cat_bar_round">
<h2 class="catbg">
', $context['view_closed'] ? $txt['mc_reportedp_closed'] : $txt['mc_reportedp_active'], '
</h2>
</div>
<div class="pagesection">';
if (!empty($context['reports']) && !$context['view_closed'] && !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
echo '
<ul class="buttonlist floatright">
<li class="inline_mod_check">
<input type="checkbox" onclick="invertAll(this, this.form, \'close[]\');">
</li>
</ul>';
echo '
<div class="pagelinks">', $context['page_index'], '</div>
</div>';
foreach ($context['reports'] as $report)
{
echo '
<div class="generic_list_wrapper windowbg">
<h5>
<strong><a href="', $report['user']['href'], '">', $report['user']['name'], '</a></strong>
</h5>
<div class="smalltext">
', $txt['mc_reportedp_last_reported'], ': ', $report['last_updated'], '&nbsp;-&nbsp;';
// Prepare the comments...
$comments = array();
foreach ($report['comments'] as $comment)
$comments[$comment['member']['id']] = $comment['member']['link'];
echo '
', $txt['mc_reportedp_reported_by'], ': ', implode(', ', $comments), '
</div>
<hr>
', template_quickbuttons($report['quickbuttons'], 'reported_members'), '
</div><!-- .generic_list_wrapper -->';
}
// Were none found?
if (empty($context['reports']))
echo '
<div class="windowbg">
<p class="centertext">', $txt['mc_reportedp_none_found'], '</p>
</div>';
echo '
<div class="pagesection">
<div class="pagelinks floatleft">', $context['page_index'], '</div>
<div class="floatright">
', (!$context['view_closed'] && !empty($context['reports'])) ? '<input type="submit" name="close_selected" value="' . $txt['mc_reportedp_close_selected'] . '" class="button">' : '', '
</div>
</div>
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
</form>';
}
/**
* Template for viewing and managing a specific report about a user's profile
*/
function template_viewmemberreport()
{
global $context, $scripturl, $txt;
// Let them know the action was a success.
if (!empty($context['report_post_action']))
echo '
<div class="infobox">
', $txt['report_action_' . $context['report_post_action']], '
</div>';
echo '
<div id="modcenter">
<form action="', $scripturl, '?action=moderate;area=reportedmembers;sa=handlecomment;rid=', $context['report']['id'], '" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">
', sprintf($txt['mc_viewmemberreport'], $context['report']['user']['link']), '
</h2>
</div>
<div class="title_bar">
<h2 class="titlebg">
<span class="">
', sprintf($txt['mc_memberreport_summary'], $context['report']['num_reports'], $context['report']['last_updated']), '
</span>';
$report_buttons = array(
'ignore' => array(
'text' => !$context['report']['ignore'] ? 'mc_reportedp_ignore' : 'mc_reportedp_unignore',
'url' => $scripturl.'?action=moderate;area=reportedmembers;sa=handle;ignore='.(int)!$context['report']['ignore'].';rid='.$context['report']['id'].';'.$context['session_var'].'='.$context['session_id'].';'.$context['mod-report-ignore_token_var'].'='.$context['mod-report-ignore_token'],
'class' => !$context['report']['ignore'] ? ' you_sure' : '',
'custom' => !$context['report']['ignore'] ? ' data-confirm="' . $txt['mc_reportedp_ignore_confirm'] . '"' : '',
'icon' => 'ignore'
),
'close' => array(
'text' => $context['report']['closed'] ? 'mc_reportedp_open' : 'mc_reportedp_close',
'url' => $scripturl.'?action=moderate;area=reportedmembers;sa=handle;closed='.(int)!$context['report']['closed'].';rid='.$context['report']['id'].';'.$context['session_var'].'='.$context['session_id'].';'.$context['mod-report-closed_token_var'].'='.$context['mod-report-closed_token'],
'icon' => 'close'
)
);
// Report buttons
template_button_strip($report_buttons, 'right');
echo '
</h2>
</div>
<br>
<div class="cat_bar">
<h2 class="catbg">', $txt['mc_memberreport_whoreported_title'], '</h2>
</div>';
foreach ($context['report']['comments'] as $comment)
echo '
<div class="windowbg">
<p class="smalltext">
', sprintf($txt['mc_modreport_whoreported_data'], $comment['member']['link'] . (empty($comment['member']['id']) && !empty($comment['member']['ip']) ? ' (' . $comment['member']['ip'] . ')' : ''), $comment['time']), '
</p>
<p>', $comment['message'], '</p>
</div>';
echo '
<br>
<div class="cat_bar">
<h2 class="catbg">', $txt['mc_modreport_mod_comments'], '</h2>
</div>
<div>';
if (empty($context['report']['mod_comments']))
echo '
<div class="information">
<p class="centertext">', $txt['mc_modreport_no_mod_comment'], '</p>
</div>';
foreach ($context['report']['mod_comments'] as $comment)
{
echo '
<div class="title_bar">
<h2 class="titlebg">', $comment['member']['link'], ': <em class="smalltext">(', $comment['time'], ')</em>', ($comment['can_edit'] ? '<span class=""><a href="' . $scripturl . '?action=moderate;area=reportedmembers;sa=editcomment;rid=' . $context['report']['id'] . ';mid=' . $comment['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" class="button">' . $txt['mc_reportedp_comment_edit'] . '</a> <a href="' . $scripturl . '?action=moderate;area=reportedmembers;sa=handlecomment;rid=' . $context['report']['id'] . ';mid=' . $comment['id'] . ';delete;' . $context['session_var'] . '=' . $context['session_id'] . ';' . $context['mod-reportC-delete_token_var'] . '=' . $context['mod-reportC-delete_token'] . '" class="button you_sure" data-confirm="' . $txt['mc_reportedp_delete_confirm'] . '">' . $txt['mc_reportedp_comment_delete'] . '</a></span>' : ''), '</h2>
</div>';
echo '
<div class="windowbg">
<p>', $comment['message'], '</p>
</div>';
}
echo '
<div class="cat_bar">
<h2 class="catbg">
<span class="">
', $txt['mc_reportedp_new_comment'], '
</span>
</h2>
</div>
<textarea rows="5" cols="60" name="mod_comment" class="mod_comment"></textarea>
<div class="padding">
<input type="submit" name="add_comment" value="', $txt['mc_modreport_add_mod_comment'], '" class="button">
<input type="hidden" name="', $context['mod-reportC-add_token_var'], '" value="', $context['mod-reportC-add_token'], '">
</div>
</div>
<br>';
template_show_list('moderation_actions_list');
echo '
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
</form>
</div><!-- #modcenter -->';
}
?>

237
Reports.template.php Normal file
View file

@ -0,0 +1,237 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* Choose which type of report to run?
*/
function template_report_type()
{
global $context, $scripturl, $txt;
echo '
<form action="', $scripturl, '?action=admin;area=reports" method="post" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">', $txt['generate_reports_type'], '</h2>
</div>
<div class="windowbg">
<dl class="settings">';
// Go through each type of report they can run.
foreach ($context['report_types'] as $type)
{
if (isset($type['description']))
echo '
<dt>', $type['description'], '</dt>';
echo '
<dd>
<input type="radio" id="rt_', $type['id'], '" name="rt" value="', $type['id'], '"', $type['is_first'] ? ' checked' : '', '>
<strong><label for="rt_', $type['id'], '">', $type['title'], '</label></strong>
</dd>';
}
echo '
</dl>
<input type="submit" name="continue" value="', $txt['generate_reports_continue'], '" class="button">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
</div><!-- .windowbg -->
</form>';
}
/**
* This is the standard template for showing reports.
*/
function template_main()
{
global $context, $txt;
echo '
<div class="cat_bar">
<h2 class="catbg">', $txt['results'], '</h2>
</div>
<div id="report_buttons">';
if (!empty($context['report_buttons']))
template_button_strip($context['report_buttons'], 'right');
echo '
</div>';
// Go through each table!
foreach ($context['tables'] as $table)
{
echo '
<table class="table_grid report_results">';
if (!empty($table['title']))
echo '
<thead>
<tr class="title_bar">
<th scope="col" colspan="', $table['column_count'], '">', $table['title'], '</th>
</tr>
</thead>
<tbody>';
// Now do each row!
$row_number = 0;
foreach ($table['data'] as $row)
{
if ($row_number == 0 && !empty($table['shading']['top']))
echo '
<tr class="windowbg table_caption">';
else
echo '
<tr class="', !empty($row[0]['separator']) ? 'title_bar' : 'windowbg', '">';
// Now do each column.
$column_number = 0;
foreach ($row as $data)
{
// If this is a special separator, skip over!
if (!empty($data['separator']) && $column_number == 0)
{
echo '
<td colspan="', $table['column_count'], '" class="smalltext">
', $data['v'], ':
</td>';
break;
}
// Shaded?
if ($column_number == 0 && !empty($table['shading']['left']))
echo '
<td class="table_caption ', $table['align']['shaded'], 'text"', $table['width']['shaded'] != 'auto' ? ' width="' . $table['width']['shaded'] . '"' : '', '>
', $data['v'] == $table['default_value'] ? '' : ($data['v'] . (empty($data['v']) ? '' : ':')), '
</td>';
else
echo '
<td class="smalltext centertext" ', $table['width']['normal'] != 'auto' ? ' width="' . $table['width']['normal'] . '"' : '', !empty($data['style']) ? ' style="' . $data['style'] . '"' : '', '>
', $data['v'], '
</td>';
$column_number++;
}
echo '
</tr>';
$row_number++;
}
echo '
</tbody>
</table>';
}
}
/**
* Header of the print page!
*/
function template_print_above()
{
global $context, $settings, $modSettings;
echo '<!DOCTYPE html>
<html', $context['right_to_left'] ? ' dir="rtl"' : '', '>
<head>
<meta charset="', $context['character_set'], '">
<title>', $context['page_title'], '</title>
<link rel="stylesheet" href="', $settings['default_theme_url'], '/css/report.css', $context['browser_cache'], '">
</head>
<body>';
}
/**
* The main print page
*/
function template_print()
{
global $context;
// Go through each table!
foreach ($context['tables'] as $table)
{
echo '
<div style="overflow: visible;', $table['max_width'] != 'auto' ? ' width: ' . $table['max_width'] . 'px;' : '', '">
<table class="bordercolor">';
if (!empty($table['title']))
echo '
<tr class="title_bar">
<td colspan="', $table['column_count'], '">
', $table['title'], '
</td>
</tr>';
// Now do each row!
$row_number = 0;
foreach ($table['data'] as $row)
{
if ($row_number == 0 && !empty($table['shading']['top']))
echo '
<tr class="titlebg">';
else
echo '
<tr class="windowbg">';
// Now do each column!!
$column_number = 0;
foreach ($row as $data)
{
// If this is a special separator, skip over!
if (!empty($data['separator']) && $column_number == 0)
{
echo '
<td colspan="', $table['column_count'], '" class="smalltext">
<strong>', $data['v'], ':</strong>
</td>';
break;
}
// Shaded?
if ($column_number == 0 && !empty($table['shading']['left']))
echo '
<td class="titlebg ', $table['align']['shaded'], 'text"', $table['width']['shaded'] != 'auto' ? ' width="' . $table['width']['shaded'] . '"' : '', '>
', $data['v'] == $table['default_value'] ? '' : ($data['v'] . (empty($data['v']) ? '' : ':')), '
</td>';
else
echo '
<td class="centertext" ', $table['width']['normal'] != 'auto' ? ' width="' . $table['width']['normal'] . '"' : '', !empty($data['style']) ? ' style="' . $data['style'] . '"' : '', '>
', $data['v'], '
</td>';
$column_number++;
}
echo '
</tr>';
$row_number++;
}
echo '
</table>
</div>
<br>';
}
}
/**
* Footer of the print page.
*/
function template_print_below()
{
echo '
<div class="copyright">', theme_copyright(), '</div>
</body>
</html>';
}
?>

474
Search.template.php Normal file
View file

@ -0,0 +1,474 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* The main search form
*/
function template_main()
{
global $context, $txt, $scripturl, $modSettings;
echo '
<div class="khbiseau_topright_color"></div>
<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" name="searchform" id="searchform">';
if (!empty($context['search_errors']))
echo '
<div class="errorbox">
', implode('<br>', $context['search_errors']['messages']), '
</div>';
if (!empty($context['search_ignored']))
echo '
<div class="noticebox">
', $txt['search_warning_ignored_word' . (count($context['search_ignored']) == 1 ? '' : 's')], ': ', implode(', ', $context['search_ignored']), '
</div>';
echo '
<div class="cat_bar">
<h2 class="catbg">
<span class="main_icons filter"></span>', $txt['set_parameters'], '
</h2>
</div>
<div id="advanced_search" class="roundframe">
<dl class="settings" id="search_options">
<dt>
<strong><label for="searchfor">', $txt['search_for'], ':</label></strong>
</dt>
<dd>
<input type="search" name="search" id="searchfor" ', !empty($context['search_params']['search']) ? ' value="' . $context['search_params']['search'] . '"' : '', ' maxlength="', $context['search_string_limit'], '" size="40">';
if (empty($modSettings['search_simple_fulltext']))
echo '
<br><em class="smalltext">', $txt['search_example'], '</em>';
echo '
</dd>
<dt>
<label for="searchtype">', $txt['search_match'], ':</label>
</dt>
<dd>
<select name="searchtype" id="searchtype">
<option value="1"', empty($context['search_params']['searchtype']) ? ' selected' : '', '>', $txt['all_words'], '</option>
<option value="2"', !empty($context['search_params']['searchtype']) ? ' selected' : '', '>', $txt['any_words'], '</option>
</select>
</dd>
<dt>
<label for="userspec">', $txt['by_user'], ':</label>
</dt>
<dd>
<input id="userspec" type="text" name="userspec" value="', empty($context['search_params']['userspec']) ? '*' : $context['search_params']['userspec'], '" size="40">
</dd>
<dt>
<label for="sort">', $txt['search_order'], ':</label>
</dt>
<dd>
<select id="sort" name="sort">
<option value="relevance|desc">', $txt['search_orderby_relevant_first'], '</option>
<option value="num_replies|desc">', $txt['search_orderby_large_first'], '</option>
<option value="num_replies|asc">', $txt['search_orderby_small_first'], '</option>
<option value="id_msg|desc">', $txt['search_orderby_recent_first'], '</option>
<option value="id_msg|asc">', $txt['search_orderby_old_first'], '</option>
</select>
</dd>
<dt class="righttext options">',
$txt['search_options'], ':
</dt>
<dd class="options">
<ul>
<li>
<input type="checkbox" name="show_complete" id="show_complete" value="1"', !empty($context['search_params']['show_complete']) ? ' checked' : '', '>
<label for="show_complete">', $txt['search_show_complete_messages'], '</label>
</li>
<li>
<input type="checkbox" name="subject_only" id="subject_only" value="1"', !empty($context['search_params']['subject_only']) ? ' checked' : '', '>
<label for="subject_only">', $txt['search_subject_only'], '</label>
</li>
</ul>
</dd>
<dt class="between">',
$txt['search_post_age'], ':
</dt>
<dd>
<label for="minage">', $txt['search_between'], ' </label>
<input type="number" name="minage" id="minage" value="', empty($context['search_params']['minage']) ? '0' : $context['search_params']['minage'], '" size="5" maxlength="4">
<label for="maxage"> ', $txt['search_and'], ' </label>
<input type="number" name="maxage" id="maxage" value="', empty($context['search_params']['maxage']) ? '9999' : $context['search_params']['maxage'], '" size="5" maxlength="4"> ', $txt['days_word'], '
</dd>
</dl>
<script>
createEventListener(window);
window.addEventListener("load", initSearch, false);
</script>
<input type="hidden" name="advanced" value="1">';
// Require an image to be typed to save spamming?
if ($context['require_verification'])
echo '
<p>
<strong>', $txt['verification'], ':</strong>
', template_control_verification($context['visual_verification_id'], 'all'), '
</p>';
// If $context['search_params']['topic'] is set, that means we're searching just one topic.
if (!empty($context['search_params']['topic']))
echo '
<p>
', $txt['search_specific_topic'], ' &quot;', $context['search_topic']['link'], '&quot;.
</p>
<input type="hidden" name="topic" value="', $context['search_topic']['id'], '">
<input type="submit" name="b_search" value="', $txt['search'], '" class="button">';
echo '
</div>';
if (empty($context['search_params']['topic']))
{
echo '
<fieldset class="flow_hidden searchfielset">
<div class="roundframe alt">
<div class="title_bar">
<h3 class="titlebg">
<span id="advanced_panel_toggle" class="toggle_down floatright" style="display: none;"></span>
<a href="#" id="advanced_panel_link">', $txt['choose_board'], '</a>
</h3>
</div>
<div class="flow_auto boardslist" id="advanced_panel_div"', $context['boards_check_all'] ? ' style="display: none;"' : '', '>
<ul>';
foreach ($context['categories'] as $category)
{
echo '
<li>
<a href="javascript:void(0);" onclick="selectBoards([', implode(', ', $category['child_ids']), '], \'searchform\'); return false;">', $category['name'], '</a>
<ul>';
$cat_boards = array_values($category['boards']);
foreach ($cat_boards as $key => $board)
{
echo '
<li>
<label for="brd', $board['id'], '">
<input type="checkbox" id="brd', $board['id'], '" name="brd[', $board['id'], ']" value="', $board['id'], '"', $board['selected'] ? ' checked' : '', '>
', $board['name'], '
</label>';
// Nest child boards inside another list.
$curr_child_level = $board['child_level'];
$next_child_level = $cat_boards[$key + 1]['child_level'] ?? 0;
if ($next_child_level > $curr_child_level)
{
echo '
<ul style="margin-', $context['right_to_left'] ? 'right' : 'left', ': 2.5ch;">';
}
else
{
// Close child board lists until we reach a common level
// with the next board.
while ($next_child_level < $curr_child_level--)
{
echo '
</li>
</ul>';
}
echo '
</li>';
}
}
echo '
</ul>
</li>';
}
echo '
</ul>
</div><!-- #advanced_panel_div -->
<br class="clear">
<div class="padding">
<input type="checkbox" name="all" id="check_all" value=""', $context['boards_check_all'] ? ' checked' : '', ' onclick="invertAll(this, this.form, \'brd\');">
<label for="check_all"><em>', $txt['check_all'], '</em></label>
<input type="submit" name="b_search" value="', $txt['search'], '" class="button floatright">
</div>
</div><!-- .roundframe -->
</fieldset>';
echo '
<script>
var oAdvancedPanelToggle = new smc_Toggle({
bToggleEnabled: true,
bCurrentlyCollapsed: ', $context['boards_check_all'] ? 'true' : 'false', ',
aSwappableContainers: [
\'advanced_panel_div\'
],
aSwapImages: [
{
sId: \'advanced_panel_toggle\',
altExpanded: ', JavaScriptEscape($txt['hide']), ',
altCollapsed: ', JavaScriptEscape($txt['show']), '
}
],
aSwapLinks: [
{
sId: \'advanced_panel_link\',
msgExpanded: ', JavaScriptEscape($txt['choose_board']), ',
msgCollapsed: ', JavaScriptEscape($txt['choose_board']), '
}
]
});
</script>';
}
echo '
</form>
<script>
var oAddMemberSuggest = new smc_AutoSuggest({
sSelf: \'oAddMemberSuggest\',
sSessionId: smf_session_id,
sSessionVar: smf_session_var,
sControlId: \'userspec\',
sSearchType: \'member\',
bItemList: false
});
</script>';
}
/**
* The search results page.
*/
function template_results()
{
global $context, $options, $txt, $scripturl, $message;
if (isset($context['did_you_mean']) || empty($context['topics']) || !empty($context['search_ignored']))
{
echo '
<div id="search_results">
<div class="cat_bar">
<h2 class="catbg">
', $txt['search_adjust_query'], '
</h2>
</div>
<div class="roundframe">';
// Did they make any typos or mistakes, perhaps?
if (isset($context['did_you_mean']))
echo '
<p>
', $txt['search_did_you_mean'], ' <a href="', $scripturl, '?action=search2;params=', $context['did_you_mean_params'], '">', $context['did_you_mean'], '</a>.
</p>';
if (!empty($context['search_ignored']))
echo '
<p>
', $txt['search_warning_ignored_word' . (count($context['search_ignored']) == 1 ? '' : 's')], ': ', implode(', ', $context['search_ignored']), '
</p>';
echo '
<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
<strong>', $txt['search_for'], ':</strong>
<input type="text" name="search"', !empty($context['search_params']['search']) ? ' value="' . $context['search_params']['search'] . '"' : '', ' maxlength="', $context['search_string_limit'], '" size="40">
<input type="submit" name="edit_search" value="', $txt['search_adjust_submit'], '" class="button">
<input type="hidden" name="searchtype" value="', !empty($context['search_params']['searchtype']) ? $context['search_params']['searchtype'] : 0, '">
<input type="hidden" name="userspec" value="', !empty($context['search_params']['userspec']) ? $context['search_params']['userspec'] : '', '">
<input type="hidden" name="show_complete" value="', !empty($context['search_params']['show_complete']) ? 1 : 0, '">
<input type="hidden" name="subject_only" value="', !empty($context['search_params']['subject_only']) ? 1 : 0, '">
<input type="hidden" name="minage" value="', !empty($context['search_params']['minage']) ? $context['search_params']['minage'] : '0', '">
<input type="hidden" name="maxage" value="', !empty($context['search_params']['maxage']) ? $context['search_params']['maxage'] : '9999', '">
<input type="hidden" name="sort" value="', !empty($context['search_params']['sort']) ? $context['search_params']['sort'] : 'relevance', '">';
if (!empty($context['search_params']['brd']))
foreach ($context['search_params']['brd'] as $board_id)
echo '
<input type="hidden" name="brd[', $board_id, ']" value="', $board_id, '">';
echo '
</form>
</div><!-- .roundframe -->
</div><!-- #search_results -->';
}
if ($context['compact'])
{
echo '
<form id="new_search" name="new_search" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
<input type="hidden" name="search"', !empty($context['search_params']['search']) ? ' value="' . $context['search_params']['search'] . '"' : '', ' maxlength="', $context['search_string_limit'], '" size="40">
<input type="hidden" name="searchtype" value="', !empty($context['search_params']['searchtype']) ? $context['search_params']['searchtype'] : 0, '">
<input type="hidden" name="userspec" value="', !empty($context['search_params']['userspec']) ? $context['search_params']['userspec'] : '', '">
<input type="hidden" name="show_complete" value="', !empty($context['search_params']['show_complete']) ? 1 : 0, '">
<input type="hidden" name="subject_only" value="', !empty($context['search_params']['subject_only']) ? 1 : 0, '">
<input type="hidden" name="minage" value="', !empty($context['search_params']['minage']) ? $context['search_params']['minage'] : '0', '">
<input type="hidden" name="maxage" value="', !empty($context['search_params']['maxage']) ? $context['search_params']['maxage'] : '9999', '">';
if (!empty($context['search_params']['brd']))
foreach ($context['search_params']['brd'] as $board_id)
echo '
<input type="hidden" name="brd[', $board_id, ']" value="', $board_id, '">';
echo '
</form>';
echo '
<div id="display_head" class="information">
<h2 class="display_title">
<span>', $txt['mlist_search_results'], ': ', $context['search_params']['search'], '</span>
</h2>
<div class="floatleft">
<a class="button" href="', $scripturl, '?action=search;params=' . $context['params'], '">', $txt['search_adjust_query'], '</a>
</div>';
// Was anything even found?
if (!empty($context['topics']))
{
echo '
<div class="floatright">
<span class="padding">', $txt['search_order'], '</span>
<select name="sort" class="floatright" form="new_search" onchange="document.forms.new_search.submit()">
<option value="relevance|desc">', $txt['search_orderby_relevant_first'], '</option>
<option value="num_replies|desc"', $context['current_sorting'] == 'num_replies|desc' ? ' selected' : '', '>', $txt['search_orderby_large_first'], '</option>
<option value="num_replies|asc"', $context['current_sorting'] == 'num_replies|asc' ? ' selected' : '', '>', $txt['search_orderby_small_first'], '</option>
<option value="id_msg|desc"', $context['current_sorting'] == 'id_msg|desc' ? ' selected' : '', '>', $txt['search_orderby_recent_first'], '</option>
<option value="id_msg|asc"', $context['current_sorting'] == 'id_msg|asc' ? ' selected' : '', '>', $txt['search_orderby_old_first'], '</option>
</select>
</div>
</div>
<div class="pagesection">
<div class="pagelinks">', $context['page_index'], '</div>
</div>';
}
else
{
echo '
</div>
<div class="roundframe noup">', $txt['search_no_results'], '</div>';
}
// While we have results to show ...
while ($topic = $context['get_topics']())
{
echo '
<div class="', $topic['css_class'], '">';
foreach ($topic['matches'] as $message)
{
echo '
<div class="block">
<div class="page_number floatright"> #', $message['counter'], '</div>
<div class="half_content">
<div class="topic_details">
<h5>', $topic['board']['link'], ' / <a href="', $scripturl, '?topic=', $topic['id'], '.msg', $message['id'], '#msg', $message['id'], '">', $message['subject_highlighted'], '</a></h5>
<span class="smalltext">', sprintf(str_replace('<br>', ' ', $txt['last_post_topic']), $message['time'], '<strong>' . $message['member']['link'] . '</strong>'), '</span>
</div>
</div>
</div><!-- .block -->';
if ($message['body_highlighted'] != '')
echo '
<div class="list_posts word_break">', $message['body_highlighted'], '</div>';
}
echo '
</div><!-- $topic[css_class] -->';
}
}
else
{
echo '
<div id="display_head" class="information">
<h2 class="display_title">
<span>', $txt['mlist_search_results'], ': ', $context['search_params']['search'], '</span>
</h2>
<div class="floatleft">
<a class="button" href="', $scripturl, '?action=search;params=' . $context['params'], '">', $txt['search_adjust_query'], '</a>
</div>';
// Was anything even found?
if (!empty($context['topics']))
{
echo '
<div class="floatright">
<span class="padding">', $txt['search_order'], '</span>
<select name="sort" class="floatright" form="new_search" onchange="document.forms.new_search.submit()">
<option value="relevance|desc">', $txt['search_orderby_relevant_first'], '</option>
<option value="num_replies|desc"', $context['current_sorting'] == 'num_replies|desc' ? ' selected' : '', '>', $txt['search_orderby_large_first'], '</option>
<option value="num_replies|asc"', $context['current_sorting'] == 'num_replies|asc' ? ' selected' : '', '>', $txt['search_orderby_small_first'], '</option>
<option value="id_msg|desc"', $context['current_sorting'] == 'id_msg|desc' ? ' selected' : '', '>', $txt['search_orderby_recent_first'], '</option>
<option value="id_msg|asc"', $context['current_sorting'] == 'id_msg|asc' ? ' selected' : '', '>', $txt['search_orderby_old_first'], '</option>
</select>
</div>
</div>
<div class="pagesection">
<div class="pagelinks">', $context['page_index'], '</div>
</div>';
}
else
{
echo '
</div>
<div class="roundframe noup">', $txt['search_no_results'], '</div>';
}
while ($topic = $context['get_topics']())
{
foreach ($topic['matches'] as $message)
{
echo '
<div class="', $topic['css_class'], '">
<div class="page_number floatright"> #', $message['counter'], '</div>
<div class="topic_details">
<h5>
', $topic['board']['link'], ' / <a href="', $scripturl, '?topic=', $topic['id'], '.', $message['start'], ';topicseen#msg', $message['id'], '">', $message['subject_highlighted'], '</a>
</h5>
<span class="smalltext">', sprintf(str_replace('<br>', ' ', $txt['last_post_topic']), $message['time'], '<strong>' . $message['member']['link'] . '</strong>'), '</span>
</div>
<div class="list_posts">', $message['body_highlighted'], '</div>';
echo '
<br class="clear">
</div><!-- $topic[css_class] -->';
}
}
}
echo '
<div class="pagesection">';
if (!empty($context['topics']))
echo '
<div class="pagelinks">', $context['page_index'], '</div>';
// Show a jump to box for easy navigation.
echo '
<div class="smalltext pagelinks floatright" id="search_jump_to"></div>
<script>
if (typeof(window.XMLHttpRequest) != "undefined")
aJumpTo[aJumpTo.length] = new JumpTo({
sContainerId: "search_jump_to",
sJumpToTemplate: "<label class=\"smalltext jump_to\" for=\"%select_id%\">', $context['jump_to']['label'], '<" + "/label> %dropdown_list%",
iCurBoardId: 0,
iCurBoardChildLevel: 0,
sCurBoardName: "', $context['jump_to']['board_name'], '",
sBoardChildLevelIndicator: "==",
sBoardPrefix: "=> ",
sCatSeparator: "-----------------------------",
sCatPrefix: "",
sGoButtonLabel: "', $txt['quick_mod_go'], '"
});
</script>
</div>';
}
?>

240
Settings.template.php Normal file
View file

@ -0,0 +1,240 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* This pseudo-template defines all the theme options
*/
function template_options()
{
global $context, $txt, $modSettings;
$context['theme_options'] = array(
$txt['theme_opt_display'],
array(
'id' => 'show_children',
'label' => $txt['show_children'],
'default' => true,
),
array(
'id' => 'topics_per_page',
'label' => $txt['topics_per_page'],
'options' => array(
0 => $txt['per_page_default'],
5 => 5,
10 => 10,
25 => 25,
50 => 50,
),
'default' => true,
'enabled' => empty($modSettings['disableCustomPerPage']),
),
array(
'id' => 'messages_per_page',
'label' => $txt['messages_per_page'],
'options' => array(
0 => $txt['per_page_default'],
5 => 5,
10 => 10,
25 => 25,
50 => 50,
),
'default' => true,
'enabled' => empty($modSettings['disableCustomPerPage']),
),
array(
'id' => 'view_newest_first',
'label' => $txt['recent_posts_at_top'],
'default' => true,
),
array(
'id' => 'show_no_avatars',
'label' => $txt['show_no_avatars'],
'default' => true,
),
array(
'id' => 'show_no_signatures',
'label' => $txt['show_no_signatures'],
'default' => true,
),
array(
'id' => 'posts_apply_ignore_list',
'label' => $txt['posts_apply_ignore_list'],
'default' => false,
'enabled' => !empty($modSettings['enable_buddylist'])
),
$txt['theme_opt_posting'],
array(
'id' => 'return_to_post',
'label' => $txt['return_to_post'],
'default' => true,
),
array(
'id' => 'no_new_reply_warning',
'label' => $txt['no_new_reply_warning'],
'default' => true,
),
array(
'id' => 'auto_notify',
'label' => $txt['auto_notify'],
'default' => true,
),
array(
'id' => 'wysiwyg_default',
'label' => $txt['wysiwyg_default'],
'default' => false,
'enabled' => empty($modSettings['disable_wysiwyg']),
),
array(
'id' => 'drafts_autosave_enabled',
'label' => $txt['drafts_autosave_enabled'],
'default' => true,
'enabled' => !empty($modSettings['drafts_autosave_enabled']) && (!empty($modSettings['drafts_post_enabled']) || !empty($modSettings['drafts_pm_enabled'])),
),
array(
'id' => 'drafts_show_saved_enabled',
'label' => $txt['drafts_show_saved_enabled'],
'default' => true,
'enabled' => !empty($modSettings['drafts_show_saved_enabled']) && (!empty($modSettings['drafts_post_enabled']) || !empty($modSettings['drafts_pm_enabled'])),
),
$txt['theme_opt_moderation'],
array(
'id' => 'display_quick_mod',
'label' => $txt['display_quick_mod'],
'options' => array(
0 => $txt['display_quick_mod_none'],
1 => $txt['display_quick_mod_check'],
2 => $txt['display_quick_mod_image'],
),
'default' => true,
),
$txt['theme_opt_personal_messages'],
array(
'id' => 'popup_messages',
'label' => $txt['popup_messages'],
'default' => true,
),
array(
'id' => 'view_newest_pm_first',
'label' => $txt['recent_pms_at_top'],
'default' => true,
),
array(
'id' => 'pm_remove_inbox_label',
'label' => $txt['pm_remove_inbox_label'],
'default' => true,
),
$txt['theme_opt_calendar'],
array(
'id' => 'calendar_default_view',
'label' => $txt['calendar_default_view'],
'options' => array(
'viewlist' => $txt['calendar_viewlist'],
'viewmonth' => $txt['calendar_viewmonth'],
'viewweek' => $txt['calendar_viewweek']
),
'default' => true,
'enabled' => !empty($modSettings['cal_enabled']),
),
array(
'id' => 'calendar_start_day',
'label' => $txt['calendar_start_day'],
'options' => array(
0 => $txt['days'][0],
1 => $txt['days'][1],
6 => $txt['days'][6],
),
'default' => true,
'enabled' => !empty($modSettings['cal_enabled']),
),
);
}
/**
* This pseudo-template defines all the available theme settings (but not their actual values)
*/
function template_settings()
{
global $context, $txt;
$context['theme_settings'] = array(
array(
'id' => 'header_logo_url',
'label' => $txt['header_logo_url'],
'description' => $txt['header_logo_url_desc'],
'type' => 'text',
),
array(
'id' => 'site_slogan',
'label' => $txt['site_slogan'],
'description' => $txt['site_slogan_desc'],
'type' => 'text',
),
array(
'id' => 'og_image',
'label' => $txt['og_image'],
'description' => $txt['og_image_desc'],
'type' => 'url',
),
'',
array(
'id' => 'smiley_sets_default',
'label' => $txt['smileys_default_set_for_theme'],
'options' => $context['smiley_sets'],
'type' => 'text',
),
'',
array(
'id' => 'enable_news',
'label' => $txt['enable_random_news'],
),
array(
'id' => 'show_newsfader',
'label' => $txt['news_fader'],
),
array(
'id' => 'newsfader_time',
'label' => $txt['admin_fader_delay'],
'type' => 'number',
),
'',
array(
'id' => 'number_recent_posts',
'label' => $txt['number_recent_posts'],
'description' => $txt['zero_to_disable'],
'type' => 'number',
),
array(
'id' => 'show_stats_index',
'label' => $txt['show_stats_index'],
),
array(
'id' => 'show_latest_member',
'label' => $txt['latest_members'],
),
array(
'id' => 'show_group_key',
'label' => $txt['show_group_key'],
),
array(
'id' => 'display_who_viewing',
'label' => $txt['who_display_viewing'],
'options' => array(
0 => $txt['who_display_viewing_off'],
1 => $txt['who_display_viewing_numbers'],
2 => $txt['who_display_viewing_names'],
),
'type' => 'list',
),
);
}
?>

221
SplitTopics.template.php Normal file
View file

@ -0,0 +1,221 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* The form that asks how you want to split things
*/
function template_ask()
{
global $context, $txt, $scripturl;
echo '
<div id="split_topics">
<form action="', $scripturl, '?action=splittopics;sa=execute;topic=', $context['current_topic'], '.0" method="post" accept-charset="', $context['character_set'], '">
<input type="hidden" name="at" value="', $context['message']['id'], '">
<div class="cat_bar">
<h2 class="catbg">', $txt['split'], '</h2>
</div>
<div class="windowbg">
<p class="split_topics">
<strong><label for="subname">', $txt['subject_new_topic'], '</label>:</strong>
<input type="text" name="subname" id="subname" value="', $context['message']['subject'], '" size="25">
</p>
<ul class="split_topics">
<li>
<input type="radio" id="onlythis" name="step2" value="onlythis" checked> <label for="onlythis">', $txt['split_this_post'], '</label>
</li>
<li>
<input type="radio" id="afterthis" name="step2" value="afterthis"> <label for="afterthis">', $txt['split_after_and_this_post'], '</label>
</li>
<li>
<input type="radio" id="selective" name="step2" value="selective"> <label for="selective">', $txt['select_split_posts'], '</label>
</li>
</ul>
<hr>
<div class="auto_flow">
<input type="submit" value="', $txt['split'], '" class="button">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
</div>
</div><!-- .windowbg -->
</form>
</div><!-- #split_topics -->';
}
/**
* A simple confirmation that things were split as expected, with links to the current board and the old and new topics.
*/
function template_main()
{
global $context, $txt, $scripturl;
echo '
<div id="split_topics">
<div class="cat_bar">
<h2 class="catbg">', $txt['split'], '</h2>
</div>
<div class="windowbg">
<p>', $txt['split_successful'], '</p>
<ul>
<li>
<a href="', $scripturl, '?board=', $context['current_board'], '.0">', $txt['message_index'], '</a>
</li>
<li>
<a href="', $scripturl, '?topic=', $context['old_topic'], '.0">', $txt['origin_topic'], '</a>
</li>
<li>
<a href="', $scripturl, '?topic=', $context['new_topic'], '.0">', $txt['new_topic'], '</a>
</li>
</ul>
</div><!-- .windowbg -->
</div><!-- #split_topics -->';
}
/**
* The form for selecting which posts to split.
*/
function template_select()
{
global $context, $txt, $scripturl, $options;
echo '
<div id="split_topics">
<form action="', $scripturl, '?action=splittopics;sa=splitSelection;board=', $context['current_board'], '.0" method="post" accept-charset="', $context['character_set'], '">
<div id="not_selected" class="floatleft">
<div class="cat_bar">
<h2 class="catbg">', $txt['split'], ' - ', $txt['select_split_posts'], '</h2>
</div>
<div class="information">
', $txt['please_select_split'], '
</div>
<div class="pagesection">
<div id="pageindex_not_selected" class="pagelinks">', $context['not_selected']['page_index'], '</div>
</div>
<ul id="messages_not_selected" class="split_messages smalltext">';
foreach ($context['not_selected']['messages'] as $message)
echo '
<li class="windowbg" id="not_selected_', $message['id'], '">
<div class="message_header">
<a class="split_icon floatright" href="', $scripturl, '?action=splittopics;sa=selectTopics;subname=', $context['topic']['subject'], ';topic=', $context['topic']['id'], '.', $context['not_selected']['start'], ';start2=', $context['selected']['start'], ';move=down;msg=', $message['id'], '" onclick="return select(\'down\', ', $message['id'], ');"><span class="main_icons split_sel" title="-&gt;"></span></a>
', sprintf($txt['post_by_member'], $message['subject'], $message['poster']), '
<em>', $message['time'], '</em>
</div>
<div class="post">', $message['body'], '</div>
</li>';
echo '
</ul>
</div><!-- #not_selected -->
<div id="selected" class="floatright">
<div class="cat_bar">
<h2 class="catbg">
', $txt['split_selected_posts'], ' (<a href="', $scripturl, '?action=splittopics;sa=selectTopics;subname=', $context['topic']['subject'], ';topic=', $context['topic']['id'], '.', $context['not_selected']['start'], ';start2=', $context['selected']['start'], ';move=reset;msg=0" onclick="return select(\'reset\', 0);">', $txt['split_reset_selection'], '</a>)
</h2>
</div>
<div class="information">
', $txt['split_selected_posts_desc'], '
</div>
<div class="pagesection">
<div id="pageindex_selected" class="pagelinks">', $context['selected']['page_index'], '</div>
</div>
<ul id="messages_selected" class="split_messages smalltext">';
if (!empty($context['selected']['messages']))
foreach ($context['selected']['messages'] as $message)
echo '
<li class="windowbg" id="selected_', $message['id'], '">
<div class="message_header">
<a class="split_icon floatleft" href="', $scripturl, '?action=splittopics;sa=selectTopics;subname=', $context['topic']['subject'], ';topic=', $context['topic']['id'], '.', $context['not_selected']['start'], ';start2=', $context['selected']['start'], ';move=up;msg=', $message['id'], '" onclick="return select(\'up\', ', $message['id'], ');"><span class="main_icons split_desel" title="&lt;-"></span></a>
', sprintf($txt['post_by_member'], $message['subject'], $message['poster']), '
<em>', $message['time'], '</em>
</div>
<div class="post">', $message['body'], '</div>
</li>';
echo '
</ul>
</div><!-- #selected -->
<br class="clear">
<div class="flow_auto">
<input type="hidden" name="topic" value="', $context['current_topic'], '">
<input type="hidden" name="subname" value="', $context['new_subject'], '">
<input type="submit" value="', $txt['split'], '" class="button">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
</div>
</form>
</div><!-- #split_topics -->
<script>
var start = new Array();
start[0] = ', $context['not_selected']['start'], ';
start[1] = ', $context['selected']['start'], ';
function select(direction, msg_id)
{
getXMLDocument(smf_prepareScriptUrl(smf_scripturl) + "action=splittopics;sa=selectTopics;subname=', $context['topic']['subject'], ';topic=', $context['topic']['id'], '." + start[0] + ";start2=" + start[1] + ";move=" + direction + ";msg=" + msg_id + ";xml;splitjs", onDocReceived);
return false;
}
function onDocReceived(XMLDoc)
{
var i, j, pageIndex;
for (i = 0; i < 2; i++)
{
pageIndex = XMLDoc.getElementsByTagName("pageIndex")[i];
setInnerHTML(document.getElementById("pageindex_" + pageIndex.getAttribute("section")), pageIndex.firstChild.nodeValue);
start[i] = pageIndex.getAttribute("startFrom");
}
var numChanges = XMLDoc.getElementsByTagName("change").length;
var curChange, curSection, curAction, curId, curList, curData, newItem, sInsertBeforeId;
for (i = 0; i < numChanges; i++)
{
curChange = XMLDoc.getElementsByTagName("change")[i];
curSection = curChange.getAttribute("section");
curAction = curChange.getAttribute("curAction");
curId = curChange.getAttribute("id");
curList = document.getElementById("messages_" + curSection);
if (curAction == "remove")
curList.removeChild(document.getElementById(curSection + "_" + curId));
// Insert a message.
else
{
// By default, insert the element at the end of the list.
sInsertBeforeId = null;
// Loop through the list to try and find an item to insert after.
oListItems = curList.getElementsByTagName("LI");
for (j = 0; j < oListItems.length; j++)
{
if (parseInt(oListItems[j].id.substr(curSection.length + 1)) ' . (empty($options['view_newest_first']) ? '>' : '<') . ' curId)
{
// This would be a nice place to insert the row.
sInsertBeforeId = oListItems[j].id;
// We\'re done for now. Escape the loop.
j = oListItems.length + 1;
}
}
// Let\'s create a nice container for the message.
newItem = document.createElement("LI");
newItem.className = "windowbg";
newItem.id = curSection + "_" + curId;
newItem.innerHTML = "<div class=\\"message_header\\"><a class=\\"split_icon float" + (curSection == "selected" ? "left" : "right") + "\\" href=\\"" + smf_prepareScriptUrl(smf_scripturl) + "action=splittopics;sa=selectTopics;subname=', $context['topic']['subject'], ';topic=', $context['topic']['id'], '.', $context['not_selected']['start'], ';start2=', $context['selected']['start'], ';move=" + (curSection == "selected" ? "up" : "down") + ";msg=" + curId + "\\" onclick=\\"return select(\'" + (curSection == "selected" ? "up" : "down") + "\', " + curId + ");\\"><span class=\\"main_icons split_" + (curSection == "selected" ? "de" : "") + "sel\\" title=\\"" + (curSection == "selected" ? "&lt;-" : "-&gt;") + "\\"></span></a><strong>" + curChange.getElementsByTagName("subject")[0].firstChild.nodeValue + "</strong> ', $txt['by'], ' <strong>" + curChange.getElementsByTagName("poster")[0].firstChild.nodeValue + "</strong><br><em>" + curChange.getElementsByTagName("time")[0].firstChild.nodeValue + "</em></div><div class=\\"post\\">" + curChange.getElementsByTagName("body")[0].firstChild.nodeValue + "</div>";
// So, where do we insert it?
if (typeof sInsertBeforeId == "string")
curList.insertBefore(newItem, document.getElementById(sInsertBeforeId));
else
curList.appendChild(newItem);
}
}
}
</script>';
}
?>

264
Stats.template.php Normal file
View file

@ -0,0 +1,264 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.0
*/
/**
* The stats page.
*/
function template_main()
{
global $context, $settings, $txt, $scripturl, $modSettings;
echo '
<div id="statistics" class="main_section">
<div class="cat_bar">
<h2 class="catbg">', $context['page_title'], '</h2>
</div>
<div class="roundframe">
<div class="title_bar">
<h4 class="titlebg">
<span class="main_icons general"></span> ', $txt['general_stats'], '
</h4>
</div>
<dl class="stats half_content">
<dt>', $txt['total_members'], ':</dt>
<dd>', $context['show_member_list'] ? '<a href="' . $scripturl . '?action=mlist">' . $context['num_members'] . '</a>' : $context['num_members'], '</dd>
<dt>', $txt['total_posts'], ':</dt>
<dd>', $context['num_posts'], '</dd>
<dt>', $txt['total_topics'], ':</dt>
<dd>', $context['num_topics'], '</dd>
<dt>', $txt['total_cats'], ':</dt>
<dd>', $context['num_categories'], '</dd>
<dt>', $txt['users_online'], ':</dt>
<dd>', $context['users_online'], '</dd>
<dt>', $txt['most_online'], ':</dt>
<dd>', $context['most_members_online']['number'], ' - ', $context['most_members_online']['date'], '</dd>
<dt>', $txt['users_online_today'], ':</dt>
<dd>', $context['online_today'], '</dd>';
if (!empty($modSettings['hitStats']))
echo '
<dt>', $txt['num_hits'], ':</dt>
<dd>', $context['num_hits'], '</dd>';
echo '
</dl>
<dl class="stats half_content">
<dt>', $txt['average_members'], ':</dt>
<dd>', $context['average_members'], '</dd>
<dt>', $txt['average_posts'], ':</dt>
<dd>', $context['average_posts'], '</dd>
<dt>', $txt['average_topics'], ':</dt>
<dd>', $context['average_topics'], '</dd>
<dt>', $txt['total_boards'], ':</dt>
<dd>', $context['num_boards'], '</dd>
<dt>', $txt['latest_member'], ':</dt>
<dd>', $context['common_stats']['latest_member']['link'], '</dd>
<dt>', $txt['average_online'], ':</dt>
<dd>', $context['average_online'], '</dd>';
if (!empty($context['gender']))
{
echo '
<dt>', $txt['gender_stats'], ':</dt>
<dd>';
foreach ($context['gender'] as $g => $n)
echo tokenTxtReplace($g), ': ', $n, '<br>';
echo '
</dd>';
}
if (!empty($modSettings['hitStats']))
echo '
<dt>', $txt['average_hits'], ':</dt>
<dd>', $context['average_hits'], '</dd>';
echo '
</dl>';
foreach ($context['stats_blocks'] as $name => $block)
{
echo '
<div class="half_content">
<div class="title_bar">
<h4 class="titlebg">
<span class="main_icons ', $name, '"></span> ', $txt['top_' . $name], '
</h4>
</div>
<dl class="stats">';
foreach ($block as $item)
{
echo '
<dt>
', $item['link'], '
</dt>
<dd class="statsbar generic_bar righttext">';
if (!empty($item['percent']))
echo '
<div class="bar" style="width: ', $item['percent'], '%;"></div>';
else
echo '
<div class="bar empty"></div>';
echo '
<span>', $item['num'], '</span>
</dd>';
}
echo '
</dl>
</div><!-- .half_content -->';
}
echo '
</div><!-- .roundframe -->
<br class="clear">
<div class="cat_bar">
<h2 class="catbg">
<span class="main_icons history"></span>', $txt['forum_history'], '
</h2>
</div>';
if (!empty($context['yearly']))
{
echo '
<table id="stats" class="table_grid">
<thead>
<tr class="title_bar">
<th class="lefttext">', $txt['yearly_summary'], '</th>
<th>', $txt['stats_new_topics'], '</th>
<th>', $txt['stats_new_posts'], '</th>
<th>', $txt['stats_new_members'], '</th>
<th>', $txt['most_online'], '</th>';
if (!empty($modSettings['hitStats']))
echo '
<th>', $txt['page_views'], '</th>';
echo '
</tr>
</thead>
<tbody>';
foreach ($context['yearly'] as $id => $year)
{
echo '
<tr class="windowbg" id="year_', $id, '">
<th class="lefttext">
<img id="year_img_', $id, '" src="', $settings['images_url'], '/selected_open.png" alt="*"> <a href="#year_', $id, '" id="year_link_', $id, '">', $year['year'], '</a>
</th>
<th>', $year['new_topics'], '</th>
<th>', $year['new_posts'], '</th>
<th>', $year['new_members'], '</th>
<th>', $year['most_members_online'], '</th>';
if (!empty($modSettings['hitStats']))
echo '
<th>', $year['hits'], '</th>';
echo '
</tr>';
foreach ($year['months'] as $month)
{
echo '
<tr class="windowbg" id="tr_month_', $month['id'], '">
<th class="stats_month">
<img src="', $settings['images_url'], '/', $month['expanded'] ? 'selected_open.png' : 'selected.png', '" alt="" id="img_', $month['id'], '"> <a id="m', $month['id'], '" href="', $month['href'], '" onclick="return doingExpandCollapse;">', $month['month'], ' ', $month['year'], '</a>
</th>
<th>', $month['new_topics'], '</th>
<th>', $month['new_posts'], '</th>
<th>', $month['new_members'], '</th>
<th>', $month['most_members_online'], '</th>';
if (!empty($modSettings['hitStats']))
echo '
<th>', $month['hits'], '</th>';
echo '
</tr>';
if ($month['expanded'])
{
foreach ($month['days'] as $day)
{
echo '
<tr class="windowbg" id="tr_day_', $day['year'], '-', $day['month'], '-', $day['day'], '">
<td class="stats_day">', $day['year'], '-', $day['month'], '-', $day['day'], '</td>
<td>', $day['new_topics'], '</td>
<td>', $day['new_posts'], '</td>
<td>', $day['new_members'], '</td>
<td>', $day['most_members_online'], '</td>';
if (!empty($modSettings['hitStats']))
echo '
<td>', $day['hits'], '</td>';
echo '
</tr>';
}
}
}
}
echo '
</tbody>
</table>
</div><!-- #statistics -->
<script>
var oStatsCenter = new smf_StatsCenter({
sTableId: \'stats\',
reYearPattern: /year_(\d+)/,
sYearImageCollapsed: \'selected.png\',
sYearImageExpanded: \'selected_open.png\',
sYearImageIdPrefix: \'year_img_\',
sYearLinkIdPrefix: \'year_link_\',
reMonthPattern: /tr_month_(\d+)/,
sMonthImageCollapsed: \'selected.png\',
sMonthImageExpanded: \'selected_open.png\',
sMonthImageIdPrefix: \'img_\',
sMonthLinkIdPrefix: \'m\',
reDayPattern: /tr_day_(\d+-\d+-\d+)/,
sDayRowClassname: \'windowbg\',
sDayRowIdPrefix: \'tr_day_\',
aCollapsedYears: [';
foreach ($context['collapsed_years'] as $id => $year)
{
echo '
\'', $year, '\'', $id != count($context['collapsed_years']) - 1 ? ',' : '';
}
echo '
],
aDataCells: [
\'date\',
\'new_topics\',
\'new_posts\',
\'new_members\',
\'most_members_online\'', empty($modSettings['hitStats']) ? '' : ',
\'hits\'', '
]
});
</script>';
}
}
?>

1183
Themes.template.php Normal file

File diff suppressed because it is too large Load diff

258
Who.template.php Normal file
View file

@ -0,0 +1,258 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.3
*/
/**
* This handles the Who's Online page
*/
function template_main()
{
global $context, $settings, $scripturl, $txt;
// Display the table header and linktree.
echo '
<div class="main_section" id="whos_online">
<form action="', $scripturl, '?action=who" method="post" id="whoFilter" accept-charset="', $context['character_set'], '">
<div class="cat_bar">
<h2 class="catbg">', $txt['who_title'], '</h2>
</div>
<div id="mlist">
<div class="pagesection">
<div class="pagelinks floatleft">', $context['page_index'], '</div>
<div class="selectbox floatright" id="upper_show">
', $txt['who_show'], '
<select name="show_top" onchange="document.forms.whoFilter.show.value = this.value; document.forms.whoFilter.submit();">';
foreach ($context['show_methods'] as $value => $label)
echo '
<option value="', $value, '" ', $value == $context['show_by'] ? ' selected' : '', '>', $label, '</option>';
echo '
</select>
<noscript>
<input type="submit" name="submit_top" value="', $txt['go'], '" class="button">
</noscript>
</div>
</div>
<table class="table_grid">
<thead>
<tr class="title_bar">
<th scope="col" class="lefttext" style="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' ? '<span class="main_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>
<th scope="col" class="lefttext time" style="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' ? '<span class="main_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>
<th scope="col" class="lefttext half_table">', $txt['who_action'], '</th>
</tr>
</thead>
<tbody>';
foreach ($context['members'] as $member)
{
echo '
<tr class="windowbg">
<td>';
// Guests can't be messaged.
if (!$member['is_guest'])
echo '
<span class="contact_info floatright">
', $context['can_send_pm'] ? '<a href="' . $member['online']['href'] . '" title="' . $txt['pm_online'] . '">' : '', $settings['use_image_buttons'] ? '<span class="main_icons im_' . ($member['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $txt['pm_online'] . '"></span>' : $member['online']['label'], $context['can_send_pm'] ? '</a>' : '', '
</span>';
echo '
<span class="member', $member['is_hidden'] ? ' hidden' : '', '">
', $member['is_guest'] ? $member['name'] : '<a href="' . $member['href'] . '" title="' . sprintf($txt['view_profile_of_username'], $member['name']) . '"' . (empty($member['color']) ? '' : ' style="color: ' . $member['color'] . ';"') . '>' . $member['name'] . '</a>', '
</span>';
if (!empty($member['ip']))
echo '
(<a href="' . $scripturl . '?action=', ($member['is_guest'] ? 'trackip' : 'profile;area=tracking;sa=ip;u=' . $member['id']), ';searchip=' . $member['ip'] . '">' . str_replace(':', ':&ZeroWidthSpace;', $member['ip']) . '</a>)';
echo '
</td>
<td class="time">', $member['time'], '</td>
<td>';
if (is_array($member['action']))
{
$tag = !empty($member['action']['tag']) ? $member['action']['tag'] : 'span';
echo '
<', $tag, !empty($member['action']['class']) ? ' class="' . $member['action']['class'] . '"' : '', '>
', $txt[$member['action']['label']], (!empty($member['action']['error_message']) ? $member['action']['error_message'] : ''), '
</', $tag, '>';
}
else
echo $member['action'];
echo '
</td>
</tr>';
}
// No members?
if (empty($context['members']))
echo '
<tr class="windowbg">
<td colspan="3">
', $txt['who_no_online_' . ($context['show_by'] == 'guests' || $context['show_by'] == 'spiders' ? $context['show_by'] : 'members')], '
</td>
</tr>';
echo '
</tbody>
</table>
<div class="pagesection" id="lower_pagesection">
<div class="pagelinks floatleft" id="lower_pagelinks">', $context['page_index'], '</div>
<div class="selectbox floatright">
', $txt['who_show'], '
<select name="show" onchange="document.forms.whoFilter.submit();">';
foreach ($context['show_methods'] as $value => $label)
echo '
<option value="', $value, '" ', $value == $context['show_by'] ? ' selected' : '', '>', $label, '</option>';
echo '
</select>
<noscript>
<input type="submit" value="', $txt['go'], '" class="button">
</noscript>
</div>
</div><!-- #lower_pagesection -->
</div><!-- #mlist -->
</form>
</div><!-- #whos_online -->';
}
/**
* This displays a nice credits page
*/
function template_credits()
{
global $context, $txt;
// The most important part - the credits :P.
echo '
<div class="main_section" id="credits">
<div class="cat_bar">
<h2 class="catbg">', $txt['credits'], '</h2>
</div>';
foreach ($context['credits'] as $section)
{
if (isset($section['pretext']))
echo '
<div class="windowbg">
<p>', $section['pretext'], '</p>
</div>';
if (isset($section['title']))
echo '
<div class="cat_bar">
<h2 class="catbg">', $section['title'], '</h2>
</div>';
echo '
<div class="windowbg">
<dl>';
foreach ($section['groups'] as $group)
{
echo '
<dt>
', isset($group['title']) ? '<strong>' . $group['title'] . '</strong>' : '', '
</dt>
<dd>';
$names = sentence_list($group['members']);
echo sprintf($txt['credits_list'], $names);
echo '
</dd>';
}
echo '
</dl>';
if (isset($section['posttext']))
echo '
<p class="posttext">', $section['posttext'], '</p>';
echo '
</div>';
}
// Other software and graphics
if (!empty($context['credits_software_graphics']))
{
echo '
<div class="cat_bar">
<h2 class="catbg">', $txt['credits_software_graphics'], '</h2>
</div>
<div class="windowbg">';
if (!empty($context['credits_software_graphics']['graphics']))
echo '
<dl>
<dt><strong>', $txt['credits_graphics'], '</strong></dt>
<dd>', implode('</dd><dd>', $context['credits_software_graphics']['graphics']), '</dd>
</dl>';
if (!empty($context['credits_software_graphics']['software']))
echo '
<dl>
<dt><strong>', $txt['credits_software'], '</strong></dt>
<dd>', implode('</dd><dd>', $context['credits_software_graphics']['software']), '</dd>
</dl>';
if (!empty($context['credits_software_graphics']['fonts']))
echo '
<dl>
<dt><strong>', $txt['credits_fonts'], '</strong></dt>
<dd>', implode('</dd><dd>', $context['credits_software_graphics']['fonts']), '</dd>
</dl>';
echo '
</div>';
}
// How about Modifications, we all love em
if (!empty($context['credits_modifications']) || !empty($context['copyrights']['mods']))
{
echo '
<div class="cat_bar">
<h2 class="catbg">', $txt['credits_modifications'], '</h2>
</div>
<div class="windowbg">
<ul>';
// Display the credits.
if (!empty($context['credits_modifications']))
echo '
<li>', implode('</li><li>', $context['credits_modifications']), '</li>';
// Legacy.
if (!empty($context['copyrights']['mods']))
echo '
<li>', implode('</li><li>', $context['copyrights']['mods']), '</li>';
echo '
</ul>
</div>';
}
// SMF itself
echo '
<div class="cat_bar">
<h2 class="catbg">', $txt['credits_forum'], ' ', $txt['credits_copyright'], '</h2>
</div>
<div class="windowbg">
', $context['copyrights']['smf'], '
</div>
</div><!-- #credits -->';
}
?>

474
Xml.template.php Normal file
View file

@ -0,0 +1,474 @@
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2022 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1.2
*/
/**
* This defines the XML for sending the body of a message
*/
function template_sendbody()
{
global $context;
echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
<smf>
<message view="', $context['view'], '">', cleanXml($context['message']), '</message>
</smf>';
}
/**
* This defines the XML for the AJAX quote feature
*/
function template_quotefast()
{
global $context;
echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
<smf>
<quote>', cleanXml($context['quote']['xml']), '</quote>
</smf>';
}
/**
* This defines the XML for the inline edit feature
*/
function template_modifyfast()
{
global $context;
echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
<smf>
<subject><![CDATA[', cleanXml($context['message']['subject']), ']]></subject>
<message id="msg_', $context['message']['id'], '"><![CDATA[', cleanXml($context['message']['body']), ']]></message>
<reason time="', $context['message']['reason']['time'], '" name="', $context['message']['reason']['name'], '"><![CDATA[', cleanXml($context['message']['reason']['text']), ']]></reason>
</smf>';
}
/**
* The XML for handling things when you're done editing a post inline
*/
function template_modifydone()
{
global $context, $txt;
echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
<smf>
<message id="msg_', $context['message']['id'], '">';
if (empty($context['message']['errors']))
{
// Build our string of info about when and why it was modified
$modified = empty($context['message']['modified']['time']) ? '' : sprintf($txt['last_edit_by'], $context['message']['modified']['time'], $context['message']['modified']['name']);
$modified .= empty($context['message']['modified']['reason']) ? '' : ' ' . sprintf($txt['last_edit_reason'], $context['message']['modified']['reason']);
echo '
<modified><![CDATA[', empty($modified) ? '' : cleanXml($modified), ']]></modified>
<subject is_first="', $context['message']['first_in_topic'] ? '1' : '0', '"><![CDATA[', cleanXml($context['message']['subject']), ']]></subject>
<body><![CDATA[', $context['message']['body'], ']]></body>
<success><![CDATA[', $txt['quick_modify_message'], ']]></success>';
}
else
echo '
<error in_subject="', $context['message']['error_in_subject'] ? '1' : '0', '" in_body="', cleanXml($context['message']['error_in_body']) ? '1' : '0', '"><![CDATA[', implode('<br />', $context['message']['errors']), ']]></error>';
echo '
</message>
</smf>';
}
/**
* This handles things when editing a topic's subject from the messageindex.
*/
function template_modifytopicdone()
{
global $context, $txt;
echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
<smf>
<message id="msg_', $context['message']['id'], '">';
if (empty($context['message']['errors']))
{
// Build our string of info about when and why it was modified
$modified = empty($context['message']['modified']['time']) ? '' : sprintf($txt['last_edit_by'], $context['message']['modified']['time'], $context['message']['modified']['name']);
$modified .= empty($context['message']['modified']['reason']) ? '' : sprintf($txt['last_edit_reason'], $context['message']['modified']['reason']);
echo '
<modified><![CDATA[', empty($modified) ? '' : cleanXml('<em>' . $modified . '</em>'), ']]></modified>';
if (!empty($context['message']['subject']))
echo '
<subject><![CDATA[', cleanXml($context['message']['subject']), ']]></subject>';
}
else
echo '
<error in_subject="', $context['message']['error_in_subject'] ? '1' : '0', '"><![CDATA[', cleanXml(implode('<br />', $context['message']['errors'])), ']]></error>';
echo '
</message>
</smf>';
}
/**
* The massive XML for previewing posts.
*/
function template_post()
{
global $context;
echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
<smf>
<preview>
<subject><![CDATA[', $context['preview_subject'], ']]></subject>
<body><![CDATA[', $context['preview_message'], ']]></body>
</preview>
<errors serious="', empty($context['error_type']) || $context['error_type'] != 'serious' ? '0' : '1', '" topic_locked="', $context['locked'] ? '1' : '0', '">';
if (!empty($context['post_error']))
foreach ($context['post_error'] as $message)
echo '
<error><![CDATA[', cleanXml($message), ']]></error>';
echo '
<caption name="guestname" class="', isset($context['post_error']['long_name']) || isset($context['post_error']['no_name']) || isset($context['post_error']['bad_name']) ? 'error' : '', '" />
<caption name="email" class="', isset($context['post_error']['no_email']) || isset($context['post_error']['bad_email']) ? 'error' : '', '" />
<caption name="evtitle" class="', isset($context['post_error']['no_event']) ? 'error' : '', '" />
<caption name="subject" class="', isset($context['post_error']['no_subject']) ? 'error' : '', '" />
<caption name="question" class="', isset($context['post_error']['no_question']) ? 'error' : '', '" />', isset($context['post_error']['no_message']) || isset($context['post_error']['long_message']) ? '
<post_error />' : '', '
</errors>
<last_msg>', isset($context['topic_last_message']) ? $context['topic_last_message'] : '0', '</last_msg>';
if (!empty($context['previous_posts']))
{
echo '
<new_posts>';
foreach ($context['previous_posts'] as $post)
echo '
<post id="', $post['id'], '">
<time><![CDATA[', $post['time'], ']]></time>
<poster><![CDATA[', cleanXml($post['poster']), ']]></poster>
<message><![CDATA[', cleanXml($post['message']), ']]></message>
<is_ignored>', $post['is_ignored'] ? '1' : '0', '</is_ignored>
</post>';
echo '
</new_posts>';
}
echo '
</smf>';
}
/**
* All the XML for previewing a PM
*/
function template_pm()
{
global $context, $txt;
// @todo something could be removed...otherwise it can be merged again with template_post
echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
<smf>
<preview>
<subject><![CDATA[', $txt['preview'], ' - ', !empty($context['preview_subject']) ? $context['preview_subject'] : $txt['no_subject'], ']]></subject>
<body><![CDATA[', $context['preview_message'], ']]></body>
</preview>
<errors serious="', empty($context['error_type']) || $context['error_type'] != 'serious' ? '0' : '1', '">';
if (!empty($context['post_error']['messages']))
foreach ($context['post_error']['messages'] as $message)
echo '
<error><![CDATA[', cleanXml($message), ']]></error>';
echo '
<caption name="to" class="', isset($context['post_error']['no_to']) ? 'error' : '', '" />
<caption name="bbc" class="', isset($context['post_error']['no_bbc']) ? 'error' : '', '" />
<caption name="subject" class="', isset($context['post_error']['no_subject']) ? 'error' : '', '" />
<caption name="question" class="', isset($context['post_error']['no_question']) ? 'error' : '', '" />', isset($context['post_error']['no_message']) || isset($context['post_error']['long_message']) ? '
<post_error />' : '', '
</errors>';
echo '
</smf>';
}
/**
* The XML for previewing a warning
*/
function template_warning()
{
global $context;
// @todo something could be removed...otherwise it can be merged again with template_post
echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
<smf>
<preview>
<subject><![CDATA[', $context['preview_subject'], ']]></subject>
<body><![CDATA[', $context['preview_message'], ']]></body>
</preview>
<errors serious="', empty($context['error_type']) || $context['error_type'] != 'serious' ? '0' : '1', '">';
if (!empty($context['post_error']['messages']))
foreach ($context['post_error']['messages'] as $message)
echo '
<error><![CDATA[', cleanXml($message), ']]></error>';
echo '
</errors>';
echo '
</smf>';
}
/**
* The XML for hiding/showing stats sections via AJAX
*/
function template_stats()
{
global $context, $modSettings;
if (empty($context['yearly']))
return;
echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
<smf>';
foreach ($context['yearly'] as $year)
foreach ($year['months'] as $month)
{
echo '
<month id="', $month['date']['year'], $month['date']['month'], '">';
foreach ($month['days'] as $day)
echo '
<day date="', $day['year'], '-', $day['month'], '-', $day['day'], '" new_topics="', $day['new_topics'], '" new_posts="', $day['new_posts'], '" new_members="', $day['new_members'], '" most_members_online="', $day['most_members_online'], '"', empty($modSettings['hitStats']) ? '' : ' hits="' . $day['hits'] . '"', ' />';
echo '
</month>';
}
echo '
</smf>';
}
/**
* The XML for selecting items to split
*/
function template_split()
{
global $context;
echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
<smf>
<pageIndex section="not_selected" startFrom="', $context['not_selected']['start'], '"><![CDATA[', $context['not_selected']['page_index'], ']]></pageIndex>
<pageIndex section="selected" startFrom="', $context['selected']['start'], '"><![CDATA[', $context['selected']['page_index'], ']]></pageIndex>';
foreach ($context['changes'] as $change)
{
if ($change['type'] == 'remove')
echo '
<change id="', $change['id'], '" curAction="remove" section="', $change['section'], '" />';
else
echo '
<change id="', $change['id'], '" curAction="insert" section="', $change['section'], '">
<subject><![CDATA[', cleanXml($change['insert_value']['subject']), ']]></subject>
<time><![CDATA[', cleanXml($change['insert_value']['time']), ']]></time>
<body><![CDATA[', cleanXml($change['insert_value']['body']), ']]></body>
<poster><![CDATA[', cleanXml($change['insert_value']['poster']), ']]></poster>
</change>';
}
echo '
</smf>';
}
/**
* This is just to hold off some errors if people are stupid.
*/
if (!function_exists('template_button_strip'))
{
function template_button_strip($button_strip, $direction = 'top', $strip_options = array())
{
}
function template_menu()
{
}
function theme_linktree()
{
}
}
/**
* XML for search results
*/
function template_results()
{
global $context, $txt;
echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
<smf>';
if (empty($context['topics']))
echo '
<noresults>', $txt['search_no_results'], '</noresults>';
else
{
echo '
<results>';
while ($topic = $context['get_topics']())
{
echo '
<result>
<id>', $topic['id'], '</id>
<relevance>', $topic['relevance'], '</relevance>
<board>
<id>', $topic['board']['id'], '</id>
<name>', cleanXml($topic['board']['name']), '</name>
<href>', $topic['board']['href'], '</href>
</board>
<category>
<id>', $topic['category']['id'], '</id>
<name>', cleanXml($topic['category']['name']), '</name>
<href>', $topic['category']['href'], '</href>
</category>
<messages>';
foreach ($topic['matches'] as $message)
{
echo '
<message>
<id>', $message['id'], '</id>
<subject><![CDATA[', cleanXml($message['subject_highlighted'] != '' ? $message['subject_highlighted'] : $message['subject']), ']]></subject>
<body><![CDATA[', cleanXml($message['body_highlighted'] != '' ? $message['body_highlighted'] : $message['body']), ']]></body>
<time>', $message['time'], '</time>
<timestamp>', $message['timestamp'], '</timestamp>
<start>', $message['start'], '</start>
<author>
<id>', $message['member']['id'], '</id>
<name>', cleanXml($message['member']['name']), '</name>
<href>', $message['member']['href'], '</href>
</author>
</message>';
}
echo '
</messages>
</result>';
}
echo '
</results>';
}
echo '
</smf>';
}
/**
* The XML for the Jump To box
*/
function template_jump_to()
{
global $context;
echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
<smf>';
foreach ($context['jump_to'] as $category)
{
echo '
<item type="category" id="', $category['id'], '"><![CDATA[', cleanXml($category['name']), ']]></item>';
foreach ($category['boards'] as $board)
echo '
<item type="board" id="', $board['id'], '" childlevel="', $board['child_level'], '" is_redirect="', (int) !empty($board['redirect']), '"><![CDATA[', cleanXml($board['name']), ']]></item>';
}
echo '
</smf>';
}
/**
* The XML for displaying a column of message icons and selecting one via AJAX
*/
function template_message_icons()
{
global $context;
echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
<smf>';
foreach ($context['icons'] as $icon)
echo '
<icon value="', $icon['value'], '" url="', $icon['url'], '"><![CDATA[', cleanXml($icon['name']), ']]></icon>';
echo '
</smf>';
}
/**
* The XML for instantly showing whether a username is valid on the registration page
*/
function template_check_username()
{
global $context;
echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
<smf>
<username valid="', $context['valid_username'] ? 1 : 0, '">', cleanXml($context['checked_username']), '</username>
</smf>';
}
/**
* This prints XML in its most generic form.
*/
function template_generic_xml()
{
global $context;
echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>';
// Show the data.
template_generic_xml_recursive($context['xml_data'], 'smf', '', -1);
}
/**
* Recursive function for displaying generic XML data.
*
* @param array $xml_data An array of XML data
* @param string $parent_ident The parent tag
* @param string $child_ident The child tag
* @param int $level How many levels to indent the code
*/
function template_generic_xml_recursive($xml_data, $parent_ident, $child_ident, $level)
{
// This is simply for neat indentation.
$level++;
echo "\n" . str_repeat("\t", $level), '<', $parent_ident, '>';
foreach ($xml_data as $key => $data)
{
// A group?
if (is_array($data) && isset($data['identifier']))
template_generic_xml_recursive($data['children'], $key, $data['identifier'], $level);
// An item...
elseif (is_array($data) && isset($data['value']))
{
echo "\n", str_repeat("\t", $level), '<', $child_ident;
if (!empty($data['attributes']))
foreach ($data['attributes'] as $k => $v)
echo ' ' . $k . '="' . $v . '"';
echo '><![CDATA[', cleanXml($data['value']), ']]></', $child_ident, '>';
}
}
echo "\n", str_repeat("\t", $level), '</', $parent_ident, '>';
}
?>

650
css/admin.css Normal file
View file

@ -0,0 +1,650 @@
/* Start with most common */
.action_admin .generic_list {
overflow: auto;
}
#admin_content .windowbg {
/*margin: 0 0 10px 0;*/
box-shadow: none;
padding: 1em;
}
#admin_content tr.windowbg td {
padding: .3em 1em;
}
#admin_content .windowbg form p {
display: flex;
justify-content: space-between;
}
#admin_content .button:not(.floatnone) {
float: right;
}
.action_admin .table_grid td {
border: 1px solid #ddd;
border-top: 0;
}
.action_admin .generic_list .flow_auto {
padding: 4px 2px;
}
.windowbg.nopadding {
margin: 0 !important;
padding: 0;
}
.windowbg ol {
margin-top: 0;
margin-bottom: 0;
}
a.help span {
margin-right: 2px;
}
.table_caption, tr.table_caption td {
color: #000;
font-size: 10px;
font-weight: bold;
}
.additional_row div.floatleft {
padding: 0 10px;
}
fieldset {
padding: 6px;
}
fieldset dl {
margin: 0;
}
legend {
font-weight: bold;
color: #000;
}
/* Styles for the admin home screen.
------------------------------------------------------- */
/* Admin quick search bar, and results page. */
.admin_search {
padding: 5px;
font-size: 0.9em;
float: right;
display: flex;
justify-content: space-between;
align-items: center;
}
.admin_search input, .admin_search select, .admin_search .button {
border-radius: 4px;
margin: 0 0 0 2px;
}
.admin_search input[type="search"] {
min-width: 0;
flex: 1 1 auto;
}
/* The welcome thingy. */
#welcome {
border: 1px solid #ddd;
border-top: none;
border-radius: 0 0 7px 7px;
font-size: 0.9em;
padding: 12px 9px 8px 9px;
}
#welcome a {
font-weight: bold;
}
#welcome img {
vertical-align: middle;
}
.search_results {
margin: 0 -6px;
}
.search_results li {
margin: 0;
padding: 5px 0;
overflow: auto;
line-height: 1.7em;
border-bottom: double #ccc;
}
.search_results li:last-child {
border: none;
}
.search_results li a strong {
color: #346;
}
.search_results li p {
padding: 0 20px;
line-height: 1.7em;
}
/* Cleaned this up a bit for less clutter.
/* Admin and moderation could generally do with a clean up everywhere.
/* Live news from smorg and support information. */
#live_news, #support_info {
width: 70%;
}
#support_info {
width: 30%;
padding-left: 6px;
}
#admin_main_section {
overflow: auto;
}
#admin_main_section .windowbg {
padding: 6px 0;
border-radius: 0;
height: 12em;
overflow: auto;
}
#smfAnnouncements dt {
padding: 4px 6px 2px 6px;
border-top: 1px solid #bf6900;
}
#smfAnnouncements dt a {
color: #bf6900;
font-weight: bold;
display: block;
}
#smfAnnouncements dd {
margin: 0;
padding: 6px 12px;
border-top: double #ddd;
}
fieldset.admin_group legend {
background: #eaf1f4;
border: 1px solid #cacdd3;
padding: 1px 5px;
border-radius: 3px;
}
fieldset.admin_group a {
display: inline-block;
width: 100px;
font-size: 85%;
text-align: center;
vertical-align: top;
}
fieldset.admin_group .inactive {
opacity: 0.4;
}
/* The update warning. */
#update_section {
margin: 6px 0;
}
/* The icons. */
.large_admin_menu_icon_file {
margin: 0 auto;
display: block;
width: 32px;
height: 32px;
}
.large_admin_menu_icon::before {
background: url(../images/icons/admin_sprite.png) no-repeat -5px -47px;
margin: 0 auto;
display: block;
content: '';
width: 32px;
height: 32px;
}
.large_admin_menu_icon.attachment::before {
background-position: -5px -5px;
}
.large_admin_menu_icon.ban::before {
background-position: -47px -5px;
}
.large_admin_menu_icon.boards::before {
background-position: -89px -5px;
}
.large_admin_menu_icon.calendar::before {
background-position: -131px -5px;
}
.large_admin_menu_icon.current_theme::before {
background-position: -173px -5px;
}
.large_admin_menu_icon.default::before {
background-position: -5px -47px;
}
.large_admin_menu_icon.engines::before {
background-position: -47px -47px;
}
.large_admin_menu_icon.exit::before {
background-position: -89px -47px;
}
.large_admin_menu_icon.features::before {
background-position: -131px -47px;
}
.large_admin_menu_icon.languages::before {
background-position: -173px -47px;
}
.large_admin_menu_icon.logs::before {
background-position: -5px -89px;
}
.large_admin_menu_icon.mail::before {
background-position: -47px -89px;
}
.large_admin_menu_icon.maintain::before {
background-position: -89px -89px;
}
.large_admin_menu_icon.membergroups::before {
background-position: -131px -89px;
}
.large_admin_menu_icon.members::before {
background-position: -173px -89px;
}
.large_admin_menu_icon.modifications::before {
background-position: -5px -131px;
}
.large_admin_menu_icon.news::before {
background-position: -47px -131px;
}
.large_admin_menu_icon.packages::before {
background-position: -89px -131px;
}
.large_admin_menu_icon.paid::before {
background-position: -131px -131px;
}
.large_admin_menu_icon.permissions::before {
background-position: -173px -131px;
}
.large_admin_menu_icon.posts::before {
background-position: -5px -173px;
}
.large_admin_menu_icon.regcenter::before {
background-position: -47px -173px;
}
.large_admin_menu_icon.reports::before {
background-position: -89px -173px;
}
.large_admin_menu_icon.scheduled::before {
background-position: -131px -173px;
}
.large_admin_menu_icon.search::before {
background-position: -173px -173px;
}
.large_admin_menu_icon.security::before {
background-position: -215px -5px;
}
.large_admin_menu_icon.server::before {
background-position: -215px -47px;
}
.large_admin_menu_icon.smiley::before {
background-position: -215px -89px;
}
.large_admin_menu_icon.support::before {
background-position: -215px -131px;
}
.large_admin_menu_icon.themes::before {
background-position: -215px -173px;
}
.large_admin_menu_icon.warning::before {
background-position: -5px -215px;
}
/* Styles for the support and credits page.
/* Hey, people might actually want to put their names on it now!
/* Only a couple of trivial markup hacks that wont break any mods or themes.
/* The older I get, the more devious I get. :D
/* Nobody ever themes admin anyway. That's why it looked like crap. */
#support_credits_list dl {
padding: 0 6px;
}
#support_credits_list dt {
float: left;
padding: 6px 0.8em 0 0;
text-indent: -4px;
}
#support_credits_list dd {
padding: 6px 0;
}
/* Styles for the package manager. */
#package_list .tborder {
margin: .25em 0 .25em 26px;
}
#package_list ol, #package_list ol li {
list-style: decimal;
margin-left: 50px;
border: none;
}
#package_list li {
border: 1px solid #cacdd3;
padding: 0.2em;
margin: 1px;
}
.package_section {
border: 1px solid #cacdd3;
}
span.package_server {
padding: 0 3em;
}
pre.file_content {
overflow: auto;
width: 100%;
padding-bottom: 1em;
}
#view_package table {
border-collapse: collapse;
}
#view_package td[colspan="5"] {
border: none;
font-size: 0.9em;
padding: 0;
}
/* Styles for the file permissions section. */
.file_permissions {
font-size: 0.8em;
white-space: nowrap;
}
.perms_status {
display: block;
width: 35%;
text-align: center;
}
.perm_read {
background-color: #d1f7bf;
width: 8%;
}
.perm_writable {
background-color: #ffbbbb;
width: 8%;
}
.perm_execute {
background-color: #fdd7af;
width: 8%;
}
.perm_custom {
background-color: #c2c6c0;
width: 8%;
}
.perm_no_change {
background-color: #eee;
width: 8%;
}
/* Styles for the BBC permissions */
.list_bbc {
width: 33%;
}
/* Styles for the manage boards section. */
#manage_boards {
overflow: auto;
}
.roundframe .windowbg {
border: 0;
padding: 0;
background: none;
}
#manage_boards li.windowbg {
padding: 8px 0;
margin: 0;
border-radius: 0;
border: 1px solid #ddd;
border-bottom: none;
}
#manage_boards li.windowbg:first-child {
border-top: none;
}
#manage_boards li.windowbg:last-child {
border-bottom: 1px solid #ddd;
}
#manage_boards li.windowbg:hover {
background: #d0e7f8;
}
#manage_boards li .floatleft {
font-weight: bold;
padding: 0 6px;
}
#manage_boards li#recycle_board {
background-color: #dee;
}
#manage_boards li.redirect_board, #manage_boards li.redirect_board:hover {
background-color: #eed;
}
.move_links {
padding: 0 13px 0 0;
}
#manage_boards .button {
margin: 0 8px 0 0;
}
#manage_boards dl {
padding: 8px 6px 0 6px;
}
#manage_boards dl textarea, #manage_boards dl table {
margin: 0 0 8px 0;
}
#manage_boards span.post_group, #manage_boards span.regular_members {
border-bottom: 1px dotted #000;
cursor: help;
}
.select_all_box {
display: none;
}
/* Styles for the manage members section. */
.msearch_details {
display: block;
width: 49%;
}
dl.right dt {
padding-right: 10px;
}
/* Styles for the manage membergroups section. */
.denyboards_layout .board:hover {
background: #e3e9ec;
}
.all_boards_in_cat {
margin-left: 2.5em;
}
/* Styles for the question and answers */
fieldset.qa_fieldset {
clear: both;
display: none;
}
/* Styles for the manage search section. */
span.search_weight {
width: 40px;
padding: 0 0.5em;
text-align: right;
}
.search_settings {
width: 47%;
}
/* Styles for the manage bans section. */
.ban_restriction {
margin: 0.2em 0 0.2em 2.2em;
}
.ban_settings {
width: 46%;
}
#manage_bans dl {
margin-bottom: 1em;
}
#manage_bans fieldset dl.settings {
margin-bottom: 0;
}
#manage_bans textarea {
min-height: 4em;
height: 5em;
}
/* Styles for the manage subscriptions section. */
#fixed_area {
width: 97%;
}
/* Styles for the manage permissions section. */
.perm_name, .perm_profile, .perm_board {
display: block;
width: 40%;
}
.perm_boards {
padding: 0;
margin: 0 0 0.6em 0;
}
.perm_boards li {
list-style-type: none;
border: 1px solid #cacdd3;
border-top: 0;
padding: 0.2em;
}
.perm_boards li:first-child {
border-top: 1px solid #cacdd3;
}
.perm_groups {
background-color: #fff;
}
.perms {
width: 20px;
display: inline-block;
text-align: center;
}
/* Styles for the themes section. */
ul.theme_options {
padding: 0;
margin: 0;
}
ul.theme_options li {
list-style: none;
padding: 0.4em;
}
.is_directory {
padding-left: 18px;
}
.is_directory span {
margin: -2px 3px 0 0;
}
.edit_file {
width: 100%;
font-family: monospace;
margin: 1ex 0;
white-space: pre;
}
dl.themes_list {
margin: 0;
}
dl.themes_list dt {
margin-bottom: 3px;
width: 40%;
}
dl.themes_list dd {
width: 59%;
font-style: italic;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
/* Generic boxes/textboxes requires to be full-width */
#agreement, #reserved {
display: block;
width: 100%;
}
#modcenter {
display: flex;
width: 100%;
flex-direction: column;
}
#modcenter .half_content {
width: 100%;
}
#modcenter .half_content .windowbg {
padding: 1em;
}
#modcenter .half_content .windowbg ul {
list-style: initial;
}
#modcenter .half_content .windowbg ul {
margin-left: 1em;
}
/* Styles for the moderation center. */
/* Moderation Notes */
ul.moderation_notes {
margin: 0;
padding: 0;
list-style: none;
overflow: auto;
height: 10.2em;
}
ul.moderation_notes li {
padding: 0.2em;
border-bottom: 1px solid #ccc;
}
.notes {
margin-top: 0.4em;
}
.post_note {
width: calc(100% - 17ex);
}
.post_note input {
width: 100%;
}
/* Styles for the Report generation */
#report_buttons {
min-height: 2.4em;
padding: 3px 0;
}
.report_results th {
border-left: 1px solid #ddd;
border-right: 1px solid #ddd;
}
#support_credits .sub_bar {
padding: 6px 0px 5px 0px;
}
#taskpad .button, #admin_form_wrapper {
margin: 5px 0 5px 0;
}
h3.config_hd {
background: url(../images/icons/config_hd.png) no-repeat 12px;
padding: 8px 0 8px 45px;
}
.full_width {
width: 100%;
}
#versions .table_grid {
margin: 0;
}
#Sources .half_table, #Default .half_table, #Languages .half_table {
padding-left: 20px;
}
.windowbg.highlight2 {
background: #d0e7f8;
}
/* Css edit page */
#css_preview_box {
margin-bottom: 2ex;
border: 1px solid #777;
width: 100%;
height: 400px;
}
/* Smileys and Message icons section */
.move_smileys img {
padding: 2px;
border: 2px solid transparent;
border-radius: 2px;
vertical-align: middle;
}
.move_smileys a:hover img {
border-color: #71a0c8;
}
.move_smileys .selected_item {
border-color: #ffb42d;
}
/* Progress bars */
.progress_bar {
margin: 20px auto;
max-width: 750px;
}

351
css/calendar.css Normal file
View file

@ -0,0 +1,351 @@
/* Styles for the calendar section.
------------------------------------------------- */
#calendar {
overflow: hidden;
}
#calendar .windowbg {
box-shadow: none;
border-radius: 0;
box-sizing: content-box;
margin: 0;
}
/* Used to indicate the current day in the grid. */
#main_grid .calendar_today span.day_text,
#month_grid .calendar_today,
.calendar_week tr.days_wrapper td.calendar_today:first-child {
font-weight: bold;
}
.calendar_today,
td.days:hover {
background: #fff;
}
#month_grid {
width: 214px;
float: left;
text-align: center;
overflow: hidden;
margin-right: 10px;
}
#month_grid h3 a {
padding: 0 6px 0 6px;
}
#month_grid table {
width: 100%;
margin-bottom: 12px;
border-collapse: collapse;
background: #f0f4f7;
border: 1px solid #ddd;
}
#main_grid {
overflow: auto;
}
#main_grid table {
width: 99.9%;
border-collapse: collapse;
background: #f0f4f7;
margin: 1px 0 0 0;
border: 1px solid #ddd;
overflow: auto;
}
#main_grid .cat_bar {
border-radius: 5px 5px 0 0;
}
#month_grid th:first-child {
background: #e7eaef;
}
#month_grid th.days {
background: #e7eaef;
font-size: smaller;
}
#month_grid th.days,
#month_grid td.weeks {
padding: 2px;
text-align: center;
}
#month_grid td.weeks {
font-size: large;
background: #e7eaef;
width: 5%;
}
#month_grid td.weeks a:hover {
text-decoration: underline;
}
#month_grid h3.catbg,
#main_grid h3.catbg {
padding: 8px 6px 4px 6px;
}
#main_grid h3.catbg span {
display: block;
font-size: 1.5em;
margin: -3px 4px 0 4px;
}
#main_grid th:first-child {
background: #e7eaef;
}
#main_grid th.days {
width: 14%;
padding: 5px 10px;
text-align: left;
background: #e7eaef;
}
#main_grid td.weeks {
text-align: center;
font-weight: bold;
font-size: 1.8em;
background: #e7eaef;
padding: 5px;
}
#main_grid td.weeks a:hover {
text-decoration: none;
}
/* Main Highlighting */
#main_grid td.disabled,
#month_grid td.disabled {
background: #eee;
border: 1px solid #ddd;
}
#main_grid td.events,
#month_grid td.events {
background: rgba(30, 245, 20, 0.1);
}
#main_grid td.holidays,
#month_grid td.holidays {
background: rgba(23, 110, 245, 0.1);
}
#main_grid td.birthdays,
#month_grid td.birthdays {
background: rgba(102, 0, 255, 0.1);
}
/* Special Case Highlighting */
#main_grid td.events:hover,
#month_grid td.events:hover,
#month_grid td.calendar_today.events {
background: rgba(30, 245, 20, 0.2);
}
#main_grid td.holidays:hover,
#month_grid td.holidays:hover,
#month_grid td.calendar_today.holidays {
background: rgba(23, 110, 245, 0.2);
}
#main_grid td.birthdays:hover,
#month_grid td.birthdays:hover,
#month_grid td.calendar_today.birthdays {
background: rgba(153, 51, 255, 0.2);
}
#main_grid td.days,
#month_grid td.days {
vertical-align: top;
text-align: left;
border-right: 1px solid #ddd;
border-bottom: 1px solid #ddd;
}
#main_grid td.days {
padding: 5px;
}
#month_grid td.days {
padding: 0;
width: 12.5%;
text-align: center;
}
#month_grid td.days a {
display: block;
padding: 5px;
}
#month_grid td.days a:hover {
text-decoration: none;
background: rgba(97, 135, 166, 0.2);
}
#main_grid tbody tr:nth-child(2) td.days,
#month_grid tbody tr:nth-child(2) {
border-top: 1px solid #ddd;
}
#main_grid tbody tr.days_wrapper > td:nth-child(2),
#month_grid tr.days_wrapper > td:nth-child(2) {
border-left: 1px solid #ddd;
}
#main_grid tr.days_wrapper:nth-child(2) > td.weeks {
border-top: 1px solid #ddd;
}
#main_grid table:last-child td.weeks {
border-bottom: 1px solid #ddd;
}
#main_grid tr:not(.days_wrapper) th,
#main_grid tr:not(.days_wrapper) td {
min-height: 30px;
}
#calendar_range,
#calendar_navigation {
padding: 5px 0;
text-align: center;
max-width: 50%;
margin: auto;
}
#main_grid .act_day {
font-size: 12pt;
}
#main_grid .active_post_event > a {
color: #999;
}
div.week_month_title {
font-weight: bold;
font-size: xx-large;
margin: 0.8em 0 0.4em 0.15em;
line-height: 1.2em;
}
div.week_month_title a {
color: #555;
}
td.week_post {
vertical-align: middle !important;
}
div.week_add_event {
/* text-align: center; */
}
div.week_add_event > a {
/* font-size: x-large; */
color: #999;
}
div.week_add_event > a:hover {
color: #555;
}
span.hidelink {
font-style: italic;
}
#view_button {
margin-top: -2px;
margin-left: inherit;
}
#main_grid .buttonrow,
#main_grid .buttonlist {
margin: 5px 0;
padding: 0
}
#main_grid td.days,
.calendar_week td.days {
height: 100px;
padding: 10px;
}
.modify_event:hover {
text-decoration: none;
}
.modify_event_links {
float: right;
}
.event_wrapper:not(:last-child) {
margin-bottom: 5px;
padding-bottom: 5px;
border-bottom: 1px solid #ddd;
}
.event_time, .event_location {
color: #777;
}
.post_event_link {
vertical-align: middle;
height: 18px;
display: inline-block;
}
.active_post_event {
margin-top: 1em;
}
/* Break long words in calendar table cells to avoid layout problems */
#main_grid td.days {
-webkit-hyphens: auto;
-ms-hyphens: auto;
hyphens: auto;
word-wrap: break-word; /* IE fallback */
overflow-wrap: break-word;
}
/* At less than 1024px wide, #main_grid needs all the space it can get */
@media (max-width: 1023px) {
#month_grid {
display: none;
}
}
/* Small screens get the calendar in a vertical list */
@media (max-width: 665px) {
#main_grid table {
border: none;
background: none;
}
#main_grid tr {
margin-bottom: 1em;
}
#main_grid tr:first-of-type {
display: none;
}
#main_grid tr:not(:first-of-type) {
display: block;
}
#main_grid td {
display: block;
}
#main_grid .calendar_table .days {
margin-top: 0;
height: auto;
}
#main_grid .calendar_table .days:not(.disabled) {
min-height: 45px;
}
#main_grid .calendar_table .weeks a::before {
content: attr(title);
font-size: 0.65em;
margin: 0 0.5em;
vertical-align: top;
}
#main_grid .calendar_table .weeks {
margin-top: 0;
}
#main_grid .calendar_week tr {
border: 1px solid #ddd !important;
}
#main_grid .calendar_week td {
margin: 0;
height: auto;
border: none !important;
}
#main_grid .calendar_week .event_col::before,
#main_grid .calendar_week .holiday_col::before,
#main_grid .calendar_week .birthday_col::before {
content: attr(data-css-prefix);
}
#main_grid .calendar_week .holiday_col:empty {
display: none;
}
#main_grid .calendar_week .birthday_col:empty {
display: none;
}
div.week_add_event {
display: inline-block;
}
div.week_add_event > a {
font-size: 1em;
text-decoration: underline;
}
}
@media (max-width: 639px) {
.calendar_top {
padding: 12px 8px;
}
#calendar_range,
#calendar_navigation {
max-width: none;
}
}
@media (max-width: 539px) {
#calendar_range {
clear: both;
padding: 10px 0 0;
}
}
@media (max-width: 479px) {
#calendar_navigation {
clear: both;
padding: 10px 0 0;
}
}

23
css/calendar.rtl.css Normal file
View file

@ -0,0 +1,23 @@
/* Styles for the calendar section.
------------------------------------------------- */
#main_grid .cat_bar {
margin: 0 0 0 2px;
}
#month_grid {
float: right;
margin: 0 0 0 1%;
}
#main_grid table.weeklist td.windowbg {
border-left: 2px solid #fff;
border-bottom: 2px solid #fff;
}
#main_grid img.calendar_icon {
float: right;
margin: 0 0 0 4px;
}
#main_grid table.weeklist td.weekdays {
text-align: left;
vertical-align: middle;
border-right: 2px solid #fff;
border-bottom: 2px solid #fff;
}

4905
css/index.css Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,625 @@
/*! SCEditor | (C) 2011-2013, Sam Clarke | sceditor.com/license */
/**
* SCEditor
* https://www.sceditor.com/
*
* Copyright (C) 2011-12, Sam Clarke (samclarke.com)
*
* SCEditor is licensed under the MIT license:
* https://opensource.org/licenses/mit-license.php
*/
div.sceditor-grip,
.sceditor-button div {
background-image: url("../images/icons/editor_sprite.png");
background-repeat: no-repeat;
width: 16px;
height: 16px;
}
.sceditor-button-flash div {
background-position: 0px -712px;
}
.sceditor-button-youtube div {
background-position: 0px 0px;
}
.sceditor-button-link div {
background-position: 0px -16px;
}
.sceditor-button-unlink div {
background-position: 0px -32px;
}
.sceditor-button-underline div {
background-position: 0px -48px;
}
.sceditor-button-time div {
background-position: 0px -64px;
}
.sceditor-button-table div {
background-position: 0px -80px;
}
.sceditor-button-superscript div {
background-position: 0px -96px;
}
.sceditor-button-subscript div {
background-position: 0px -112px;
}
.sceditor-button-strike div {
background-position: 0px -128px;
}
.sceditor-button-source div {
background-position: 0px -144px;
}
.sceditor-button-size div {
background-position: 0px -160px;
}
.sceditor-button-rtl div {
background-position: 0px -176px;
}
.sceditor-button-right div {
background-position: 0px -192px;
}
.sceditor-button-removeformat div {
background-position: 0px -208px;
}
.sceditor-button-quote div {
background-position: 0px -224px;
}
.sceditor-button-print div {
background-position: 0px -240px;
}
.sceditor-button-pastetext div {
background-position: 0px -256px;
}
.sceditor-button-paste div {
background-position: 0px -272px;
}
.sceditor-button-outdent div {
background-position: 0px -288px;
}
.sceditor-button-orderedlist div {
background-position: 0px -304px;
}
.sceditor-button-maximize div {
background-position: 0px -320px;
}
.sceditor-button-ltr div {
background-position: 0px -336px;
}
.sceditor-button-left div {
background-position: 0px -352px;
}
.sceditor-button-justify div {
background-position: 0px -368px;
}
.sceditor-button-italic div {
background-position: 0px -384px;
}
.sceditor-button-indent div {
background-position: 0px -400px;
}
.sceditor-button-image div {
background-position: 0px -416px;
}
.sceditor-button-horizontalrule div {
background-position: 0px -432px;
}
.sceditor-button-format div {
background-position: 0px -448px;
}
.sceditor-button-font div {
background-position: 0px -464px;
}
.sceditor-button-emoticon div {
background-position: 0px -480px;
}
.sceditor-button-email div {
background-position: 0px -496px;
}
.sceditor-button-date div {
background-position: 0px -512px;
}
.sceditor-button-cut div {
background-position: 0px -528px;
}
.sceditor-button-copy div {
background-position: 0px -544px;
}
.sceditor-button-color div {
background-position: 0px -560px;
}
.sceditor-button-code div {
background-position: 0px -576px;
}
.sceditor-button-center div {
background-position: 0px -592px;
}
.sceditor-button-bulletlist div {
background-position: 0px -608px;
}
.sceditor-button-bold div {
background-position: 0px -624px;
}
div.sceditor-grip {
background-position: 0px -640px;
width: 10px;
height: 10px;
}
.rtl div.sceditor-grip {
background-position: 0px -650px;
width: 10px;
height: 10px;
}
/**
* SCEditor
* https://www.sceditor.com/
*
* Copyright (C) 2011-12, Sam Clarke (samclarke.com)
*
* SCEditor is licensed under the MIT license:
* https://opensource.org/licenses/mit-license.php
*/
/*---------------------------------------------------
LESS Elements 0.7
---------------------------------------------------
A set of useful LESS mixins
More info at: http://lesselements.com
---------------------------------------------------*/
.sceditor-container {
display: -ms-flexbox;
display: flex;
-ms-flex-direction: column;
flex-direction: column;
position: relative;
background: #fff;
border: 1px solid #d9d9d9;
font-size: 13px;
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
color: #222;
line-height: 1;
font-weight: bold;
border-radius: 4px;
background-clip: padding-box;
min-width: 100%;
max-width: 100%;
}
.sceditor-container *,
.sceditor-container *::before,
.sceditor-container *::after {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
.sceditor-container,
.sceditor-container div,
div.sceditor-dropdown,
div.sceditor-dropdown div {
padding: 0;
margin: 0;
z-index: 5;
}
.sceditor-container iframe,
.sceditor-container textarea {
line-height: normal;
border: 0;
outline: none;
font-size: 14px;
color: #111;
box-sizing: border-box;
padding: 0 5px;
margin: 0px;
resize: none;
background: #fff;
display: flex;
flex-basis: 175px;
flex-grow: 1;
min-width: 100%;
max-width: 100%;
height: 175px;
min-height: 1px;
max-height: 100%;
}
.sceditor-container iframe {
font-family: Verdana, Arial, Helvetica, sans-serif;
}
.sceditor-container textarea {
font-family: "DejaVu Sans Mono", Monaco, Consolas, monospace;
}
div.sceditor-dnd-cover {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background: rgba(255, 255, 255, 0.2);
border: 5px dashed #aaa;
z-index: 200;
font-size: 2em;
text-align: center;
color: #aaa;
}
div.sceditor-dnd-cover p {
position: relative;
top: 45%;
pointer-events: none;
}
div.sceditor-resize-cover {
position: absolute;
top: 0;
left: 0;
background: #000;
width: 100%;
height: 100%;
z-index: 10;
opacity: 0.3;
}
div.sceditor-grip {
overflow: hidden;
width: 10px;
height: 10px;
cursor: pointer;
position: absolute;
bottom: 0;
right: 0;
z-index: 3;
line-height: 0;
}
div.sceditor-grip.has-icon {
background-image: none;
}
.sceditor-maximize {
position: fixed;
top: 0;
left: 0;
height: 100% !important;
width: 100% !important;
border-radius: 0;
background-clip: padding-box;
z-index: 2000;
}
html.sceditor-maximize,
body.sceditor-maximize {
height: 100%;
width: 100%;
padding: 0;
margin: 0;
overflow: hidden;
}
.ie6.sceditor-maximize {
position: absolute;
}
.sceditor-maximize div.sceditor-grip {
display: none;
}
.sceditor-maximize div.sceditor-toolbar {
border-radius: 0;
background-clip: padding-box;
}
div.sceditor-smileyPopup, div.sceditor-dropdown {
border: 1px solid #ccc;
background: #fff;
color: #333;
z-index: 4000;
padding: 10px;
line-height: 1;
border-radius: 2px;
background-clip: padding-box;
box-shadow: 1px 2px 4px rgba(0, 0, 0, .2);
overflow-y: auto;
}
div.sceditor-smileyPopup, .sceditor-smileyPopup {
width: auto;
position: absolute;
top: 0;
max-width:90%;
}
/*@media screen and (min-width: 1024px) {
div.sceditor-smileyPopup {
max-height: 50%;
width: 50%;
position: fixed;
background:aliceblue !important;
}
#sceditor-popup {
height: 100%;
}
#sceditor-popup-smiley {
height: 90%;
overflow: auto;
}
}
@media screen and (max-width: 1024px) {
div.sceditor-smileyPopup {
width: 90%;
position: absolute;
background:black !important;
}
}*/
/**
* Dropdown styleing
*/
div.sceditor-dropdown {
position: absolute;
border: 1px solid #ccc;
background: #fff;
color: #333;
z-index: 4000;
padding: 10px;
line-height: 1;
border-radius: 2px;
background-clip: padding-box;
box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.2);
}
div.sceditor-dropdown a,
div.sceditor-dropdown a:link {
color: #333;
}
div.sceditor-dropdown form {
margin: 0;
}
div.sceditor-dropdown label {
display: block;
font-weight: bold;
color: #3c3c3c;
padding: 4px 0;
}
div.sceditor-dropdown input,
div.sceditor-dropdown textarea {
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
outline: 0;
padding: 4px;
border: 1px solid #ccc;
border-top-color: #888;
margin: 0 0 .75em;
border-radius: 1px;
background-clip: padding-box;
}
div.sceditor-dropdown textarea {
padding: 6px;
}
div.sceditor-dropdown input:focus,
div.sceditor-dropdown textarea:focus {
border-color: #aaa;
border-top-color: #666;
box-shadow: inset 0 1px 5px rgba(0, 0, 0, 0.1);
}
div.sceditor-dropdown .button {
font-weight: bold;
color: #444;
padding: 0 12px;
background: #ececec;
border: solid 1px #ccc;
border-radius: 2px;
background-clip: padding-box;
cursor: pointer;
margin: .3em 0 0;
}
div.sceditor-dropdown .button:hover {
background: #f3f3f3;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
}
div.sceditor-font-picker,
div.sceditor-fontsize-picker,
div.sceditor-format {
padding: 6px 0;
}
div.sceditor-emoticons,
div.sceditor-more-emoticons,
div.sceditor-color-picker {
padding: 0;
}
.sceditor-pastetext textarea {
border: 1px solid #bbb;
width: 20em;
}
.sceditor-emoticons img,
.sceditor-more-emoticons img {
padding: 0;
cursor: pointer;
margin: 2px;
}
.sceditor-insertemoticon {
padding: 4px !important;
}
.sceditor-insertemoticon > div, .sceditor-insertemoticon > center {
display: inline-block;
vertical-align: middle;
}
.sceditor-more {
border-top: 1px solid #bbb;
display: inline-block;
cursor: pointer;
font-weight: bold;
padding: 0 4px !important;
margin-top: 4px !important;
}
.sceditor-dropdown a:hover {
background: #eee;
}
.sceditor-fontsize-option,
.sceditor-font-option,
.sceditor-format a {
display: block;
padding: 7px 10px;
cursor: pointer;
text-decoration: none;
color: #222;
}
.sceditor-fontsize-option {
padding: 7px 13px;
}
.sceditor-color-column {
float: left;
}
.sceditor-color-option {
display: block;
border: 1px solid #fff;
height: 10px;
width: 10px;
overflow: hidden;
display: inline-block;
border: 1px solid #fff;
}
@media screen and (min-width: 1024px) {
.sceditor-color-option {
height: 24px;
width: 24px;
}
.sceditor-color-picker {
width: 131px;
}
}
@media screen and (max-width: 1024px) {
.sceditor-color-option {
height: 48px;
width: 48px;
}
.sceditor-color-picker {
width: 251px;
}
}
.sceditor-color-option:hover {
border: 1px solid #333;
}
/**
* Toolbar styleing
*/
div.sceditor-toolbar {
flex-shrink: 0;
overflow: hidden;
padding: 3px 5px 2px;
background: #f7f7f7;
border-bottom: 1px solid #c0c0c0;
line-height: 0;
text-align: left;
user-select: none;
border-radius: 3px 3px 0 0;
background-clip: padding-box;
margin: 0 0 5px;
}
div.sceditor-group {
display: inline-block;
background: #ddd;
margin: 1px 5px 1px 0;
padding: 1px;
border-bottom: 1px solid #aaa;
border-radius: 3px;
background-clip: padding-box;
}
.sceditor-button {
float: left;
cursor: pointer;
padding: 3px 5px;
width: 16px;
height: 20px;
border-radius: 3px;
background-clip: padding-box;
}
.sceditor-button:hover,
.sceditor-button:active,
.sceditor-button.active {
background: #fff;
box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.3), inset -1px 0 rgba(0, 0, 0, 0.3), inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}
.sceditor-button:active {
background: #fff;
box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.3), inset -1px 0 rgba(0, 0, 0, 0.3), inset 0 -1px 0 rgba(0, 0, 0, 0.2), inset 0 0 8px rgba(0, 0, 0, 0.3);
}
.sceditor-button.disabled:hover {
background: inherit;
cursor: default;
box-shadow: none;
}
.sceditor-button,
.sceditor-button div {
display: block;
}
.sceditor-button svg {
display: inline-block;
height: 16px;
width: 16px;
margin: 2px 0;
fill: #111;
pointer-events: none;
line-height: 1;
}
.sceditor-button.disabled svg {
fill: #888;
}
.sceditor-button div {
margin: 2px 0;
padding: 0;
overflow: hidden;
line-height: 0;
font-size: 0;
color: transparent;
}
.sceditor-button.has-icon div {
display: none;
}
.sceditor-button.disabled div {
opacity: 0.3;
}
.text .sceditor-button,
.text .sceditor-button div,
.sceditor-button.text,
.sceditor-button.text div,
.text-icon .sceditor-button,
.text-icon .sceditor-button div,
.sceditor-button.text-icon,
.sceditor-button.text-icon div {
display: inline-block;
width: auto;
line-height: 16px;
font-size: 1em;
color: inherit;
text-indent: 0;
}
.text-icon .sceditor-button.has-icon div,
.sceditor-button.has-icon div,
.text .sceditor-button div,
.sceditor-button.text div {
padding: 0 2px;
background: none;
}
.text .sceditor-button svg,
.sceditor-button.text svg {
display: none;
}
.text-icon .sceditor-button div,
.sceditor-button.text-icon div {
padding: 0 2px 0 20px;
}
.rtl div.sceditor-toolbar {
text-align: right;
}
.rtl .sceditor-button {
float: right;
}
.rtl div.sceditor-grip {
right: auto;
left: 0;
}
/* SMF buttons styles */
.sceditor-button-pre div {
background-position: 0 -696px;
}
.sceditor-button-floatleft div {
background-position: 0px -680px;
}
.sceditor-button-floatright div {
background-position: 0px -664px;
}
.sceditor-insertemoticon img,
.sceditor-smileyPopup img {
margin: 0;
border-left: var(--neutral-mid-color) 1px dotted;
padding: 0 0.3em;
}
.sceditor-insertemoticon img,
div.sceditor-dropdown img,
.sceditor-smileyPopup img {
cursor: pointer;
}

996
css/responsive.css Normal file
View file

@ -0,0 +1,996 @@
/* Reprise du bazar en mode < 700, > 700-1000 < et >1000
/* Modif Khaganat ; à retravailler */
/*Large screen */
@media (min-width: 1000px) {
.khbb_nav {
/*padding: 0 10em;*/
}
}
/* Middle Screen */
@media (min-width: 700px) and (max-width: 1000px) {
.lastpost {
width: 20%;
margin: 3px 0 0 5px;
}
#alerts .alert_time {
display: none;
}
#alerts .alert_inline_time {
display: block;
}
}
/* Little Screen */
@media (max-width: 700px) {
/* Menu */
.khnav_sticky {
z-index: 10 !important;
}
.khbb_mobile_button {
display: flex;
justify-content: center;
align-items: center;
background-color: var(--color1);
color: var(--neutral-light-color);
padding: 0.3em;
padding-right: 0.5em;
}
.khbb_nav {
flex-direction: column;
}
.khbb_nav ul {
/*background: var(--neutral-light-color);*/
width: auto;
}
.khbb_nav ul li {
width: auto;
padding: 0.1em 1em;
margin: 0;
}
.khbb_nav ul li a {
flex-direction: row;
justify-content: start;
}
.khbb_nav ul li a img {
height: 1.2em;
width: initial;
}
.khbb_subtitlemenu {
display: block;
visibility: visible;
position: relative;
padding: 0;
background-color: inherit;
color: inherit;
}
.khbb_nav ul li a span.amt, .khbb_nav ul li a span.error {
position: relative;
}
/* Autres modifs maisons */
.khbb_subtitle {
justify-content: center;
}
.khbb_identity {
max-width: initial;
}
.khbb_subtitle .news {
display: none !important;
}
/* Board */
.board_stats, .cat_bar .lastpost {
display: none !important;
}
.khbb_children {
flex-wrap: wrap;
}
.khbb_children .lastpost {
display: flex;
flex-direction: column;
}
.boardindex_table .khbb_children .info {
width: calc(100% - 100px);
}
/*Messages */
#forumposts .windowbg {
margin: 0.5em;
border-radius: 5px;
box-shadow: 0 -2px 2px rgba(0, 0, 0, 0.1);
border-top: none;
}
.post_wrapper {
flex-direction: column;
}
.poster {
padding: 0.5em 0.5em 0 0.5em;
border-right: none;
}
/* Breadcrumb ; les flèches créent une marge... Mais changer le padding suffirait ?*/
.navigate_section ul li::before, .navigate_section ul li::after {
}
.navigate_section ul li {
padding: .5em 0.2em .5em 1em;
}
/* page "recents" et autres affichages de ce genre */
#recent .windowbg .recent_title {
flex-direction: column;
}
#alerts .windowbg {
flex-direction: column;
}
/* Stuff de SMF rangé en mode plus simple */
.lastpost {
margin: 0 0 0 20px;
}
.board_stats {
display: none;
}
#alerts .alert_time {
display: none;
}
#alerts .alert_inline_time {
display: block;
}
#profile_menu_top .textmenu,
#pm_menu_top .textmenu,
#alerts_menu_top .textmenu {
display: none;
}
#pm_menu_top .main_icons,
#alerts_menu_top .main_icons {
display: inline-block;
}
#member_list .ip, #member_list .last_active, #member_list .user_name {
display: none !important;
}
}
@media (min-width: 720px) and (max-width: 799px) {
#top_info .welcome {
display: none;
}
/* Calendar */
#event_time_options {
width: 44%;
}
#event_title {
padding: 0;
}
#evtitle {
width: 98%;
}
.event_options_left, .event_options_right {
display: block;
max-width: unset;
width: unset;
}
#event_title input[type="text"] {
width: 100%;
}
#post_event #event_board select {
width: calc(100% - 90px);
max-width: unset;
}
}
/* We have shared things... */
@media screen and (max-width: 720px) {
/* Remove some content from the hooks table */
#list_integration_hooks th#header_list_integration_hooks_function_name, #list_integration_hooks td.function_name,
#list_integration_hooks th#header_list_integration_hooks_remove, #list_integration_hooks td.remove {
display: none;
}
/* New Mobile Action/Mod Pop (Test) */
.moderationbuttons_check {
display: none;
}
.moderationbuttons_mobile_check {
display: inline-block;
}
#mobile_action .button, #mobile_moderation .button, #mobile_action .top_menu {
width: 100%;
margin: 0;
border-radius: 0;
border-left: 0;
border-right: 0;
text-indent: 5px;
}
#mobile_action .button, #mobile_moderation .button {
line-height: 2.8em;
height: auto;
}
#mobile_action .notify_dropdown {
top: 0 !important;
left: 0 !important;
position: relative;
}
#mobile_action .top_menu {
padding: 0;
margin: 0 auto;
}
#mobile_action .notify_dropdown a {
border-bottom: 1px solid #999;
}
#mobile_action .notify_dropdown a:last-of-type {
border-bottom: none;
}
#mobile_action .notify_dropdown span {
display: none;
}
.mobile_buttons {
margin: 5px 0;
}
.mobile_buttons .button {
margin: 0;
}
.pagesection .buttonlist, #moderationbuttons {
display: none;
}
.mobile_buttons {
display: block;
}
/* Stuff */
#top_info {
padding: 5px;
}
.infolinks {
display: inline-block;
margin: 5px 7px 0 0;
}
#registration .field_icons {
float: left;
margin: 5px 0 0 3px;
}
dl.register_form dt span {
display: inline;
}
#quick_actions {
display: flex;
justify-content: flex-end;
}
#quick_actions > * {
flex: 0 1 auto;
margin: 0 5px 0 0;
max-width: 40%;
white-space: nowrap;
}
#quick_actions > .button.qaction {
flex: 0 0 auto;
margin: 0 !important;
}
/* Menu */
.postinfo .quickbuttons {
justify-content: end;
display: flex;
flex-wrap: wrap;
}
.quickbuttons li:hover ul {
display: none;
}
/* General */
.action_home {
width: 100% !important;
}
#wrapper {
border-left: 0;
border-right: 0;
border-radius: 0;
}
#footer {
padding: 10px;
}
#top_section .inner_wrap, #wrapper, #header, #footer .inner_wrap {
width: 100%;
}
#upper_section, #inner_section, #content_section {
border-radius: 0;
}
#boardindex_table .stats {
display: none;
}
.login {
width: 100%;
}
#inner_wrap {
flex-flow: row wrap;
}
#inner_wrap .user,
#inner_wrap .news {
width: auto;
max-width: initial;
}
#languages_form {
padding-right: 10px;
}
/* BoardIndex */
.board_stats {
display: none;
}
.info {
width: calc(100% - 65px);
}
.lastpost {
width: 100%;
padding: 0;
min-height: 2em;
}
.up_contain .lastpost {
border-top: 1px solid #ddd;
min-height: initial;
}
.lastpost p {
margin: 5px;
}
span.postby {
display: inline-block;
}
/* Stats Center */
#ic_recentposts {
margin: 0;
width: 100%;
}
#upshrink_stats p.inline, #upshrink_stats p.last {
padding: 5px;
}
/* MessageIndex */
#messageindex .board_icon, #messageindex .lastpost {
display: none;
}
#messageindex .info {
padding: 8px 10px;
}
.info_block {
display: block;
width: 95%;
}
.moderation a {
padding: 3px;
}
#topic_container .moderation .main_icons {
display: none;
}
/* Unread */
#unread .board_icon, #unread .lastpost, #unreadreplies .board_icon, #unreadreplies .lastpost {
display: none;
}
#unread .info, #unreadreplies .info {
padding-left: 5px;
}
/* Display (Topics) */
.poster {
float: none;
width: auto;
position: relative;
}
.postarea {
margin: 0;
}
.inner {
padding: 1em 2px;
}
.moderatorbar {
margin: 0;
}
.keyinfo {
clear: both;
}
.keyinfo .postinfo {
font-weight: normal;
align-items: flex-start;
}
.keyinfo .postinfo .postinfo_link {
max-width: 55%;
}
.keyinfo .postinfo .quickbuttons {
max-width: 45%;
}
.keyinfo .postinfo .smalltext,
.keyinfo .page_number {
opacity: 0.6;
}
.keyinfo .postinfo a.smalltext:hover {
opacity: 1;
}
img.icon, #forumposts .catbg img {
display: none;
}
.poster h4 {
display: inline-block;
}
.user_info {
display: inline;
font-size: small;
}
.user_info li,
.custom_fields_above_member {
display: none;
}
.user_info li.title,
.user_info li.membergroup {
display: inline-block;
font-weight: normal;
color: var(--neutral-mid-color);
}
.user_info li::before {
content: "·";
padding: 0 0.5ch 0 0ch;
}
.like_count,
.smflikebutton:last-child {
margin-bottom: 8px;
}
.button.mobile {
margin: 0 0 5px 0;
}
.pagelinks {
margin: 0;
z-index: inherit;
}
/* Profile */
#admin_content .content {
padding: 0;
}
#creator dt {
width: 33%;
}
#creator dd {
width: 65%;
}
#basicinfo, #detailedinfo {
width: 100%;
}
#basicinfo {
margin: 0 0 5px 0; /* For UX */
}
/* Buddies & Ignore List */
#edit_buddies .buddy_custom_fields {
display: none;
}
/* PersonalMessages */
#personal_messages .pm_time, #personal_messages .pm_from_to {
display: none;
}
#personal_messages .pm_inline_time {
display: block;
}
/* Alerts Page */
#alerts .alert_text, #alerts .alert_time, #alerts .alert_buttons {
display: block;
}
#alerts .alert_time {
float: left;
}
#alerts .alert_text {
margin: 11px 0 0;
}
#alerts .alert_buttons .quickbuttons {
margin: 0 0 11px;
display: block;
}
#alerts .alert_image {
width: 60px;
}
/* Post Screen */
form#postmodify .roundframe, #post_event .roundframe {
padding: 5px;
}
#post_header input {
width: 100%;
}
#post_confirm_buttons .smalltext {
display: none;
}
ul.post_options {
padding: 0;
margin: 0;
}
ul.post_options li {
margin: 2px 5px 0 0;
width: 48%;
}
/* Search */
#searchform .roundframe {
padding: 5px;
flex-direction: column;
}
#advanced_search dt {
text-align: left;
width: 100%;
float: left;
}
#advanced_search dd {
width: auto;
}
#advanced_search dl#search_options {
width: 100%;
}
input#searchfor, input#userspec {
width: 75%;
}
/* Hide me */
#inner_wrap.hide_720, #inner_wrap time, #inner_wrap .news,
#search_form, #smflogo, #message_index_jump_to, .nextlinks, #display_jump_to,
#siteslogan, th.id_group, th.registered, th.posts, th.reg_group, th.reg_date, td.reg_group, td.reg_date,
td.id_group, td.registered, td.posts:not(.unique), td.statsbar.posts,
#approve_list .ip, #approve_list .date_registered, #group_members .date_registered,
#main_content_section .navigate_section, .time,
#header_custom_profile_fields_field_type, #header_custom_profile_fields_active,
#header_custom_profile_fields_placement, #custom_profile_fields .active, #custom_profile_fields .field_type, #custom_profile_fields .placement {
display: none !important;
}
/* Generic Lists */
#topic_notification_list .last_post, #topic_notification_list .started_by,
#request_list .time_applied, #file_list .date, #ban_list .notes, #ban_list .reason, #ban_log .email,
#mail_queue .priority, #attachments .posted {
display: none;
}
/* Admin */
.admin_search {
float: none;
}
.table_grid.half_content {
width: 100%;
margin: 0;
padding: 0;
}
.table_grid select {
max-width: 85vw;
}
#private, #enclose {
width: 95%;
}
/* Edit Language */
#language_list .character_set {
display: none;
}
/* Generic Classes for Customizations */
.hide_720 {
display: none;
}
.block_720 {
display: block;
}
.inlineblock_720 {
display: inline-block;
}
}
/* Tricky menu */
@media (min-width: 561px) {
#mobile_user_menu.popup_container {
display: block !important;
}
div[id^="mobile_generic_menu_"].popup_container {
display: block !important;
}
#main_menu .popup_window_menu
#main_menu .popup_window,
#genericmenu .popup_window,
#adm_submenus .popup_window {
box-shadow: none;
border-width: 0;
background: none;
}
}
@media (max-width: 560px) {
/* This is general */
#main_menu .popup_container,
#genericmenu .popup_container,
#adm_submenus .popup_container {
display: none;
z-index: 20;
width: auto;
background:var(--neutral-light-color);
/* position: fixed;
left: 0;
transform: translate(50%);
* Cause souci sur menu type profil (#genericmenu .popup_container), voir les effets de bords */
}
#main_menu .popup_heading,
#genericmenu .popup_heading,
#adm_submenus .popup_heading {
display: block;
}
#main_menu {
margin: 0;
}
.popup_window,
#main_menu .popup_window_menu
#main_menu .popup_window,
#genericmenu .popup_window,
#adm_submenus .popup_window {
top: 15%;
width: 95vw;
min-height: auto;
max-height: 90vh;
overflow-x: hidden;
overflow-y: scroll;
}
#adm_submenus {
padding: 0;
}
#adm_submenus .dropmenu li {
float: left;
margin: 0;
}
.generic_menu {
display: none;
}
#mobile_user_menu .dropmenu,
div[id^="mobile_generic_menu_"] .generic_menu,
.generic_menu > .dropmenu {
display: flex;
width: auto;
flex-direction: column;
}
a.mobile_user_menu,
a[class^="mobile_generic_menu_"] {
display: flex;
align-items: center;
margin: 0 0 4px 0;
justify-content: center;
}
a[class^="mobile_generic_menu_"] {
margin: 8px 0;
}
.menu_icon {
display: inline-block;
background: url(../images/icons/menu.svg) no-repeat;
height: 24px;
width: 24px;
}
.dropmenu li, .dropmenu li:hover,
.dropmenu li a, .dropmenu li a:hover,
.dropmenu li a.active, .dropmenu li a.active:hover, .dropmenu li:hover a.active,
.dropmenu li ul, .dropmenu li li, .dropmenu li li a {
/* Inutile ? règle souci de saut au survol quand commenté width: 100%;
padding: 0;
margin: 0;
border-left: 0;
border-right: 0;*/
}
.dropmenu li a, .dropmenu li a:hover {
border-radius: 0;
padding: 5px 0 !important;
}
.dropmenu li li li a,
.dropmenu li li li a:hover {
padding: 5px 24px !important;
}
.dropmenu li a, .dropmenu li:hover a,
.dropmenu li a.active, .dropmenu li a.active:hover,
.dropmenu ul li a:hover, .dropmenu li li a:hover,
.dropmenu ul li li:hover, .dropmenu li ul,
.dropmenu li li:hover ul, .dropmenu li li ul {
border-left: 0;
border-right: 0;
}
.dropmenu ul li a {
width: auto !important;
}
.dropmenu li.subsections > a::after {
position: absolute;
padding: 5px 0;
right: 10px;
font: 83.33%/150% Arial, sans-serif;
content: "\25bc" !important;
}
.dropmenu > .subsections > a::before {
position: relative;
padding: 0 .5em;
}
.dropmenu li ul,
.dropmenu li li:hover ul, .dropmenu li li ul {
position: relative;
border-radius: 0;
left: 0;
box-shadow: none;
}
/* 3rd level menu tests */
.dropmenu li ul ul {
margin: 0 !important;
}
}
@media (min-width: 481px) and (max-width: 560px) {
/* Calendar */
#event_time_options {
width: 40%;
}
#event_title, #event_board {
width: 100%;
}
#evtitle {
width: 98%;
}
}
/* Entry level phones */
@media (max-width: 480px) {
.board_moderators {
display: none;
}
#top_info .welcome {
display: none;
}
#pm_menu, #alerts_menu, #profile_menu {
min-width: initial;
width: 25em;
max-width: calc(100vw - 17px);
}
#footer {
text-align: center;
}
#footer ul {
width: 100%;
float: none;
}
#footer li {
display: block;
float: none;
}
/* MessageIndex */
#main_content_section .pagelinks {
display: block;
}
#main_content_section .pagesection {
margin: 5px 0;
padding: 0;
}
#topic_icons p {
display: block;
width: 100%;
}
/* some new stuff for far better UX */
.mobile_subject {
position: relative;
}
fieldset {
max-width: 100%;
min-width: unset;
}
/* Register Page */
#registration .button {
font-size: 0.67em;
}
dl.register_form, dl.register_form dt, dl.register_form dd {
float: none;
width: 100%;
}
/* Login Page */
.login dt, .login dd {
float: none;
width: 100%;
text-align: left;
}
.login #ajax_loginuser, .login #ajax_loginpass, .login #loginuser, .login #loginpass, .login select {
width: 100%;
}
/* Display (Topic View) */
.subject_title input {
width: 90%;
}
#quickreply_options .roundframe {
padding: 8px 10px 12px 10px;
}
/* Post Section */
#post_header dd {
width: 55%;
}
#post_header dt {
width: 35%;
}
img#icons {
margin: 0 0 0 5px;
}
#quickreply_options #postmodify {
width: 100%;
}
/* Poll */
#poll_options dl.options {
padding: 0;
}
#poll_options dl.options dt,
#poll_options dl.options dd,
dl.settings dt, dl.settings dd,
#creator .settings dt, #creator .settings dd,
div#report_form dl.settings dd, div#report_form dl.settings dt,
#tracking dt, #tracking dd,
#detailedinfo dt, #detailedinfo dd,
#advanced_search dt, #advanced_search dd {
width: 100%;
float: none;
}
#post_draft_options dl.settings dt, #post_draft_options dl.settings dd {
width: 50%;
float: left;
}
dl.settings dd textarea, #report_comment {
width: 100%;
}
.move_topic {
width: 100%;
}
.bbc_float {
max-width: 100% !important;
margin-left: 0.5em !important;
margin-right: 0.5em !important;
}
/* PersonalMessages */
#personal_messages .pm_icon {
display: none;
}
#personal_messages div.labels {
clear: both;
}
/* Alerts page */
#alerts .alert_image {
width: 40px;
padding-left: 6px;
}
#alerts .alert_image .avatar {
display: none;
}
#alerts .alert_image .avatar + .alert_icon {
position: static;
}
/* Buddies & Ignore List */
#edit_buddies .buddy_email {
display: none;
}
/* Stats Center */
.half_content {
width: 100%;
margin: 0;
padding: 0;
}
th.recentboard, th.recenttime,
td.recentboard, td.recenttime {
display: none;
}
.sceditor-container {
min-height: 375px;
}
/* Memberlist */
th.website_url,
td.website_url, td.reg_group, td.reg_date, td.post_num {
display: none;
}
#mlist .post_count {
width: 50px;
}
#mlist .post_count .generic_bar {
border: 0;
background: transparent;
color: inherit;
}
#mlist .post_count .generic_bar .bar {
background: transparent;
box-shadow: none;
}
#mlist_search dt {
width: 100%;
display: block;
padding: 0;
}
#mlist_search dd {
padding: 0;
margin: 0;
}
#mlist_search input[type="checkbox"] {
margin: 0 13px 3px 3px;
vertical-align: middle;
}
/* Moderation */
.post_note input {
width: 75%;
}
.modbox .floatleft {
float: none;
}
#warning_list .reason, #moderation_log_list .position, #moderation_log_list .ip, #group_members .last_active,
#group_request_list .date, #group_lists .icons, #regular_membergroups_list .icons, #post_count_membergroups_list .icons, #watch_user_list .last_login {
display: none;
}
/* Admin */
#live_news, #support_info {
width: 100%;
padding: 0;
margin: 0 0 5px 0;
}
fieldset.admin_group a {
width: 50%;
float: left;
margin: 0 0 5px 0;
}
.error_info, #fatal_error {
width: 100% !important;
padding: 0 !important;
float: none;
}
/* Calendar */
.event_options_left, .event_options_right {
width: 100%;
}
#event_title, #event_board {
width: 100%;
}
#evtitle {
width: 98%;
}
/* Menu tests */
#header_news_lists_preview, tr[id^="list_news_lists_"] td:nth-child(even),
#header_smiley_set_list_default, #header_smiley_set_list_url, #header_smiley_set_list_check,
tr[id^="list_smiley_set_list_"] td:nth-child(odd),
#header_mail_queue_priority,
tr[id^="list_mail_queue_"] td:nth-child(odd),
#header_member_list_user_name, #header_member_list_ip,
#header_member_list_last_active, #header_member_list_posts {
display: none;
}
tr[id^="list_mail_queue_"] td:first-of-type,
tr[id^="list_mail_queue_"] td:last-of-type {
display: table-cell;
}
.msearch_details {
width: 100% !important;
float: none;
}
.msearch_details .righttext {
text-align: left;
}
.msearch_details input {
width: 90%;
}
.msearch_details input[type="checkbox"] {
width: 5%;
}
/* Generic Lists */
#request_list .time_applied,
#track_user_list .date, #track_user_list .date2, #file_list .filesize, #file_list .downloads,
#ban_list .added, #ban_list .num_triggers, #ban_log .date, #mail_queue .age, #attachments .subject {
display: none;
}
/* Likes */
#likes li .like_time {
display: none;
}
/* Generic Classes for Customizations */
.hide_480 {
display: none;
}
.block_480 {
display: block;
}
.inlineblock_480 {
display: inline-block;
}
}

687
css/rtl.css Normal file
View file

@ -0,0 +1,687 @@
/* Common classes to easy styling.
------------------------------------------------------- */
.floatright {
float: left;
}
.floatleft {
float: right;
}
.clear_left {
clear: right;
}
.clear_right {
clear: left;
}
.righttext {
text-align: left;
}
.lefttext {
text-align: right;
}
/* Styling for BBC tags */
.bbc_list {
text-align: right;
}
/* A quote, perhaps from another post. */
.bbc_standard_quote::before, .bbc_alternate_quote::before {
content: '\275E';
margin-left: 0.25em;
}
/* All the signatures used in the forum. If your forum users use Mozilla, Opera, or Safari, you might add max-height here ;). */
.signature, .attachments, .custom_fields_above_signature {
clear: left;
}
/* the page navigation area */
.main_icons.move::before, .main_icons.next_page::before {
background-position: -31px -57px;
}
.main_icons.previous_page::before {
background-position: -5px -31px;
}
/* Amounts */
.amt {
margin-left: 0;
margin-right: 3px;
}
/* Lists with settings use these a lot.
------------------------------------------------------- */
dl.settings {
clear: left;
}
dl.settings dt {
float: right;
clear: both;
}
dl.settings dt.windowbg {
float: right;
}
dl.settings dd {
float: left;
}
dl.settings img {
margin: 0 0 0 10px;
}
/* Styles for popup windows
------------------------------------------------------- */
.popup_heading .hide_popup {
float: left;
}
/* Styles for rounded headers.
------------------------------------------------------- */
h3.catbg .icon {
margin: -2px 0 0 5px;
}
.cat_bar .desc {
margin: -8px 13px 4px 0;
}
/* Introduce New Title Bar */
h3.titlebg, h4.titlebg, .titlebg, h3.subbg, h4.subbg, .subbg {
padding-right: 9px;
padding-left: 9px;
}
/* Styles for the standard dropdown menus.
------------------------------------------------------- */
#main_menu {
float: right;
}
#menu_nav {
padding: 0;
}
/* Level 3 submenu wrapper positioning. */
.dropmenu li ul ul {
margin: -2em 3.1em 0 0;
}
/* This is a small fix for dropmenu icons */
.dropmenu .main_icons, #profile_menu .main_icons, .dropmenu img {
margin: 0 -4px 0 8px;
}
/* Hiding Level 3 submenu off hover. */
.dropmenu li:hover ul ul, .dropmenu li ul ul, .dropmenu li:hover ul ul ul, .dropmenu li ul ul ul {
right: -9999px;
left: unset;
}
/* Reposition as visible on hover. */
.dropmenu li li:hover ul, .dropmenu li li ul {
right: 11em;
}
/* Indicator for additional levels. Best in the anchor so it stays visible on hover. */
.dropmenu li li.subsections > a::after {
left: 10px;
right: auto;
content: '\25c4';
}
/* the main title. */
h1.forumtitle {
float: right;
}
/* float these items to the left */
#siteslogan, img#smflogo {
float: left;
}
/* Tweak the SMF logo */
img#smflogo {
margin-right: 1em;
}
/* Styles for the general looks of the theme.
------------------------------------------------------- */
.user {
padding-left: 0;
text-align: left;
}
#upper_section .news {
float: right;
}
.navigate_section .unread_links {
float: left;
}
/* Profile drop it needs reverse on RTL */
#profile_menu_top > img.avatar {
float: right;
margin: 2px 0 0 5px;
}
#profile_menu .profile_user_info {
margin: 3px 10px 5px 0;
}
#profile_menu .profile_user_avatar img {
margin: 5px 10px 0 0;
}
.profile_user_links li {
padding-right: 24px;
padding-left: 0;
}
/* The framing graphics */
#search_form {
text-align: left;
}
/* The navigation list (i.e. linktree) */
.navigate_section ul li {
float: right;
}
.navigate_section ul li .dividers {
padding: 0 6px 0 2px;
}
/* the posting icons */
#postbuttons_upper ul li a span {
line-height: 19px;
padding: 0 6px 0 0;
}
.mark_read {
float: left;
}
/* Poll results */
#poll_options dl.options {
padding: 1em 2em 1em 2.5em;
margin: 0 0 1em 1em;
}
#poll_options dl.options dt {
float: right;
clear: right;
}
#poll_options dl.options dd {
float: right;
text-align: left;
}
/* poster and postarea + moderation area underneath */
.poster {
float: right;
}
.postarea, .moderatorbar {
margin: 0 175px 0 0;
}
.keyinfo h5::after {
clear: left;
}
.moderatorbar {
clear: left;
}
/* poster details and list of items */
.poster h4, .poster ul {
padding: 0;
margin: 0;
}
/* The quick buttons */
ul.quickbuttons {
float: left;
clear: left;
}
ul.quickbuttons li {
float: right;
}
.quickbuttons li:last-child, .quickbuttons li:last-child:hover {
border-radius: 4px 1px 1px 4px;
padding-bottom: 0;
}
.quickbuttons li:first-child, .quickbuttons li:first-child:hover {
border-radius: 1px 4px 4px 1px;
padding-bottom: 0;
line-height: 1.9em;
}
.quickbuttons li.quick_edit, .quickbuttons li.post_options {
line-height: 1.9em;
position: relative;
}
.quickbuttons li ul {
text-align: right;
right: unset;
left: -1px;
}
/* The buttonrow */
.buttonrow .button:last-child {
border-radius: 0;
border-right: 0;
}
.buttonrow .button:first-child {
border-radius: 0;
border-right: 1px solid #ccc;
}
.post_verification #verification_control {
margin: .3em 1em .3em 0;
}
.post {
clear: left;
}
#forumposts .modified {
float: right;
}
#forumposts .reportlinks {
margin-left: 1.5em;
text-align: left;
clear: left;
}
#moderationbuttons_strip {
float: right;
}
#moderationbuttons_strip ul {
margin: 0 0.2em 0 0;
padding: 0 1em 0 0;
}
/* The jump to box */
#display_jump_to {
text-align: left;
}
#display_jump_to select {
margin: 0 5px 0 0;
}
/* mlist */
#mlist .website_url {
width: 80px;
}
/* Styles for edit post section
---------------------------------------------------- */
#post_header dt {
float: right;
}
#post_header dd {
float: right;
}
ul.post_options {
margin: 0 1em 0 0;
}
ul.post_options li {
float: right;
margin: 0 2px;
}
/* Styles for edit event section
---------------------------------------------------- */
#post_event div.event_options {
float: left;
}
#post_event #event_main input {
margin: 0 0 1em 0;
float: right;
}
#post_event #event_main div.smalltext {
float: left;
}
#post_event ul.event_main li {
float: left;
}
#post_event ul.event_options {
padding: 0 .7em .7em 0;
}
#post_event #event_main select, #post_event ul.event_options li select,
#post_event ul.event_options li input[type="checkbox"] {
margin: 0 0 0 1em;
}
/* Styles for edit poll section.
---------------------------------------------------- */
#edit_poll fieldset input {
margin-right: 7em;
}
#edit_poll ul.poll_main li {
padding-right: 1em;
}
#edit_poll ul.poll_main input {
margin-right: 1em;
}
#edit_poll div.poll_options {
float: right;
}
#edit_poll ul.poll_main, dl.poll_options {
padding: 0 .7em 0 0;
}
#edit_poll dl.poll_options dt {
padding: 0 1em 0 0;
}
#edit_poll dl.poll_options dd input {
margin-right: 0;
}
/* Styles for the personal messages section.
------------------------------------------------- */
#personal_messages h3 span#author, #personal_messages h3 span#topic_title {
float: right;
}
#personal_messages h3 span#author {
margin: 0 0.5em 0 0;
}
#personal_messages h3 span#topic_title {
margin: 0 9em 0 0;
}
#personal_messages .labels {
padding: 0 0 0 1em;
}
#to_item_list_container div, #bcc_item_list_container div {
float: right;
margin: 0;
}
/* Styles for the move topic section. */
.move_topic {
text-align: right;
}
/* Styles for the login areas.
------------------------------------------------------- */
.login dt {
float: right;
}
.login dd {
float: right;
text-align: right;
}
.login h3 img {
margin: 0 0 0.5em;
}
/* Additional profile fields */
dl.register_form {
clear: left;
}
dl.register_form dt {
float: right;
}
/* Styles for maintenance mode.
------------------------------------------------------- */
#maintenance_mode img.floatleft {
margin-left: 1em;
}
/* common for all admin sections */
h3.titlebg img {
margin-left: 0.5em;
}
tr.titlebg td {
padding-right: 0.7em;
}
div#admin_menu {
padding-right: 0;
}
#admin_content {
clear: right;
}
/* Styles for generic tables.
------------------------------------------------------- */
#info_center .cat_bar, .table_grid tr.catbg th {
text-align: right;
}
.message_index_title {
margin-left: 40px;
}
/* Styles for info boxes.
------------------------------------------------- */
.errorbox, .noticebox, .infobox {
padding: 7px 35px 7px 10px;
}
.errorbox::before, .noticebox::before, .infobox::before {
left: 0;
right: 10px;
}
.errorbox p.alert {
margin: 0 0 0 4px;
float: right;
}
.errorbox, .noticebox, .infobox {
padding: 7px 35px 7px 10px;
}
/* Styles for the profile section.
------------------------------------------------- */
#basicinfo {
float: right;
}
#detailedinfo {
float: left;
}
#basicinfo .icon_fields li {
float: right;
margin-right: 0;
margin-left: 5px;
}
#avatar_server_stored div {
float: right;
}
#detailedinfo dt, #tracking dt {
float: right;
}
#userstatus .smalltext, .pm_icon {
margin: 0 5px 0 0 !important;
}
/* h3 HD Icons */
h3.search_hd {
padding: 8px 45px 6px;
background-position: 99% 50%;
}
h3.profile_hd {
padding: 8px 50px 8px 0;
background-position: 99% 50%;
}
/* Activity by time */
#activitytime {
clear: right;
}
.activity_stats li {
float: right;
}
.activity_stats li span {
border-width: 1px 0 0 1px;
}
.activity_stats li.last span {
border-left: none;
}
.profile_pie {
background-image: url(../images/stats_pie_rtl.png);
float: right;
margin-right: 0;
margin-left: 1em;
}
/* Most popular boards by posts and activity */
#popularposts {
float: right;
}
#popularactivity {
float: left;
}
/* View posts */
.topic .time {
float: left;
}
.counter {
padding: 0.2em 0.2em 0.1em 0.5em;
float: right;
}
.topic .mod_icons {
text-align: left;
margin-right: 0;
margin-left: 1em;
}
#ip_list li.header, #ip_list li.ip {
float: right;
}
#creator dt {
float: right;
}
#creator dd {
float: right;
}
.ignoreboards ul {
margin: 0 1em 0 0;
}
.ignoreboards li {
float: right;
}
#pick_theme {
float: right;
}
.infolinks {
min-width: 95%;
float: right;
}
/* Styles for the statistics center.
------------------------------------------------- */
.stats_icon {
margin: 2px 3px -1px 6px;
}
dl.stats dt {
float: right;
}
dl.stats dd {
margin: 0 2% 4px 0;
}
#stats tr.windowbg th.stats_month {
text-align: right;
}
.generic_bar .bar, .progress_bar .bar {
left: unset;
right: 0;
}
tr.windowbg th.stats_month, tr.windowbg td.stats_day {
text-align: right;
}
#stats tr.windowbg th.lefttext, #stats tr.titlebg th.lefttext {
text-align: right;
}
/* Styles for the advanced search section.
------------------------------------------------- */
#searchform fieldset {
text-align: right;
}
#advanced_search dt {
float: right;
text-align: left;
}
#advanced_search dd {
float: right;
margin: 0 0.5em 0 0;
text-align: right;
}
/* Boards picker */
#searchform fieldset p {
text-align: right;
}
.search_results_posts .buttons {
padding: 5px 0 0 1em;
}
/* Styles for the help section.
------------------------------------------------- */
#helpmain h3.section {
padding: 0 0.5em 0.5em 0;
}
/* put back the bullets please */
#helpmain ul {
margin: 0 25px 0 0;
padding-left: 0;
}
#helpmain #messageindex {
clear: left;
}
/* Styles for the admincenter (reverse admin.css).
------------------------------------------------- */
/* common admin classes */
#admin_content .button {
float: left;
}
#manage_boards .button {
margin: 2px 6px 0px 6px;
}
/* Styles for the package manager.
------------------------------------------------- */
#package_list .tborder {
margin: .25em 26px .25em 0;
}
#package_list ol, #package_list ol li {
margin-left: 0;
margin-right: 50px;
}
/* ManageBoards */
#manage_boards ul {
overflow: hidden;
}
#manage_boards li {
overflow: hidden;
}
.move_links {
padding: 0 0 0 13px;
}
span.search_weight {
text-align: left;
}
/* Manage Bans */
.ban_restriction {
margin: 0.2em 2.2em 0.2em 0;
}
/* Themes */
.is_directory {
padding-right: 18px;
padding-left: 0;
}
.is_directory span {
margin: -2px 0 0 3px;
}
/* Styles for the moderation center.
------------------------------------------------- */
ul.moderation_notes li {
padding: 4px 4px 4px 0;
}
h3 .collapse {
float: left;
}
.pages {
margin-left: 0;
margin-right: 7px;
}
/* Styles for the calendar.
----------------------------- */
#main_grid th.days, #main_grid td.days {
text-align: right;
}
/* Code is a code do it LTR */
code.bbc_code, pre.file_content {
text-align: left;
direction: ltr;
}

BIN
images/banniere.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

BIN
images/bbc/bbc_bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 425 B

BIN
images/bbc/bbc_hoverbg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 B

9
images/bbc/index.php Normal file
View file

@ -0,0 +1,9 @@
<?php
// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
include(dirname(dirname(__FILE__)) . '/index.php');
else
exit;
?>

BIN
images/bbc/spoiler.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 B

BIN
images/blank.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 B

BIN
images/boardicons.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

238
images/boardicons.svg Normal file
View file

@ -0,0 +1,238 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="47.625mm"
height="47.625mm"
viewBox="0 0 47.625 47.625"
version="1.1"
id="svg5"
xml:space="preserve"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14, custom)"
sodipodi:docname="boardicons.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="2.6557772"
inkscape:cx="121.43338"
inkscape:cy="100.34727"
inkscape:window-width="1920"
inkscape:window-height="1026"
inkscape:window-x="0"
inkscape:window-y="2"
inkscape:window-maximized="1"
inkscape:current-layer="layer1"
showguides="false" /><defs
id="defs2" /><g
inkscape:label="Calque 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-28.695021,-30.302504)"><path
sodipodi:type="star"
style="opacity:1;fill:#9890bd;fill-opacity:1;stroke:none;stroke-width:0.3;stroke-linejoin:round;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path1239"
inkscape:flatsided="true"
sodipodi:sides="6"
sodipodi:cx="8.7351255"
sodipodi:cy="6.197978"
sodipodi:r1="29.58176"
sodipodi:r2="25.618555"
sodipodi:arg1="-1.0471976"
sodipodi:arg2="-0.52359878"
inkscape:rounded="0"
inkscape:randomized="0"
d="M 23.526004,-19.420579 38.316886,6.1979766 23.526007,31.816533 -6.0557534,31.816535 -20.846635,6.1979795 -6.0557559,-19.420577 Z"
transform="matrix(0.38954086,0,0,0.38954086,37.105474,39.754841)" /><path
sodipodi:type="star"
style="fill:#9890bd;fill-opacity:1;stroke:none;stroke-width:0.3;stroke-linejoin:round;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path1239-2"
inkscape:flatsided="true"
sodipodi:sides="6"
sodipodi:cx="8.7351255"
sodipodi:cy="6.197978"
sodipodi:r1="29.58176"
sodipodi:r2="25.618555"
sodipodi:arg1="-1.0471976"
sodipodi:arg2="-0.52359878"
inkscape:rounded="0"
inkscape:randomized="0"
d="M 23.526004,-19.420579 38.316886,6.1979766 23.526007,31.816533 -6.0557534,31.816535 -20.846635,6.1979795 -6.0557559,-19.420577 Z"
transform="matrix(0.38954086,0,0,0.38954086,60.927134,39.754841)" /><path
sodipodi:type="star"
style="fill:#9890bd;fill-opacity:1;stroke:none;stroke-width:0.3;stroke-linejoin:round;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path1239-2-2"
inkscape:flatsided="true"
sodipodi:sides="6"
sodipodi:cx="8.7351255"
sodipodi:cy="6.197978"
sodipodi:r1="29.58176"
sodipodi:r2="25.618555"
sodipodi:arg1="-1.0471976"
sodipodi:arg2="-0.52359878"
inkscape:rounded="0"
inkscape:randomized="0"
d="M 23.526004,-19.420579 38.316886,6.1979766 23.526007,31.816533 -6.0557534,31.816535 -20.846635,6.1979795 -6.0557559,-19.420577 Z"
transform="matrix(0.38954086,0,0,0.38954086,60.927134,63.758258)" /><path
sodipodi:type="star"
style="fill:#9890bd;fill-opacity:1;stroke:none;stroke-width:0.3;stroke-linejoin:round;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path1239-2-8"
inkscape:flatsided="true"
sodipodi:sides="6"
sodipodi:cx="8.7351255"
sodipodi:cy="6.197978"
sodipodi:r1="29.58176"
sodipodi:r2="25.618555"
sodipodi:arg1="-1.0471976"
sodipodi:arg2="-0.52359878"
inkscape:rounded="0"
inkscape:randomized="0"
d="M 23.526004,-19.420579 38.316886,6.1979766 23.526007,31.816533 -6.0557534,31.816535 -20.846635,6.1979795 -6.0557559,-19.420577 Z"
transform="matrix(0.38954086,0,0,0.38954086,37.105474,63.758258)" /><g
id="g386"
transform="translate(-0.26879614,-0.27100869)"><g
id="g3486-3"
transform="translate(-30.362466,25.451311)"
style="fill:#8530bf;fill-opacity:1"><path
style="fill:#8530bf;fill-opacity:1;stroke:none;stroke-width:0.561057;stroke-linejoin:round;stroke-miterlimit:2;paint-order:stroke fill markers"
d="m 75.498274,22.254678 c 0,0 0.336734,0.634649 2.389664,1.133196 C 76.323512,22.35551 76.228957,21.18979 76.228957,21.18979"
id="path1508-2-3-5-9"
sodipodi:nodetypes="ccc" /><path
id="path1510-9-6-6-0"
style="fill:#8530bf;fill-opacity:1;stroke-width:0.52564;stroke-linejoin:round;stroke-miterlimit:2;paint-order:stroke fill markers"
d="m -73.092828,16.117323 a 5.3818111,3.35495 0 0 1 5.303552,2.798279 c -0.80402,0.185379 -1.675644,0.287321 -2.585888,0.287321 -2.060395,0 -3.922483,-0.522612 -5.251876,-1.351339 -0.418728,-0.261029 -0.782948,-0.550035 -1.085722,-0.861446 a 5.3818111,3.35495 0 0 1 3.619934,-0.872815 z m -4.047815,1.144633 c 0.34933,0.374265 0.771055,0.714774 1.250053,1.013375 1.426282,0.889124 3.370805,1.42782 5.515426,1.42782 0.933448,0 1.829376,-0.101859 2.660819,-0.290422 a 5.3818111,3.35495 0 0 1 0.0031,0.05995 5.3818111,3.35495 0 0 1 -5.381584,3.354834 5.3818111,3.35495 0 0 1 -5.3821,-3.354834 5.3818111,3.35495 0 0 1 1.334285,-2.210718 z"
transform="scale(-1,1)" /><g
id="g1642-1-9-8"
transform="translate(30.388612,-24.818836)"
style="fill:#8530bf;fill-opacity:1"><path
style="fill:#8530bf;fill-opacity:1;stroke:none;stroke-width:0.79375;stroke-linejoin:round;stroke-miterlimit:2;paint-order:stroke fill markers"
d="m 36.583874,43.461557 c 0,0 -0.476392,0.897865 -3.380757,1.603179 2.213258,-1.460528 2.347029,-3.109719 2.347029,-3.109719"
id="path1508-27-4-8"
sodipodi:nodetypes="ccc" /><ellipse
style="fill:#8530bf;fill-opacity:1;stroke:none;stroke-width:0.743645;stroke-linejoin:round;stroke-miterlimit:2;paint-order:stroke fill markers"
id="path1510-0-8-5"
cx="39.986717"
cy="39.525448"
rx="7.6138706"
ry="4.7463861" /></g></g><g
id="g4200"
style="fill:#8530bf;fill-opacity:1"><path
style="fill:#8530bf;fill-opacity:1;stroke:none;stroke-width:0.561057;stroke-linejoin:round;stroke-miterlimit:2;paint-order:stroke fill markers"
d="m 69.135808,47.705989 c 0,0 0.336734,0.634649 2.389664,1.133196 -1.564426,-1.032364 -1.658981,-2.198084 -1.658981,-2.198084"
id="path1508-2-3-5-96"
sodipodi:nodetypes="ccc" /><path
id="path1510-9-6-6-3"
style="fill:#8530bf;fill-opacity:1;stroke-width:0.52564;stroke-linejoin:round;stroke-miterlimit:2;paint-order:stroke fill markers"
d="m 66.730362,41.568634 a 5.3818111,3.35495 0 0 0 -5.303552,2.798279 c 0.80402,0.185379 1.675644,0.287321 2.585888,0.287321 2.060395,0 3.922483,-0.522612 5.251876,-1.351339 0.418728,-0.261029 0.782948,-0.550035 1.085722,-0.861446 a 5.3818111,3.35495 0 0 0 -3.619934,-0.872815 z m 4.047815,1.144633 c -0.34933,0.374265 -0.771055,0.714774 -1.250053,1.013375 -1.426282,0.889124 -3.370805,1.42782 -5.515426,1.42782 -0.933448,0 -1.829376,-0.101859 -2.660819,-0.290422 a 5.3818111,3.35495 0 0 0 -0.0031,0.05995 5.3818111,3.35495 0 0 0 5.381584,3.354834 5.3818111,3.35495 0 0 0 5.3821,-3.354834 5.3818111,3.35495 0 0 0 -1.334285,-2.210718 z" /></g><g
id="g4196"
style="fill:#dddddd;fill-opacity:1"><g
id="g4110-4"
transform="translate(59.000842,-34.843345)"
style="fill:#dddddd;fill-opacity:1"><ellipse
style="fill:#dddddd;fill-opacity:1;stroke:none;stroke-width:0.695183;stroke-linejoin:round;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path3753-8-3"
cx="0.22994268"
cy="79.393974"
rx="0.7073034"
ry="0.43313131" /><ellipse
style="fill:#dddddd;fill-opacity:1;stroke:none;stroke-width:0.525692;stroke-linejoin:round;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path3753-6-3-3"
cx="-0.826244"
cy="80.132942"
rx="0.56068492"
ry="0.31244308" /><ellipse
style="fill:#dddddd;fill-opacity:1;stroke:none;stroke-width:0.36305;stroke-linejoin:round;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path3753-3-1-3"
cx="-1.9399792"
cy="80.540527"
rx="0.40688068"
ry="0.20534968" /></g><ellipse
style="fill:#dddddd;fill-opacity:1;stroke:none;stroke-width:0.743645;stroke-linejoin:round;stroke-miterlimit:2;paint-order:stroke fill markers"
id="path1510-0-8-1"
cx="64.012863"
cy="40.157925"
rx="7.6138706"
ry="4.7463861" /></g><g
id="g4162"
style="fill:#dddddd;fill-opacity:1"><path
style="fill:#dddddd;fill-opacity:1;stroke:none;stroke-width:0.561057;stroke-linejoin:round;stroke-miterlimit:2;paint-order:stroke fill markers"
d="m 69.135808,71.705989 c 0,0 0.336734,0.634649 2.389664,1.133196 -1.564426,-1.032364 -1.658981,-2.198084 -1.658981,-2.198084"
id="path1508-2-3-5-4"
sodipodi:nodetypes="ccc" /><path
id="path1510-9-6-6-4"
style="fill:#dddddd;fill-opacity:1;stroke-width:0.52564;stroke-linejoin:round;stroke-miterlimit:2;paint-order:stroke fill markers"
d="m 66.730362,65.568634 a 5.3818111,3.35495 0 0 0 -5.303552,2.798279 c 0.80402,0.185379 1.675644,0.287321 2.585888,0.287321 2.060395,0 3.922483,-0.522612 5.251876,-1.351339 0.418728,-0.261029 0.782948,-0.550035 1.085722,-0.861446 a 5.3818111,3.35495 0 0 0 -3.619934,-0.872815 z m 4.047815,1.144633 c -0.34933,0.374265 -0.771055,0.714774 -1.250053,1.013375 -1.426282,0.889124 -3.370805,1.42782 -5.515426,1.42782 -0.933448,0 -1.829376,-0.101859 -2.660819,-0.290422 a 5.3818111,3.35495 0 0 0 -0.0031,0.05995 5.3818111,3.35495 0 0 0 5.381584,3.354834 5.3818111,3.35495 0 0 0 5.3821,-3.354834 5.3818111,3.35495 0 0 0 -1.334285,-2.210718 z" /><path
style="fill:#dddddd;fill-opacity:1;stroke:none;stroke-width:0.79375;stroke-linejoin:round;stroke-miterlimit:2;paint-order:stroke fill markers"
d="m 60.61002,68.094032 c 0,0 -0.476392,0.897865 -3.380757,1.603179 2.213258,-1.460528 2.347029,-3.109719 2.347029,-3.109719"
id="path1508-27-4-4"
sodipodi:nodetypes="ccc" /><ellipse
style="fill:#dddddd;fill-opacity:1;stroke:none;stroke-width:0.743645;stroke-linejoin:round;stroke-miterlimit:2;paint-order:stroke fill markers"
id="path1510-0-8-7"
cx="64.012863"
cy="64.157921"
rx="7.6138706"
ry="4.7463861" /></g><g
id="g4182"
style="fill:#dddddd;fill-opacity:1"><path
id="path1510-9-6-6-9"
style="fill:#dddddd;fill-opacity:1;stroke-width:0.52564;stroke-linejoin:round;stroke-miterlimit:2;paint-order:stroke fill markers"
d="m 42.73036,65.568634 a 5.3818111,3.35495 0 0 0 -5.303552,2.798279 c 0.80402,0.185379 1.675644,0.287321 2.585888,0.287321 2.060395,0 3.922483,-0.522612 5.251876,-1.351339 0.418728,-0.261029 0.782948,-0.550035 1.085722,-0.861446 A 5.3818111,3.35495 0 0 0 42.73036,65.568634 Z m 4.047815,1.144633 c -0.34933,0.374265 -0.771055,0.714774 -1.250053,1.013375 -1.426282,0.889124 -3.370805,1.42782 -5.515426,1.42782 -0.933448,0 -1.829376,-0.101859 -2.660819,-0.290422 a 5.3818111,3.35495 0 0 0 -0.0031,0.05995 5.3818111,3.35495 0 0 0 5.381584,3.354834 5.3818111,3.35495 0 0 0 5.3821,-3.354834 5.3818111,3.35495 0 0 0 -1.334285,-2.210718 z" /><ellipse
style="fill:#dddddd;fill-opacity:1;stroke:none;stroke-width:0.509371;stroke-linejoin:round;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path3753-5"
cx="-46.276207"
cy="71.956123"
rx="0.51825184"
ry="0.31736183"
transform="scale(-1,1)" /><ellipse
style="fill:#dddddd;fill-opacity:1;stroke:none;stroke-width:0.385182;stroke-linejoin:round;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path3753-6-9"
cx="-47.050091"
cy="72.497574"
rx="0.41082227"
ry="0.22893174"
transform="scale(-1,1)" /><ellipse
style="fill:#dddddd;fill-opacity:1;stroke:none;stroke-width:0.266012;stroke-linejoin:round;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path3753-3-7"
cx="-47.866142"
cy="72.796219"
rx="0.29812759"
ry="0.15046281"
transform="scale(-1,1)" /></g><g
id="g4176"
style="fill:#dddddd;fill-opacity:1"><ellipse
style="fill:#dddddd;fill-opacity:1;stroke:none;stroke-width:0.743645;stroke-linejoin:round;stroke-miterlimit:2;paint-order:stroke fill markers"
id="path1510-0-8-0"
cx="40.012859"
cy="64.157921"
rx="7.6138706"
ry="4.7463861" /><ellipse
style="fill:#dddddd;fill-opacity:1;stroke:none;stroke-width:0.695183;stroke-linejoin:round;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path3753"
cx="35.243378"
cy="68.441536"
rx="0.7073034"
ry="0.43313131" /><ellipse
style="fill:#dddddd;fill-opacity:1;stroke:none;stroke-width:0.525692;stroke-linejoin:round;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path3753-6"
cx="34.187191"
cy="69.180504"
rx="0.56068492"
ry="0.31244308" /><ellipse
style="fill:#dddddd;fill-opacity:1;stroke:none;stroke-width:0.36305;stroke-linejoin:round;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path3753-3"
cx="33.073456"
cy="69.588089"
rx="0.40688068"
ry="0.20534968" /></g></g><g
id="g1642-1-6"
transform="translate(4.6126872,-24.786987)" /></g></svg>

After

Width:  |  Height:  |  Size: 15 KiB

BIN
images/buddy_useroff.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

BIN
images/buddy_useron.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 570 B

BIN
images/cake.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
images/construction.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
images/curve.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 KiB

BIN
images/curve2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 KiB

BIN
images/forum_logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
images/generic_attach.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
images/helptopics.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 757 B

BIN
images/helptopics_hd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
images/icons/admin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

63
images/icons/admin.svg Normal file
View file

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="16.779617mm"
height="16.779602mm"
viewBox="0 0 16.779617 16.779602"
version="1.1"
id="svg1571"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14, custom)"
sodipodi:docname="icones.svg"
xml:space="preserve"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
id="namedview1573"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="0.46947953"
inkscape:cx="-563.38985"
inkscape:cy="490.96923"
inkscape:window-width="1920"
inkscape:window-height="1026"
inkscape:window-x="0"
inkscape:window-y="2"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" /><defs
id="defs1568"><rect
id="rect835-3-6-3-2-6-9-6-3"
height="303.83588"
width="372.11261"
y="52.104076"
x="20.339798" /></defs><g
inkscape:label="Calque 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(216.28379,-315.84881)"><g
id="g3320-9"
transform="translate(-145.32913,184.36429)"
inkscape:export-filename="newimages/admin.png"
inkscape:export-xdpi="136"
inkscape:export-ydpi="136"><rect
y="131.48451"
x="-70.954659"
height="16.7796"
width="16.7796"
id="rect1386-5-6-7-48-3-4"
style="display:inline;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.04022;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><text
transform="matrix(0.90648265,0,0,0.90648265,-87.855149,86.244072)"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14.1111px;line-height:100%;font-family:Alegreya;-inkscape-font-specification:Alegreya;letter-spacing:0px;word-spacing:0px;white-space:pre;shape-inside:url(#rect835-3-6-3-2-6-9-6-3);display:inline;fill:#8530bf;fill-opacity:1;stroke:none;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="text833-6-2-6-2-1-8-9-7"
xml:space="preserve"><tspan
x="20.339844"
y="64.198744"
id="tspan15009"></tspan></text></g></g></svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

BIN
images/icons/alerts.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

64
images/icons/alerts.svg Normal file
View file

@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="16.779602mm"
height="16.779572mm"
viewBox="0 0 16.779602 16.779572"
version="1.1"
id="svg1571"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14, custom)"
sodipodi:docname="icones.svg"
xml:space="preserve"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
id="namedview1573"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="0.46947953"
inkscape:cx="-563.38985"
inkscape:cy="490.96923"
inkscape:window-width="1920"
inkscape:window-height="1026"
inkscape:window-x="0"
inkscape:window-y="2"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" /><defs
id="defs1568"><rect
x="20.339798"
y="52.104076"
width="372.11261"
height="303.83588"
id="rect835-3-6-3-2-6-44-5" /></defs><g
inkscape:label="Calque 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(216.28379,-262.2896)"><g
id="g3025-9"
style="display:inline"
transform="translate(-274.56294,142.54894)"
inkscape:export-filename="newimages/suivi.png"
inkscape:export-xdpi="136"
inkscape:export-ydpi="136"><rect
y="119.74065"
x="58.279148"
height="16.7796"
width="16.7796"
id="rect1386-5-6-7-7-4-3"
style="display:inline;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.04022;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><text
xml:space="preserve"
id="text833-6-2-6-2-1-4-1"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14.1111px;line-height:100%;font-family:Alegreya;-inkscape-font-specification:Alegreya;letter-spacing:0px;word-spacing:0px;white-space:pre;shape-inside:url(#rect835-3-6-3-2-6-44-5);display:inline;fill:#8530bf;fill-opacity:1;stroke:none;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
transform="matrix(0.97438646,0,0,0.97438646,40.466307,70.486654)"><tspan
x="20.339844"
y="64.198744"
id="tspan13313"></tspan></text></g></g></svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

1
images/icons/bell.svg Normal file
View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M0 0h512v512H0z"/><path fill="#fff" d="M254.125 26.188c-17.377-.003-31.66 14.28-31.656 31.656 0 7.617 2.733 14.64 7.28 20.125-10.79 3.876-19.043 10.963-26.906 22.06-13.057 18.43-23.687 49.03-35.406 92.782-10.257 38.29-24.345 57.012-34.657 70.563-10.31 13.55-16.252 20.325-16.25 42.688.002 3.5 1.975 7.314 8.44 12.03 6.463 4.717 16.877 9.383 29.905 13.188 26.055 7.612 62.442 11.962 100.25 11.97 19.384.004 38.368-1.15 55.78-3.28v.124c12.13-1.043 33.332-3.898 51.345-10.28 5.795-2.055 11.28-4.422 16.125-7.533 2.612-1.376 4.947-2.747 6.875-4.155 6.458-4.714 8.438-8.523 8.438-12.03-.004-22.363-5.935-29.135-16.25-42.69-10.316-13.553-24.42-32.27-34.688-70.56-11.732-43.757-22.343-74.35-35.406-92.782-8.225-11.607-16.895-18.836-28.438-22.594 4.31-5.41 6.908-12.24 6.906-19.626-.002-17.377-14.31-31.654-31.687-31.657zm0 18.687c7.278 0 13 5.694 13 12.97 0 7.272-5.722 12.97-13 12.968-7.278-.002-12.968-5.696-12.97-12.97 0-7.273 5.693-12.97 12.97-12.968zm9.22 43.22c34.616 10.188 49.56 64.686 58.124 101.56 14.99 64.56 45.652 82.98 53.03 111.25-.327.633-1.002 1.286-2.094 2.408-2.665 2.74-8.816 6.216-16.406 8.906-7.366 2.61-16 4.614-24.188 6.124-1.73-38.024-33.765-53.55-33.25-107.47.603-63.043-17.19-103.352-39.5-121.78 1.468-.233 2.886-.57 4.282-1zm-206.876 91.28C23.546 223.947 11.19 289.253 28.874 355.25c18.208 67.957 63.562 118.994 116.313 140.03-38.592-30.418-72.26-83.223-89.75-148.5-16.674-62.228-14.924-122.366 1.03-167.405zm399.436 0c15.955 45.04 17.705 105.177 1.03 167.406-17.49 65.277-51.157 118.082-89.748 148.5 52.75-21.036 98.135-72.073 116.343-140.03 17.686-65.997 5.298-131.303-27.624-175.875zM105.687 210.28c-29.71 34.43-42.433 83.74-29.343 132.595 13.478 50.306 50.845 87.082 95.5 101.156-32.19-21.55-59.46-60.02-72.406-108.342-12.344-46.066-8.896-91.175 6.25-125.407zm301.032 0c15.144 34.233 18.56 79.342 6.217 125.407-12.947 48.322-40.185 86.793-72.375 108.344 44.655-14.073 81.99-50.85 95.47-101.155 13.09-48.856.396-98.166-29.313-132.594zM146.53 348.25c1.218 12.736 11.944 22.686 25 22.688 9.422 0 17.642-5.173 21.94-12.844-15.986-2.11-30.823-5.08-43.814-8.875-1.06-.31-2.09-.65-3.125-.97z"/></svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
images/icons/clip.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 B

BIN
images/icons/config_hd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 963 B

BIN
images/icons/delete.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

1
images/icons/generic.svg Normal file
View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M0 0h512v512H0z"/><path fill="#fff" d="M451.47 49.25l-70.22.125-5.47-.03L373.064 54l-34.344 58.875-58.876.125-31.188-53.375-2.625-4.72-5.468-.06-70.218.124-5.5-.032-2.688 4.656-34 58.312-65.562.125-5.47-.03-2.718 4.656-35.093 60.188-2.688 4.656 2.78 4.688 31.126 53.28-33.75 57.938-2.718 4.656 2.782 4.688 35.125 60.094 2.593 4.75 5.5.03 67.812-.124 31.03 53.03 2.595 4.75 5.5.033 67.594-.125 31.187 53.375 2.626 4.718 5.47.064 70.218-.125 5.312.092 2.72-4.656 34.155-58.375 65.564-.124 5.312.094 2.688-4.656 35.28-60.25 2.688-4.656-2.78-4.688-35.126-60.094-2.594-4.72-5.5-.06-67.593.124-27.19-46.5 32.94-56.344 61.53-.125 5.313.095 2.687-4.656 35.25-60.25 2.72-4.657-2.783-4.688-35.125-60.094-2.593-4.718-5.5-.062zm-5.345 18.656l29.5 51.094-29.53 50.688-59.47.093L357 118.876l29.656-50.906 59.47-.064zM127.47 136.562l29.5 51.094-29.532 50.688-59.47.094-29.624-50.907L68 136.626l59.47-.063zm106.905 58l28.53 49.5-30.374 52.125-57.78.094-29.5-50.717 29.656-50.907 59.47-.094zm105.313 57.344l29.375 50.938-29.532 50.72-59.467.06-28.72-49.343L281.907 252l57.78-.094zm106.78 57.875l29.5 51.095-29.53 50.688-59.47.062-29.624-50.875L387 309.844l59.47-.063zm-214.53 5.19l29.406 50.967-29.53 50.688-59.47.063-29.625-50.907 29.56-50.717 59.657-.094z"/></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
images/icons/help.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

BIN
images/icons/home.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

65
images/icons/home.svg Normal file
View file

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="16.779617mm"
height="16.7796mm"
viewBox="0 0 16.779617 16.7796"
version="1.1"
id="svg1571"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14, custom)"
sodipodi:docname="icones.svg"
xml:space="preserve"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
id="namedview1573"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="0.46947953"
inkscape:cx="-563.38985"
inkscape:cy="490.96923"
inkscape:window-width="1920"
inkscape:window-height="1026"
inkscape:window-x="0"
inkscape:window-y="2"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" /><defs
id="defs1568"><rect
id="rect835-3-6-3-2-6-91"
height="303.83588"
width="372.11261"
y="52.104076"
x="20.339798" /></defs><g
inkscape:label="Calque 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(216.28379,5.5064782)"><g
id="g3297-3"
transform="translate(-148.51715,-68.124852)"
inkscape:export-filename="newimages/accueil.png"
inkscape:export-xdpi="136"
inkscape:export-ydpi="136"><rect
y="62.618374"
x="-67.76664"
height="16.7796"
width="16.7796"
id="rect1386-5-6-7-9-3-2"
style="display:inline;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.04022;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><text
transform="matrix(0.9743676,0,0,0.9743676,-85.786138,13.365496)"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14.1111px;line-height:100%;font-family:Alegreya;-inkscape-font-specification:Alegreya;letter-spacing:0px;word-spacing:0px;white-space:pre;shape-inside:url(#rect835-3-6-3-2-6-91);display:inline;fill:#8530bf;fill-opacity:1;stroke:none;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="text833-6-2-6-2-1-0"
xml:space="preserve"><tspan
x="20.339844"
y="64.198744"
id="tspan4826"><tspan
style="shape-inside:url(#rect835-3-6-3-2-6-91);display:inline"
id="tspan4824"></tspan></tspan></text></g></g></svg>

After

Width:  |  Height:  |  Size: 2.7 KiB

9
images/icons/index.php Normal file
View file

@ -0,0 +1,9 @@
<?php
// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
include(dirname(dirname(__FILE__)) . '/index.php');
else
exit;
?>

BIN
images/icons/login.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

63
images/icons/login.svg Normal file
View file

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="16.779617mm"
height="16.779602mm"
viewBox="0 0 16.779617 16.779602"
version="1.1"
id="svg1571"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14, custom)"
sodipodi:docname="icones.svg"
xml:space="preserve"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
id="namedview1573"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="0.46947953"
inkscape:cx="-563.38985"
inkscape:cy="490.96923"
inkscape:window-width="1920"
inkscape:window-height="1026"
inkscape:window-x="0"
inkscape:window-y="2"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" /><defs
id="defs1568"><rect
id="rect835-3-6-3-2-6-4-3-5"
height="303.83588"
width="372.11261"
y="52.104076"
x="20.339798" /></defs><g
inkscape:label="Calque 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(216.28379,-369.40801)"><g
id="g3325-8"
transform="translate(-145.32913,215.45785)"
inkscape:export-filename="newimages/login.png"
inkscape:export-xdpi="136"
inkscape:export-ydpi="136"><rect
y="153.95016"
x="-70.954659"
height="16.7796"
width="16.7796"
id="rect1386-5-6-7-04-3-4"
style="display:inline;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.04022;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><text
transform="matrix(1.0367602,0,0,1.0367602,-90.52238,100.7776)"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14.1111px;line-height:100%;font-family:Alegreya;-inkscape-font-specification:Alegreya;letter-spacing:0px;word-spacing:0px;white-space:pre;shape-inside:url(#rect835-3-6-3-2-6-4-3-5);display:inline;fill:#8530bf;fill-opacity:1;stroke:none;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="text833-6-2-6-2-1-1-6-5"
xml:space="preserve"><tspan
x="20.339844"
y="64.198744"
id="tspan16699"></tspan></text></g></g></svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

63
images/icons/logout.svg Normal file
View file

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="16.779617mm"
height="16.779602mm"
viewBox="0 0 16.779617 16.779602"
version="1.1"
id="svg1571"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14, custom)"
sodipodi:docname="icones.svg"
xml:space="preserve"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
id="namedview1573"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="0.46947953"
inkscape:cx="-563.38985"
inkscape:cy="490.96923"
inkscape:window-width="1920"
inkscape:window-height="1026"
inkscape:window-x="0"
inkscape:window-y="2"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" /><defs
id="defs1568"><rect
id="rect835-3-6-3-2-6-4-3-5"
height="303.83588"
width="372.11261"
y="52.104076"
x="20.339798" /></defs><g
inkscape:label="Calque 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(216.28379,-369.40801)"><g
id="g3325-8"
transform="translate(-145.32913,215.45785)"
inkscape:export-filename="newimages/login.png"
inkscape:export-xdpi="136"
inkscape:export-ydpi="136"><rect
y="153.95016"
x="-70.954659"
height="16.7796"
width="16.7796"
id="rect1386-5-6-7-04-3-4"
style="display:inline;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.04022;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><text
transform="matrix(1.0367602,0,0,1.0367602,-90.52238,100.7776)"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14.1111px;line-height:100%;font-family:Alegreya;-inkscape-font-specification:Alegreya;letter-spacing:0px;word-spacing:0px;white-space:pre;shape-inside:url(#rect835-3-6-3-2-6-4-3-5);display:inline;fill:#8530bf;fill-opacity:1;stroke:none;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="text833-6-2-6-2-1-1-6-5"
xml:space="preserve"><tspan
x="20.339844"
y="64.198744"
id="tspan16699"></tspan></text></g></g></svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

BIN
images/icons/members.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

64
images/icons/members.svg Normal file
View file

@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="16.779617mm"
height="16.779602mm"
viewBox="0 0 16.779617 16.779602"
version="1.1"
id="svg1571"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14, custom)"
sodipodi:docname="icones.svg"
xml:space="preserve"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
id="namedview1573"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="0.46947953"
inkscape:cx="-563.38985"
inkscape:cy="490.96923"
inkscape:window-width="1920"
inkscape:window-height="1026"
inkscape:window-x="0"
inkscape:window-y="2"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" /><defs
id="defs1568"><rect
x="20.339798"
y="52.104076"
width="170.43362"
height="365.07245"
id="rect835-69-2-2-2-36-3" /></defs><g
inkscape:label="Calque 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(216.28379,-208.73039)"><g
inkscape:export-ydpi="136"
inkscape:export-xdpi="136"
inkscape:export-filename="newimages/members.png"
id="g3184-7-0"
style="display:inline"
transform="translate(-227.07141,134.09666)"><rect
y="74.633713"
x="10.78762"
height="16.7796"
width="16.7796"
id="rect1386-5-6-7-0-5-9"
style="display:inline;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.04022;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><text
transform="matrix(0.97825566,0,0,0.97825566,-8.1152888,25.150822)"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14.1111px;line-height:100%;font-family:Alegreya;-inkscape-font-specification:Alegreya;letter-spacing:0px;word-spacing:0px;white-space:pre;shape-inside:url(#rect835-69-2-2-2-36-3);display:inline;fill:#8530bf;fill-opacity:1;stroke:none;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="text833-8-8-9-0-3-3"
xml:space="preserve"><tspan
x="20.339844"
y="64.198744"
id="tspan11623"></tspan></text></g></g></svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

10
images/icons/menu.svg Normal file
View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="windows-1252"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="24px" height="24px" viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
<g id="Icons" style="opacity:0.75;">
<path id="menu" d="M6,15h12c0.553,0,1,0.447,1,1v1c0,0.553-0.447,1-1,1H6c-0.553,0-1-0.447-1-1v-1C5,15.447,5.447,15,6,15z M5,11v1 c0,0.553,0.447,1,1,1h12c0.553,0,1-0.447,1-1v-1c0-0.553-0.447-1-1-1H6C5.447,10,5,10.447,5,11z M5,6v1c0,0.553,0.447,1,1,1h12 c0.553,0,1-0.447,1-1V6c0-0.553-0.447-1-1-1H6C5.447,5,5,5.447,5,6z"/>
</g>
<g id="Guides" style="display:none;">
</g>
</svg>

After

Width:  |  Height:  |  Size: 879 B

BIN
images/icons/moderate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Some files were not shown because too many files have changed in this diff Show more