<?php
if (!defined('ABSPATH')) {
die;
} // Cannot access directly.
//**切换暗黑风格
function tap_dark()
{
$is_ripro_dark = !empty($_POST['is_ripro_dark']) ? intval($_POST['is_ripro_dark']) : 0;
$_SESSION['is_ripro_dark'] = $is_ripro_dark;
echo $_SESSION['is_ripro_dark'];
exit();
}
add_action('wp_ajax_tap_dark', 'tap_dark');
add_action('wp_ajax_nopriv_tap_dark', 'tap_dark');
//**切换博客模式
function blog_style()
{
$is_blog_style = ($_POST['is_blog_style'] == '0') ? 1 : 0;
$_SESSION['is_blog_style'] = $is_blog_style;
echo $_SESSION['is_blog_style'];
exit();
}
add_action('wp_ajax_blog_style', 'blog_style');
add_action('wp_ajax_nopriv_blog_style', 'blog_style');
function get_bigger_img()
{
//新版本海报抛弃传统的php后端生产模式,使用js前段绘图,不占用服务器资源 性能出众 参考灵感来自wpcom.cn和b2的html2canvasjs技术
header('Content-type:application/html; Charset=utf-8');
global $current_user;
$post_id = !empty($_POST['id']) ? (int)$_POST['id'] : 0;
$post = get_post($post_id);
if ($current_user->ID>0) {
// 生出带参数的推广文章链接
$afflink = add_query_arg(array('ref' => $current_user->ID), get_the_permalink($post_id));
} else {
$afflink = get_the_permalink($post_id);
}
if (!$post) {
exit('参数错误');
}
$img_u = _get_post_thumbnail_url($post_id);
$img_t = get_template_directory_uri() . '/timthumb.php?src=' . $img_u . '&h=300&w=400&zc=1&a=c&q=80&s=1';
// $imageInfo = getimagesize($img_t);
// $b64 = base64_encode(file_get_contents($img_t));
// switch ($imageInfo[2]) { //判读图片类型
// case 1: $img_type = "gif";
// break;
// case 2: $img_type = "jpg";
// break;
// case 3: $img_type = "png";
// break;
// }
// $img_base64 = 'data:image/' . $img_type . ';base64,' . $b64;
echo '<div id="poster-html" class="poster-html">';
echo '<div class="poster-header">';
echo '<img src="'.$img_t.'">';
echo '<h2 class="poster-title">'.get_the_title($post_id).'</h2>';
echo '</div>';
echo '<div class="poster-body">';
echo '<div class="poster-meta">';
echo '<div class="poster-author">'.get_avatar($post->post_author).get_the_author_meta('display_name', $post->post_author).'</div>';
echo '<div class="poster-data">'.$post->post_date.'</div>';
echo '</div>';
echo '<div class="poster-text">'.wp_trim_words(strip_shortcodes($post->post_content), 120, '...').'</div>';
echo '</div>';
echo '<div class="poster-footer">';
echo '<div class="poster-logo">';
echo '<img src="'._cao('poster_logo').'">';
echo '<p>'._cao('poster_desc').'</p>';
echo '</div>';
echo '<div class="poster-qrcode">';
echo '<img src="'.getQrcode($afflink).'">';
echo '</div>';
echo '</div>';
echo '</div>';
echo '<div class="poster-canvas"></div>';
echo '<a class="poster-down btn" href="" download="'.get_the_title($post_id).'.png"><i class="fa fa-spinner fa-spin"></i> '.esc_html__('海报生成中', 'rizhuti-v2').'</a>';
exit;
}
add_action('wp_ajax_nopriv_get_bigger_img', 'get_bigger_img');
add_action('wp_ajax_get_bigger_img', 'get_bigger_img');
/**
* [ajax_getcat_post 分类文章获取]
* @Author Dadong2g
* @DateTime 2020-03-05T19:56:17+0800
* @return [type] [html str]
*/
function ajax_getcat_post()
{
global $wp_query;
header('Content-type:application/html; Charset=utf-8');
// $paged = !empty($_POST['paged']) ? esc_sql($_POST['paged']) : 1;
$cat = !empty($_POST['cat']) ? (int)$_POST['cat'] : '';
/////////////
$is_cao_site_list_blog = is_cao_site_list_blog();
if ($is_cao_site_list_blog) {
$latest_layout = 'bloglist';
} else {
$latest_layout = _cao('latest_layout', 'grid');
}
/////////////
$args = array(
'cat' => $cat,
'post_status' => 'publish',
);
$data = new WP_Query($args);
if ($data->have_posts()) {
while ($data->have_posts()) : $data->the_post();
get_template_part('parts/template-parts/content', $latest_layout);
endwhile;
} else {
get_template_part('parts/template-parts/content', 'none');
}
wp_reset_postdata();
exit();
}
add_action('wp_ajax_ajax_getcat_post', 'ajax_getcat_post');
add_action('wp_ajax_nopriv_ajax_getcat_post', 'ajax_getcat_post');
/**
* [ajax_search AJAX搜索]
* @Author Dadong2g
* @DateTime 2019-08-21T23:35:34+0800
* @return [type] [JSON Arr]
*/
function ajax_search()
{
global $wp_query;
header('Content-type:application/json; Charset=utf-8');
$text = !empty($_POST['text']) ? esc_sql($_POST['text']) : null;
$args = array('s' => $text,'posts_per_page' => 5);
$array_posts = array();
$data = new WP_Query($args);
while ($data->have_posts()) : $data->the_post();
array_push($array_posts, array("title"=>get_the_title(),"url"=>get_permalink(),"img"=>_get_post_timthumb_src() ));
endwhile;
echo json_encode($array_posts);
exit();
}
add_action('wp_ajax_ajax_search', 'ajax_search');
add_action('wp_ajax_nopriv_ajax_search', 'ajax_search');
function get_mpweixin_qr()
{
header('Content-type:application/json; Charset=utf-8');
$wxConfig = _cao('oauth_mpweixin');
$CaoMpWeixin = new CaoMpWeixin($wxConfig);
echo json_encode($CaoMpWeixin->getLoginQr());
exit;
}
add_action('wp_ajax_get_mpweixin_qr', 'get_mpweixin_qr');
add_action('wp_ajax_nopriv_get_mpweixin_qr', 'get_mpweixin_qr');
function check_mpweixin_qr()
{
header('Content-type:application/json; Charset=utf-8');
$scene_id = !empty($_POST['scene_id']) ? sanitize_text_field(wp_unslash($_POST[ 'scene_id' ])) : null;
global $current_user;
$current_user_id =$current_user->ID;
// 查询数据库
global $wpdb, $mpwx_log_table_name;
$res = $wpdb->get_row($wpdb->prepare("SELECT * FROM $mpwx_log_table_name WHERE scene_id = %s ", esc_sql($scene_id)));
if (($res->create_time+180)<time()) {
echo json_encode(array('status' => 0));
exit;
//180秒内有效
}
// 查询openid
$_prefix = 'mpweixin';
$_openid_meta_key = 'open_' . $_prefix . '_openid';
$user_exist = $wpdb->get_var($wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key=%s AND meta_value=%s", $_openid_meta_key, $res->openid));
if (!$current_user_id && !empty($res) && $res->scene_id == $scene_id && !empty($res->openid)) {
if (!empty($user_exist)) {
wp_set_auth_cookie($user_exist, true, false);
$user = get_user_by('id', $user_exist);
do_action('wp_login', $user->user_login, $user); // 保证挂载的action执行
}
$status = 1;
} else {
$status = 0;
}
echo json_encode(array('status' => $status));
exit;
}
add_action('wp_ajax_check_mpweixin_qr', 'check_mpweixin_qr');
add_action('wp_ajax_nopriv_check_mpweixin_qr', 'check_mpweixin_qr');
/**
* [user_login 用户登录]
* @Author Dadong2g
* @DateTime 2019-06-02T15:34:38+0800
* @return [type] [description]
*/
function user_login()
{
header('Content-type:application/json; Charset=utf-8');
$username = !empty($_POST['username']) ? esc_sql($_POST['username']) : null;
$password = !empty($_POST['password']) ? esc_sql($_POST['password']) : null;
$rememberme = !empty($_POST['rememberme']) ? esc_sql($_POST['rememberme']) : null;
if (_cao('is_close_wplogin')) {
echo json_encode(array('status' => '0', 'msg' => '仅开放社交账号登录'));
exit;
}
$login_data = array();
$login_data['user_login'] = $username;
$login_data['user_password'] = $password;
$login_data['remember'] = false;
if (isset($rememberme) && $rememberme == '1') {
没有合适的资源?快使用搜索试试~ 我知道了~
WordPress博客主题RiPro9.0全解密无后门免扩展版本
共536个文件
php:380个
po:21个
js:21个
需积分: 13 11 下载量 130 浏览量
2023-04-07
15:48:21
上传
评论 1
收藏 2.57MB ZIP 举报
温馨提示
测试可用,无任何限制,需要自己下载
资源推荐
资源详情
资源评论
收起资源包目录
WordPress博客主题RiPro9.0全解密无后门免扩展版本 (536个子文件)
app111.css 213KB
app.css 169KB
app.min.css 158KB
external.css 121KB
style.css 80KB
style.min.css 64KB
admin.css 51KB
DPlayer.min.css 44KB
sweetalert2.min.css 21KB
style.css 20KB
wangEditor.min.css 15KB
jquery.fancybox.min.css 14KB
style-rtl.css 9KB
style-rtl.min.css 5KB
install.min.css 5KB
style.css 946B
diy.css 621B
materialdesignicons-webfont.eot 296KB
fontawesome-webfont.eot 75KB
preloader.gif 866B
loginAgent.html 4KB
loginAgent.html 4KB
loginAgent.html 4KB
screenshot.jpg 120KB
6.jpg 53KB
bg-1.jpg 25KB
ads.jpg 12KB
qr.jpg 8KB
op-default.jpg 3KB
1.jpg 3KB
full.jpg 3KB
op-slider2.jpg 2KB
sidebar.jpg 2KB
grid.jpg 2KB
list.jpg 2KB
op-blog.jpg 2KB
no-sidebar.jpg 2KB
op-slider1.jpg 2KB
hls.min.js 209KB
html2canvas.min.js 145KB
plugins.js 118KB
DPlayer.min.js 114KB
main.js 92KB
jquery-2.2.4.min.js 84KB
llqrcode.js 70KB
plugins.js 65KB
wangEditor.min.js 64KB
sweetalert2.all.js 64KB
jquery.fancybox.min.js 60KB
main.min.js 44KB
plugins.min.js 37KB
sweetalert2.min.js 37KB
app.js 30KB
jquery.easydropdown.min.js 7KB
nprogress.min.js 4KB
respond.min.js 4KB
html5shiv - 副本.js 3KB
gutenberg.js 2KB
html5shiv.js 2KB
installed.json 5KB
composer.json 621B
composer.json 582B
composer.json 457B
composer.json 450B
zh_CN.mo 8KB
bn_BD.mo 6KB
hi_IN.mo 6KB
th.mo 6KB
ru_RU.mo 5KB
ar.mo 5KB
ja.mo 5KB
fr_FR.mo 4KB
vi.mo 4KB
de_DE.mo 4KB
az.mo 4KB
ko_KR.mo 4KB
es_ES.mo 4KB
tr_TR.mo 4KB
nl_NL.mo 4KB
it_IT.mo 4KB
pl_PL.mo 4KB
pt_PT.mo 4KB
id_ID.mo 4KB
ne_NP.mo 3KB
wp-clean-up-zh_CN.mo 2KB
core-ajax.php 134KB
admin-options.php 132KB
qrcode.class.php 113KB
theme-functions.php 86KB
google-fonts.php 75KB
timthumb.php 52KB
core.class.7.4.php 35KB
fa5-icons.php 31KB
widget-options.php 28KB
core-functions.php 26KB
admin-options.class.php 26KB
setup.class.php 24KB
typography.php 22KB
HttpRequest.php 20KB
Swoole.php 17KB
共 536 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
龙哥爱学习
- 粉丝: 5
- 资源: 21
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功