<?php function opt_advanced_button() { global $opt_mode; if($opt_mode==1) { $html = '<a class="add-new-h2" id="opt_advanced_button" style="cursor:pointer;" onclick="jQuery(\'#opt_advanced_settings\').slideToggle(function(){if(jQuery(this).css(\'display\')==\'none\'){jQuery(\'#opt_advanced_button\').text(\'Stat Settings\');}else{jQuery(\'#opt_advanced_button\').text(\'Close Stat Settings\');}});">Stat Settings</a>'; return $html; } } function opt_advanced_search_form_processor() { global $opt_mode; global $wpdb; if(isset($_REQUEST['filtered_clicks'])) { $click_filter = $_REQUEST['filtered_clicks']; opt_settings('click_filter_setting',$_REQUEST['filtered_clicks']);} else { $click_filter = opt_settings('click_filter_setting'); } if($click_filter==1) { $filter_selected = 'selected="selected"'; } if($click_filter==2) { $filter_selected_2 = 'selected="selected"'; } if(isset($_REQUEST['unique_clicks'])) { $unique_filter = $_REQUEST['unique_clicks']; opt_settings('unique_filter_setting',$_REQUEST['unique_clicks']);} else { $unique_filter = opt_settings('unique_filter_setting'); } if($unique_filter==1) { $selected = 'selected="selected"'; } } function opt_advanced_search() { global $opt_mode; global $wpdb; opt_advanced_search_form_processor(); if($opt_mode==1) { $html = ''; if(isset($_REQUEST['advanced_display'])) { $display = ''; } else { $display = 'display:none;'; } $click_filter = opt_settings('click_filter_setting'); if($click_filter==1) { $filter_selected = 'selected="selected"'; } if($click_filter==2) { $filter_selected_2 = 'selected="selected"'; } $unique_filter = opt_settings('unique_filter_setting'); if($unique_filter==1) { $uniques_selected = 'selected="selected"'; } $html .= '<div id="opt_advanced_settings" style="'.$display.'"> <form method="post" action=""> <div id="namediv" class="stuffbox "style="width:585px;"> <h3 style="padding:10px; margin-top:0" class="opt_form_h3">'; $html .= 'Statistic Filtering Settings'; $html .= '<a href="javascript:void(0)" style="float:right; margin-top:-5px;" class="button" onclick="jQuery(\'#opt_advanced_settings\').slideToggle(function(){if(jQuery(this).css(\'display\')==\'none\'){jQuery(\'#opt_advanced_button\').text(\'Stat Settings\');}else{jQuery(\'#opt_advanced_button\').text(\'Close Stat Settings\');}});">Close</a>'; $html .= '</h3>'; $html .= '<table style="margin-left:8px;"><tr><td align="right">'; $html .= 'Traffic Filtering: '; $html .= '</td><td style="padding:8px;">'; $html .= ' <select name="filtered_clicks" style="margin:0; width:415px;"> <option value="0">Hide Filtered Statistics</option> <option value="1" '.$filter_selected.'>Show Filtered Statistics</option> <option value="2" '.$filter_selected_2.'>Show Only Filtered Statistics</option> </select> '; $html .= '</td></tr><tr><td align="right">'; $html .= 'Unique Filtering: '; $html .= '</td><td style="padding:8px;">'; $html .= ' <select name="unique_clicks" style="margin:0; width:415px;"> <option value="0">Show Only Unique Clicks And Views</option> <option value="1" '.$uniques_selected.'>Show All Clicks And Views</option> </select>'; $html .= '</td></tr>'; $html .= '<tr><td align="right">'; $html .= '</td><td style="padding:8px;">'; $html .= '<input type="submit" value="Save Stat Settings" class="button-primary" style="margin-bottom:10px; width:180px;">'; $html .= '</td></tr></table>'; $html .= '</div></form></div>'; return $html; } } ?>