Settings'; array_unshift($links, $settings_link); return $links; } } add_filter("plugin_action_links_".plugin_basename(__FILE__), 'aklamator_plugin_settings_link' ); /* * Activation Hook */ register_activation_hook( __FILE__, 'set_up_options' ); function set_up_options(){ add_option('aklamatorApplicationID', ''); add_option('aklamatorPoweredBy', ''); add_option('aklamatorSingleWidgetID', ''); add_option('aklamatorPageWidgetID', ''); add_option('aklamatorSingleWidgetTitle', ''); } /* * Uninstall Hook */ register_uninstall_hook(__FILE__, 'aklamator_uninstall'); function aklamator_uninstall() { delete_option('aklamatorApplicationID'); delete_option('aklamatorPoweredBy'); delete_option('aklamatorSingleWidgetID'); delete_option('aklamatorPageWidgetID'); delete_option('aklamatorSingleWidgetTitle'); } if( !function_exists("bottom_of_every_post")){ function bottom_of_every_post($content){ /* we want to change `the_content` of posts, not pages and the text file must exist for this to work */ if (is_single()){ $widget_id = get_option('aklamatorSingleWidgetID'); }elseif (is_page()) { $widget_id = get_option('aklamatorPageWidgetID'); }else{ /* if `the_content` belongs to a page or our file is missing the result of this filter is no change to `the_content` */ return $content; } $title = ""; if(get_option('aklamatorSingleWidgetTitle') !== ''){ $title .= "

". get_option('aklamatorSingleWidgetTitle'). "

"; } /* append the text file contents to the end of `the_content` */ return $content . $title ."
" . "
"; } } class AklamatorWidget { public $aklamator_url; public $api_data; public function __construct() { $this->aklamator_url = "http://aklamator.com/"; if (is_admin()) { add_action("admin_menu", array( &$this, "adminMenu" )); add_action('admin_init', array( &$this, "setOptions" )); if (get_option('aklamatorApplicationID') !== '') { $this->api_data = $this->addNewWebsiteApi(); } } if (get_option('aklamatorSingleWidgetID') !== 'none') { if (get_option('aklamatorSingleWidgetID') == '') { if ($this->api_data->data[0]) { update_option('aklamatorSingleWidgetID', $this->api_data->data[0]->uniq_name); } } add_filter('the_content', 'bottom_of_every_post'); } if (get_option('aklamatorPageWidgetID') !== 'none') { if (get_option('aklamatorPageWidgetID') == '') { if ($this->api_data->data[0]) { update_option('aklamatorPageWidgetID', $this->api_data->data[0]->uniq_name); } } add_filter('the_content', 'bottom_of_every_post'); } } function setOptions() { register_setting('aklamator-options', 'aklamatorApplicationID'); register_setting('aklamator-options', 'aklamatorPoweredBy'); register_setting('aklamator-options', 'aklamatorSingleWidgetID'); register_setting('aklamator-options', 'aklamatorPageWidgetID'); register_setting('aklamator-options', 'aklamatorSingleWidgetTitle'); } public function adminMenu() { add_menu_page('Aklamator Digital PR', 'Aklamator PR', 'manage_options', 'aklamator-digital-pr', array( $this, 'createAdminPage' ), content_url() . '/plugins/aklamator-digital-pr/images/aklamator-icon.png'); } public function getSignupUrl() { return $this->aklamator_url . 'registration/publisher?utm_source=wordpress&utm_medium=admin&e=' . urlencode(get_option('admin_email')) . '&pub=' . preg_replace('/^www\./','',$_SERVER['SERVER_NAME']). '&un=' . urlencode(wp_get_current_user()->display_name).'&domain='.site_url(); } private function addNewWebsiteApi() { if (!is_callable('curl_init')) { return; } $service = $this->aklamator_url . "wp-authenticate/user"; $p['ip'] = $_SERVER['REMOTE_ADDR']; $p['domain'] = site_url(); $p['source'] = "wordpress"; $p['AklamatorApplicationID'] = get_option('aklamatorApplicationID'); $client = curl_init(); curl_setopt($client, CURLOPT_AUTOREFERER, TRUE); curl_setopt($client, CURLOPT_HEADER, 0); curl_setopt($client, CURLOPT_RETURNTRANSFER, true); curl_setopt($client, CURLOPT_URL, $service); if (!empty($p)) { curl_setopt($client, CURLOPT_POST, count($p)); curl_setopt($client, CURLOPT_POSTFIELDS, http_build_query($p)); } $data = curl_exec($client); if (curl_error($client)!= "") { $this->curlfailovao=1; } else { $this->curlfailovao=0; } curl_close($client); $data = json_decode($data); return $data; } public function createAdminPage() { $code = get_option('aklamatorApplicationID'); $ak_home_url = 'http://aklamator.com'; $ak_dashboard_url = 'http://aklamator.com/dashboard'; ?>

Aklamator Digital PR

Step 1:

Step 2:      Paste your Aklamator Application ID

Your Aklamator Application ID

" maxlength="999" onchange="appIDChange(this.value)"/>

Required="Required"> Required I acknowledge there is a 'powered by aklamator' link on the widget.

api_data->flag === false): ?>

api_data->error; ?>

api_data->flag): ?>

Options

Select widget to be shown on bottom of the each:

" maxlength="999" /> api_data->data; /* Add new item to the end of array */ $item_add = new stdClass(); $item_add->uniq_name = 'none'; $item_add->title = 'Do not show'; $widgets[] = $item_add; ?>

" />
curlfailovao && get_option('aklamatorApplicationID') != ''): ?>

Error communicating with Aklamator server, please refresh plugin page or try again later.

api_data->flag): ?>

Your Widgets

In order to add new widgets or change dimensions please login to aklamator

api_data->data as $item): ?>
Name Domain Settings Image size Column/row Created At
title; ?> domain_ids as $domain): ?> title; ?>
img_size; ?>px column_number; ?> x row_number; ?> date_created; ?>
Name Domain Settings Immg size Column/row Created At
'', 'title' => '', 'content' => '', ); public function __construct() { // widget actual processes parent::__construct( 'wp_widget_aklamator', // Base ID 'Aklamator Digital PR', // Name array( 'description' => __( 'Display Aklamator Widgets in Sidebar')) // Widget Description ); } function widget( $args, $instance ) { extract($args); //var_dump($instance); die(); $supertitle_html = ''; if ( ! empty( $instance['supertitle'] ) ) { $supertitle_html = sprintf( __( '%s', 'envirra' ), $instance['supertitle'] ); } $title_html = ''; if ( ! empty( $instance['title'] ) ) { $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base); $title_html = $supertitle_html.$title; } echo $before_widget; if ( $instance['title'] ) echo $before_title . $title_html . $after_title; ?> show_widget(do_shortcode( $instance['widget_id'] )); ?>
default ); $supertitle = strip_tags( $instance['supertitle'] ); $title = strip_tags( $instance['title'] ); $content = $instance['content']; $widget_id = $instance['widget_id']; if($widget_data->api_data->flag && !empty($widget_data->api_data->data)): ?>





Please make sure that you configured Aklamator plugin correctly Click here to configure Aklamator plugin