Ejemplo n.º 1
0
 public function setup_meta_box_view()
 {
     $data = Database::get_results($this->args['table'], null, array('post_id' => (string) get_the_ID()));
     // Include the specified view or create a standard default meta box view
     if (!empty($this->args['view'])) {
         $array = $this->args['array'];
         $prefix = $this->args['table']['prefix'] . '_';
         include_once $this->args['view'];
     } else {
         $this->default_meta_box_view($data);
     }
 }
Ejemplo n.º 2
0
 public function get_mailing_list($status = NULL)
 {
     switch ($status) {
         case 'active':
             return Database::get_results(static::$table, NULL, array('status' => 'active'));
             break;
         case 'trash':
             return Database::get_results(static::$table, NULL, array('status' => 'trash'));
             break;
         case 'deleted':
             return Database::get_results(static::$table, NULL, array('status' => 'deleted'));
             break;
         default:
             return Database::get_results(static::$table);
             break;
     }
 }
Ejemplo n.º 3
0
/**
 * Admin view that displays the mailing list.
 *
 * @package     Интоор Library (intoor)
 * @author      Colton James Wiscombe <*****@*****.**>
 * @copyright   2014 Hazard Media Group LLC
 * @license     MIT License - http://www.opensource.org/licenses/mit-license.html
 * @link        https://github.com/Alekhen/intoor-lib
 * @version     Release: 1.2
 */
if (!defined('INTOOR_RESTRICT_ACCESS') || !INTOOR_RESTRICT_ACCESS) {
    die('Unauthorized Access');
}
extract($this->args);
$data = Database::get_results($table, array('id', 'email', 'status', 'create_date', 'create_time'));
$default_view = 'active';
$current_view = empty($_GET['view']) ? $default_view : $_GET['view'];
$views = ['active' => ['url' => admin_url() . 'admin.php?page=' . $id, 'item_count' => 0, 'empty_message' => 'No Active Emails to Display', 'actions' => ['trash' => 'Move to Trash']], 'trash' => ['url' => admin_url() . 'admin.php?page=' . $id . '&view=trash', 'item_count' => 0, 'empty_message' => 'No Emails in the Trash', 'actions' => ['active' => 'Restore', 'delete' => 'Delete Permanently']]];
// Update item_count for each view
foreach ($data as $row => $val) {
    if (!empty($val['id'])) {
        $views[$val['status']]['item_count'] = $views[$val['status']]['item_count'] + 1;
    }
}
$table_cols = ['num' => '#', 'email' => 'Email Address', 'date' => 'Date'];
?>
<div class="wrap">

	<h2>Mailing List</h2>
Ejemplo n.º 4
0
 public static function get_params()
 {
     $params = array();
     $data = Database::get_results(static::$table);
     foreach ($data as $row => $arr) {
         $params[$arr['param']] = $arr['value'];
     }
     return $params;
 }
Ejemplo n.º 5
0
/**
 * Admin view that displays options for customizing tracking.
 *
 * @package     Интоор Library (intoor)
 * @author      Colton James Wiscombe <*****@*****.**>
 * @copyright   2014 Hazard Media Group LLC
 * @license     MIT License - http://www.opensource.org/licenses/mit-license.html
 * @link        https://github.com/Alekhen/intoor-lib
 * @version     Release: 1.2
 */
if (!defined('INTOOR_RESTRICT_ACCESS') || !INTOOR_RESTRICT_ACCESS) {
    die('Unauthorized Access');
}
$p = Tracking::$table['prefix'] . '_';
$data = Database::get_results(Tracking::$table);
?>
<div class="wrap">

	<h2>Tracking Parameters</h2>
	<p><em>Definitions:</em> Query strings are one way of transfering data from one website to another.  Query strings are all the numbers, letters, and symbols that follows a question mark (?) at the end of a URL.  Parameters are sets of key/value pairs within query strings (ie. example.com/?key=value).  When a query string contains multiple parameters they are separated by the ampersand (&amp;) symbol (ie. example.com/?key1=value1&key2=value2).</p>
	<p><em>Instructions:</em> Below you have the ability to define the keys and default value pairs that are associated with tracking.  The parameters defined here will be collected and stored in the session tracking cookie when users visit the site.</p>
	<p><em>Note:</em> To delete a parameter, simply erase the key and save your changes.</p>

	<form method="post" action="options-general.php?page=tracking">

		<table id="template" style="display:none;">
			<tr>
				<th scope="row">
					<input type="hidden" id="" name="<?php 
echo $p;
Ejemplo n.º 6
0
/**
 * Admin view that displays the mailing list stats.
 *
 * @package     Интоор Library (intoor)
 * @author      Colton James Wiscombe <*****@*****.**>
 * @copyright   2014 Hazard Media Group LLC
 * @license     MIT License - http://www.opensource.org/licenses/mit-license.html
 * @link        https://github.com/Alekhen/intoor-lib
 * @version     Release: 1.2
 */
if (!defined('INTOOR_RESTRICT_ACCESS') || !INTOOR_RESTRICT_ACCESS) {
    die('Unauthorized Access');
}
extract($this->args);
$data = Database::get_results($table, array('status'));
$active_count = 0;
$inactive_count = 0;
$deleted_count = 0;
$total_count = 0;
$month_count = Database::date_count($table, 'create_date', 'month');
$month_unsub_count = Database::date_count($table, 'delete_date', 'month');
$week_count = Database::date_count($table, 'create_date', 'week');
$week_unsub_count = Database::date_count($table, 'delete_date', 'week');
$day_count = Database::date_count($table, 'create_date', 'day');
$day_unsub_count = Database::date_count($table, 'delete_date', 'day');
foreach ($data as $row => $val) {
    if (!isset($val['email'])) {
        $total_count++;
        switch ($val['status']) {
            case 'active':