Beispiel #1
0
function __wps__plugin_forum() {

  	echo '<div class="wrap">';
  	echo '<div id="icon-themes" class="icon32"><br /></div>';
  	echo '<h2>'.sprintf(__('%s Options', WPS_TEXT_DOMAIN), WPS_WL).'</h2><br />';

	__wps__show_tabs_header('forum');

	global $wpdb;

		// See if the user has posted forum settings
		if( isset($_POST[ 'symposium_update' ]) && $_POST[ 'symposium_update' ] == '__wps__plugin_forum' ) {

			update_option(WPS_OPTIONS_PREFIX.'_send_summary', isset($_POST[ 'send_summary' ]) ? $_POST[ 'send_summary' ] : '');
			update_option(WPS_OPTIONS_PREFIX.'_include_admin', isset($_POST[ 'include_admin' ]) ? $_POST[ 'include_admin' ] : '');
			update_option(WPS_OPTIONS_PREFIX.'_oldest_first', isset($_POST[ 'oldest_first' ]) ? $_POST[ 'oldest_first' ] : '');
			update_option(WPS_OPTIONS_PREFIX.'_use_votes', isset($_POST[ 'use_votes' ]) ? $_POST[ 'use_votes' ] : '');
			update_option(WPS_OPTIONS_PREFIX.'_use_votes_remove', $_POST[ 'use_votes_remove' ] != '' ? $_POST[ 'use_votes_remove' ] : 0);
			update_option(WPS_OPTIONS_PREFIX.'_use_votes_min', $_POST[ 'use_votes_min' ] != '' ? $_POST[ 'use_votes_min' ] : 10);
			update_option(WPS_OPTIONS_PREFIX.'_preview1', $_POST[ 'preview1' ] != '' ? $_POST[ 'preview1' ] : 0);
			update_option(WPS_OPTIONS_PREFIX.'_preview2', $_POST[ 'preview2' ] != '' ? $_POST[ 'preview2' ] : 100);
			update_option(WPS_OPTIONS_PREFIX.'_chatroom_banned', $_POST[ 'chatroom_banned' ]);
			update_option(WPS_OPTIONS_PREFIX.'_closed_word', $_POST[ 'closed_word' ]);
			update_option(WPS_OPTIONS_PREFIX.'_bump_topics', isset($_POST[ 'bump_topics' ]) ? $_POST[ 'bump_topics' ] : '');
			update_option(WPS_OPTIONS_PREFIX.'_forum_ajax', isset($_POST[ 'forum_ajax' ]) ? $_POST[ 'forum_ajax' ] : '');
			update_option(WPS_OPTIONS_PREFIX.'_forum_login', isset($_POST[ 'forum_login' ]) ? $_POST[ 'forum_login' ] : '');
			update_option(WPS_OPTIONS_PREFIX.'_moderation', isset($_POST[ 'moderation' ]) ? $_POST[ 'moderation' ] : '');
			$sharing_permalink = (isset($_POST[ 'sharing_permalink' ])) ? "pl;" : ""; 
			$sharing_facebook = (isset($_POST[ 'sharing_facebook' ])) ? "fb;" : ""; 
			$sharing_twitter = (isset($_POST[ 'sharing_twitter' ])) ? "tw;" : ""; 
			$sharing_myspace = (isset($_POST[ 'sharing_myspace' ])) ? "ms;" : ""; 
			$sharing_bebo = (isset($_POST[ 'sharing_bebo' ])) ? "be;" : ""; 
			$sharing_linkedin = (isset($_POST[ 'sharing_linkedin' ])) ? "li;" : ""; 
			$sharing_email = (isset($_POST[ 'sharing_email' ])) ? "em;" : ""; 
			$sharing = $sharing_permalink.$sharing_facebook.$sharing_twitter.$sharing_myspace.$sharing_bebo.$sharing_linkedin.$sharing_email;
			update_option(WPS_OPTIONS_PREFIX.'_sharing', $sharing);
			$forum_ranks = (isset($_POST[ 'forum_ranks' ])) ? $_POST[ 'forum_ranks' ].';' : '';
			for ( $rank = 1; $rank <= 11; $rank ++) {
				$forum_ranks .= $_POST['rank'.$rank].";";
				$forum_ranks .= $_POST['score'.$rank].";";
			}
			update_option(WPS_OPTIONS_PREFIX.'_forum_ranks', $forum_ranks);
			update_option(WPS_OPTIONS_PREFIX.'_symposium_forumlatestposts_count', $_POST[ 'symposium_forumlatestposts_count' ] != '' ? $_POST[ 'symposium_forumlatestposts_count' ] : 10);
			update_option(WPS_OPTIONS_PREFIX.'_forum_uploads', isset($_POST[ 'forum_uploads' ]) ? $_POST[ 'forum_uploads' ] : '');
			update_option(WPS_OPTIONS_PREFIX.'_forum_thumbs', isset($_POST[ 'forum_thumbs' ]) ? $_POST[ 'forum_thumbs' ] : '');
			update_option(WPS_OPTIONS_PREFIX.'_forum_thumbs_size', $_POST[ 'forum_thumbs_size' ]);
			update_option(WPS_OPTIONS_PREFIX.'_forum_login_form', isset($_POST[ 'forum_login_form' ]) ? $_POST[ 'forum_login_form' ] : '');
			update_option(WPS_OPTIONS_PREFIX.'_forum_info', isset($_POST[ 'forum_info' ]) ? $_POST[ 'forum_info' ] : '');
			update_option(WPS_OPTIONS_PREFIX.'_forum_stars', isset($_POST[ 'forum_stars' ]) ? $_POST[ 'forum_stars' ] : '');
			update_option(WPS_OPTIONS_PREFIX.'_forum_refresh', isset($_POST[ 'forum_refresh' ]) ? $_POST[ 'forum_refresh' ] : '');
			update_option(WPS_OPTIONS_PREFIX.'_use_answers', isset($_POST[ 'use_answers' ]) ? $_POST[ 'use_answers' ] : '');
			update_option(WPS_OPTIONS_PREFIX.'_wps_default_forum', $_POST[ 'wps_default_forum' ]);
			update_option(WPS_OPTIONS_PREFIX.'_use_bbcode', isset($_POST[ 'use_bbcode' ]) ? $_POST[ 'use_bbcode' ] : '');
			update_option(WPS_OPTIONS_PREFIX.'_use_bbcode_icons', isset($_POST[ 'use_bbcode_icons' ]) ? $_POST[ 'use_bbcode_icons' ] : '');
			update_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg', isset($_POST[ 'use_wysiwyg' ]) && !isset($_POST[ 'use_bbcode' ]) ? $_POST[ 'use_wysiwyg' ] : '');
			update_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_1', (isset($_POST[ 'use_wysiwyg_1' ]) && $_POST[ 'use_wysiwyg_1' ] != '') ? $_POST[ 'use_wysiwyg_1' ] : 'bold,italic,|,fontselect,fontsizeselect,forecolor,backcolor,|,bullist,numlist,|,link,unlink,|,image,media,|,emotions');
			update_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_2', (isset($_POST[ 'use_wysiwyg_2' ]) && $_POST[ 'use_wysiwyg_2' ] != '') ? $_POST[ 'use_wysiwyg_2' ] : '');
			update_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_3', (isset($_POST[ 'use_wysiwyg_3' ]) && $_POST[ 'use_wysiwyg_3' ] != '') ? $_POST[ 'use_wysiwyg_3' ] : '');
			update_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_4', (isset($_POST[ 'use_wysiwyg_4' ]) && $_POST[ 'use_wysiwyg_4' ] != '') ? $_POST[ 'use_wysiwyg_4' ] : '');
			update_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_css', (isset($_POST[ 'use_wysiwyg_css' ])) ? $_POST[ 'use_wysiwyg_css' ] : '');
			update_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_skin', (isset($_POST[ 'use_wysiwyg_skin' ])) ? $_POST[ 'use_wysiwyg_skin' ] : '');
			update_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_width', $_POST[ 'use_wysiwyg_width' ]);
			update_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_height', $_POST[ 'use_wysiwyg_height' ]);
			update_option(WPS_OPTIONS_PREFIX.'_forum_lock', $_POST[ 'forum_lock' ] != '' ? $_POST[ 'forum_lock' ] : 0);
			update_option(WPS_OPTIONS_PREFIX.'_include_context', isset($_POST[ 'include_context' ]) ? $_POST[ 'include_context' ] : '');
			update_option(WPS_OPTIONS_PREFIX.'_allow_subscribe_all', isset($_POST[ 'allow_subscribe_all' ]) ? $_POST[ 'allow_subscribe_all' ] : '');
			
			update_option(WPS_OPTIONS_PREFIX.'_alt_subs', isset($_POST[ '_alt_subs' ]) ? $_POST[ '_alt_subs' ] : '');
			update_option(WPS_OPTIONS_PREFIX.'_pagination', isset($_POST[ 'pagination' ]) ? $_POST[ 'pagination' ] : '');
			update_option(WPS_OPTIONS_PREFIX.'_pagination_size', isset($_POST[ 'pagination_size' ]) ? $_POST[ 'pagination_size' ] : '10');
			update_option(WPS_OPTIONS_PREFIX.'_pagination_location', $_POST[ 'pagination_location' ]);

			update_option(WPS_OPTIONS_PREFIX.'_show_dropdown', isset($_POST[ 'show_dropdown' ]) ? $_POST[ 'show_dropdown' ] : '');
			update_option(WPS_OPTIONS_PREFIX.'_topic_count', isset($_POST[ 'topic_count' ]) ? $_POST[ 'topic_count' ] : '');
			
			update_option(WPS_OPTIONS_PREFIX.'_moderation_email_rejected', isset($_POST[ 'moderation_email_rejected' ]) ? $_POST[ 'moderation_email_rejected' ] : '');
			update_option(WPS_OPTIONS_PREFIX.'_moderation_email_accepted', isset($_POST[ 'moderation_email_accepted' ]) ? $_POST[ 'moderation_email_accepted' ] : '');

			update_option(WPS_OPTIONS_PREFIX.'_suppress_forum_notify', isset($_POST[ 'suppress_forum_notify' ]) ? $_POST[ 'suppress_forum_notify' ] : '');

			// Clear forum subscriptions
			if (isset($_POST['clear_forum_subs'])) {
				$wpdb->query("DELETE FROM ".$wpdb->prefix."symposium_subs");
				echo "<script>alert('Forum subscriptions cleared');</script>";
			}

			// Forum moderators
			if (isset($_POST['moderators'])) {
		   		$range = array_keys($_POST['moderators']);
		   		$level = '';
	   			foreach ($range as $key) {
					$level .= $_POST['moderators'][$key].',';
		   		}
			} else {
				$level = '';
			}
			update_option(WPS_OPTIONS_PREFIX.'_moderators', serialize($level));

			// Forum viewers
			if (isset($_POST['viewers'])) {
		   		$range = array_keys($_POST['viewers']);
		   		$level = '';
	   			foreach ($range as $key) {
					$level .= $_POST['viewers'][$key].',';
		   		}
			} else {
				$level = '';
			}
			update_option(WPS_OPTIONS_PREFIX.'_viewer', serialize($level));
			
			// Forum editors (new topic)
			if (isset($_POST['editors'])) {
		   		$range = array_keys($_POST['editors']);
		   		$level = '';
	   			foreach ($range as $key) {
					$level .= $_POST['editors'][$key].',';
		   		}
			} else {
				$level = '';
			}
			update_option(WPS_OPTIONS_PREFIX.'_forum_editor', serialize($level));

			// Forum replies
			if (isset($_POST['repliers'])) {
		   		$range = array_keys($_POST['repliers']);
		   		$level = '';
	   			foreach ($range as $key) {
					$level .= $_POST['repliers'][$key].',';
		   		}
			} else {
				$level = '';
			}
			update_option(WPS_OPTIONS_PREFIX.'_forum_reply', serialize($level));	

			// Forum replies
			if (isset($_POST['commenters'])) {
		   		$range = array_keys($_POST['commenters']);
		   		$level = '';
	   			foreach ($range as $key) {
					$level .= $_POST['commenters'][$key].',';
		   		}
			} else {
				$level = '';
			}
			update_option(WPS_OPTIONS_PREFIX.'_forum_reply_comment', serialize($level));	
			
			// Put an settings updated message on the screen
			echo "<div class='updated slideaway'><p>".__('Saved', WPS_TEXT_DOMAIN).".</p></div>";

		}
		
		?>

			<form method="post" action=""> 
			<input type="hidden" name="symposium_update" value="__wps__plugin_forum">
				
			<table class="form-table __wps__admin_table"> 
		
			<tr><td colspan="2">
			<div style="float: right; margin-top:-15px;">
			<?php echo '<a href="admin.php?page=symposium_categories">'.__('Go to Forum Management', WPS_TEXT_DOMAIN).'</a>'; ?>
			</div>
			<h2>Editor</h2></td></tr>

            <tr valign="top"> 
            <td scope="row"><label for="use_wysiwyg_width"><?php echo __('Width', WPS_TEXT_DOMAIN); ?></label></td>
            <td><span class="description"><?php echo __('Width of editor (eg: 300px or 100%)', WPS_TEXT_DOMAIN); ?></span><br />
            <input name="use_wysiwyg_width" type="text" id="use_wysiwyg_width"  value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_width'); ?>" />
            </td> 
            </tr> 
            <tr valign="top"> 
            <td scope="row"><label for="use_wysiwyg_height"><?php echo __('Height', WPS_TEXT_DOMAIN); ?></label></td>
            <td><span class="description"><?php echo __('Height of editor (eg: 250px)', WPS_TEXT_DOMAIN); ?></span><br />
            <input name="use_wysiwyg_height" type="text" id="use_wysiwyg_height"  value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_height'); ?>" />
            </td> 
            </tr> 

			<?php if (get_option(WPS_OPTIONS_PREFIX.'__wps__wysiwyg_activated') || get_option(WPS_OPTIONS_PREFIX.'__wps__wysiwyg_network_activated')) { ?>

	            <tr valign="top"> 
	            <td scope="row"><label for="use_bbcode"><?php echo __('BB Code toolbar', WPS_TEXT_DOMAIN); ?></label></td>
	            <td>
	            <input type="checkbox" name="use_bbcode" id="use_bbcode" <?php if (get_option(WPS_OPTIONS_PREFIX.'_use_bbcode') == "on") { echo "CHECKED"; } ?>/>
	            <span class="description">
	            <?php echo __('Use BB Code toolbar on the forums (cannot be used with WYSIWYG editor).', WPS_TEXT_DOMAIN); ?><br />
	            </span></td> 
	            </tr> 

				<?php if (get_option(WPS_OPTIONS_PREFIX.'_use_bbcode') == 'on') { ?>
                    <tr valign="top" style='border-bottom: 1px dashed #666;border-right: 1px dashed #666; border-left: 1px dashed #666; border-top: 1px dashed #666;'> 
                    <td class="highlighted_row" scope="row"><label for="use_bbcode_icons"><?php echo __('BB Code toolbar icons', WPS_TEXT_DOMAIN).'<br />bold|italic|underline|link|quote|code'; ?></label></td>
                    <td class="highlighted_row"><span class="description">
                    	<?php echo __('Icons to include in the BB Code toolbar.', WPS_TEXT_DOMAIN); ?></span><br />
                    <?php if (!get_option(WPS_OPTIONS_PREFIX.'_use_bbcode_icons')) update_option(WPS_OPTIONS_PREFIX.'_use_bbcode_icons', 'bold|italic|underline|link|quote|code'); ?>
                    <input name="use_bbcode_icons" style="width:350px" type="text" id="use_bbcode_icons"  value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_use_bbcode_icons'); ?>" />
                    </td> 
                    </tr>

                <?php } else {
                    echo '<input type="hidden" name="use_bbcode_icons" id="use_bbcode_icons" value="'.get_option(WPS_OPTIONS_PREFIX.'_use_bbcode_icons').'" />';
                }  
                ?>

                <tr valign="top"> 
                <td scope="row"><label for="use_wysiwyg"><?php echo __('WYSIWYG editor', WPS_TEXT_DOMAIN); ?></label></td>
                <td>
                <input type="checkbox" name="use_wysiwyg" id="use_wysiwyg" <?php if (get_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg') == "on") { echo "CHECKED"; } ?>/>
                <span class="description">
                <?php echo __('Use the TinyMCE WYSIWYG editor/toolbar on the forums.', WPS_TEXT_DOMAIN); ?><br />
                <?php echo __('NB. Some themes cause layout problems with TinyMCE. Verified with TwentyEleven and tested with many others, but', WPS_TEXT_DOMAIN); ?><br />
                <?php echo __('if your editor toolbar layout is broken, check your theme stylesheets.', WPS_TEXT_DOMAIN); ?>
                </span></td> 
                </tr> 
            	                
				<?php if (get_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg') == 'on') { ?>					
                    <tr valign="top" style='border-right: 1px dashed #666; border-left: 1px dashed #666; border-top: 1px dashed #666;'> 
                    <td scope="row" class="highlighted_row"><label for="include_context"><?php echo __('Context menu', WPS_TEXT_DOMAIN); ?></label></td>
                    <td class="highlighted_row">
                    <input type="checkbox" name="include_context" id="include_context" <?php if (get_option(WPS_OPTIONS_PREFIX.'_include_context') == "on") { echo "CHECKED"; } ?>/>
                    <span class="description"><?php echo __('Activate right-mouse click context menu.', WPS_TEXT_DOMAIN); ?></span></td> 
                    </tr> 
                
                    <tr valign="top" style='border-right: 1px dashed #666; border-left: 1px dashed #666;'> 
                    <td class="highlighted_row" scope="row"><label for="use_wysiwyg_1"><?php echo __('Editor Toolbars', WPS_TEXT_DOMAIN); ?><br />
                    <a href="http://www.tinymce.com/wiki.php/Buttons/controls" target="_blank"><?php echo __('See all buttons/controls', WPS_TEXT_DOMAIN) ?></a><br />
                    <a href="javascript:void(0);" id="use_wysiwyg_reset"><?php echo __('Reset (full)', WPS_TEXT_DOMAIN); ?></a><br />
                    <a href="javascript:void(0);" id="use_wysiwyg_reset_min"><?php echo __('Reset (minimal)', WPS_TEXT_DOMAIN); ?></a>
                    </label></td>
                    <td class="highlighted_row">
                        <span class="description"><?php echo __('Toolbar row 1', WPS_TEXT_DOMAIN); ?></span><br />
                        <textarea name="use_wysiwyg_1" style="width:350px; height:80px" id="use_wysiwyg_1"><?php echo get_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_1'); ?></textarea><br />
                        <span class="description"><?php echo __('Toolbar row 2', WPS_TEXT_DOMAIN); ?></span><br />
                        <textarea name="use_wysiwyg_2" style="width:350px; height:80px" id="use_wysiwyg_2"><?php echo get_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_2'); ?></textarea><br />
                        <span class="description"><?php echo __('Toolbar row 3', WPS_TEXT_DOMAIN); ?></span><br />
                        <textarea name="use_wysiwyg_3" style="width:350px; height:80px" id="use_wysiwyg_3"><?php echo get_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_3'); ?></textarea><br />
                        <span class="description"><?php echo __('Toolbar row 4', WPS_TEXT_DOMAIN); ?></span><br />
                        <textarea name="use_wysiwyg_4" style="width:350px; height:80px" id="use_wysiwyg_4"><?php echo get_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_4'); ?></textarea><br />
                    </td> 
                    </tr> 
                    <tr valign="top" style='border-right: 1px dashed #666; border-left: 1px dashed #666; '> 
                    <td class="highlighted_row" scope="row"><label for="use_wysiwyg_css"><?php echo __('Editor CSS', WPS_TEXT_DOMAIN); ?></label></td>
                    <td class="highlighted_row"><span class="description"><?php echo __('Path for CSS file, eg:', WPS_TEXT_DOMAIN).' '.str_replace(__wps__siteURL(), '', WPS_PLUGIN_URL."/tiny_mce/themes/advanced/skins/wps.css"); ?></span><br />
                    <span class="description"><?php echo __('You may need to clear your browsing cache if changing the content of the file.', WPS_TEXT_DOMAIN); ?></span><br />
                    <?php if (!get_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_css')) update_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_css', str_replace(__wps__siteURL(), '', WPS_PLUGIN_URL."/tiny_mce/themes/advanced/skins/wps.css")); ?>
                    <input name="use_wysiwyg_css" style="width:350px" type="text" id="use_wysiwyg_css"  value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_css'); ?>" />
                    </td> 
                    </tr> 
                    <tr valign="top" style='border-bottom: 1px dashed #666; border-right: 1px dashed #666; border-left: 1px dashed #666; '> 
                    <td class="highlighted_row" scope="row"><label for="use_wysiwyg_skin"><?php echo __('Skin folder', WPS_TEXT_DOMAIN); ?></label></td>
                    <td class="highlighted_row"><span class="description"><?php echo sprintf(__('Folders are stored in %s/tiny_mce/themes/advanced/skins; eg: cirkuit', WPS_TEXT_DOMAIN), str_replace(get_bloginfo('url'), '', WPS_PLUGIN_URL)); ?></span><br />
                    <?php if (!get_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_skin')) update_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_skin', 'cirkuit'); ?>
                    <input name="use_wysiwyg_skin" type="text" id="use_wysiwyg_skin"  value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_skin'); ?>" />
                    </td> 
                    </tr> 
                <?php } else {
                    echo '<input type="hidden" name="use_wysiwyg_1" id="use_wysiwyg_1" value="'.get_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_1').'" />';
                    echo '<input type="hidden" name="use_wysiwyg_2" id="use_wysiwyg_2" value="'.get_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_2').'" />';
                    echo '<input type="hidden" name="use_wysiwyg_3" id="use_wysiwyg_3" value="'.get_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_3').'" />';
                    echo '<input type="hidden" name="use_wysiwyg_4" id="use_wysiwyg_4" value="'.get_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_4').'" />';
                    echo '<input type="hidden" name="use_wysiwyg_css" id="use_wysiwyg_css" value="'.get_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_css').'" />';
                    echo '<input type="hidden" name="use_wysiwyg_skin" id="use_wysiwyg_skin" value="'.get_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_skin').'" />';
                }  
                					
			} else {

				echo '<tr valign="top"><td colspan="2">';
				echo __("To access WYSWIYG forum editor and BB Code Toolbar settings, <a href='admin.php?page=symposium_debug'>activate the Bronze member feature</a>.", WPS_TEXT_DOMAIN).'<br />';
				echo '<em>NB. Some themes cause layout problems with TinyMCE WYSIWYG editor. The editor is verified with TwentyTwelve and tested with many others, but if your editor toolbar layout is broken, check your theme stylesheets.</em>';
				echo '</td></tr>';
				
				echo '<input type="hidden" name="use_wysiwyg" id="use_wysiwyg" value="'.get_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_1').'" />';
			} ?>

			<tr><td colspan="2"><h2>AJAX/Refresh</h2></td></tr>

			<tr valign="top"> 
			<td scope="row"><label for="forum_ajax"><?php echo __('Use AJAX', WPS_TEXT_DOMAIN); ?></label></td>
			<td>
			<input type="checkbox" name="forum_ajax" id="forum_ajax" <?php if (get_option(WPS_OPTIONS_PREFIX.'_forum_ajax') == "on") { echo "CHECKED"; } ?>/>
			<span class="description"><?php echo __('Use AJAX, or hyperlinks and page re-loading?', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 

			<tr valign="top"> 
			<td scope="row"><label for="forum_refresh"><?php echo __('Refresh forum after reply', WPS_TEXT_DOMAIN); ?></label></td>
			<td>
			<input type="checkbox" name="forum_refresh" id="forum_refresh" <?php if (get_option(WPS_OPTIONS_PREFIX.'_forum_refresh') == "on") { echo "CHECKED"; } ?>/>
			<span class="description"><?php echo __('Reload the page after posting a reply on the forum.', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 
	
			<tr><td colspan="2"><h2>Moderation</h2></td></tr>

			<tr valign="top"> 
			<td scope="row"><label for="moderation"><?php echo __('Moderation', WPS_TEXT_DOMAIN); ?></label></td>
			<td>
			<input type="checkbox" name="moderation" id="moderation" <?php if (get_option(WPS_OPTIONS_PREFIX.'_moderation') == "on") { echo "CHECKED"; } ?>/>
			<span class="description"><?php echo __('New topics and posts require admin approval', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 
	
			<tr valign="top"> 
			<td scope="row"><label for="moderation_email_rejected"><?php echo __('Rejection email', WPS_TEXT_DOMAIN); ?></label></td>
			<td>
			<input type="checkbox" name="moderation_email_rejected" id="moderation_email_rejected" <?php if (get_option(WPS_OPTIONS_PREFIX.'_moderation_email_rejected') == "on") { echo "CHECKED"; } ?>/>
			<span class="description"><?php echo __('Send email to user when forum post rejected', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 
	
			<tr valign="top"> 
			<td scope="row"><label for="moderation_email_accepted"><?php echo __('Accepted email', WPS_TEXT_DOMAIN); ?></label></td>
			<td>
			<input type="checkbox" name="moderation_email_accepted" id="moderation_email_accepted" <?php if (get_option(WPS_OPTIONS_PREFIX.'_moderation_email_accepted') == "on") { echo "CHECKED"; } ?>/>
			<span class="description"><?php echo __('Send email to user when forum post accepted', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 
	
			<tr><td colspan="2"><h2>Attachments</h2></td></tr>

			<tr valign="top"> 
			<td scope="row"><label for="forum_uploads"><?php echo __('Allow uploads', WPS_TEXT_DOMAIN); ?></label></td>
			<td>
			<input type="checkbox" name="forum_uploads" id="forum_uploads" <?php if (get_option(WPS_OPTIONS_PREFIX.'_forum_uploads') == "on") { echo "CHECKED"; } ?>/>
			<span class="description"><?php echo __('Allow members to upload files with forum posts (requires Flash to be installed)', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 

			<tr valign="top"> 
			<td scope="row"><label for="forum_thumbs"><?php echo __('Inline attachments', WPS_TEXT_DOMAIN); ?></label></td>
			<td>
			<input type="checkbox" name="forum_thumbs" id="forum_thumbs" <?php if (get_option(WPS_OPTIONS_PREFIX.'_forum_thumbs') == "on") { echo "CHECKED"; } ?>/>
			<span class="description"><?php echo __('Show uploaded forum attachments as images/videos (not links). Documents are always links.', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 
		
			<tr valign="top"> 
			<td scope="row"><label for="forum_thumbs_size"><?php echo __('Thumbnail size', WPS_TEXT_DOMAIN); ?></label></td>
			<td><input name="forum_thumbs_size" style="width:50px" type="text" id="forum_thumbs_size"  value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_forum_thumbs_size'); ?>" /> 
			<span class="description"><?php echo __('If using inline attachments, maximum width', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 
			
			<tr><td colspan="2"><h2>Voting</h2></td></tr>

			<tr valign="top"> 
			<td scope="row"><label for="use_votes"><?php echo __('Use Votes', WPS_TEXT_DOMAIN); ?></label></td>
			<td>
			<input type="checkbox" name="use_votes" id="use_votes" <?php if (get_option(WPS_OPTIONS_PREFIX.'_use_votes') == "on") { echo "CHECKED"; } ?>/>
			<span class="description"><?php echo __('Allow members to vote (plus or minus) on forum posts', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 

			<tr valign="top"> 
			<td scope="row"><label for="use_votes_min"><?php echo __('Votes (minimum posts)', WPS_TEXT_DOMAIN); ?></label></td>
			<td><input name="use_votes_min" style="width:50px" type="text" id="use_votes_min"  value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_use_votes_min'); ?>" /> 
			<span class="description"><?php echo __('How many posts a member must have made in order to vote', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 
	
	
			<tr valign="top"> 
			<td scope="row"><label for="use_votes_remove"><?php echo __('Votes (removal point)', WPS_TEXT_DOMAIN); ?></label></td>
			<td><input name="use_votes_remove" style="width:50px" type="text" id="use_votes_remove"  value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_use_votes_remove'); ?>" /> 
			<span class="description"><?php echo __('When a forum post gets this many votes, it is removed. Can be + or -. Leave as 0 to ignore.', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 

			<tr valign="top"> 
			<td scope="row"><label for="use_answers"><?php echo __('Votes (answers)', WPS_TEXT_DOMAIN); ?></label></td>
			<td>
			<input type="checkbox" name="use_answers" id="use_answers" <?php if (get_option(WPS_OPTIONS_PREFIX.'_use_answers') == "on") { echo "CHECKED"; } ?>/>
			<span class="description"><?php echo __('Allows topic owners and administrators to mark a reply as an answer (one per topic)', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 

			<tr><td colspan="2"><h2>Permissions</h2></td></tr>

			<tr valign="top"> 
			<td scope="row"><label for="moderation_roles"><?php echo __('Roles that can moderate the forum', WPS_TEXT_DOMAIN); ?></label></td> 
			<td>
			<?php		
				// Get list of roles
				global $wp_roles;
				$all_roles = $wp_roles->roles;
		
				$view_roles = get_option(WPS_OPTIONS_PREFIX.'_moderators');

				foreach ($all_roles as $role) {
					echo '<input type="checkbox" name="moderators[]" value="'.$role['name'].'"';
					if ($role['name'] == 'Administrator' || strpos(strtolower($view_roles), strtolower($role['name']).',') !== FALSE) {
						echo ' CHECKED';
					}
					echo '> '.$role['name'].'<br />';
				}			
			?>
			<span class="description">
					<?php echo sprintf(__('The WordPress roles that can <a href="%s">moderate forum posts</a>. Administrator will always be checked.', WPS_TEXT_DOMAIN), "admin.php?page=symposium_moderation"); ?><br />
					<?php echo __('Checked roles can also manage the forum via the front-end.', WPS_TEXT_DOMAIN); ?>
			</span></td> 
			</tr> 

			<tr valign="top"> 
			<td scope="row"><label for="viewer"><?php echo __('View forum roles', WPS_TEXT_DOMAIN); ?></label></td> 
			<td>
			<?php		
				// Get list of roles
				global $wp_roles;
				$all_roles = $wp_roles->roles;
		
				$view_roles = get_option(WPS_OPTIONS_PREFIX.'_viewer');

				echo '<input type="checkbox" name="viewers[]" value="'.__('everyone', WPS_TEXT_DOMAIN).'"';
				if (strpos(strtolower($view_roles), strtolower(__('everyone', WPS_TEXT_DOMAIN)).',') !== FALSE) {
					echo ' CHECKED';
				}
				echo '> '.__('Guests', WPS_TEXT_DOMAIN).' ... <span class="description">'.__('means everyone can view the forum if checked', WPS_TEXT_DOMAIN).'</span><br />';						
				foreach ($all_roles as $role) {
					echo '<input type="checkbox" name="viewers[]" value="'.$role['name'].'"';
					if (strpos(strtolower($view_roles), strtolower($role['name']).',') !== FALSE) {
						echo ' CHECKED';
					}
					echo '> '.$role['name'].'<br />';
				}			
			?>
			<span class="description"><?php echo __('The WordPress roles that can view the entire forum (fine tune with <a href="admin.php?page=symposium_categories">forum categories</a>)', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 
	
			<tr valign="top"> 
			<td scope="row"><label for="forum_editor"><?php echo __('Forum new topic roles', WPS_TEXT_DOMAIN); ?></label></td> 
			<td>
			<?php		
				// Get list of roles
				global $wp_roles;
				$all_roles = $wp_roles->roles;
		
				$view_roles = get_option(WPS_OPTIONS_PREFIX.'_forum_editor');

				echo '<input type="checkbox" name="editors[]" value="'.__('everyone', WPS_TEXT_DOMAIN).'"';
				if (strpos(strtolower($view_roles), strtolower(__('everyone', WPS_TEXT_DOMAIN)).',') !== FALSE) {
					echo ' CHECKED';
				}
				echo '> '.__('Everyone', WPS_TEXT_DOMAIN).' ... <span class="description">'.__('means all members can post new topics if checked', WPS_TEXT_DOMAIN).'</span><br />';						
				foreach ($all_roles as $role) {
					echo '<input type="checkbox" name="editors[]" value="'.$role['name'].'"';
					if (strpos(strtolower($view_roles), strtolower($role['name']).',') !== FALSE) {
						echo ' CHECKED';
					}
					echo '> '.$role['name'].'<br />';
				}			
			?>
			<span class="description"><?php echo __('The WordPress roles that can post a new topic on the forum', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 

			<tr valign="top"> 
			<td scope="row"><label for="forum_reply"><?php echo __('Forum reply roles', WPS_TEXT_DOMAIN); ?></label></td> 
			<td>
			<?php		
				// Get list of roles
				global $wp_roles;
				$all_roles = $wp_roles->roles;
		
				$reply_roles = get_option(WPS_OPTIONS_PREFIX.'_forum_reply');

				echo '<input type="checkbox" name="repliers[]" value="'.__('everyone', WPS_TEXT_DOMAIN).'"';
				if (strpos(strtolower($reply_roles), strtolower(__('everyone', WPS_TEXT_DOMAIN)).',') !== FALSE) {
					echo ' CHECKED';
				}
				echo '> '.__('Everyone', WPS_TEXT_DOMAIN).' ... <span class="description">'.__('means all members can reply to topics if checked', WPS_TEXT_DOMAIN).'</span><br />';						
				foreach ($all_roles as $role) {
					echo '<input type="checkbox" name="repliers[]" value="'.$role['name'].'"';
					if (strpos(strtolower($reply_roles), strtolower($role['name']).',') !== FALSE) {
						echo ' CHECKED';
					}
					echo '> '.$role['name'].'<br />';
				}			
			?>
			<span class="description"><?php echo __('The WordPress roles that can reply to a topic on the forum', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 
		
			<tr valign="top"> 
			<td scope="row"><label for="forum_comments"><?php echo __('Forum comment roles', WPS_TEXT_DOMAIN); ?></label></td> 
			<td>
			<?php		
				// Get list of roles
				global $wp_roles;
				$all_roles = $wp_roles->roles;
		
				$reply_roles = get_option(WPS_OPTIONS_PREFIX.'_forum_reply_comment');

				echo '<input type="checkbox" name="commenters[]" value="'.__('everyone', WPS_TEXT_DOMAIN).'"';
				if (strpos(strtolower($reply_roles), strtolower(__('everyone', WPS_TEXT_DOMAIN)).',') !== FALSE) {
					echo ' CHECKED';
				}
				echo '> '.__('Everyone', WPS_TEXT_DOMAIN).' ... <span class="description">'.__('means all members can comment on replies if checked', WPS_TEXT_DOMAIN).'</span><br />';						
				foreach ($all_roles as $role) {
					echo '<input type="checkbox" name="commenters[]" value="'.$role['name'].'"';
					if (strpos(strtolower($reply_roles), strtolower($role['name']).',') !== FALSE) {
						echo ' CHECKED';
					}
					echo '> '.$role['name'].'<br />';
				}			
			?>
			<span class="description"><?php echo __('The WordPress roles that can add comments to forum replies', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 

			<tr><td colspan="2"><a name="ranks"></a><h2>Ranks</h2></td></tr>

			<?php
			$ranks = explode(';', get_option(WPS_OPTIONS_PREFIX.'_forum_ranks'));
			?>
			<tr valign="top"> 
			<td scope="row"><label for="forum_ranks"><?php echo __('Forum ranks', WPS_TEXT_DOMAIN); ?></label></td>
			<td>
			<input type="checkbox" name="forum_ranks" id="forum_ranks" <?php if ($ranks[0] == "on") { echo "CHECKED"; } ?>/>
			<span class="description"><?php echo __('Use ranks on the forum?', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr>

			<?php
			for ( $rank = 1; $rank <= 11; $rank ++) {
				echo '<tr valign="top">';
					if ($rank == 1) { 

						echo '<td scope="row">';
							echo __('Title and Posts Required', WPS_TEXT_DOMAIN);
						echo '</td>';

					} else {

						echo '<td scope="row">';
						
							if ($rank == 11) {
								echo '<em>'.__('(blank ranks are not used)', WPS_TEXT_DOMAIN).'</em>';
							} else {
								echo "&nbsp;";
							}
						
						echo '</td>';

					}
					?>
					<td>
						<?php 
							$this_rank = $rank*2-1;
							$this_rank_label = $ranks[$this_rank];
							$this_rank_value = $ranks[$this_rank+1];
							
							if ($this_rank_label != '') {
								echo '<input name="rank'.$rank.'" type="text" id="rank'.$rank.'"  value="'.$this_rank_label.'" /> ';
								if ($rank > 1) {
									echo '<input name="score'.$rank.'" type="text" id="score'.$rank.'" style="width:50px" value="'.$this_rank_value.'" /> ';
								} else {
									echo '<input name="score'.$rank.'" type="text" id="score'.$rank.'" style="width:50px; display:none;"" /> ';
								} 
							} else {
								echo '<input name="rank'.$rank.'" type="text" id="rank'.$rank.'"  value="" /> ';
								if ($rank > 1) {
									echo '<input name="score'.$rank.'" type="text" id="score'.$rank.'" style="width:50px" value="" /> ';
								}
							}
						?>

						<span class="description">
						<?php 
						if ($rank == 1) {
							echo __('Most posts', WPS_TEXT_DOMAIN); 
						} else {
							echo __('Rank', WPS_TEXT_DOMAIN).' '.($rank-1); 							
						}
						?></span>
					</td> 
				</tr>
			<?php
			}
			do_action('__wps__menu_forum_hook');	
			?>
			
			<tr><td colspan="2"><a name="display"></a><h2>Display</h2></td></tr>

			<tr valign="top"> 
			<td scope="row"><label for="_alt_subs"><?php echo __('Sub Categories', WPS_TEXT_DOMAIN); ?></label></td>
			<td>
			<input type="checkbox" name="_alt_subs" id="_alt_subs" <?php if (get_option(WPS_OPTIONS_PREFIX.'_alt_subs') == "on") { echo "CHECKED"; } ?>/>
			<span class="description"><?php echo __('Show child categories under parent categories', WPS_TEXT_DOMAIN); ?></span>
			</td> 
			</tr> 

			<tr valign="top"> 
			<td scope="row"><label for="pagination"><?php echo __('Pagination', WPS_TEXT_DOMAIN); ?></label></td>
			<td>
			<input type="checkbox" name="pagination" id="pagination" <?php if (get_option(WPS_OPTIONS_PREFIX.'_pagination') == "on" && get_option(WPS_OPTIONS_PREFIX.'_forum_ajax') != "on") { echo "CHECKED"; } ?>/>
			<span class="description"><?php echo __('Breaks topic replies into pages', WPS_TEXT_DOMAIN); ?></span>
			<?php if (get_option(WPS_OPTIONS_PREFIX.'_forum_ajax') == "on")
				echo '<br /><span class="description" style="color:red;">'.__('Sorry, this is not compatible if using AJAX on the forum (above).', WPS_TEXT_DOMAIN).'</span>';
			?>
			</td> 
			</tr> 

			<tr valign="top"> 
			<td scope="row"><label for="pagination_location"><?php echo __('Pagination Placement', WPS_TEXT_DOMAIN); ?></label></td>
			<td>
			<select name="pagination_location">
				<option value="both"<?php if (get_option(WPS_OPTIONS_PREFIX.'_pagination_location') == 'both') echo ' SELECTED'; ?>><?php echo __('Above and below replies', WPS_TEXT_DOMAIN); ?></option>
				<option value="top"<?php if (get_option(WPS_OPTIONS_PREFIX.'_pagination_location') == 'top') echo ' SELECTED'; ?>><?php echo __('Above replies', WPS_TEXT_DOMAIN); ?></option>
				<option value="bottom"<?php if (get_option(WPS_OPTIONS_PREFIX.'_pagination_location') == 'bottom') echo ' SELECTED'; ?>><?php echo __('Below replies', WPS_TEXT_DOMAIN); ?></option>
			</select>
			<span class="description"><?php echo __('If pagination is used, where to show page navigation', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 

			<tr valign="top"> 
			<td scope="row"><label for="pagination_size"><?php echo __('Number of replies per page (pagination)', WPS_TEXT_DOMAIN); ?></label></td>
			<td><input name="pagination_size" style="width:50px" type="text" id="pagination_size"  value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_pagination_size') ? get_option(WPS_OPTIONS_PREFIX.'_pagination_size') : 10; ?>" /> 
			<span class="description"><?php echo __('If pagination is used, how many replies per page.', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 
	
			<tr valign="top"> 
			<td scope="row"><label for="topic_count"><?php echo __('Forum category post count', WPS_TEXT_DOMAIN); ?></label></td>
			<td><input name="topic_count" style="width:50px" type="text" id="topic_count"  value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_topic_count') ? get_option(WPS_OPTIONS_PREFIX.'_topic_count') : 10; ?>" /> 
			<span class="description"><?php echo __('How many topics are shown in a forum category (use an even number).', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 
	
			<tr valign="top"> 
			<td scope="row"><label for="show_dropdown"><?php echo __('Dropdown category list', WPS_TEXT_DOMAIN); ?></label></td>
			<td>
			<input type="checkbox" name="show_dropdown" id="show_dropdown" <?php if (get_option(WPS_OPTIONS_PREFIX.'_show_dropdown') == "on") { echo "CHECKED"; } ?>/>
			<span class="description"><?php echo __('Show a dropdown list of categories for quick navigation', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 

			<tr valign="top"> 
			<td scope="row"><label for="forum_info"><?php echo __('Member Info', WPS_TEXT_DOMAIN); ?></label></td>
			<td>
			<input type="checkbox" name="forum_info" id="forum_info" <?php if (get_option(WPS_OPTIONS_PREFIX.'_forum_info') == "on") { echo "CHECKED"; } ?>/>
			<span class="description"><?php echo __('Show member info underneath avatar on forum', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 

			<tr valign="top"> 
			<td scope="row"><label for="forum_stars"><?php echo __('New post stars', WPS_TEXT_DOMAIN); ?></label></td>
			<td>
			<input type="checkbox" name="forum_stars" id="forum_stars" <?php if (get_option(WPS_OPTIONS_PREFIX.'_forum_stars') == "on") { echo "CHECKED"; } ?>/>
			<span class="description"><?php echo __('Show stars for posts added since last login.', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 
	
			<tr valign="top"> 
			<td scope="row"><label for="forum_login"><?php echo __('Login Link', WPS_TEXT_DOMAIN); ?></label></td>
			<td>
			<input type="checkbox" name="forum_login" id="forum_login" <?php if (get_option(WPS_OPTIONS_PREFIX.'_forum_login') == "on") { echo "CHECKED"; } ?>/>
			<span class="description"><?php echo __('Show login link on forum when not logged in?', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 
                                                			
			<tr valign="top"> 
			<td scope="row"><label for="forum_login_form"><?php echo __('Show login link below topic', WPS_TEXT_DOMAIN); ?></label></td>
			<td>
			<input type="checkbox" name="forum_login_form" id="forum_login_form" <?php if (get_option(WPS_OPTIONS_PREFIX.'_forum_login_form') == "on") { echo "CHECKED"; } ?>/>
			<span class="description"><?php echo __('If a user has to log in, show the login link underneath the topic/replies.', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 

			<tr><td colspan="2"><a name="more"></a><h2>Subscriptions</h2></td></tr>
									
			<tr valign="top"> 
			<td scope="row"><label for="suppress_forum_notify"><?php echo __('Forum subscription', WPS_TEXT_DOMAIN); ?></label></td>
			<td>
			<input type="checkbox" name="suppress_forum_notify" id="suppress_forum_notify" <?php if (get_option(WPS_OPTIONS_PREFIX.'_suppress_forum_notify') == "on") { echo "CHECKED"; } ?>/>
			<span class="description"><?php echo __('Hide all forum subscription options', WPS_TEXT_DOMAIN); ?></span><br />
			<input type="checkbox" name="clear_forum_subs" id="clear_forum_subs" />
			<span class="description"><?php echo __('If checked, all forum subscriptions will be cleared when you save (option not saved, applied just once)', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 
	
			<tr valign="top"> 
			<td scope="row"><label for="allow_subscribe_all"><?php echo __('Subscribe to all forum activity', WPS_TEXT_DOMAIN); ?></label></td>
			<td>
			<input type="checkbox" name="allow_subscribe_all" id="allow_subscribe_all" <?php if (get_option(WPS_OPTIONS_PREFIX.'_allow_subscribe_all') == "on") { echo "CHECKED"; } ?>/>
			<span class="description"><?php echo __('Allow subscribe to all via Profile page, Profile Details. If you have a lot of users, consider switching this off to improve forum performance.', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 
	
			<tr><td colspan="2"><a name="more"></a><h2>More...</h2></td></tr>

			<tr valign="top"> 
			<td scope="row"><label for="send_summary"><?php echo __('Daily Digest', WPS_TEXT_DOMAIN); ?></label></td>
			<td>
			<input type="checkbox" name="send_summary" id="send_summary" <?php if (get_option(WPS_OPTIONS_PREFIX.'_send_summary') == "on") { echo "CHECKED"; } ?>/>
			<span class="description"><?php echo __('Enable daily summaries of forum activity to all members via email', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 
	
			<tr valign="top"> 
			<td scope="row"><label for="include_admin"><?php echo __('Admin views', WPS_TEXT_DOMAIN); ?></label></td>
			<td>
			<input type="checkbox" name="include_admin" id="include_admin" <?php if (get_option(WPS_OPTIONS_PREFIX.'_include_admin') == "on") { echo "CHECKED"; } ?>/>
			<span class="description"><?php echo __('Include administrator viewing a topic in the total view count', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 
	
			<tr valign="top"> 
			<td scope="row"><label for="bump_topics"><?php echo __('Bump topics', WPS_TEXT_DOMAIN); ?></label></td>
			<td>
			<input type="checkbox" name="bump_topics" id="bump_topics" <?php if (get_option(WPS_OPTIONS_PREFIX.'_bump_topics') == "on") { echo "CHECKED"; } ?>/>
			<span class="description"><?php echo __('Bumps topics to top of forum when new replies are posted', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 
	
			<tr valign="top"> 
			<td scope="row"><label for="oldest_first"><?php echo __('Order of replies', WPS_TEXT_DOMAIN); ?></label></td>
			<td>
			<input type="checkbox" name="oldest_first" id="oldest_first" <?php if (get_option(WPS_OPTIONS_PREFIX.'_oldest_first') == "on") { echo "CHECKED"; } ?>/>
			<span class="description"><?php echo __('Show oldest replies first (uncheck to reverse order)', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 
	
			<tr valign="top"> 
			<td scope="row"><label for="forum_lock"><?php echo __('Post lock time', WPS_TEXT_DOMAIN); ?></label></td>
			<td><input name="forum_lock" style="width:50px" type="text" id="forum_lock"  value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_forum_lock'); ?>" /> 
			<span class="description"><?php echo __('How many minutes before a forum topic/reply can no longer be edited/deleted, 0 for no lock.', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 
	
			<tr valign="top"> 
			<td scope="row"><label for="preview1"><?php echo __('Preview length', WPS_TEXT_DOMAIN); ?></label></td>
			<td><input name="preview1" style="width:50px" type="text" id="preview1"  value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_preview1'); ?>" /> 
			<span class="description"><?php echo __('Maximum number of characters to show in topic preview', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 
	
			<tr valign="top"> 
			<td scope="row"><label for="preview2"></label></td>
			<td><input name="preview2" style="width:50px" type="text" id="preview2"  value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_preview2'); ?>" /> 
			<span class="description"><?php echo __('Maximum number of characters to show in reply preview', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 

			<tr valign="top"> 
			<td scope="row"><label for="wps_default_forum"><?php echo __('Default Categories', WPS_TEXT_DOMAIN); ?></label></td>
			<td><input name="wps_default_forum" type="text" id="wps_default_forum"  value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_wps_default_forum'); ?>" /> 
			<span class="description"><?php echo __('List of forum categories IDs, that new site members automatically subscribe to (comma separated)', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 
			
			<tr valign="top"> 
			<td scope="row"><label for="chatroom_banned"><?php echo __('Banned forum words', WPS_TEXT_DOMAIN); ?></label></td> 
			<td><input name="chatroom_banned" type="text" id="chatroom_banned"  value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_chatroom_banned'); ?>" /> 
			<span class="description"><?php echo __('Comma separated list of words not allowed in the forum', WPS_TEXT_DOMAIN); ?></td> 
			</tr> 

									
			<tr valign="top"> 
			<td scope="row"><label for="closed_word"><?php echo __('Closed word', WPS_TEXT_DOMAIN); ?></label></td>
			<td><input name="closed_word" type="text" id="closed_word"  value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_closed_word'); ?>" /> 
			<span class="description"><?php echo __('Word used to denote a topic that is closed (see also Styles)', WPS_TEXT_DOMAIN); ?></span></td> 
			</tr> 

			<?php
			$sharing = get_option(WPS_OPTIONS_PREFIX.'_sharing');
			if ( strpos($sharing, "pl") === FALSE ) { $sharing_permalink = ''; } else { $sharing_permalink = 'on'; }
			if ( strpos($sharing, "fb") === FALSE ) { $sharing_facebook = ''; } else { $sharing_facebook = 'on'; }
			if ( strpos($sharing, "tw") === FALSE ) { $sharing_twitter = ''; } else { $sharing_twitter = 'on'; }
			if ( strpos($sharing, "ms") === FALSE ) { $sharing_myspace = ''; } else { $sharing_myspace = 'on'; }
			if ( strpos($sharing, "li") === FALSE ) { $sharing_linkedin = ''; } else { $sharing_linkedin = 'on'; }
			if ( strpos($sharing, "be") === FALSE ) { $sharing_bebo = ''; } else { $sharing_bebo = 'on'; }
			if ( strpos($sharing, "em") === FALSE ) { $sharing_email = ''; } else { $sharing_email = 'on'; }
			?>
			

			<tr valign="top"> 
			<td scope="row"><label for="sharing_permalink"><?php echo __('Sharing icons included', WPS_TEXT_DOMAIN); ?></label></td>
			<td>
			<input type="checkbox" name="sharing_permalink" id="sharing_permalink" <?php if ($sharing_permalink == "on") { echo "CHECKED"; } ?>/>
			<span class="description"><?php echo __('Permalink (to copy)', WPS_TEXT_DOMAIN); ?></span><br />
			<input type="checkbox" name="sharing_email" id="sharing_email" <?php if ($sharing_email == "on") { echo "CHECKED"; } ?>/>
			<span class="description"><?php echo __('Email', WPS_TEXT_DOMAIN); ?></span><br />
			<input type="checkbox" name="sharing_facebook" id="sharing_facebook" <?php if ($sharing_facebook == "on") { echo "CHECKED"; } ?>/>
			<span class="description"><?php echo __('Facebook', WPS_TEXT_DOMAIN); ?></span><br />
			<input type="checkbox" name="sharing_twitter" id="sharing_twitter" <?php if ($sharing_twitter == "on") { echo "CHECKED"; } ?>/>
			<span class="description"><?php echo __('Twitter', WPS_TEXT_DOMAIN); ?></span><br />
			<input type="checkbox" name="sharing_myspace" id="sharing_myspace" <?php if ($sharing_myspace == "on") { echo "CHECKED"; } ?>/>
			<span class="description"><?php echo __('MySpace', WPS_TEXT_DOMAIN); ?></span><br /> 
			<input type="checkbox" name="sharing_bebo" id="sharing_bebo" <?php if ($sharing_bebo == "on") { echo "CHECKED"; } ?>/>
			<span class="description"><?php echo __('Bebo', WPS_TEXT_DOMAIN); ?></span><br />
			<input type="checkbox" name="sharing_linkedin" id="sharing_linkedin" <?php if ($sharing_linkedin == "on") { echo "CHECKED"; } ?>/>
			<span class="description"><?php echo __('LinkedIn', WPS_TEXT_DOMAIN); ?></span>
			</td> 
			</tr> 

			<tr valign="top"> 
			<td colspan=2>
				<p>
				<span class="description">
				<strong><?php echo __('Notes', WPS_TEXT_DOMAIN); ?></strong>
				<ul style='margin-left:6px'>
				<li>&middot;&nbsp;<?php echo __('Daily summaries (if there is anything to send) are sent when the first visitor comes to the site after midnight, local time.', WPS_TEXT_DOMAIN); ?></li>
				<li>&middot;&nbsp;<?php echo __('Be aware of any limits set by your hosting provider for sending out bulk emails, they may suspend your website.', WPS_TEXT_DOMAIN); ?></li>
				</ul>
				</p>
			</td>
			</tr> 

			<tr><td colspan="2"><h2>Shortcodes</h2></td></tr>

			<tr><td><?php echo '['.WPS_SHORTCODE_PREFIX.'-forum]'; ?></td>
				<td><?php _e('Display the forum.', WPS_TEXT_DOMAIN); ?></td></tr>
			<tr><td><?php echo '['.WPS_SHORTCODE_PREFIX.'-forum cat="2"]'; ?></td>
				<td><?php _e('Display just forum category ID 2 on a single WordPress page.', WPS_TEXT_DOMAIN); ?></td></tr>
			<tr valign="top"> 
			<td scope="row"><label for="symposium_forumlatestposts_count"><?php echo '['.WPS_SHORTCODE_PREFIX.'-forumlatestposts]'; ?></label></td>
			<td><?php _e('Display most recent forum posts and replies.', WPS_TEXT_DOMAIN); ?><br /><input name="symposium_forumlatestposts_count" style="width:50px" type="text" id="symposium_forumlatestposts_count"  value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_symposium_forumlatestposts_count'); ?>" /> 
			<span class="description"><?php 
			echo sprintf(__('Default number of topics to show. Can be overridden, eg: [%s-forumlatestposts count=10]', WPS_TEXT_DOMAIN), WPS_SHORTCODE_PREFIX).'<br />'; 
			echo '<span style="margin-left:55px">'.sprintf(__('Forum category IDs can be specified in the shortcode, eg: [%s-forumlatestposts cat=1]', WPS_TEXT_DOMAIN), WPS_SHORTCODE_PREFIX).'</span>'; ?></span></td> 
			</tr> 
			

															
			</table> 	
		 
			<p class="submit" style='margin-left:6px;'> 
			<input type="submit" name="Submit" class="button-primary" value="<?php echo __('Save Changes', WPS_TEXT_DOMAIN); ?>" /> 
			</p> 
			</form> 
		
	<?php	__wps__show_tabs_header_end(); ?> 
	</div>
<?php
}
Beispiel #2
0
function __wps__show_gallery() {
	
	global $wpdb, $current_user;
		
	$html = '';
	$html .= "<div class='__wps__wrapper'>";

	$term = "";
	if (isset($_GET['term'])) { $term .= strtolower($_GET['term']); }	
		
	$html .= "<div style='padding:0px'>";
	$html .= '<input type="text" id="gallery_member" autocomplete="off" name="gallery_member" class="gallery_member_box" value="'.$term.'" style="margin-right:10px" />';
	$html .= '<input id="gallery_go_button" type="submit" class="__wps__button" value="'.__("Search", WPS_TEXT_DOMAIN).'" />';
	$html .= "</div>";	
	
	$sql = "SELECT g.*, u.display_name FROM ".$wpdb->base_prefix."symposium_gallery g
			INNER JOIN ".$wpdb->base_prefix."users u ON u.ID = g.owner
			WHERE g.name LIKE '%".$term."%' 
			   OR u.display_name LIKE '%".$term."%' 
			ORDER BY gid DESC 
			LIMIT 0,50";

	$albums = $wpdb->get_results($sql);
	
	$album_count = 0;	
	$total_count = 0;
	
	if ($albums) {
		
		$page_length = (get_option(WPS_OPTIONS_PREFIX."_gallery_page_length") != '') ? get_option(WPS_OPTIONS_PREFIX."_gallery_page_length") : 10;

		$html .= "<div id='symposium_gallery_albums'>";
		
		foreach ($albums AS $album) {

			$total_count++;				

			// check for privacy
			if ( ($album->owner == $current_user->ID) || (strtolower($album->sharing) == 'public') || (is_user_logged_in() && strtolower($album->sharing) == 'everyone') || (strtolower($album->sharing) == 'friends only' && __wps__friend_of($album->owner, $current_user->ID)) || __wps__get_current_userlevel() == 5) {

				$sql = "SELECT COUNT(iid) FROM ".$wpdb->base_prefix."symposium_gallery_items WHERE gid = %d";
				$photo_count = $wpdb->get_var($wpdb->prepare($sql, $album->gid));	
				
				if ($photo_count > 0) {

					$sql = "SELECT * FROM ".$wpdb->base_prefix."symposium_gallery_items WHERE gid = %d ORDER BY photo_order DESC";
					$photos = $wpdb->get_results($wpdb->prepare($sql, $album->gid));	
					
					// Check that at least one actually exists
					$tmpDir = get_option(WPS_OPTIONS_PREFIX.'_img_path');
					$img_exists = false;
					if ($photos && get_option(WPS_OPTIONS_PREFIX.'_img_db') != "on") {
						foreach ($photos as $photo) {
		                	$img_src = '/members/'.$album->owner.'/media/'.$album->gid.'/'.$photo->name;
		                	if (file_exists($tmpDir.$img_src)) {
		                	    $img_exists = true;
		                	    break;
		                	}
						}
					} else {
						$img_exists = true;
					}
					
					if ($img_exists) {
						
						$html .= "<div id='__wps__album_content' style='padding-bottom:30px;'>";
	
							$html .= "<div id='wps_gallery_album_name_".$album->gid."' class='topic-post-header'>".stripslashes($album->name)."</div>";
							$html .= "<p>".__wps__profile_link($album->owner)."</p>";
				
							if ($photos) {
								
								$album_count++;
								
								$cnt = 0;
			
								$thumbnail_size = (get_option(WPS_OPTIONS_PREFIX."_gallery_thumbnail_size") != '') ? get_option(WPS_OPTIONS_PREFIX."_gallery_thumbnail_size") : 75;
								$html .= '<div id="wps_comment_plus" style="width:98%;height:'.($thumbnail_size+10).'px;overflow:hidden; ">';
					
								$preview_count = (get_option(WPS_OPTIONS_PREFIX."_gallery_preview") != '') ? get_option(WPS_OPTIONS_PREFIX."_gallery_preview") : 5;
					       		foreach ($photos as $photo) {
					       		    
					       		    $cnt++;
					              					
									if (get_option(WPS_OPTIONS_PREFIX.'_img_db') == "on") {
										
										$img_src = WP_CONTENT_URL."/plugins/wp-symposium/get_album_item.php?iid=".$photo->iid."&size=photo";
										$thumb_src = WP_CONTENT_URL."/plugins/wp-symposium/get_album_item.php?iid=".$photo->iid."&size=thumbnail";
										
									} else {

					                	$tmp_src = '/members/'.$album->owner.'/media/'.$album->gid.'/thumb_'.$photo->name;
              							if (file_exists($tmpDir.$tmp_src)) { 

											if (get_option(WPS_OPTIONS_PREFIX."_gallery_show_resized") == 'on') {
							                	$img_src = get_option(WPS_OPTIONS_PREFIX.'_img_url').'/members/'.$album->owner.'/media/'.$album->gid.'/show_'.$photo->name;
											} else {
							                	$img_src = get_option(WPS_OPTIONS_PREFIX.'_img_url').'/members/'.$album->owner.'/media/'.$album->gid.'/'.$photo->name;
											}
						        	        $thumb_src = get_option(WPS_OPTIONS_PREFIX.'_img_url').'/members/'.$album->owner.'/media/'.$album->gid.'/thumb_'.$photo->name;
					        	        
              							} else {
              							    $img_src = __wps__siteURL().get_option(WPS_OPTIONS_PREFIX.'_images').'/broken_file_link.png';
						        	        $thumb_src = __wps__siteURL().get_option(WPS_OPTIONS_PREFIX.'_images').'/broken_file_link.png';
              							}              							    
              							
									}
					
					               	$html .= '<div class="__wps__photo_outer">';
					           			$html .= '<div class="__wps__photo_inner">';
					      						$html .= '<div class="__wps__photo_cover">';
												$html .= '<a class="__wps__photo_cover_action wps_gallery_album" data-owner="'.$album->owner.'" data-iid="'.$photo->iid.'" data-name="'.stripslashes($photo->title).'" href="'.$img_src.'" rev="'.$cnt.'" rel="symposium_gallery_photos_'.$album->gid.'" title="'.stripslashes($album->name).'">';
					        						$thumbnail_size = (get_option(WPS_OPTIONS_PREFIX."_gallery_thumbnail_size") != '') ? get_option(WPS_OPTIONS_PREFIX."_gallery_thumbnail_size") : 75;
					        						$html .= '<img class="__wps__photo_image" style="width:'.$thumbnail_size.'px; height:'.$thumbnail_size.'px;" src="'.$thumb_src.'" />';
					        					$html .= '</a>';
					     						$html .= '</div>';
					       					$html .= '</div>';
					     				$html .= '</div>';
			
						       		if (count($photos) > $preview_count && $cnt == $preview_count) {
						       		    $html .= '<div id="wps_gallery_comment_more" style="cursor:pointer">'.__('more...', WPS_TEXT_DOMAIN).'<div style="clear:both"></div></div>';
						       		}   		
					      				
					       		}
					       		
					       		$html .= '</div>';							
							
							} else {
							
						      	 $html .= __("No photos yet.", WPS_TEXT_DOMAIN);
						     
							}
			
						$html .= '</div>';	
					}
				}	
	
				if ($album_count == $page_length) { break; }
				
			}
		
		}
	
		$html .= "<div style='clear:both;text-align:center; margin-top:20px; width:100%'><a href='javascript:void(0)' id='showmore_gallery'>".__("more...", WPS_TEXT_DOMAIN)."</a></div>";
		
		$html .= '</div>';
		
		
	}

	// Stores start value for more
	$html .= '<div id="symposium_gallery_start" style="display:none">'.$total_count.'</div>';
	$html .= '<div id="symposium_gallery_page_length" style="display:none">'.$page_length.'</div>';


	$html .= '</div>';
	return $html;
}
	if (get_option(WPS_OPTIONS_PREFIX.'_status_label') === false)	
		update_option(WPS_OPTIONS_PREFIX.'_status_label', __('What`s up?', WPS_TEXT_DOMAIN));
	if (get_option(WPS_OPTIONS_PREFIX.'_jscharts') === false)	
		update_option(WPS_OPTIONS_PREFIX.'_jscharts', 'on');
	if (get_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg') === false)	
		update_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg', '');
	if (get_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_1') === false)	
		update_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_1', 'bold,italic,|,fontselect,fontsizeselect,forecolor,backcolor,|,bullist,numlist,|,link,unlink,|,image,media,|,emotions');
	if (get_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_2') === false)	
		update_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_2', '');
	if (get_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_3') === false)	
		update_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_3', '');
	if (get_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_4') === false)	
		update_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_4', '');
	if (get_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_css') === false)	
		update_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_css', str_replace(__wps__siteURL(), '', WPS_PLUGIN_URL."/tiny_mce/themes/advanced/skins/wps.css"));
	if (get_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_skin') === false)	
		update_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_skin', 'cirkuit');
	if (get_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_width') === false)	
		update_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_width', 563);
	if (get_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_height') === false)	
		update_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg_height', 300);
	if (get_option(WPS_OPTIONS_PREFIX.'_forum_refresh') === false)	
		update_option(WPS_OPTIONS_PREFIX.'_forum_refresh', '');
	if (get_option(WPS_OPTIONS_PREFIX.'_subject_mail_new') === false)	
		update_option(WPS_OPTIONS_PREFIX.'_subject_mail_new', __('New Mail Message: [subject]', WPS_TEXT_DOMAIN));
	if (get_option(WPS_OPTIONS_PREFIX.'_subject_forum_new') === false)	
		update_option(WPS_OPTIONS_PREFIX.'_subject_forum_new', __('New Forum Topic', WPS_TEXT_DOMAIN));
	if (get_option(WPS_OPTIONS_PREFIX.'_subject_forum_reply') === false)	
		update_option(WPS_OPTIONS_PREFIX.'_subject_forum_reply', __('New Forum Reply', WPS_TEXT_DOMAIN));
	if (get_option(WPS_OPTIONS_PREFIX.'_profile_comments') === false)