function spa_usergroups_create_usergroup_form() { global $spPaths; ?> <script type="text/javascript"> jQuery(document).ready(function() { spjAjaxForm('sfusergroupnew', 'sfreloadub'); }); </script> <?php spa_paint_options_init(); $ahahURL = SFHOMEURL . 'index.php?sp_ahah=usergroups-loader&sfnonce=' . wp_create_nonce('forum-ahah') . '&saveform=newusergroup'; ?> <form action="<?php echo $ahahURL; ?> " method="post" id="sfusergroupnew" name="sfusergroupnew"> <?php echo sp_create_nonce('forum-adminform_usergroupnew'); spa_paint_open_tab(spa_text('User Groups') . ' - ' . spa_text('Create New User Group'), true); spa_paint_open_panel(); spa_paint_open_fieldset(spa_text('Edit User Group'), 'true', 'edit-user-group'); spa_paint_input(spa_text('User Group Name'), 'usergroup_name', '', false, true); spa_paint_input(spa_text('User Group Description'), 'usergroup_desc', '', false, true); spa_paint_select_start(spa_text('Select Badge'), 'usergroup_badge', 'usergroup_badge'); spa_select_icon_dropdown('usergroup_badge', spa_text('Select Badge'), SF_STORE_DIR . '/' . $spPaths['ranks'] . '/', '', false); spa_paint_select_end('<small>(' . spa_text('Upload badges on the Components - Forum Ranks admin panel') . ')</small>'); spa_paint_checkbox(spa_text('Allow members to join usergroup'), 'usergroup_join', false, false, false, false, '<small>' . spa_text('(Indicates that members are allowed to choose to join this usergroup on their profile page)') . '</small>'); spa_paint_checkbox(spa_text('Is moderator'), 'usergroup_is_moderator', false, false, false, false, '<small>' . spa_text('(Indicates that members of this usergroup are considered Moderators)') . '</small>'); spa_paint_close_fieldset(); spa_paint_close_panel(); do_action('sph_usergroup_create_panel'); spa_paint_close_container(); ?> <div class="sfform-submit-bar"> <input type="submit" class="button-primary" id="saveit" name="saveit" value="<?php spa_etext('Create New User Group'); ?> " /> </div> </form> <?php spa_paint_close_tab(); ?> <div class="sfform-panel-spacer"></div> <?php }
function spa_usergroups_edit_usergroup_form($usergroup_id) { global $spPaths; ?> <script type="text/javascript"> jQuery(document).ready(function() { jQuery('#usergrouprow-<?php echo $usergroup_id; ?> ').addClass('inForm'); spjAjaxForm('sfusergroupedit<?php echo $usergroup_id; ?> ', 'sfreloadub'); }); </script> <?php $usergroup = spa_get_usergroups_row($usergroup_id); spa_paint_options_init(); $ahahURL = SFHOMEURL . 'index.php?sp_ahah=usergroups-loader&sfnonce=' . wp_create_nonce('forum-ahah') . '&saveform=editusergroup'; ?> <form action="<?php echo $ahahURL; ?> " method="post" id="sfusergroupedit<?php echo $usergroup->usergroup_id; ?> " name="sfusergroupedit<?php echo $usergroup->usergroup_id; ?> "> <?php echo sp_create_nonce('forum-adminform_usergroupedit'); spa_paint_open_tab(spa_text('User Groups') . ' - ' . spa_text('Manage User Groups'), true); spa_paint_open_panel(); spa_paint_open_fieldset(spa_text('Edit User Group'), 'true', 'edit-user-group'); ?> <input type="hidden" name="usergroup_id" value="<?php echo $usergroup->usergroup_id; ?> " /> <input type="hidden" name="ugroup_name" value="<?php echo sp_filter_title_display($usergroup->usergroup_name); ?> " /> <input type="hidden" name="ugroup_desc" value="<?php echo sp_filter_title_display($usergroup->usergroup_desc); ?> " /> <input type="hidden" name="ugroup_join" value="<?php echo $usergroup->usergroup_join; ?> " /> <input type="hidden" name="ugroup_ismod" value="<?php echo $usergroup->usergroup_is_moderator; ?> " /> <?php spa_paint_input(spa_text('User Group Name'), 'usergroup_name', sp_filter_title_display($usergroup->usergroup_name), false, true); spa_paint_input(spa_text('User Group Description'), 'usergroup_desc', sp_filter_title_display($usergroup->usergroup_desc), false, true); spa_paint_select_start(spa_text('Select Badge'), 'usergroup_badge', 'usergroup_badge'); spa_select_icon_dropdown('usergroup_badge', spa_text('Select Badge'), SF_STORE_DIR . '/' . $spPaths['ranks'] . '/', $usergroup->usergroup_badge, false); spa_paint_select_end('<small>(' . spa_text('Upload badges on the Components - Forum Ranks admin panel') . ')</small>'); spa_paint_checkbox(spa_text('Allow members to join usergroup'), 'usergroup_join', $usergroup->usergroup_join, false, false, false, '<small>' . spa_text('(Indicates that members are allowed to choose to join this usergroup on their profile page)') . '</small>'); spa_paint_checkbox(spa_text('Is moderator'), 'usergroup_is_moderator', $usergroup->usergroup_is_moderator, false, false, false, '<small>' . spa_text('(Indicates that members of this usergroup are considered Moderators)') . '</small>'); spa_paint_close_fieldset(); spa_paint_close_panel(); do_action('sph_usergroup_edit_panel'); spa_paint_close_container(); ?> <div class="sfform-submit-bar"> <input type="submit" class="button-primary" id="sfusergroupedit<?php echo $usergroup->usergroup_id; ?> " name="sfusergroupedit<?php echo $usergroup->usergroup_id; ?> " value="<?php spa_etext('Update User Group'); ?> " /> <input type="button" class="button-primary" onclick="javascript:jQuery('#usergroup-<?php echo $usergroup->usergroup_id; ?> ').html('');jQuery('#usergrouprow-<?php echo $usergroup_id; ?> ').removeClass('inForm');" id="sfusergroupedit<?php echo $usergroup->usergroup_id; ?> " name="editusergroupcancel<?php echo $usergroup->usergroup_id; ?> " value="<?php spa_etext('Cancel'); ?> " /> </div> </form> <?php spa_paint_close_tab(); ?> <div class="sfform-panel-spacer"></div> <?php }
function spa_forums_edit_forum_form($forum_id) { ?> <script type="text/javascript"> jQuery(document).ready(function() { jQuery('#forumrow-<?php echo $forum_id; ?> ').addClass('inForm'); spjAjaxForm('sfforumedit<?php echo $forum_id; ?> ', 'sfreloadfb'); }); </script> <?php global $spPaths, $tab; $forum = spdb_table(SFFORUMS, "forum_id={$forum_id}", 'row'); spa_paint_options_init(); $ahahURL = SFHOMEURL . 'index.php?sp_ahah=forums-loader&sfnonce=' . wp_create_nonce('forum-ahah') . '&saveform=editforum'; ?> <form action="<?php echo $ahahURL; ?> " method="post" id="sfforumedit<?php echo $forum->forum_id; ?> " name="sfforumedit<?php echo $forum->forum_id; ?> "> <?php echo sp_create_nonce('forum-adminform_forumedit'); spa_paint_open_tab(spa_text('Forums') . ' - ' . spa_text('Manage Groups and Forums'), true); spa_paint_open_panel(); spa_paint_open_fieldset(spa_text('Forum Details'), false); $subforum = $forum->parent ? true : false; echo "<input type='hidden' name='cgroup_id' value='{$forum->group_id}' />"; echo "<input type='hidden' name='cparent' value='{$forum->parent}' />"; echo "<input type='hidden' name='cchildren' value='{$forum->children}' />"; if (!$subforum && empty($forum->children)) { $mess = sp_text('This is a top-level forum with no sub-forums and on this panel you can change the forum Group it is a member of. If changed it will be moved to the target Forum Group.'); } elseif (!$subforum && !empty($forum->children)) { $mess = sp_text('This is a top level forum with designated sub-forums and on this panel you can change the forum Group it is a member of. If changed it will be moved, along with the sub-forums, to the target Forum Group.'); } elseif ($subforum && empty($forum->children)) { $mess = sp_text('This is a sub-forum and on this panel you can change the forum parent it belongs to. If changed it will be moved to become a sub-forum of the target Forum.'); } else { $mess = sp_text('This is a sub-forum and also a parent to other sub-forums and on this panel you can change the forum parent it belongs to. If changed it will be moved, along with the sub-forums, to the target Forum.'); } echo '<div class="sfoptionerror spaceabove">'; echo "<p><b>{$mess}</b></br>"; echo sp_text('For more flexible Group/Forum ordering and sub-forum promotion and demotion, please use the drag and drop interface on the Order Groups and Forums admin panel from the Forums Menu - or the Order Forums panel at Group level.') . '</p>'; echo '</div>'; # Top level forum... $style = $subforum ? ' style="display:none"' : ' style="display:block"'; echo "<div {$style}>"; spa_paint_select_start(spa_text('The group this forum belongs to'), 'group_id', ''); echo spa_create_group_select($forum->group_id); spa_paint_select_end(); echo '</div>'; # sub-forum... $style = $subforum ? ' style="display:block"' : ' style="display:none"'; echo "<div {$style}>"; spa_paint_select_start(spa_text('Parent forum this subforum belongs to'), 'parent', ''); echo spa_create_forum_select($forum->parent); spa_paint_select_end(); echo '</div>'; spa_paint_input(spa_text('Forum name'), 'forum_name', sp_filter_title_display($forum->forum_name), false, true); echo '<input type="hidden" name="forum_id" value="' . $forum->forum_id . '" />'; $target = 'cforum_slug'; $ahahURL = SFHOMEURL . 'index.php?sp_ahah=forums&sfnonce=' . wp_create_nonce('forum-ahah'); echo "<div class='sp-form-row'>\n"; echo "<div class='wp-core-ui sflabel sp-label-40'>" . spa_text('Forum slug') . ':</div>'; echo '<input type="text" class="wp-core-ui sp-input-60" tabindex="' . $tab . '" name="cforum_slug" id="cforum_slug" value="' . esc_attr($forum->forum_slug) . '" onchange="spjSetForumSlug(this, \'' . $ahahURL . '\', \'' . $target . '\', \'edit\');" />'; echo '<div class="clearboth"></div>'; echo '</div>'; $tab++; spa_paint_input(spa_text('Description'), 'forum_desc', sp_filter_text_edit($forum->forum_desc), false, true); spa_paint_close_fieldset(); spa_paint_close_panel(); spa_paint_open_panel(); spa_paint_open_fieldset(spa_text('Forum Options'), false); $target = 'cforum_slug'; $ahahURL = SFHOMEURL . 'index.php?sp_ahah=forums&sfnonce=' . wp_create_nonce('forum-ahah'); spa_paint_checkbox(spa_text('Locked'), 'forum_status', $forum->forum_status); spa_paint_checkbox(spa_text('Disable forum RSS feed so feed will not be generated'), 'forum_private', $forum->forum_rss_private); spa_paint_select_start(sprintf(spa_text('Featured Image for this forum %s(200px x 200px recommended)'), '<br>'), 'feature_image', ''); spa_select_icon_dropdown('feature_image', spa_text('Select Feature Image'), SF_STORE_DIR . '/' . $spPaths['forum-images'] . '/', $forum->feature_image, false); spa_paint_select_end(); echo '<div class="sfoptionerror spaceabove">'; echo '<p><b>' . sp_text('Custom Icon Ordering') . '</b></br>'; echo sp_text('When using custom forum or topic icons and multiple conditions exist, the following precedence is used:') . '</p>'; echo sp_text('Locked') . '<br />'; echo sp_text('Pinned') . '<br />'; echo sp_text('Unread') . '<br />'; echo sp_text('Custom') . '<br />'; echo sp_text('Theme Default') . '<br />'; echo '</div>'; spa_paint_select_start(spa_text('Custom forum icon'), 'forum_icon', ''); spa_select_icon_dropdown('forum_icon', spa_text('Select Custom Icon'), SF_STORE_DIR . '/' . $spPaths['custom-icons'] . '/', $forum->forum_icon, false); spa_paint_select_end(); spa_paint_select_start(spa_text('Custom forum icon when new posts'), 'forum_icon_new', ''); spa_select_icon_dropdown('forum_icon_new', spa_text('Select Custom Icon'), SF_STORE_DIR . '/' . $spPaths['custom-icons'] . '/', $forum->forum_icon_new, false); spa_paint_select_end(); spa_paint_select_start(spa_text('Custom forum icon when locked'), 'forum_icon_locked', ''); spa_select_icon_dropdown('forum_icon_locked', spa_text('Select Custom Icon'), SF_STORE_DIR . '/' . $spPaths['custom-icons'] . '/', $forum->forum_icon_locked, false); spa_paint_select_end(); spa_paint_select_start(spa_text('Custom topic icon'), 'topic_icon', ''); spa_select_icon_dropdown('topic_icon', spa_text('Select Custom Icon'), SF_STORE_DIR . '/' . $spPaths['custom-icons'] . '/', $forum->topic_icon, false); spa_paint_select_end(); spa_paint_select_start(spa_text('Custom topic icon when new posts'), 'topic_icon_new', ''); spa_select_icon_dropdown('topic_icon_new', spa_text('Select Custom Icon'), SF_STORE_DIR . '/' . $spPaths['custom-icons'] . '/', $forum->topic_icon_new, false); spa_paint_select_end(); spa_paint_select_start(spa_text('Custom topic icon when locked'), 'topic_icon_locked', ''); spa_select_icon_dropdown('topic_icon_locked', spa_text('Select Custom Icon'), SF_STORE_DIR . '/' . $spPaths['custom-icons'] . '/', $forum->topic_icon_locked, false); spa_paint_select_end(); spa_paint_select_start(spa_text('Custom topic icon when pinned'), 'topic_icon_pinned', ''); spa_select_icon_dropdown('topic_icon_pinned', spa_text('Select Custom Icon'), SF_STORE_DIR . '/' . $spPaths['custom-icons'] . '/', $forum->topic_icon_pinned, false); spa_paint_select_end(); spa_paint_input(spa_text('Replacement external RSS URL') . '<br />' . spa_text('Default') . ': <strong>' . sp_build_url($forum->forum_slug, '', 0, 0, 0, 1) . '</strong>', 'forum_rss', sp_filter_url_display($forum->forum_rss), false, true); spa_paint_input(spa_text('Custom meta keywords (SEO option must be enabled)'), 'forum_keywords', '', false, true); spa_paint_wide_textarea('Special forum message to be displayed above forums', 'forum_message', sp_filter_text_edit($forum->forum_message)); spa_paint_close_fieldset(); spa_paint_close_panel(); spa_paint_open_panel(); spa_paint_open_fieldset(spa_text('Extended Forum Options'), false); # As added by plugins do_action('sph_forum_edit_forum_options', $forum); spa_paint_close_fieldset(); spa_paint_close_panel(); spa_paint_close_container(); ?> <div class="sfform-submit-bar"> <input type="submit" class="button-primary" id="sfforumedit<?php echo $forum->forum_id; ?> " name="sfforumedit<?php echo $forum->forum_id; ?> " value="<?php spa_etext('Update Forum'); ?> " /> <input type="button" class="button-primary" onclick="javascript:jQuery('#forum-<?php echo $forum->forum_id; ?> ').html('');jQuery('#forumrow-<?php echo $forum_id; ?> ').removeClass('inForm');" id="sfforumedit<?php echo $forum->forum_id; ?> " name="editforumcancel<?php echo $forum->forum_id; ?> " value="<?php spa_etext('Cancel'); ?> " /> </div> <?php spa_paint_close_tab(); ?> </form> <div class="sfform-panel-spacer"></div> <?php }
function spa_forums_edit_group_form($group_id) { ?> <script type="text/javascript"> jQuery(document).ready(function() { jQuery('#grouprow-<?php echo $group_id; ?> ').addClass('inForm'); spjAjaxForm('sfgroupedit<?php echo $group_id; ?> ', 'sfreloadfb'); }); </script> <?php global $spPaths; $group = $group = spdb_table(SFGROUPS, "group_id={$group_id}", 'row'); spa_paint_options_init(); $ahahURL = SFHOMEURL . 'index.php?sp_ahah=forums-loader&sfnonce=' . wp_create_nonce('forum-ahah') . '&saveform=editgroup'; ?> <form action="<?php echo $ahahURL; ?> " method="post" id="sfgroupedit<?php echo $group->group_id; ?> " name="sfgroupedit<?php echo $group->group_id; ?> "> <?php echo sp_create_nonce('forum-adminform_groupedit'); spa_paint_open_tab(spa_text('Forums') . ' - ' . spa_text('Manage Groups and Forums'), false); spa_paint_open_panel(); spa_paint_open_fieldset(spa_text('Edit Group'), 'true', 'edit-forum-group'); ?> <input type="hidden" name="group_id" value="<?php echo $group->group_id; ?> " /> <input type="hidden" name="cgroup_name" value="<?php echo sp_filter_title_display($group->group_name); ?> " /> <input type="hidden" name="cgroup_desc" value="<?php echo sp_filter_text_edit($group->group_desc); ?> " /> <input type="hidden" name="cgroup_seq" value="<?php echo $group->group_seq; ?> " /> <input type="hidden" name="cgroup_icon" value="<?php echo esc_attr($group->group_icon); ?> " /> <input type="hidden" name="cgroup_rss" value="<?php echo $group->group_rss; ?> " /> <input type="hidden" name="cgroup_message" value="<?php echo sp_filter_text_edit($group->group_message); ?> " /> <?php spa_paint_input(spa_text('Group Name'), 'group_name', sp_filter_title_display($group->group_name), false, true); spa_paint_input(spa_text('Description'), 'group_desc', sp_filter_text_edit($group->group_desc), false, true); spa_paint_select_start(spa_text('Select Custom Icon'), 'group_icon', ''); spa_select_icon_dropdown('group_icon', spa_text('Select Custom Icon'), SF_STORE_DIR . '/' . $spPaths['custom-icons'] . '/', $group->group_icon, false); spa_paint_select_end(); spa_paint_input(spa_text('Replacement external RSS URL') . '<br />' . spa_text('Default') . ': <strong>' . sp_get_sfqurl(sp_build_url('', '', 0, 0, 0, 1)) . 'group=' . $group->group_id . '</strong>', 'group_rss', sp_filter_url_display($group->group_rss), false, true); spa_paint_wide_textarea('Special group message to be displayed above forums', 'group_message', sp_filter_text_edit($group->group_message)); do_action('sph_forums_edit_group_panel'); spa_paint_close_fieldset(); echo '<div class="sfoptionerror spaceabove">'; echo sprintf(sp_text('To re-order your Groups, Forums and SubForums use the %s Order Groups and Forums %s option from the Forums Menu'), '<b>', '</b>'); echo '</div>'; spa_paint_close_panel(); spa_paint_tab_right_cell(); spa_paint_open_panel(); spa_paint_open_fieldset(spa_text('Default User Group Permissions'), false); echo '<strong>' . spa_text('Set default usergroup permission sets for this group') . '</strong><br />'; echo spa_text('Note - This will not will add or modify any current permissions. It is only a default setting for future forums created in this group. Existing default usergroup settings will be shown in the drop down menus'); # Permissions $usergroups = spa_get_usergroups_all(); $roles = sp_get_all_roles(); foreach ($usergroups as $usergroup) { echo '<input type="hidden" name="usergroup_id[]" value="' . $usergroup->usergroup_id . '" />'; spa_paint_select_start(sp_filter_title_display($usergroup->usergroup_name), 'role[]', ''); $defrole = spa_get_defpermissions_role($group->group_id, $usergroup->usergroup_id); if ($defrole == -1 || $defrole == '') { echo '<option value="-1">' . spa_text('Select permission set') . '</option>'; } foreach ($roles as $role) { $selected = ''; if ($defrole == $role->role_id) { $selected = 'selected="selected" '; } echo '<option ' . $selected . 'value="' . $role->role_id . '">' . sp_filter_title_display($role->role_name) . '</option>' . "\n"; } spa_paint_select_end(); } spa_paint_close_fieldset(); spa_paint_close_panel(); spa_paint_close_container(); ?> <div class="sfform-submit-bar"> <input type="submit" class="button-primary" id="groupedit<?php echo $group->group_id; ?> " name="groupedit<?php echo $group->group_id; ?> " value="<?php spa_etext('Update Group'); ?> " /> <input type="button" class="button-primary" onclick="javascript:jQuery('#group-<?php echo $group->group_id; ?> ').html('');jQuery('#grouprow-<?php echo $group_id; ?> ').removeClass('inForm');" id="sfgroupedit<?php echo $group->group_id; ?> " name="groupeditcancel<?php echo $group->group_id; ?> " value="<?php spa_etext('Cancel'); ?> " /> </div> </form> <?php spa_paint_close_tab(); ?> <div class="sfform-panel-spacer"></div> <?php }
function spa_paint_rankings_table($rankings) { global $tab, $spPaths; $usergroups = spa_get_usergroups_all(); # sort rankings from lowest to highest if ($rankings) { foreach ($rankings as $x => $info) { $ranks['id'][$x] = $info['meta_id']; $ranks['title'][$x] = $info['meta_key']; $ranks['posts'][$x] = $info['meta_value']['posts']; $ranks['usergroup'][$x] = $info['meta_value']['usergroup']; $ranks['badge'][$x] = !empty($info['meta_value']['badge']) ? $info['meta_value']['badge'] : ''; } array_multisort($ranks['posts'], SORT_ASC, $ranks['title'], $ranks['usergroup'], $ranks['badge'], $ranks['id']); } ?> <table class="widefat fixed spMobileTable1280"> <thead> <tr> <th style='text-align:center'><?php spa_etext('Forum Rank Name'); ?> </th> <th style='text-align:center'><?php spa_etext('# Posts For Rank'); ?> </th> <th style='text-align:center'><?php spa_etext('Automatic User Group Membership'); ?> </th> <th style='text-align:center'><?php spa_etext('Badge'); ?> </th> <th style='text-align:center'><?php spa_etext('Remove'); ?> </th> </tr> </thead> <tbody> <?php # display rankings info $class = 'class ="spMobileTableData"'; for ($x = 0; $x < count($rankings); $x++) { ?> <tr id="rank<?php echo $x; ?> " <?php echo $class; ?> > <td data-label='<?php spa_etext('Forum Rank Name'); ?> '> <input type='text' size="12" class='wp-core-ui' tabindex='<?php echo $tab; ?> ' name='rankdesc[]' value='<?php echo esc_attr($ranks['title'][$x]); ?> ' /> <input type='hidden' name='rankid[]' value='<?php echo esc_attr($ranks['id'][$x]); ?> ' /> </td> <?php $tab++; ?> <td data-label='<?php spa_etext('# Posts For Rank'); ?> '> <input type='text' class='wp-core-ui' size='5' tabindex='<?php echo $tab; ?> ' name='rankpost[]' value='<?php echo $ranks['posts'][$x]; ?> ' /> <?php echo ' ' . spa_text('Posts'); ?> </td> <?php $tab++; ?> <td data-label='<?php spa_etext('Auto User Group'); ?> '> <select class="wp-core-ui" name="rankug[]" style="width:135px;"> <?php if ($ranks['usergroup'][$x] == 'none') { $out = '<option value="none" selected="selected">' . spa_text('None') . '</option>'; } else { $out = '<option value="none">' . spa_text('None') . '</option>'; } foreach ($usergroups as $usergroup) { if ($ranks['usergroup'][$x] == $usergroup->usergroup_id) { $selected = ' SELECTED'; } else { $selected = ''; } $out .= '<option value="' . $usergroup->usergroup_id . '"' . $selected . '>' . sp_filter_title_display($usergroup->usergroup_name) . '</option>'; } echo $out; ?> </select> </td> <?php $tab++; ?> <td data-label='<?php spa_etext('Badge'); ?> '> <?php spa_select_icon_dropdown('rankbadge[]', spa_text('Select Badge'), SF_STORE_DIR . '/' . $spPaths['ranks'] . '/', $ranks['badge'][$x], true, 135); ?> </td> <?php $tab++; ?> <td data-label='<?php spa_etext('Remove'); ?> '> <?php $site = SFHOMEURL . 'index.php?sp_ahah=components&sfnonce=' . wp_create_nonce('forum-ahah') . '&action=del_rank&key=' . $ranks['id'][$x]; ?> <img onclick="spjDelRow('<?php echo $site; ?> ', 'rank<?php echo $x; ?> ');" src="<?php echo SFCOMMONIMAGES; ?> delete.png" title="<?php spa_etext('Delete Rank'); ?> " alt="" /> </td> <?php $tab++; ?> </tr> <?php $class = strpos($class, 'alternate') === false ? 'class="spMobileTableData alternate"' : 'class="spMobileTableData"'; } ?> <!--empty row fir new rank--> <tr class="spMobileTableData"> <td data-label='<?php spa_etext('Forum Rank Name'); ?> '> <input type='text' size="12" class='wp-core-ui' tabindex='<?php echo $tab; ?> ' name='rankdesc[]' value='' /> <input type='hidden' name='rankid[]' value='-1' /> </td> <?php $tab++; ?> <td data-label='<?php spa_etext('# Posts For Rank'); ?> '> <input type='text' class='wp-core-ui' size='5' tabindex='<?php echo $tab; ?> ' name='rankpost[]' value='' /> <?php echo ' ' . spa_text('Posts'); ?> </td> <?php $tab++; ?> <td data-label='<?php spa_etext('Auto User Group'); ?> '> <select class="wp-core-ui" name="rankug[]" style="width:135px;"> <?php $out = '<option value="none">' . spa_text('None') . '</option>'; foreach ($usergroups as $usergroup) { $out .= '<option value="' . $usergroup->usergroup_id . '">' . sp_filter_title_display($usergroup->usergroup_name) . '</option>'; } echo $out; ?> </select> </td> <?php $tab++; ?> <td data-label='<?php spa_etext('Badge'); ?> '> <?php spa_select_icon_dropdown('rankbadge[]', spa_text('Select Badge'), SF_STORE_DIR . '/' . $spPaths['ranks'] . '/', '', true, 135); ?> </td> <?php $tab++; ?> <td></td> </tr> </tbody> </table> <?php }
function spa_special_rankings_form($rankings) { global $tab, $spPaths; ?> <script type="text/javascript"> jQuery(document).ready(function() { spjAjaxForm('sfaddspecialrank', 'sfreloadfr'); }); </script> <?php spa_paint_options_init(); $ahahURL = SFHOMEURL . 'index.php?sp_ahah=components-loader&sfnonce=' . wp_create_nonce('forum-ahah') . '&saveform=specialranks&action=newrank'; ?> <form action="<?php echo $ahahURL; ?> " method="post" name="sfaddspecialrank" id="sfaddspecialrank"> <?php echo sp_create_nonce('special-rank-new'); spa_paint_open_tab(spa_text('Components') . ' - ' . spa_text('Special Forum Ranks'), true); spa_paint_open_panel(); spa_paint_open_fieldset(spa_text('Special Forum Ranks'), true, 'special-ranks'); spa_paint_input(spa_text('New Special Rank Name'), 'specialrank', '', false, true); echo '<input type="submit" class="button-primary" id="addspecialrank" name="addspecialrank" value="' . spa_text('Add Special Rank') . '" />'; spa_paint_close_fieldset(); do_action('sph_components_add_rank_panel'); echo '</form>'; spa_paint_close_panel(); spa_paint_close_container(); echo '<div class="sfform-panel-spacer"></div>'; spa_paint_close_tab(); # display rankings info if ($rankings) { spa_paint_open_nohead_tab(true); spa_paint_open_panel(); ?> <table class="wp-list-table widefat"> <tr> <th width="50%"><strong><?php spa_etext('Special Rank Name'); ?> </strong></th> <th width="50%"><strong><?php spa_etext('Special Rank Badge'); ?> </strong></th> </tr> </table> <?php foreach ($rankings as $rank) { ?> <script type="text/javascript"> jQuery(document).ready(function() { spjAjaxForm('sfspecialrankupdate<?php echo $rank['meta_id']; ?> ', ''); }); </script> <?php $ahahURL = SFHOMEURL . 'index.php?sp_ahah=components-loader&sfnonce=' . wp_create_nonce('forum-ahah') . '&saveform=specialranks&action=updaterank&id=' . $rank['meta_id']; $delsite = SFHOMEURL . 'index.php?sp_ahah=components&sfnonce=' . wp_create_nonce('forum-ahah') . '&action=del_specialrank&key=' . $rank['meta_id']; ?> <form action="<?php echo $ahahURL; ?> " method="post" id="sfspecialrankupdate<?php echo $rank['meta_id']; ?> " name="sfspecialrankupdate<?php echo $rank['meta_id']; ?> "> <?php echo sp_create_nonce('special-rank-update'); ?> <table class="wp-list-table widefat" id="srank<?php echo $rank['meta_id']; ?> "> <tr> <td width="50%" style="overflow:hidden"> <input type="text" class="wp-core-ui" size="16" tabindex="'.$tab.'" name="<?php echo 'specialrankdesc[' . $rank['meta_id'] . ']'; ?> " value="<?php echo $rank['meta_key']; ?> " /> </td> <td width="50%" style="overflow:hidden"> <?php spa_select_icon_dropdown('specialrankbadge[' . $rank['meta_id'] . ']', spa_text('Select Badge'), SF_STORE_DIR . '/' . $spPaths['ranks'] . '/', $rank['meta_value']['badge'], true, 105); ?> </td> </tr> <tr> <td colspan="2"> <div class="sp-half-row-left"> <input type="submit" class="button-primary" style="vertical-align:top;" id="updatespecialrank.<?php echo $rank['meta_id']; ?> " name="updatespecialrank.<?php echo $rank['meta_id']; ?> " value="<?php spa_etext('Update Rank'); ?> " /> </form> <img style="vertical-align:top;" onclick="spjDelRow('<?php echo $delsite; ?> ', 'srank<?php echo $rank['meta_id']; ?> ');" src="<?php echo SFCOMMONIMAGES; ?> delete.png" title="<?php spa_etext('Delete Special Rank'); ?> " alt="" /> <?php $loc = '#sfrankshow-' . $rank['meta_id']; $site = SFHOMEURL . 'index.php?sp_ahah=components&sfnonce=' . wp_create_nonce('forum-ahah') . '&action=show&key=' . $rank['meta_id']; $gif = SFCOMMONIMAGES . 'working.gif'; $text = esc_js(spa_text('Show/Hide Members')); ?> <input type="button" id="show<?php echo $rank['meta_id']; ?> " class="button-secondary" value="<?php echo $text; ?> " onclick="spjToggleRow('<?php echo $loc; ?> ');spjShowMemberList('<?php echo $site; ?> ', '<?php echo $gif; ?> ', '<?php echo $rank['meta_id']; ?> ');" /> </div> <div class="sp-half-row-right"> <?php $base = SFHOMEURL . 'index.php?sp_ahah=components-loader&sfnonce=' . wp_create_nonce('forum-ahah'); $target = 'members-' . $rank['meta_id']; $image = SFADMINIMAGES; ?> <input type="button" id="remove<?php echo $rank['meta_id']; ?> " class="button-secondary button-jump-left" value="<?php spa_etext('Remove Members'); ?> " onclick="jQuery('<?php echo $loc; ?> ').show();spjLoadForm('delmembers', '<?php echo $base; ?> ', '<?php echo $target; ?> ', '<?php echo $image; ?> ', '<?php echo $rank['meta_id']; ?> ', 'open'); " /> <input type="button" id="add<?php echo $rank['meta_id']; ?> " class="button-secondary button-jump-left" value="<?php spa_etext('Add Members'); ?> " onclick="jQuery('<?php echo $loc; ?> ').show();spjLoadForm('addmembers', '<?php echo $base; ?> ', '<?php echo $target; ?> ', '<?php echo $image; ?> ', '<?php echo $rank['meta_id']; ?> ', 'open'); " /> </div </td> </tr> <tr id="sfrankshow-<?php echo $rank['meta_id']; ?> "> <td colspan="2"> <div id="members-<?php echo $rank['meta_id']; ?> "></div> </td> </tr> </table> <?php } spa_paint_close_panel(); spa_paint_close_container(); echo '<div class="sfform-panel-spacer"></div>'; spa_paint_close_tab(); } }
function spa_forums_create_forum_form() { ?> <script type="text/javascript"> jQuery(document).ready(function() { spjAjaxForm('sfforumnew', 'sfreloadfb'); }); </script> <?php global $spPaths, $tab; spa_paint_options_init(); $ahahURL = SFHOMEURL . 'index.php?sp_ahah=forums-loader&sfnonce=' . wp_create_nonce('forum-ahah') . '&saveform=createforum'; ?> <form action="<?php echo $ahahURL; ?> " method="post" id="sfforumnew" name="sfforumnew"> <?php echo sp_create_nonce('forum-adminform_forumnew'); spa_paint_open_tab(spa_text('Forums') . ' - ' . spa_text('Create New Forum'), true); spa_paint_open_panel(); spa_paint_open_fieldset(spa_text('Create New Forum'), 'true', 'create-new-forum'); # check there are groups before proceeding if (spdb_count(SFGROUPS) == 0) { echo '<br /><div class="sfoptionerror">'; spa_etext('There are no groups defined'); echo '<br />' . spa_text('Create new group'); echo '</div><br />'; spa_paint_close_fieldset(); spa_paint_close_panel(); spa_paint_close_container(); spa_paint_close_tab(); echo '</form>'; return; } # Select the forum type first echo "<div class='sp-form-row'>\n"; echo "<div class='wp-core-ui sflabel sp-label-40'>" . spa_text('What type of forum are you creating') . ":</div>\n"; echo "<div class='wp-core-ui sp-radio'>"; echo '<input type="radio" name="forumtype" id="sfradio1" tabindex="' . $tab . '" value="1" checked="checked" onchange="spjSetForumOptions(\'forum\');" />' . "\n"; echo '<label for="sfradio1" class="wp-core-ui">' . spa_text('Standard Forum') . '</label><br>' . "\n"; $tab++; # check there are forums before offering subforum creation! if (spdb_count(SFFORUMS) != 0) { echo '<input type="radio" name="forumtype" id="sfradio2" tabindex="' . $tab . '" value="2" onchange="spjSetForumOptions(\'subforum\');" />' . "\n"; echo '<label for="sfradio2" class="wp-core-ui">' . spa_text('Sub or child forum') . '</label>' . "\n"; $tab++; } echo '</div><div class="clearboth"></div></div>'; # Now display the two select box options $ahahURL = SFHOMEURL . 'index.php?sp_ahah=forums&sfnonce=' . wp_create_nonce('forum-ahah'); $target = 'fseq'; echo '<div id="groupselect" style="display:block;">'; echo "<div class='sp-form-row'>\n"; echo "<div class='wp-core-ui sflabel sp-label-40'>" . spa_text('Select group new forum will belong to') . ":</div>\n"; echo '<select class="wp-core-ui sp-input-60" tabindex="' . $tab . '" name="group_id" onchange="spjSetForumSequence();">'; echo spa_create_group_select(0, 1); echo "</select>\n"; echo '<div class="clearboth"></div>'; echo '</div>'; $tab++; echo '</div>'; echo '<div id="forumselect" style="display:none;">'; echo "<div class='sp-form-row'>\n"; echo "<div class='wp-core-ui sflabel sp-label-40'>" . spa_text('Select forum new subforum will belong to') . ":</div>\n"; echo '<select class="wp-core-ui sp-input-60" tabindex="' . $tab . '" name="forum_id" onchange="spjSetForumSequence();">'; echo sp_render_group_forum_select(false, false, false, true); echo "</select>\n"; echo '<div class="clearboth"></div>'; echo '</div>'; $tab++; echo '</div>'; spa_paint_close_fieldset(); spa_paint_close_panel(); spa_paint_close_container(); echo '<div class="sfform-panel-spacer"></div>'; spa_paint_close_tab(); echo '<div class="sfform-panel-spacer"></div>'; echo '<div class="sfhidden" id="block1">'; spa_paint_open_nohead_tab(false); spa_paint_open_panel(); spa_paint_open_fieldset(spa_text('Forum Details'), false); $target = 'thisforumslug'; $ahahURL = SFHOMEURL . 'index.php?sp_ahah=forums&sfnonce=' . wp_create_nonce('forum-ahah'); # forum name and slug echo "<div class='sp-form-row'>"; echo "<div class='wp-core-ui sflabel sp-label-40'>" . spa_text('Forum Name') . ':</div>'; echo '<input type="text" class="wp-core-ui sp-input-60" tabindex="' . $tab . '" name="forum_name" value="" onchange="spjSetForumSlug(this, \'' . $ahahURL . '\', \'' . $target . '\', \'new\');" />'; echo '<div class="clearboth"></div>'; echo '</div>'; $tab++; echo "<div class='sp-form-row'>\n"; echo "<div class='wp-core-ui sflabel sp-label-40'>" . spa_text('Forum slug') . ":</div>"; echo '<input type="text" class="wp-core-ui sp-input-60" tabindex="' . $tab . '" name="thisforumslug" id="thisforumslug" value="" disabled="disabled" onchange="spjSetForumSlug(this, \'' . $ahahURL . '\', \'' . $target . '\', \'new\');" />'; echo '<div class="clearboth"></div>'; echo '</div>'; $tab++; spa_paint_input(spa_text('Description'), 'forum_desc', '', false, true); spa_paint_checkbox(spa_text('Locked'), 'forum_status', 0); spa_paint_checkbox(spa_text('Disable forum RSS feed so feed will not be generated'), 'forum_private', 0); echo '<div class="sfoptionerror spaceabove">'; echo '<p><b>' . sp_text('Custom Icon Ordering') . '</b></br>'; echo sp_text('When using custom forum or topic icons and multiple conditions exist, the following precedence is used:') . '</p>'; echo sp_text('Locked') . '<br />'; echo sp_text('Pinned') . '<br />'; echo sp_text('Unread') . '<br />'; echo sp_text('Custom') . '<br />'; echo sp_text('Theme Default') . '<br />'; echo '</div>'; spa_paint_select_start(spa_text('Custom forum icon'), 'forum_icon', ''); spa_select_icon_dropdown('forum_icon', spa_text('Select Custom Icon'), SF_STORE_DIR . '/' . $spPaths['custom-icons'] . '/', '', false); spa_paint_select_end(); spa_paint_select_start(spa_text('Custom forum icon when new posts'), 'forum_icon_new', ''); spa_select_icon_dropdown('forum_icon_new', spa_text('Select Custom Icon'), SF_STORE_DIR . '/' . $spPaths['custom-icons'] . '/', '', false); spa_paint_select_end(); spa_paint_select_start(spa_text('Custom forum icon when locked'), 'forum_icon_locked', ''); spa_select_icon_dropdown('forum_icon_locked', spa_text('Select Custom Icon'), SF_STORE_DIR . '/' . $spPaths['custom-icons'] . '/', '', false); spa_paint_select_end(); spa_paint_select_start(spa_text('Custom topic icon'), 'topic_icon', ''); spa_select_icon_dropdown('topic_icon', spa_text('Select Custom Icon'), SF_STORE_DIR . '/' . $spPaths['custom-icons'] . '/', '', false); spa_paint_select_end(); spa_paint_select_start(spa_text('Custom topic icon when new posts'), 'topic_icon_new', ''); spa_select_icon_dropdown('topic_icon_new', spa_text('Select Custom Icon'), SF_STORE_DIR . '/' . $spPaths['custom-icons'] . '/', '', false); spa_paint_select_end(); spa_paint_select_start(spa_text('Custom topic icon when locked'), 'topic_icon_locked', ''); spa_select_icon_dropdown('topic_icon_locked', spa_text('Select Custom Icon'), SF_STORE_DIR . '/' . $spPaths['custom-icons'] . '/', '', false); spa_paint_select_end(); spa_paint_select_start(spa_text('Custom topic icon when pinned'), 'topic_icon_pinned', ''); spa_select_icon_dropdown('topic_icon_pinned', spa_text('Select Custom Icon'), SF_STORE_DIR . '/' . $spPaths['custom-icons'] . '/', '', false); spa_paint_select_end(); spa_paint_input(spa_text('Custom meta keywords (SEO option must be enabled)'), 'forum_keywords', '', false, true); spa_paint_wide_textarea('Special forum message to be displayed above forums', 'forum_message', ''); spa_paint_close_fieldset(); echo '<div class="sfoptionerror spaceabove">'; echo sprintf(sp_text('To re-order your Groups, Forums and SubForums use the %s Order Groups and Forums %s option from the Forums Menu'), '<b>', '</b>'); echo '</div>'; spa_paint_close_panel(); spa_paint_tab_right_cell(); spa_paint_open_panel(); spa_paint_open_fieldset(spa_text('Extended Forum Options'), false); # As added by plugins do_action('sph_forum_create_forum_options'); spa_paint_close_fieldset(); spa_paint_close_panel(); spa_paint_open_panel(); spa_paint_open_fieldset(spa_text('Add User Group Permissions'), false); echo '<div id="block2" class="sfhidden">'; echo '<strong>' . spa_text('You can selectively set the permission sets for the forum below. If you want to use the default permissions for the selected group, then do not select anything') . '</strong>'; # Permissions $usergroups = spa_get_usergroups_all(); $roles = sp_get_all_roles(); foreach ($usergroups as $usergroup) { echo '<input type="hidden" name="usergroup_id[]" value="' . $usergroup->usergroup_id . '" />'; spa_paint_select_start(sp_filter_title_display($usergroup->usergroup_name), 'role[]', ''); echo '<option value="-1">' . spa_text('Select permission set') . '</option>'; foreach ($roles as $role) { echo '<option value="' . $role->role_id . '">' . sp_filter_title_display($role->role_name) . '</option>' . "\n"; } spa_paint_select_end(); } echo '</div>'; spa_paint_close_fieldset(); spa_paint_close_panel(); spa_paint_close_container(); ?> <div class="sfform-submit-bar"> <input type="submit" class="button-primary" id="saveit" name="saveit" value="<?php spa_etext('Create New Forum'); ?> " /> </div> <?php spa_paint_close_tab(); ?> </div> </form> <div class="sfform-panel-spacer"></div> <?php }
function spa_forums_create_group_form() { ?> <script type="text/javascript"> jQuery(document).ready(function() { spjAjaxForm('sfgroupnew', 'sfreloadfb'); }); </script> <?php global $spPaths; spa_paint_options_init(); $ahahURL = SFHOMEURL . 'index.php?sp_ahah=forums-loader&sfnonce=' . wp_create_nonce('forum-ahah') . '&saveform=creategroup'; ?> <form action="<?php echo $ahahURL; ?> " method="post" id="sfgroupnew" name="sfgroupnew"> <?php echo sp_create_nonce('forum-adminform_groupnew'); spa_paint_open_tab(spa_text('Forums') . ' - ' . spa_text('Create New Group'), false); spa_paint_open_panel(); spa_paint_open_fieldset(spa_text('Create New Group'), 'true', 'create-new-forum-group'); spa_paint_input(spa_text('Group Name'), 'group_name', '', false, true); spa_paint_input(spa_text('Description'), 'group_desc', '', false, true); spa_paint_select_start(spa_text('Select Custom Icon'), 'group_icon', ''); spa_select_icon_dropdown('group_icon', spa_text('Select Custom Icon'), SF_STORE_DIR . '/' . $spPaths['custom-icons'] . '/', '', false); spa_paint_select_end(); spa_paint_wide_textarea('Special group message to be displayed above forums', 'group_message', ''); do_action('sph_forums_create_group_panel'); spa_paint_close_fieldset(); echo '<div class="sfoptionerror spaceabove">'; echo sprintf(sp_text('To re-order your Groups, Forums and SubForums use the %s Order Groups and Forums %s option from the Forums Menu'), '<b>', '</b>'); echo '</div>'; spa_paint_close_panel(); spa_paint_tab_right_cell(); spa_paint_open_panel(); spa_paint_open_fieldset(spa_text('Default User Group Permissions'), false); echo '<strong>' . spa_text('Set default usergroup permission sets for this group') . '</strong><br />'; echo spa_text('Note - This will not add or modify any current permissions. It is only a default setting for future forums created in this group.'); # Permissions $usergroups = spa_get_usergroups_all(); $roles = sp_get_all_roles(); foreach ($usergroups as $usergroup) { echo '<input type="hidden" name="usergroup_id[]" value="' . $usergroup->usergroup_id . '" />'; spa_paint_select_start(sp_filter_title_display($usergroup->usergroup_name), 'role[]', ''); echo '<option value="-1">' . spa_text('Select permission set') . '</option>'; foreach ($roles as $role) { echo '<option value="' . $role->role_id . '">' . sp_filter_title_display($role->role_name) . '</option>' . "\n"; } spa_paint_select_end(); } spa_paint_close_fieldset(); spa_paint_close_panel(); spa_paint_close_container(); ?> <div class="sfform-submit-bar"> <input type="submit" class="button-primary" id="saveit" name="saveit" value="<?php spa_etext('Create New Group'); ?> " /> </div> </form> <?php spa_paint_close_tab(); ?> <div class="sfform-panel-spacer"></div> <?php }