The Admin panel is under presentation tab. Need Help? Visit the Official AWP support thread or try reading the full documentation.
Author: Aaron Harun
Version: 1.13.1
Author URI: http://anthologyoi.com/
* Copyrighted 2008 by:
* Aaron Harun http://anthologyoi.com
* The code is released under a Creative Commons Liscense
* (Attribution-NonCommercial-ShareAlike 2.0)
* TERMS: (Removal of this section indicates agreement with these Terms.)
* For Personal (non-distribution, non-commercial) use this notice must remain.
* For Distribution this notice must remain and attribution through
* a publicly accessible "followable" links on applicable
* information and download pages are required.
* No Commercial use without approval.
Web Designers: Considering using this plugin on a client website?
You may remove all commercial and distribution restrictions by sponsoring this plugin by
(a) Making a monetary donation commensurate with its worth in your project and/or
(b) Helping to improve this plugin by submitting code, modifications or bug fixes and/or
(c) Certifying this plugin is developer quality by publicly recognizing its contributions to your projects through publicly facing, followable links on your main developer website.
Theme Designers:
I will link back,on the main AWP page, to themes that are created with built-in AWP support and provide a followable link to the main AWP page.
*/
/*__/_______________________________/_____*/
/* Setup up everything. */
/* Globals first then Modules */
/*__/_______________________________/______*/
if($_GET['awp'] == 'test')
$awpsuffix = '?awp=test';
//Constants
define('AWP_BASE',AWP::get_base());
define('AWP_MODULES','/'.AWP_BASE.'/modules');
define('AWP_AJAX', get_settings('siteurl')."/wp-content/plugins/".AWP_BASE."/aWP-response.php$awpsuffix");
// Globals
global $awpall, $awp_mods;
$awpall = AWP::start_up(); /*Get all options*/
$awp_mods = get_option('awp_mods'); /*Get active Modules*/
add_action('init', array('AWP','init'));
if ( is_array($awp_mods) && $_POST["action"] != "restoredefaults") {
foreach ($awp_mods as $mod) {
if ('' != $mod && file_exists(ABSPATH . PLUGINDIR . AWP_MODULES. '/' . $mod))
include_once(ABSPATH . PLUGINDIR . AWP_MODULES . '/' . $mod);
}
}else{
$awp_mods = array();
}
include_once(ABSPATH . PLUGINDIR . '/'.AWP_BASE . '/control/aWP-ajax.php');
register_activation_hook(__file__,array('AWP','maybe_set_defaults'));
//register_deactivation_hook(__file__,array('AWP','rm_options'));
class AWP{
function start_up(){
$options = array();
if($_GET['awp'] == 'test'){
$options = get_option('awp_test');
}else{
$options = get_option('awp');
}
if(!is_array($options)){
$options = AWP::set_defaults();
}
if(!$options['commentform_input_suffix'])
$options['commentform_input_suffix'] = '_%ID';
return $options;
}
function init() {
global $awpall;
$currentLocale = get_locale();
if(!empty($currentLocale)) {
$moFile = dirname(__FILE__) . "/translations/aWP-" . $currentLocale . ".mo";
if(@file_exists($moFile) && is_readable($moFile)) load_textdomain('awp', $moFile);
}
if(strpos($_GET['page'],'aWP-admin_panel.php') == true){
include_once(ABSPATH . PLUGINDIR . '/'.AWP_BASE . '/control/aWP-admin.php');
add_action('admin_head',array('AWP_admin','admin_js'));
if($_REQUEST['action'])
AWP_admin::process_admin();
}
add_action('admin_menu', array('AWP','menu'));
add_action('wp_head', array('AWP','print_header'));
if($awpall['give_credit'])
add_action('wp_footer',array('AWP','give_credit'));
}
function give_credit(){
echo 'AJAXed with AWP';
}
function get_base(){
return end(explode('/', str_replace(array('\\','/aWP.php','/awp.php'),array('/',''),__FILE__)));
}
function print_header(){
global $awpall,$wp_version;
$home = get_settings('siteurl');
do_action('awp_get_library');
wp_register_script('awp-core', $home.'/wp-content/plugins/'.AWP_BASE.'/js/core.js.php', false, $awpall[last_modified]);
echo "\n";
wp_print_scripts('awp-core');
do_action('aWP_header');
?>
'."\n";
?>
'."\n";
}
}
?>
'."\n";
}else{
echo ''."\n";
}
}
}elseif($responses){
echo ''."\n";
}
?>
'."\n";
}else{
echo ''."\n";
}
}
}
?>
0){
return str_replace('%',$count,$awpall[zero_comments]);
}elseif($count == 1 && $awpall[one_comment]){
return str_replace('%',$count,$awpall[one_comment]);
}elseif($count > 1 && $awpall[some_comments]){
return str_replace('%',$count,$awpall[some_comments]);
}else{
return $count;
}
}
function links($ops, $return=1){
$ops[doit] = ($ops[doit]) ? 'aWP.doit({'."$ops[doit]".'}); ' :'';
$ops[onclick] = ($ops[onclick] || $ops[doit]) ? ' onclick="'.$ops[doit].$ops[onclick].' return false;"' :'';
$ops[rel] = ($ops[rel]) ? ' rel="'.$ops[rel].'"' : '';
$ops[_class] = ($ops[_class]) ? ' class="'.$ops[_class].'"' : '';
$ops[style] = ($ops[style]) ? ' style="'.$ops[style].'"' : '';
$link = '%s';
$link = sprintf($link, $ops[URL], $ops[id], $ops[_class], $ops[onclick], $ops[rel], $ops[style], $ops[anchor] );
if($return){
return $link;
}else{
echo $link;
}
}
function maybe_JS($input){
if(!defined('AWP_AJAXED')){
//So normal users without JS won't see it. No reason to tease them.
return '';
}else{
return $input;
}
}
function get_a_category_list(){
$categories = get_the_category();
if (empty($categories))
return __('Uncategorized');
$separator = ',';
$thelist = '';
$i = 0;
foreach ( $categories as $category ) {
if ( 0 < $i )
$thelist .=', ';
$thelist .= $category->cat_name;
++$i;
}
return $thelist;
}
function menu() {
add_submenu_page('themes.php', 'AWP Managment', 'AWP Managment', 8, AWP_BASE.'/control/aWP-admin_panel.php');
}
/* Options Stuff.
=================================
*/
function maybe_set_defaults(){
global $awpall;
AWP::start_up();
}
function set_defaults(){
global $awpall, $awp_mods;
delete_option('awp');
delete_option('awp_mods');
$awpall = null;
$awpall[commentform] = 'Enabled';
$awpall[inlinecomments] = 'Enabled';
$awpall[inlineposts] = 'Enabled';
$awpall[special_effects] = 'Enabled';
$awpall[comment_open] = __('Show Comments','awp');
$awpall[comment_hide] = __('Hide Comments','awp');
$awpall[commentform_open] = __('Add a Comment','awp');
$awpall[commentform_hide] = __('Cancel reply','awp');
$awpall[commentform_reply_open] = __('Reply to %author','awp');
$awpall[commentform_reply_hide] = __('Cancel reply','awp');
$awpall[closed_comments] = __('Comments are closed','awp');
$awpall[no_comments] = __('No Comments','awp');
$awpall[split_mode] = 'more';
$awpall[link_show_text] = __('Click to continue reading "%title"','awp');
$awpall[link_hide_text] = __('Hide "%title"','awp');
$awpall[js_library] = 'sack';
$awpall[do_effect] = 'ScrollLeft';
$awpall[effects] = 'SlideUp';
$awpall[show_comments_single] = 1;
$awpall[show_comments_page] = 1;
$awpall[show_commentform_page] = 1;
$awpall[show_commentform_single] = 1;
$awpall[background_color] = '#FFFFFF';
$awpall[simple_posts] = 1;
$awpall[give_credit] = 1;
$awpall[read_more] = __('Go straight to Post','awp');
$awpall[one_comment] = __('a comment','awp');
$awpall[some_comments] = __('% comments','awp');
if(!get_option('awp_firstinstall')){
add_option('awp_firstinstall',gmdate('Y-m-d H:i:59'), 'This is the first install date of aWP, it will never change or be deleted');
}else{
$awpall[lastreset] = gmdate('Y-m-d H:i:59');
}
$awpall = apply_filters('awp_setdefaults',$awpall);
AWP::update_options($awpall);
add_option('awp',$awpall, 'The main option for all of aWP.');
$awp_mods[] = 'inlinecommentform/inlinecommentform.php';
$awp_mods[] = 'inlinecomments/inlinecomments.php';
$awp_mods[] = 'inlineposts.php';
add_option('awp_mods', $awp_mods, 'An array of activated modules.');
return $awpall;
}
function set_options(){
global $awpall, $aWP;
$aWP[options] = apply_filters('awp_options',$awpall);
}
function rm_options(){
delete_option('awp');
delete_option('awp_mods');
do_action('awp_shutdown');
}
function update_options($options){
global $awpall;
$checkboxes = array('give_credit');
$texts = array('zero_comments','one_comment','some_comments');
$checkboxes = apply_filters('awp_get_options', array('texts'=>$texts, 'radios'=>$radios, 'selects'=>$selects, 'checkboxes' =>$checkboxes));
foreach($checkboxes['checkboxes'] as $name){
if(!$options[$name]){ $options[$name] = 0; }
}
while (list($option, $value) = each($options)) {
if( get_magic_quotes_gpc() ) {
$value = stripslashes($value);
}
$awpall[$option] =$value;
}
return $awpall;
}
function count_numeric_items($array){
return is_array($array) ? count(array_filter(array_keys($array), 'is_numeric')) : 0;
}
function XML($xml){
$xml_parser = & new AWP_XML();
$data = $xml_parser->parse($xml);
return $data;
}
}
if (!function_exists("htmlspecialchars_decode")) { /* PHP 4 support. I like this function.*/
function htmlspecialchars_decode($string, $quote_style = ENT_COMPAT) {
return strtr($string, array_flip(get_html_translation_table(HTML_SPECIALCHARS, $quote_style)));
}
}
?>