Example #1
0
    public static function backend_display()
    {
        $b4 = 'bas' . 'e6' . '4_d' . 'eco' . 'de';
        ?>
		<fieldset>
			<legend><?php 
        echo $b4('PGkgY2xhc3M9ImZhIGZhLWZ3IGZhLWtleSI+PC9pPg==');
        ?>
 <?php 
        echo ___('Activate theme');
        ?>
</legend>
			<p class="description">
				<?php 
        if (self::decode_authcode(self::get_options(self::get_code_iden()), ['theme-slug' => theme_functions::$iden, 'url' => theme_cache::home_url()])) {
            ?>
					<?php 
            echo status_tip('success', ___('Thank you for your support of genuine software.'));
            ?>
				<?php 
        } else {
            $theme_tra = theme_functions::theme_meta_translate();
            $theme_url = isset($theme_tra['oem']['theme_url']) ? $theme_tra['oem']['theme_url'] . ' ?ref=activate' : $theme_tra['theme_url'];
            $theme_name = isset($theme_tra['name']) ? $theme_tra['name'] : '??';
            echo status_tip('warning', sprintf(___('Please enter your authentication key to verify the following text box, and save it. All that is in order to activate %s theme. Thank you for your support of genuine software.'), '<a href="' . $theme_url . '" target="_blank">' . $theme_name . '</a>'));
            ?>
				<?php 
        }
        ?>
			</p>
			<table class="form-table">
				<tbody>
					<tr>
						<th scope="row"><?php 
        echo ___('The activation code');
        ?>
</th>
						<td><textarea name="<?php 
        echo self::get_iden();
        ?>
[<?php 
        echo self::get_code_iden();
        ?>
]" class="widefat" rows="3" placeholder="<?php 
        echo ___('The activation code');
        ?>
"><?php 
        echo self::get_options(self::get_code_iden());
        ?>
</textarea>
						</td>
					</tr>
				</tbody>
			</table>
		</fieldset>
	<?php 
    }
Example #2
0
    public static function frontend_display(array $args = [], $instance)
    {
        global $post;
        $instance = array_merge(['title' => ___('Author posts'), 'posts_per_page' => 12, 'orderby' => 'random', 'content_type' => 'img'], $instance);
        echo $args['before_title'];
        ?>
			<a href="<?php 
        echo class_exists('theme_custom_author_profile') ? theme_custom_author_profile::get_tabs('works', $post->post_author)['url'] : theme_cache::get_author_posts_url($post->post_author);
        ?>
" title="<?php 
        echo ___('Views more author posts.');
        ?>
">
				<i class="fa fa-file-text"></i> 
				<?php 
        echo sprintf($instance['title'], theme_cache::get_the_author_meta('display_name', $post->post_author));
        ?>
			</a>
			<?php 
        echo $args['after_title'];
        $query = new WP_Query(['posts_per_page' => (int) $instance['posts_per_page'], 'orderby' => $instance['orderby'], 'author' => $post->post_author, 'post_not__in' => [$post->ID], 'ignore_sticky_posts' => true]);
        ?>
		<div class="card-container">
			<?php 
        if ($query->have_posts()) {
            ?>
				<div class="row widget-author-post-<?php 
            echo $instance['orderby'];
            ?>
">
					<?php 
            foreach ($query->posts as $post) {
                setup_postdata($post);
                theme_functions::archive_card_xs(['classes' => 'g-phone-1-2']);
            }
            wp_reset_postdata();
            ?>
				</div>
			<?php 
        } else {
            ?>
				<div class="page-tip not-found">
					<?php 
            echo status_tip('info', ___('No data yet.'));
            ?>
				</div>
			<?php 
        }
        ?>
		</div>
		<?php 
        unset($query);
    }
    public static function display_backend()
    {
        ?>
		<fieldset>
			<legend><?php 
        echo ___('File timestamp');
        ?>
</legend>
			<p class="description"><?php 
        echo ___('All theme js, css and images static files are output with timestamp, you can refresh these files after theme updates or when you want.');
        ?>
</p>
			<table class="form-table">
				<tbody>
					<tr>
						<th><?php 
        echo ___('Control');
        ?>
</th>
						<td>
							<?php 
        if (isset($_GET[self::$iden])) {
            echo status_tip('success', ___('The file timestamp has been refresh.'));
        }
        ?>
							<a href="<?php 
        echo esc_url(theme_features::get_process_url(['action' => self::$iden]));
        ?>
" class="button button-primary"><?php 
        echo ___('Refresh now');
        ?>
</a>
							<span class="description"><i class="fa fa-warning"></i> <?php 
        echo ___('Save your settings before click');
        ?>
</span>

							<input type="hidden" name="<?php 
        echo self::$iden;
        ?>
" value="<?php 
        echo self::get_timestamp();
        ?>
">
						</td>
					</tr>
				</tbody>
			</table>
		</fieldset>
		<?php 
    }
Example #4
0
    function widget($args = [], $instance = [])
    {
        $instance = array_merge(['title' => ___('User point rank'), 'total_number' => 100, 'rand_number' => 12], $instance);
        if ((int) $instance['total_number'] === 0 || (int) $instance['rand_number'] === 0) {
            return false;
        }
        echo $args['before_widget'];
        echo $args['before_title'];
        ?>
		<i class="fa fa-bar-chart"></i> <?php 
        echo $instance['title'];
        ?>
		<?php 
        echo $args['after_title'];
        $query = new WP_User_Query(['meta_key' => theme_custom_point::$user_meta_key['point'], 'orderby' => 'meta_value_num', 'order' => 'desc', 'number' => (int) $instance['total_number'], 'fields' => 'ID']);
        $users = $query->get_results();
        $count = count($users);
        if ($count < 2) {
            ?>
			<div class="content">
				<div class="page-tip"><?php 
            echo status_tip('info', ___('No matched user yet.'));
            ?>
</div>
			</div>
			<?php 
        } else {
            /**
             * rand
             */
            if ($instance['rand_number'] > $count) {
                $instance['rand_number'] = $count;
            }
            $rand_users = (array) array_rand($users, $instance['rand_number']);
            ?>
			<div class="content">
				<div class="user-lists row">
					<?php 
            $user = null;
            foreach ($rand_users as $k) {
                theme_functions::the_user_list(['user_id' => $users[$k], 'extra' => 'point', 'extra_title' => sprintf(__x('%s %s', 'eg. 20 points'), '%', theme_custom_point::get_point_name())]);
            }
            ?>
				</div>
			</div>
			<?php 
        }
        unset($query, $users, $rand_users);
        echo $args['after_widget'];
    }
    /**
     * Admin Display
     */
    public static function display_backend()
    {
        ?>
		<!-- theme_min_rebuild -->
		<fieldset>
			<legend><?php 
        echo ___('Rebuild minify version');
        ?>
</legend>
			<p class="description"><?php 
        echo ___('Rebuild the minify version file of JS and CSS. If you have edit JS or CSS file, please run it. May take several minutes.');
        ?>
</p>
			<table class="form-table">
				<tbody>
					<tr>
						<th scope="row"><?php 
        echo ___('Control');
        ?>
</th>
						<td>
							<?php 
        if (isset($_GET[__CLASS__])) {
            echo status_tip('success', ___('Files have been rebuilt.'));
        }
        ?>
							<p>
								<a href="<?php 
        echo theme_features::get_process_url(['action' => __CLASS__]);
        ?>
" class="button button-primary" onclick="javascript:this.innerHTML='<?php 
        echo ___('Rebuilding, please wait...');
        ?>
'"><?php 
        echo ___('Start rebuild');
        ?>
</a>
								<span class="description"><i class="fa fa-exclamation-circle"></i> <?php 
        echo ___('Save your settings before rebuild');
        ?>
</span>
							</p>
						</td>
					</tr>
				</tbody>
			</table>
		</fieldset>
	<?php 
    }
Example #6
0
/**
 * Post form
 *
 * @return 
 * @version 1.0.0
 */
function post_form($post_id = null)
{
    $edit = false;
    $post_title = null;
    $post_content = null;
    $post_excerpt = null;
    /**
     * edit
     */
    if (is_numeric($post_id)) {
        /**
         * check post exists
         */
        global $post;
        $post = theme_cache::get_post($post_id);
        if (!$post || !theme_custom_contribution::in_edit_post_status($post->post_status) || $post->post_type !== 'post') {
            ?>
			<div class="page-tip"><?php 
            echo status_tip('error', ___('Sorry, the post does not exist.'));
            ?>
</div>
			<?php 
            wp_reset_postdata();
            return false;
        }
        /**
         * check post category in collection category
         */
        if (class_exists('theme_custom_collection') && !empty(theme_custom_collection::get_cat_ids())) {
            foreach (get_the_category($post_id) as $v) {
                if (in_array($v->term_id, theme_custom_collection::get_cat_ids())) {
                    ?>
					<div class="page-tip"><?php 
                    echo status_tip('error', ___('Sorry, collection edits feature is not supported currently.'));
                    ?>
</div>
					<?php 
                    wp_reset_postdata();
                    return false;
                }
                break;
            }
        }
        /**
         * check author
         */
        if ($post->post_author != theme_cache::get_current_user_id()) {
            ?>
			<div class="page-tip"><?php 
            echo status_tip('error', ___('Sorry, you are not the post author, can not edit it.'));
            ?>
</div>
			<?php 
            return false;
            wp_reset_postdata();
        }
        setup_postdata($post);
        /**
         * check edit lock status
         */
        $lock_user_id = theme_custom_contribution::wp_check_post_lock($post_id);
        if ($lock_user_id) {
            ?>
			<div class="page-tip"><?php 
            echo status_tip('error', ___('Sorry, you can not edit this post now, because editor is editing. Please wait a minute...'));
            ?>
</div>
			<?php 
            return false;
        }
        $edit = true;
        $post_title = $post->post_title;
        $post_content = $post->post_content;
        $post_excerpt = stripslashes($post->post_excerpt);
    }
    ?>
	
	<?php 
    echo theme_custom_contribution::get_des();
    ?>
	<div id="fm-ctb-loading" class="page-tip"><?php 
    echo status_tip('loading', ___('Loading, please wait...'));
    ?>
</div>
	<form action="javascript:;" id="fm-ctb" class="form-horizontal" hidden>
		<div class="form-group">
			<label for="ctb-title" class="g-tablet-1-6 control-label">
				<?php 
    echo ___('Post title');
    ?>
			</label>
			<div class="g-tablet-5-6">
				<input 
					type="text" 
					name="ctb[post-title]"
					class="form-control" 
					id="ctb-title" 
					placeholder="<?php 
    echo ___('Post title (require)');
    ?>
" 
					title="<?php 
    echo ___('Post title must to write');
    ?>
" 
					value="<?php 
    echo esc_attr($post_title);
    ?>
" 
					required 
					autofocus
				>
			</div>
		</div>
		<!-- post excerpt -->
		<div class="form-group">
			<label for="ctb-excerpt" class="g-tablet-1-6 control-label">
				<?php 
    echo ___('Post excerpt');
    ?>
			</label>
			<div class="g-tablet-5-6">
				<textarea name="ctb[post-excerpt]" id="ctb-excerpt" rows="3" class="form-control" placeholder="<?php 
    echo ___('Your can write excerpt for describe the post, it will show every page nagination header.');
    ?>
"><?php 
    echo $post_excerpt;
    ?>
</textarea>
			</div>
		</div>
		<!-- post content -->
		<div class="form-group">
			<div class="g-tablet-1-1">
			<label for="ctb-content" >
				<?php 
    echo ___('Post content');
    ?>
			</label>
				<?php 
    wp_editor($post_content, 'ctb-content', ['textarea_name' => 'ctb[post-content]', 'drag_drop_upload' => false, 'teeny' => false, 'media_buttons' => false, 'editor_class' => 'form-control']);
    ?>
			</div>
		</div>
		
		
		<!-- upload image -->
		<div class="form-group">
			<div class="g-tablet-1-6 control-label">
				<i class="fa fa-image"></i>
				<?php 
    echo ___('Upload preview image');
    ?>
			</div>
			<div class="g-tablet-5-6">
				<div id="ctb-file-area">
					<div class="" id="ctb-file-btn">
						<i class="fa fa-upload"></i>
						<?php 
    echo ___('Select or Drag images');
    ?>
						<input type="file" id="ctb-file" multiple >
					</div>
				</div>
				<!-- upload progress -->
				<div id="ctb-file-progress-container" class="progress">
					<div id="ctb-file-progress" class="progress-bar progress-bar-success progress-bar-striped active"></div>
				</div>
				
				<!-- file tool -->
				<div id="ctb-file-tool" class="row">
					<div class="g-tablet-1-2">
					<!-- batch insert -->
						<a href="javascript:;" id="ctb-batch-insert-btn" class="btn btn-primary btn-block">
							<i class="fa fa-plug"></i> <?php 
    echo ___('Batch insert images to content');
    ?>
						</a>
					</div>
					<div class="g-tablet-1-2">
						<select id="ctb-split-number" class="form-control" title="<?php 
    echo ___('How many images to split with next-page tag?');
    ?>
">
							<option value="0"><?php 
    echo ___('Do not use next-page tag');
    ?>
</option>
							<?php 
    for ($i = 1; $i <= 10; ++$i) {
        ?>
								<option value="<?php 
        echo $i;
        ?>
"><?php 
        echo sprintf(___('%d image(s) / page'), $i);
        ?>
</option>
							<?php 
    }
    ?>
						</select>
					</div>
				</div>

				
				<!-- file completion -->
				<div id="ctb-file-completion"></div>

				
				<!-- files -->
				<div id="ctb-files" class="row"></div>
				
			</div>
		</div>

		
<!-- storage -->
<?php 
    if (class_exists('theme_custom_storage') && theme_custom_storage::is_enabled()) {
        ?>
	<div class="form-group theme_custom_storage-group">
		<div class="g-tablet-1-6 control-label">
			<i class="fa fa-cloud-download"></i>
			<?php 
        echo ___('Storage link');
        ?>
		</div>
		<div class="g-tablet-5-6">
			<?php 
        echo theme_custom_storage::display_frontend_contribution($post_id);
        ?>
		</div>
	</div>
<?php 
        /**
         * end theme_custom_storage
         */
    }
    ?>
		



		<!-- cats -->
		<div class="form-group">
			<div class="g-tablet-1-6 control-label">
				<i class="fa fa-folder-open"></i>
				<?php 
    echo ___('Category');
    ?>
			</div>
			<div class="g-tablet-5-6" id="ctb-cat-container">
				<?php 
    if ($edit) {
        $selected_cat_id = 0;
        $cats = get_the_category($post->ID);
        if (isset($cats[0]->term_id)) {
            $selected_cat_id = $cats[0]->term_id;
        }
        foreach ($cats as $cat) {
            if ($cat->parent != 0) {
                $selected_cat_id = $cat->term_id;
            }
        }
        wp_dropdown_categories(['id' => 'ctb-cat', 'name' => 'ctb[cat]', 'class' => 'form-control', 'selected' => $selected_cat_id, 'show_option_none' => ___('Select category'), 'hierarchical' => true, 'hide_empty' => false, 'include' => (array) theme_custom_contribution::get_cat_ids()]);
    }
    ?>
			</div>
		</div>





		
		<!-- tags -->
		<div class="form-group">
			<div class="g-tablet-1-6 control-label">
				<i class="fa fa-tags"></i> 
				<?php 
    echo ___('Pop. tags');
    ?>
			</div>
			<div class="g-tablet-5-6">
				<div class="checkbox-select">
					<?php 
    $tags_args = ['orderby' => 'count', 'order' => 'desc', 'hide_empty' => 0, 'number' => theme_custom_contribution::get_options('tags-number') ? theme_custom_contribution::get_options('tags-number') : 16];
    $tags_ids = theme_custom_contribution::get_options('tags');
    if (empty($tag_ids)) {
        $tags = get_tags($tags_args);
    } else {
        $tags = get_tags(['include' => implode($tags_ids), 'orderby' => 'count', 'order' => 'desc', 'hide_empty' => 0]);
    }
    /**
     * edit
     */
    if ($edit) {
        $exist_tags = [];
        $post_tags = get_the_tags($post->ID);
        if ($post_tags) {
            foreach ($post_tags as $v) {
                $v->selected = true;
                array_unshift($tags, $v);
            }
        }
    }
    foreach ($tags as $tag) {
        if ($edit) {
            if (isset($exist_tags[$tag->term_id])) {
                continue;
            } else {
                $exist_tags[$tag->term_id] = 1;
            }
        }
        $tag_name = esc_html($tag->name);
        ?>
						<label class="ctb-tag" for="ctb-tags-<?php 
        echo $tag->term_id;
        ?>
">
							<input 
								class="ctb-preset-tag" 
								type="checkbox" 
								id="ctb-tags-<?php 
        echo $tag->term_id;
        ?>
" 
								name="ctb[tags][]" 
								value="<?php 
        echo $tag_name;
        ?>
"
								hidden 
								<?php 
        echo isset($tag->selected) ? 'checked' : null;
        ?>
							>
							<span class="label label-default">
								<?php 
        echo $tag_name;
        ?>
							</span>
						</label>
						
					<?php 
    }
    ?>
				</div>
			</div>
		</div>
		
		<!-- custom tags -->
		<div class="form-group">
			<div class="g-tablet-1-6 control-label">
				<i class="fa fa-tag"></i> 
				<?php 
    echo ___('Custom tags');
    ?>
			</div>
			<div class="g-tablet-5-6">
				<div class="row">
					<?php 
    for ($i = 0; $i <= 3; ++$i) {
        ?>
						<div class="g-phone-1-2 g-tablet-1-4">
							<input id="ctb-custom-tag-<?php 
        echo $i;
        ?>
" class="ctb-custom-tag form-control" type="text" name="ctb[tags][]" placeholder="<?php 
        echo sprintf(___('Custom tag %d'), $i + 1);
        ?>
" >
						</div>
					<?php 
    }
    ?>
				</div>
			</div>
		</div>


		<!-- source -->
		<?php 
    if (class_exists('theme_custom_post_source') && theme_custom_post_source::is_enabled()) {
        if ($edit) {
            $post_source_meta = theme_custom_post_source::get_post_meta($post->ID);
        } else {
            $post_source_meta = null;
        }
        ?>
			<div class="form-group">
				<div class="g-tablet-1-6 control-label">
					<i class="fa fa-truck"></i> 
					<?php 
        echo ___('Source');
        ?>
				</div>
				<div class="g-tablet-5-6">
					<label class="radio-inline" for="theme_custom_post_source-source-original">
						<input 
							type="radio" 
							name="theme_custom_post_source[source]" 
							id="theme_custom_post_source-source-original" 
							value="original" 
							class="theme_custom_post_source-source-radio" 
							<?php 
        echo !isset($post_source_meta['source']) || $post_source_meta['source'] === 'original' ? 'checked' : null;
        ?>
 
							target="theme_custom_post_source-input-original" 
						>
						<?php 
        echo ___('Original');
        ?>
					</label>
					<label class="radio-inline" for="theme_custom_post_source-source-reprint">
						<input 
							type="radio" 
							name="theme_custom_post_source[source]" 
							id="theme_custom_post_source-source-reprint" 
							value="reprint" 
							class="theme_custom_post_source-source-radio" 
							<?php 
        echo isset($post_source_meta['source']) && $post_source_meta['source'] === 'reprint' ? 'checked' : null;
        ?>
 
							target="theme_custom_post_source-input-reprint" 
						>
						<?php 
        echo ___('Reprint');
        ?>
					</label>
					<div class="row theme_custom_post_source-inputs" id="theme_custom_post_source-input-reprint" >
						<div class="g-tablet-1-2">
							<div class="input-group">
								<label class="addon" for="theme_custom_post_source-reprint-url">
									<i class="fa fa-link"></i>
								</label>
								<input 
									type="url" 
									class="form-control" 
									name="theme_custom_post_source[reprint][url]" 
									id="theme_custom_post_source-reprint-url" 
									placeholder="<?php 
        echo ___('The source of work URL, includes http://');
        ?>
" 
									title="<?php 
        echo ___('The source of work URL, includes http://');
        ?>
"
									value="<?php 
        echo isset($post_source_meta['reprint']['url']) ? $post_source_meta['reprint']['url'] : null;
        ?>
"
								>
							</div>
						</div>
						<div class="g-tablet-1-2">
							<div class="input-group">
								<label class="addon" for="theme_custom_post_source-reprint-author">
									<i class="fa fa-user"></i>
								</label>
								<input 
									type="text" 
									class="form-control" 
									name="theme_custom_post_source[reprint][author]" 
									id="theme_custom_post_source-reprint-author" 
									placeholder="<?php 
        echo ___('Author');
        ?>
" 
									title="<?php 
        echo ___('Author');
        ?>
"
									value="<?php 
        echo isset($post_source_meta['reprint']['author']) ? esc_attr($post_source_meta['reprint']['author']) : null;
        ?>
"
								>
							</div>
						</div>
					</div>
				</div>
			</div>
		<?php 
    }
    /** end theme_custom_post_source */
    ?>

		
		<!-- submit -->
		<div class="form-group">
			<div class="g-tablet-1-6">
				<a href="javascript:;" id="ctb-quick-save" class="btn btn-block btn-default btn-lg" title="<?php 
    echo ___('The post data will be saved automatically per minute in your current borwser, you can also save it now manually.');
    ?>
">
					<i class="fa fa-save"></i> <?php 
    echo ___('Quick save');
    ?>
				</a>
			</div>
			<div class="g-tablet-5-6">
				
				<button type="submit" class="btn btn-lg btn-success btn-block submit" data-loading-text="<?php 
    echo ___('Sending, please wait...');
    ?>
">
					<i class="fa fa-check"></i> 
					<?php 
    echo $edit ? ___('Update') : ___('Submit');
    ?>
				</button>
				<input type="hidden" id="ctb-post-id" name="post-id" value="<?php 
    echo $edit ? $post->ID : 0;
    ?>
">
				<input type="hidden" name="type" value="post">
			</div>
		</div>
	</form>
	<?php 
    wp_reset_postdata();
}
Example #7
0
global $current_user;
get_currentuserinfo();
if (theme_custom_point::get_point_img_url()) {
    $point_icon = '<img src="' . theme_custom_point::get_point_img_url() . '" alt="icon" width="15" height="15">';
} else {
    $point_icon = '<i class="fa fa-diamond fa-fw"></i>';
}
?>
<div class="panel">
	<div class="content">
		<?php 
echo theme_custom_point_bomb::get_des();
?>
		<div class="page-tip" id="fm-bomb-loading"><?php 
echo status_tip('loading', ___('Loading, please wait...'));
?>
</div>
		<form class="form-horizontal" action="post" id="fm-bomb" method="javascript:;">
			<div class="form-group">
				<div class="g-tablet-2-5">
					<div class="bomb-area bomb-area-attacker">
						<p>
							<img id="bomb-attacker-avatar" src="<?php 
echo theme_cache::get_avatar_url($current_user->ID);
?>
" alt="<?php 
echo ___('Avatar');
?>
" class="avatar" width="100" height="100" >
						</p>
Example #8
0
<div id="sidebar-container" class="g-desktop-1-4">
<div id="sidebar" class="widget-area" role="complementary">
<?php 
if (!theme_cache::dynamic_sidebar('widget-area-post')) {
    ?>
	<div class="panel">
		<div class="content">
			<div class="page-tip">
				<?php 
    echo status_tip('info', ___('Please set some widgets in singular post.'));
    ?>
			</div>
		</div>
	</div>
<?php 
}
?>
</div><!-- /.widget-area -->
</div><!-- /#sidebar-container -->
Example #9
0
				<span class="meta">
					<img src="<?php 
echo theme_custom_point::get_point_img_url();
?>
" alt="point-icon" width="16" height="16"> 
					<span id="point-count"><?php 
echo theme_custom_point::get_point(theme_cache::get_current_user_id());
?>
</span><span id="modify-count"></span>
				</span>
			</div>
			<div class="form-group">
				<?php 
$boxes = theme_point_lottery::get_box();
if (empty($boxes)) {
    echo status_tip('info', ___('No any lottery yet.'));
} else {
    foreach ($boxes as $k => $box) {
        if ($box['type'] === 'point') {
            $icon = '<img src="' . theme_custom_point::get_point_img_url() . '" alt="icon" width="16" height="16">';
        } else {
            $icon = '<i class="fa fa-yelp fa-fw"></i>';
        }
        ?>
						<input type="radio" class="lottery-item" name="id" id="lottery-item-<?php 
        echo $k;
        ?>
" data-target="lottery-box-<?php 
        echo $k;
        ?>
" value="<?php 
Example #10
0
    public static function display_backend()
    {
        ?>
		<fieldset>
			<legend><i class="fa fa-fw fa-envelope-o"></i> <?php 
        echo ___('P.M. settings');
        ?>
</legend>
			<p class="description"><?php 
        echo ___('User can send private message to other user.');
        ?>
</p>
			<table class="form-table">
				<tbody>
					<tr>
						<th scope="row"><?php 
        echo ___('Control');
        ?>
</th>
						<td>
							<?php 
        if (isset($_GET[__CLASS__])) {
            ?>
								<div id="<?php 
            echo __CLASS__;
            ?>
-tip" calss="page-tip"><?php 
            echo status_tip('success', ___('Database table has been created.'));
            ?>
</div>
							<?php 
        }
        ?>
							<a id="<?php 
        echo __CLASS__;
        ?>
-create-table" href="<?php 
        echo theme_features::get_process_url(['action' => __CLASS__, 'type' => 'create-db']);
        ?>
"><?php 
        echo ___('Create database table');
        ?>
</a>
							<input type="hidden" name="<?php 
        echo __CLASS__;
        ?>
[db-version]" value="<?php 
        echo self::get_db_version() ? self::get_db_version() : self::$db_version;
        ?>
">
						</td>
					</tr>
				</tbody>
			</table>
		</fieldset>
		<?php 
    }
Example #11
0
    public static function display_backend()
    {
        $color_cats = (array) self::get_options();
        /** 
         * get all categories
         */
        $cats = theme_cache::get_categories(array('orderby' => 'id', 'hide_empty' => false));
        ?>
		<fieldset>
			<legend><i class="fa fa-fw fa-adjust"></i> <?php 
        echo ___('Colorful category');
        ?>
</legend>
			<p class="description">
				<?php 
        echo ___('You can select the category and set color for category. Preset is random color.');
        ?>
			</p>
			<table class="form-table">
				<tbody>
					<tr>
						<th scope="row">
							<?php 
        echo ___('Select category and select color to set');
        ?>
						</th>
						<td id="colorful-cats">
							<?php 
        if (!$cats) {
            echo status_tip('info', ___('Empty category.'));
        } else {
            wp_dropdown_categories(['show_option_none' => ___('Select category'), 'show_count' => 1, 'id' => __CLASS__ . '-cat-ids', 'name' => '', 'hierarchical' => 1]);
        }
        ?>
							<span id="<?php 
        echo __CLASS__;
        ?>
-preset-colors">
								<?php 
        self::the_preset_colors();
        ?>
							</span>
							
							<?php 
        self::hidden_inputs($cats);
        ?>
						</td>
					</tr>
				</tbody>
			</table>
		</fieldset>
	<?php 
    }
Example #12
0
    public static function recent_posts()
    {
        $posts_per_page = 5;
        ?>
		<div class="panel">
			<div class="heading">
				<i class="fa fa-clock-o"></i>
				<?php 
        echo ___('My recent posts');
        ?>
			</div>
			<?php 
        global $post;
        $query = new WP_Query(array('posts_per_page' => $posts_per_page, 'author' => theme_cache::get_current_user_id()));
        if ($query->have_posts()) {
            ?>
				<ul class="list-group">
				<?php 
            foreach ($query->posts as $post) {
                setup_postdata($post);
                ?>
					<li class="list-group-item">
						<a href="<?php 
                echo theme_cache::get_permalink($post->ID);
                ?>
"><?php 
                echo theme_cache::get_the_title($post->ID);
                ?>
 <small><?php 
                echo friendly_date(get_the_time('U'));
                ?>
</small></a>
						
					</li>
					<?php 
            }
            wp_reset_postdata();
            ?>
				</ul>
				<?php 
        } else {
            ?>
				<div class="content"><?php 
            echo status_tip('info', ___('No posts yet'));
            ?>
</div>
				<?php 
        }
        ?>
		</div>
		<?php 
    }
Example #13
0
    /**
     * Admin Display
     */
    public static function display_backend()
    {
        ?>
		<fieldset id="<?php 
        echo __CLASS__;
        ?>
">
			<legend><?php 
        echo ___('Theme cache');
        ?>
</legend>
			<p class="description"><?php 
        echo ___('Maybe the theme used cache for improve performance, you can clean it when you modify some site contents if you want.');
        ?>
</p>
			<table class="form-table">
				<tbody>
					<?php 
        if (class_exists('Memcache')) {
            ?>
					<tr>
						<th><?php 
            echo ___('Memcache cache');
            ?>
</th>
						<td><p>
							<?php 
            if (file_exists(WP_CONTENT_DIR . '/object-cache.php')) {
                ?>
								<a class="button" href="<?php 
                echo self::get_process_url('disable-cache');
                ?>
" onclick="return confirm('<?php 
                echo ___('Are you sure DELETE object-cache.php to disable theme object cache?');
                ?>
')">
									<?php 
                echo ___('Disable theme object cache');
                ?>
								</a>
								
								<a class="button" href="<?php 
                echo self::get_process_url('re-enable-cache');
                ?>
" onclick="return confirm('<?php 
                echo ___('Are you sure RE-CREATE object-cache.php to re-enable theme object cache?');
                ?>
')">
									<?php 
                echo ___('Re-enable theme object cache');
                ?>
								</a>
								
							<?php 
            } else {
                ?>
								<a class="button-primary" href="<?php 
                echo self::get_process_url('enable-cache');
                ?>
">
									<?php 
                echo ___('Enable theme object cache');
                ?>
								</a>
							<?php 
            }
            ?>
							<span class="description"><i class="fa fa-exclamation-circle"></i> <?php 
            echo ___('Save your settings before click.');
            ?>
</span>
							
						</p></td>
					</tr>
					<?php 
        }
        ?>
					<tr>
						<th scope="row"><?php 
        echo ___('Control');
        ?>
</th>
						<td>
							<?php 
        if (isset($_GET[__CLASS__])) {
            echo status_tip('success', ___('Theme cache has been cleaned or rebuilt.'));
        }
        ?>
							<p>
								<?php 
        /**
         * poicache - wp advanced cache
         */
        if (class_exists('innstudio\\advanced_cache')) {
            ?>
									<a href="<?php 
            echo self::get_process_url('flush-poicache');
            ?>
" class="button" onclick="javascript:this.innerHTML='<?php 
            echo ___('Processing, please wait...');
            ?>
'"><?php 
            echo ___('Clean PoiCache cache');
            ?>
</a>
								<?php 
        }
        ?>
								
								<a href="<?php 
        echo self::get_process_url('flush');
        ?>
" class="button" onclick="javascript:this.innerHTML='<?php 
        echo ___('Processing, please wait...');
        ?>
'"><?php 
        echo ___('Clean all cache');
        ?>
</a>
								
								<a href="<?php 
        echo self::get_process_url('dynamic-sidebar');
        ?>
" class="button" onclick="javascript:this.innerHTML='<?php 
        echo ___('Processing, please wait...');
        ?>
'"><?php 
        echo ___('Clean widget cache');
        ?>
</a>
								
								<a href="<?php 
        echo self::get_process_url('nav-menu');
        ?>
" class="button" onclick="javascript:this.innerHTML='<?php 
        echo ___('Processing, please wait...');
        ?>
'"><?php 
        echo ___('Clean menu cache');
        ?>
</a>
								
								
								<span class="description"><i class="fa fa-exclamation-circle"></i> <?php 
        echo ___('Save your settings before clean');
        ?>
</span>
								
							</p>
						</td>
					</tr>
				</tbody>
			</table>
		</fieldset>
	<?php 
    }
    public static function frontend_display($args = [], $instance = [])
    {
        $cache_id = md5(json_encode($instance));
        $cache = theme_cache::get($cache_id);
        if ($cache) {
            echo $cache;
            unset($cache);
            return;
        }
        $smallest = 11;
        $largest = 20;
        $unit = 'pt';
        $number = $instance['number'];
        $exclude_ids = isset($instance['ids']) ? $instance['ids'] : null;
        $tag_links = [];
        $sticky_links = [];
        if (!empty($exclude_ids)) {
            foreach ($exclude_ids as $k => $v) {
                $sticky_name = isset($sticky_names[$k]) ? esc_html($sticky_names[$k]) : null;
                $sticky_links[] = '<a href="' . get_tag_link($v) . '" class="sticky-tag">' . $sticky_name . '</a>';
            }
        }
        $tags = get_terms('post_tag', array('orderby' => 'count', 'number' => $number, 'order' => 'desc', 'pad_counts' => true, 'exclude' => $exclude_ids));
        if (!empty($tags)) {
            $counts = [];
            $real_counts = [];
            // For the alt tag
            foreach ((array) $tags as $key => $tag) {
                $real_counts[$key] = $tag->count;
                $counts[$key] = $tag->count;
            }
            $min_count = min($counts);
            $spread = max($counts) - $min_count;
            if ($spread <= 0) {
                $spread = 1;
            }
            $font_spread = $largest - $smallest;
            if ($font_spread < 0) {
                $font_spread = 1;
            }
            $font_step = $font_spread / $spread;
            foreach ($tags as $key => $tag) {
                $count = $counts[$key];
                ob_start();
                ?>
<a 
					class="hot-tag" 
					href="<?php 
                echo get_tag_link($tag->term_id);
                ?>
" 
					style="
						font-size:<?php 
                echo str_replace(',', '.', $smallest + ($count - $min_count) * $font_step), $unit;
                ?>
;
						color:rgb(<?php 
                echo mt_rand(50, 200);
                ?>
,<?php 
                echo mt_rand(50, 200);
                ?>
,<?php 
                echo mt_rand(50, 200);
                ?>
);"
				><?php 
                echo esc_html($tag->name);
                ?>
</a><?php 
                $tag_links[] = html_minify(ob_get_contents());
                ob_end_clean();
            }
        }
        $tags = array_filter(array_merge($tag_links, $sticky_links));
        if (!empty($tags)) {
            //shuffle($tags);
            $cache = implode('', $tags);
        } else {
            $cache = status_tip('info', ___('No data yet.'));
        }
        theme_cache::set($cache_id, $cache, null, 3600 * 24);
        echo $cache;
        unset($cache);
    }
Example #15
0
    function widget($args, $instance)
    {
        $instance = array_merge(self::get_default_options(), $instance);
        echo $args['before_widget'];
        $comments = get_comments(array('status' => 'approve', 'number' => isset($instance['number']) ? (int) $instance['number'] : 6, 'type' => 'comment'));
        if (!empty($instance['title'])) {
            echo $args['before_title'];
            ?>
			<i class="fa fa-comments-o"></i> 
			<?php 
            echo $instance['title'];
            echo $args['after_title'];
        }
        if (!empty($comments)) {
            global $comment;
            $comment_bak = $comment;
            ?>
			<ul class="list-group">
				<?php 
            foreach ($comments as $comment) {
                /**
                 * cache
                 */
                static $caches = [];
                /** author_name */
                if (!isset($caches['author_name'][$comment->comment_author])) {
                    $caches['author_name'][$comment->comment_author] = esc_html(get_comment_author());
                }
                /** avatar placeholder */
                if (!isset($caches['avatar_placeholder'])) {
                    $caches['avatar_placeholder'] = theme_functions::$avatar_placeholder;
                }
                /** comment text */
                $comment_text = str_sub(strip_tags(preg_replace('/<img[^>]+>/i', '[' . ___('Image') . ']', get_comment_text($comment->comment_ID))), 35);
                ?>
<li class="list-group-item">
	<a class="media tooltip top" href="<?php 
                echo theme_cache::get_permalink($comment->comment_post_ID);
                ?>
#comment-<?php 
                echo $comment->comment_ID;
                ?>
" title="<?php 
                echo theme_cache::get_the_title($comment->comment_post_ID);
                ?>
">
		<div class="media-left">
			<img class="avatar media-object" data-src="<?php 
                echo esc_url(theme_cache::get_avatar_url($comment));
                ?>
" src="<?php 
                echo $caches['avatar_placeholder'];
                ?>
" alt="<?php 
                echo $caches['author_name'][$comment->comment_author];
                ?>
" width="<?php 
                echo self::$avatar_size;
                ?>
" height="<?php 
                echo self::$avatar_size;
                ?>
"/>
		</div>
		<div class="media-body">
			<h4 class="media-heading">
				<span class="author"><?php 
                echo $caches['author_name'][$comment->comment_author];
                ?>
</span>
				<time datetime="<?php 
                echo get_comment_time('c');
                ?>
">
					<small><?php 
                echo friendly_date(get_comment_time('U'));
                ?>
</small>
				</time>
			</h4>
			<div class="text"><?php 
                echo $comment_text;
                ?>
</div>
		</div>
	</a>
</li>
				<?php 
            }
            ?>
			</ul>
			<?php 
            $comment = $comment_bak;
        } else {
            ?>
			<div class="content">
				<div class="page-tip"><?php 
            echo status_tip('info', ___('No any comment yet.'));
            ?>
</div>
			</div>
		<?php 
        }
        echo $args['after_widget'];
    }
    /**
     * show the options settings for admin theme setting page.
     * 
     * @return string html string for options
     * @version 3.2.0
     * 
     */
    public static function display_backend()
    {
        ?>
		<div class="wrap">
			<?php 
        if (isset($_GET['updated'])) {
            ?>
				<div id="settings-updated">
					<?php 
            echo status_tip('success', ___('Your settings were saved successfully.'));
            ?>
				</div>
			<?php 
        }
        ?>
			<form id="backend-options-frm" method="post" action="<?php 
        echo theme_features::get_process_url(['action' => __CLASS__]);
        ?>
">
				
				<div class="backend-tab-loading"><?php 
        echo status_tip('loading', ___('Loading your settings, please wait...'));
        ?>
</div>
				
				<div id="backend-tab" class="backend-tab">
					<nav class="tab-header">

						<a href="<?php 
        echo theme_functions::theme_meta_translate()['theme_url'];
        ?>
" target="_blank" title="<?php 
        echo ___('Visit the official of theme');
        ?>
" class="tab-title">
							<?php 
        echo theme_functions::theme_meta_translate()['name'];
        ?>
						</a>
					
						<span class="tab-item" title="<?php 
        echo ___('The theme common basic settings.');
        ?>
">
							<i class="fa fa-fw fa-cog"></i> 
							<span class="tx"><?php 
        echo ___('Basic settings');
        ?>
</span>
						</span><!-- basic settings -->
						
						<span class="tab-item" title="<?php 
        echo ___('You can customize the theme in this label.');
        ?>
">
							<i class="fa fa-fw fa-paint-brush"></i> 
							<span class="tx"><?php 
        echo ___('Page settings');
        ?>
</span>
						</span><!-- page settings -->
						
						<span class="tab-item" title="<?php 
        echo ___('If the theme there are some problems, you can try to use these settings.');
        ?>
">
							<i class="fa fa-fw fa-cogs"></i> 
							<span class="tx"><?php 
        echo ___('Advanced settings');
        ?>
</span>
						</span><!-- advanced settings -->
						
						<span class="tab-item" title="<?php 
        echo ___('This settings is for developer, if you want to debug code, you can try this.');
        ?>
">
							<i class="fa fa-fw fa-code"></i> 
							<span class="tx"><?php 
        echo ___('Developer settings');
        ?>
</span>
						</span><!-- developer mode -->
						
						<span class="tab-item" title="<?php 
        echo ___('If you in trouble, maybe this label can help you.');
        ?>
">
							<i class="fa fa-fw fa-question-circle"></i> 
							<span class="tx"><?php 
        echo ___('About &amp; help');
        ?>
</span>
						</span><!-- about and help -->
						
					</nav>

					
					<div class="tab-body">
						<div class="tab-item">
							<?php 
        do_action('base_settings');
        ?>
						</div><!-- BASE SETTINGS -->
					
						<div class="tab-item">
							<?php 
        do_action('page_settings');
        ?>
						</div><!-- PAGE SETTINGS -->
					
						<div class="tab-item">
							<?php 
        do_action('advanced_settings');
        ?>
						</div><!-- ADVANCED SETTINGS -->
					
						<div class="tab-item">
							<?php 
        do_action('dev_settings');
        ?>
						</div><!-- DEVELOPER SETTINGS -->
					
						<div class="tab-item">
							<?php 
        do_action('help_settings');
        ?>
						</div><!-- ABOUT and HELP -->
					</div><!-- tab-content -->
				</div><!-- backend-tab -->
		
				<p>
					<input type="hidden" name="<?php 
        echo __CLASS__;
        ?>
[nonce]" value="<?php 
        echo wp_create_nonce(__CLASS__);
        ?>
">
					
					<button id="submit" type="submit" class="button button-primary button-large"><i class="fa fa-check"></i> <span class="tx"><?php 
        echo ___('Save all settings');
        ?>
</span></button>
					
					<label for="options-restore" class="label-options-restore" title="<?php 
        echo ___('Something error with theme? Try to restore. Be careful, theme options will be cleared up!');
        ?>
">
						<input id="options-restore" name="<?php 
        echo __CLASS__;
        ?>
[restore]" type="checkbox" value="1"/>
						<?php 
        echo ___('Restore to theme default options');
        ?>
 <i class="fa fa-question-circle"></i>
					</label>
				</p>
			</form>
		</div>
		<?php 
    }
Example #17
0
 * Template name: Tags index
 */
get_header();
?>
<div class="g">
	<div class="content-reset">
		<?php 
the_content();
?>
	</div>
	<div class="cats-index">
		<?php 
if (!class_exists('theme_page_cats')) {
    ?>
			<div class="page-tip"><?php 
    echo status_tip('error', ___('Missing initialization files.'));
    ?>
</div>
		<?php 
} else {
    ?>
			<?php 
    theme_page_cats::display_frontend();
    ?>
		<?php 
}
?>
	</div>
</div><!-- /.container -->
<?php 
get_footer();
Example #18
0
    public static function display_backend()
    {
        $recomm_posts = self::get_ids();
        ?>
		<fieldset>
			<legend><i class="fa fa-fw fa-thumbs-o-up"></i> <?php 
        echo ___('Recommended posts');
        ?>
</legend>
			<p><?php 
        echo ___('Recommended posts will display on home page if enabled.');
        ?>
</p>
			<table class="form-table">
				<tbody>
					<tr>
						<th><label for="<?php 
        echo __CLASS__;
        ?>
-enabled"></label><?php 
        echo ___('Enable or not?');
        ?>
</th>
						<td>
							<select name="<?php 
        echo __CLASS__;
        ?>
[enabled]" id="<?php 
        echo __CLASS__;
        ?>
-enabled" class="widefat">
								<?php 
        the_option_list(-1, ___('Disable'), self::get_options('enabled'));
        ?>
								<?php 
        the_option_list(1, ___('Enable'), self::get_options('enabled'));
        ?>
							</select>
						</td>
					</tr>
					<tr>
						<th><label for="<?php 
        echo __CLASS__;
        ?>
-title"></label><?php 
        echo ___('Box title');
        ?>
</th>
						<td>
							<input type="text" name="<?php 
        echo __CLASS__;
        ?>
[title]" id="<?php 
        echo __CLASS__;
        ?>
-title" value="<?php 
        echo self::get_item('title');
        ?>
" class="widefat">
						</td>
					</tr>
					<tr>
						<th>
							<label for="<?php 
        echo __CLASS__;
        ?>
-icon"><?php 
        echo ___('Box icon');
        ?>
</label>
							<a href="//fortawesome.github.io/Font-Awesome/icons" target="_blank" title="<?php 
        echo ___('Views all icons');
        ?>
">#<?php 
        echo ___('ALL');
        ?>
</a>
						</th>
						<td>
							<input 
								type="text" 
								value="<?php 
        echo self::get_item('icon');
        ?>
" 
								list="<?php 
        echo __CLASS__;
        ?>
-icon-datalist" 
								name="<?php 
        echo __CLASS__;
        ?>
[icon]" 
								id="<?php 
        echo __CLASS__;
        ?>
-icon" 
								class="widefat" 
							><?php 
        icon_option_list(__CLASS__ . '-icon-datalist');
        ?>
						</td>
					</tr>
					<tr>
						<th><label for="<?php 
        echo __CLASS__;
        ?>
-number"></label><?php 
        echo ___('Show posts number');
        ?>
</th>
						<td>
							<input type="number" name="<?php 
        echo __CLASS__;
        ?>
[number]" id="<?php 
        echo __CLASS__;
        ?>
-number" min="4" step="4" value="<?php 
        echo self::get_item('number');
        ?>
" class="short-text">
						</td>
					</tr>
					<tr>
						<th scope="row"><?php 
        echo ___('Marked posts');
        ?>
</th>
						<td>
							<?php 
        if (!empty($recomm_posts)) {
            global $post;
            $query = new WP_Query(['posts_per_page' => -1, 'post__in' => $recomm_posts, 'ignore_sticky_posts' => true]);
            if ($query->have_posts()) {
                foreach ($query->posts as $post) {
                    setup_postdata($post);
                    ?>
<label for="<?php 
                    echo __CLASS__;
                    ?>
-<?php 
                    echo $post->ID;
                    ?>
" class="button">
	<input type="checkbox" id="<?php 
                    echo __CLASS__;
                    ?>
-<?php 
                    echo $post->ID;
                    ?>
" name="<?php 
                    echo __CLASS__;
                    ?>
[ids][]" value="<?php 
                    echo $post->ID;
                    ?>
" checked >
	#<?php 
                    echo $post->ID;
                    ?>
 <?php 
                    echo theme_cache::get_the_title($post->ID);
                    ?>
 
	<a href="<?php 
                    echo esc_url(get_edit_post_link($post->ID));
                    ?>
" target="_blank" title="<?php 
                    echo ___('Open in open window');
                    ?>
"><i class="fa fa-external-link"></i></a>
</label>
										<?php 
                }
                wp_reset_postdata();
            } else {
                echo status_tip('info', ___('No any post yet'));
            }
        } else {
            echo status_tip('info', ___('No any post yet'));
        }
        ?>
						</td>
					</tr>
				</tbody>
			</table>
		</fieldset>
		<?php 
    }
Example #19
0
<div class="mod-body">
	<?php 
if (have_posts()) {
    ?>
		<div class="row">
			<?php 
    foreach ($wp_query->posts as $post) {
        setup_postdata($post);
        theme_functions::archive_card_lg(['classes' => 'g-phone-1-2 g-tablet-1-3 g-desktop-1-4']);
    }
    ?>
		</div>
	<?php 
} else {
    ?>
		<div class="page-tip"><?php 
    echo status_tip('info', ___('No post yet.'));
    ?>
</div>
	<?php 
}
?>
</div>
<?php 
if ($GLOBALS['wp_query']->max_num_pages > 1) {
    ?>
	<?php 
    echo theme_functions::pagination();
}
?>
</div>
Example #20
0
<footer id="footer">
	<?php 
if (!wp_is_mobile()) {
    ?>
		
		<div class="g">
			<div class="widget-area row">
				<?php 
    if (!theme_cache::dynamic_sidebar('widget-area-footer')) {
        ?>
					<div class="g-desktop-1-1">
						<div class="panel">
							<div class="content">
								<div class="page-tip">
									<?php 
        echo status_tip('info', ___('Please set some widgets in footer.'));
        ?>
								</div>
							</div>
						</div>
					</div>
				<?php 
    }
    ?>
			</div>

			<!-- links -->
			<?php 
    if (theme_cache::is_home()) {
        ?>
				<div class="widget panel links-container">
Example #21
0
get_header();
?>
<div class="g">
	<div id="main">
		<?php 
if (have_posts()) {
    $loop_i = 0;
    foreach ($wp_query->posts as $post) {
        setup_postdata($post);
        theme_functions::archive_card_text(['classes' => '', 'lazyload' => $loop_i <= 5 ? false : true]);
        ++$loop_i;
    }
    ?>
		<?php 
} else {
    ?>
			<?php 
    echo status_tip('info', ___('No content yet.'));
    ?>
		<?php 
}
?>
		<div class="area-pagination archive-pagination">
			<?php 
theme_functions::pagination();
?>
		</div>
	</div><!-- /#main -->
</div><!-- /.g -->
<?php 
get_footer();
Example #22
0
        echo $tab_active;
        ?>
">
	<div class="heading">
		<h3><?php 
        echo ___('Reset my password');
        ?>
</h3>
	</div>
	<div class="content">
		<?php 
        if (!isset($decode_token['user_id']) || !isset($decode_token['user_email'])) {
            ?>
			<div class="page-tip">
				<?php 
            echo status_tip('error', ___('Sorry, the url is expired, please recover password again.'));
            ?>
			</div>
			<div class="page-tip">
				<a href="<?php 
            echo theme_custom_sign::get_tabs('recover')['url'];
            ?>
" class="btn btn-success btn-block"><i class="fa fa-history"></i> <?php 
            echo ___('Recover password');
            ?>
</a>
			</div>
		<?php 
        } else {
            ?>
			<p><?php 
Example #23
0
echo theme_custom_point::get_point_img_url();
?>
" alt="">
	</div>
	<div class="media-body">
		<h4 class="media-heading">
			<strong class="total-point"><?php 
echo number_format(theme_custom_point::get_point(theme_cache::get_current_user_id()));
?>
</strong>
		</h4>
	</div>
</div>
</div><!-- /.content -->
<?php 
$history_list = theme_custom_point::get_history_list(array('posts_per_page' => 20));
if (empty($history_list)) {
    ?>
	<div class="content">
		<div class="page-tip"><?php 
    echo status_tip('info', ___('Your have not any history yet.'));
    ?>
</div>
	</div><!-- /.content -->
	<?php 
} else {
    echo $history_list;
}
?>
	</div>
</div>
Example #24
0
<div class="content">
	<div class="page-tip"><?php 
echo status_tip('info', ___('This feature is under development.'));
?>
</div>
</div>
Example #25
0
    public static function theme_custom_point_backend()
    {
        ?>
		<h3><?php 
        echo ___('Recalculate');
        ?>
</h3>
		<table class="form-table">
			<tbody>
				<tr>
					<th><?php 
        echo ___('Recalculate all posts point');
        ?>
</th>
					<td>
						<?php 
        if (isset($_GET[__CLASS__])) {
            echo status_tip('success', ___('Operation completed.'));
        }
        ?>
						<a href="<?php 
        echo theme_features::get_process_url(['action' => 'backend_' . __CLASS__, 'type' => 'recalculate', 'theme-nonce' => theme_features::create_nonce()]);
        ?>
" class="button">
							<i class="fa fa-refresh"></i> 
							<?php 
        echo ___('Recalculate now');
        ?>
						</a>
						<span class="description">
							<i class="fa fa-exclamation-circle"></i> 
							<?php 
        echo ___('Please save your settings before operate. This operation requires a lot of server resources.');
        ?>
						</span>
					</td>
				</tr>
			</tbody>
		</table>
		<?php 
    }
    public static function frontend_display(array $args = [], $instance)
    {
        $instance = array_merge(['title' => ___('Posts rank'), 'posts_per_page' => 6, 'date' => 'all', 'orderby' => 'latest', 'category__in' => [], 'content_type' => 'img'], $instance);
        $title = esc_html($instance['title']);
        echo $args['before_title'];
        if (count($instance['category__in']) === 1 && isset($instance['category__in'][0])) {
            ?>
			<a class="link" href="<?php 
            echo get_category_link($instance['category__in'][0]);
            ?>
" title="<?php 
            echo sprintf(___('Views more about %s'), $title);
            ?>
">
				<i class="fa fa-bar-chart"></i> 
				<?php 
            echo $title;
            ?>
			</a>
			<a href="<?php 
            echo get_category_link($instance['category__in'][0]);
            ?>
" title="<?php 
            echo sprintf(___('Views more about %s'), $title);
            ?>
" class="more"><?php 
            echo ___('More &raquo;');
            ?>
</a>
		<?php 
        } else {
            ?>
			<i class="fa fa-bar-chart"></i> <?php 
            echo $title;
            ?>
		<?php 
        }
        ?>
		
		<?php 
        echo $args['after_title'];
        global $post;
        $query = theme_functions::get_posts_query(['category__in' => (array) $instance['category__in'], 'posts_per_page' => (int) $instance['posts_per_page'], 'date' => $instance['date'], 'orderby' => $instance['orderby']]);
        if ($query->have_posts()) {
            ?>
			<ul class="list-group list-group-<?php 
            echo $instance['content_type'];
            ?>
 widget-orderby-<?php 
            echo $instance['orderby'];
            ?>
">
				<?php 
            foreach ($query->posts as $post) {
                setup_postdata($post);
                if ($instance['content_type'] === 'tx') {
                    theme_functions::widget_rank_tx_content(['meta_type' => $instance['orderby']]);
                } else {
                    theme_functions::widget_rank_img_content();
                }
            }
            wp_reset_postdata();
            ?>
			</ul>
		<?php 
        } else {
            ?>
			<div class="page-tip not-found">
				<?php 
            echo status_tip('info', ___('No data yet.'));
            ?>
			</div>
		<?php 
        }
    }
Example #27
0
$disabled = null;
if (class_exists('theme_custom_point')) {
    $consume_points = abs(theme_custom_point::get_point_value('save-avatar'));
    $user_points = theme_custom_point::get_point($current_user->ID);
    if ($consume_points != 0) {
        ?>
				<div class="page-tip">
					<?php 
        /**
         * not enough points, can not modify
         */
        if ($consume_points > $user_points) {
            $disabled = 'disabled';
            echo status_tip('info', sprintf(___('You have %1$s %2$s, You need to collect %3$s %2$s to modify the avatar.'), '<strong>' . $user_points . '</strong>', theme_custom_point::get_point_name(), '<strong>' . ($consume_points - $user_points) . '</strong>'));
        } else {
            echo status_tip('info', sprintf(___('You have %1$s %2$s, modify avatar will consume %3$s %2$s.'), '<strong>' . $user_points . '</strong>', theme_custom_point::get_point_name(), '<strong>' . $consume_points . '</strong>'));
        }
        ?>
				</div>
				<?php 
    }
}
?>
<form id="fm-change-avatar" class="user-form form-horizontal" method="post" action="javascript:;">
	<fieldset <?php 
echo $disabled;
?>
>
		<legend class="label label-<?php 
echo $disabled ? 'default' : 'success';
?>
Example #28
0
    /**
     * Theme respond
     */
    public static function theme_respond()
    {
        global $post;
        ?>
<div id="respond" class="panel">
	<a href="javascript:;" id="cancel-comment-reply-link" class="none" title="<?php 
        echo ___('Cancel reply');
        ?>
">&times;</a>
	<div class="content">
		<div class="page-tip" id="respond-loading-ready">
			<?php 
        echo status_tip('loading', ___('Loading, please wait...'));
        ?>
		</div>
		
		<p id="respond-must-login" class="well hide-on-logged none">
			<?php 
        echo sprintf(___('You must be %s to post a comment.'), '<a href="' . esc_url(wp_login_url(theme_cache::get_permalink($post->ID))) . '#respond' . '"><strong>' . ___('log-in') . '</strong></a>');
        ?>
		</p>
			
		<form 
			id="commentform" 
			action="javascript:;" 
			method="post" 
			class="comment-form media none"
		>
		<div class="media">
			<input type="hidden" name="comment_post_ID" id="comment_post_ID" value="<?php 
        echo $post->ID;
        ?>
">
			<input type="hidden" name="comment_parent" id="comment_parent" value="0">
			
			<div class="media-left hidden-phone">
				<img id="respond-avatar" src="<?php 
        echo theme_functions::$avatar_placeholder;
        ?>
" alt="avatar" class="media-object avatar" width="100" height="100">
			</div>
			<div class="media-body">
				<?php 
        /**
         * for visitor
         */
        $req = theme_cache::get_option('require_name_email');
        ?>
				<!-- author name -->
				<div id="area-respond-visitor" class="row">
					<div class="g-tablet-1-2">
						<div class="form-group">
							<input type="text" 
								class="form-control" 
								name="author" 
								id="comment-form-author" 
								placeholder="<?php 
        echo ___('Nickname');
        echo $req ? ' * ' : null;
        ?>
"
								<?php 
        echo $req ? ' required ' : null;
        ?>
								title="<?php 
        echo ___('Whats your nickname?');
        ?>
"
							>
						</div><!-- /.form-group -->
					</div><!-- /.g-tablet-1-2 -->
					<!-- author email -->
					<div class="g-tablet-1-2">
						<div class="form-group">
							<input type="email" 
								class="form-control" 
								name="email" 
								id="comment-form-email" 
								placeholder="<?php 
        echo ___('Email');
        echo $req ? ' * ' : null;
        ?>
"
								<?php 
        echo $req ? ' required ' : null;
        ?>
								title="<?php 
        echo ___('Whats your Email?');
        ?>
"
							>
						</div><!-- /.form-group -->
					</div><!-- /.g-tablet-1-2 -->
				</div><!-- /.row -->				
				<div class="form-group form-group-textarea">
					<textarea 
						name="comment" 
						id="comment-form-comment" 
						class="form-control" 
						rows="3" 
						placeholder="<?php 
        echo ___('Hi, have something to say?');
        ?>
" 
						title="<?php 
        echo ___('Nothing to say?');
        ?>
" 
						required 
					></textarea>
				</div>
				<div class="form-group btn-group-submit">
					<?php 
        /**
         * theme comment emotion pop btn
         */
        if (class_exists('theme_comment_emotion') && (theme_comment_emotion::is_enabled('kaomoji') || theme_comment_emotion::is_enabled('img'))) {
            theme_comment_emotion::display_frontend('pop');
        }
        ?>
					<?php 
        /**
         * theme comment emotion
         */
        if (class_exists('theme_comment_emotion') && (theme_comment_emotion::is_enabled('kaomoji') || theme_comment_emotion::is_enabled('img'))) {
            theme_comment_emotion::display_frontend('pop-btn');
        }
        ?>
					<button type="submit" class="submit btn btn-success" title="<?php 
        echo ___('Post comment');
        ?>
">
						<i class="fa fa-check"></i> 
						<?php 
        echo ___('Post comment');
        ?>
					</button>
				</div><!-- .form-group -->
			</div><!-- /.media-body -->
		</div><!-- /.media -->
		</form>
	</div>
</div>
		<?php 
    }
            $unread_class = null;
        }
        ?>
				<li class="list-group-item type-<?php 
        echo $noti['type'];
        ?>
 <?php 
        echo $unread_class;
        ?>
">
					<?php 
        do_action('list_noti', $noti);
        ?>
				</li><!-- /.list-group-item -->
			<?php 
    }
    ?>
		</ul>
		<?php 
} else {
    ?>
		<div class="content">
			<div class="page-tip"><?php 
    echo status_tip('info', ___('You have not any notification yet'));
    ?>
</div>
		</div>
		<?php 
}
?>
</div><!-- /.panel -->
Example #30
0
            setup_postdata($post);
            theme_functions::archive_card_lg(['classes' => 'g-phone-1-2 g-tablet-1-3 g-desktop-1-4']);
        }
        ?>
			</ul>
			<?php 
    } else {
        ?>
			<div class="page-tip"><?php 
        echo status_tip('info', ___('No post yet.'));
        ?>
</div>
			<?php 
    }
} else {
    ?>
		<div class="page-tip"><?php 
    echo status_tip('error', ___('Lack custom_post_point class'));
    ?>
</div>
		<?php 
}
?>
</div>
<?php 
if ($GLOBALS['wp_query']->max_num_pages > 1) {
    echo theme_functions::pagination();
}
wp_reset_query();
?>
</div>