<?php
/**
* Copyright (c) 2014-2018, www.kuacg.com
* All right reserved.
*
* @since LTS-181021
* @package Cute
* @author 酷ACG资源网
* @date 2018/10/21 10:00
* @link https://www.kuacg.com/23856.html
*/
?>
<?php
require_once 'Constants.php';
date_default_timezone_set('PRC');
if (!function_exists('load_dash')) {
function load_dash($path)
{
load_template(THEME_DIR.'/dash/'.$path.'.php');
}
}
if (!function_exists('load_api')) {
function load_api($path)
{
load_template(THEME_DIR.'/core/api/'.$path.'.php');
}
}
if (!function_exists('load_class')) {
function load_class($path, $safe = false)
{
if ($safe) {
@include_once THEME_DIR.'/core/classes/'.$path.'.php';
} else {
load_template(THEME_DIR.'/core/classes/'.$path.'.php');
}
}
}
if (!function_exists('load_func')) {
function load_func($path, $safe = false)
{
if ($safe) {
@include_once THEME_DIR.'/core/functions/'.$path.'.php';
} else {
load_template(THEME_DIR.'/core/functions/'.$path.'.php');
}
}
}
if (!function_exists('load_mod')) {
function load_mod($path, $safe = false)
{
if ($safe) {
@include_once THEME_DIR.'/core/modules/'.$path.'.php';
} else {
load_template(THEME_DIR.'/core/modules/'.$path.'.php');
}
}
}
if (!function_exists('load_tpl')) {
function load_tpl($path, $safe = false)
{
if ($safe) {
@include_once THEME_DIR.'/core/templates/'.$path.'.php';
} else {
load_template(THEME_DIR.'/core/templates/'.$path.'.php');
}
}
}
if (!function_exists('load_widget')) {
function load_widget($path, $safe = false)
{
if ($safe) {
@include_once THEME_DIR.'/core/modules/widgets/'.$path.'.php';
} else {
load_template(THEME_DIR.'/core/modules/widgets/'.$path.'.php');
}
}
}
if (!function_exists('load_vm')) {
function load_vm($path, $safe = false)
{
if ($safe) {
@include_once THEME_DIR.'/core/viewModels/'.$path.'.php';
} else {
load_template(THEME_DIR.'/core/viewModels/'.$path.'.php');
}
}
}
load_dash('of_inc/options-framework');
load_dash('options');
defined('THEME_CDN_ASSET') || define('THEME_CDN_ASSET', of_get_option('tt_cute_static_cdn_path', THEME_ASSET));
defined('TT_DEBUG') || define('TT_DEBUG', of_get_option('tt_theme_debug', false));
if (TT_DEBUG) {
ini_set('display_errors', 'On');
error_reporting(E_ALL);
} else {
ini_set('display_errors', 'Off');
}
load_dash('dash');
load_api('api.Config');
defined('TT_PRO') || define('TT_PRO', true);
function tt_load_languages()
{
load_theme_textdomain('tt', THEME_DIR.'/core/languages');
}
add_action('after_setup_theme', 'tt_load_languages');
function tt_theme_l10n()
{
return tt_get_option('tt_l10n', 'zh_CN');
}
add_filter('locale', 'tt_theme_l10n');
function tt_generate_reset_password_link($email, $user_id = 0)
{
$base_url = tt_url_for('resetpass');
if (!$user_id) {
$user_id = get_user_by('email', $email)->ID;
}
$data = array(
'id' => $user_id,
'email' => $email,
);
$key = base64_encode(tt_authdata($data, 'ENCODE', tt_get_option('tt_private_token'), 60 * 10)); // 10分钟有效期
$link = add_query_arg('key', $key, $base_url);
return $link;
}
function tt_verify_reset_password_link($key)
{
if (empty($key)) {
return false;
}
$data = tt_authdata(base64_decode($key), 'DECODE', tt_get_option('tt_private_token'));
if (!$data || !is_array($data) || !isset($data['id']) || !isset($data['email'])) {
return false;
}
return true;
}
function tt_reset_password_by_key($key, $new_pass)
{
$data = tt_authdata(base64_decode($key), 'DECODE', tt_get_option('tt_private_token'));
if (!$data || !is_array($data) || !isset($data['id']) || !isset($data['email'])) {
return new WP_Error('invalid_key', __('The key is invalid.', 'tt'), array('status' => 400));
}
$user = get_user_by('id', (int) $data['id']);
if (!$user) {
return new WP_Error('user_not_found', __('Sorry, the user was not found.', 'tt'), array('status' => 404));
}
reset_password($user, $new_pass);
return $user;
}
function tt_generate_registration_activation_link ($username, $email, $password, $oauth='', $open_data_key='') {
$base_url = tt_url_for('activate');
$data = array(
'oauth' => $oauth,
'open_data_key' => $open_data_key,
'username' => $username,
'email' => $email,
'password' => $password
);
$key = base64_encode(tt_authdata($data, 'ENCODE', tt_get_option('tt_private_token'), 60*10));
$link = add_query_arg('key', $key, $base_url);
return $link;
}
function tt_activate_registration_from_link($key) {
$reg_ver_option = tt_get_option('tt_enable_k_reg_ver', false);
if(empty($key)) {
return new WP_Error( 'invalid_key', __( 'The registration activation key is invalid.', 'tt' ), array( 'status' => 400 ) );
}
$data = tt_authdata(base64_decode($key), 'DECODE', tt_get_option('tt_private_token'));
if(!$data || !is_array($data) || !isset($data['username']) || !isset($data['email']) || !isset($data['password'])){
return new WP_Error( 'invalid_key', __( 'The registration activation key is invalid.', 'tt' ), array( 'status' => 400 ) );
}
$userdata = array(
'user_login' => $data['username'],
'user_email' => $data['email'],
'user_pass' => $data['password']
);
switch($data['oauth']) {
case 'qq':
$openid_meta_key = 'tt_qq_openid';
$_access_token_meta_key = 'tt_qq_access_token';
$_refresh_token_meta_key = 'tt_qq_refresh_token';
$_token_expiration_meta_key = 'tt_qq_token_expiration';
break;
case 'weibo':
$openid_meta_key = 'tt_weibo_openid';
$_access_token_meta_key = 'tt_weibo_access_token';
$_refresh_token_meta_key = 'tt_weibo_refresh_token';
$_token_expiration_meta_key = 'tt_weibo_token_expiration';
break;
case 'weixin':
$openid_meta_key = 'tt_weixin_openid';
$_access_token_meta_key = 'tt_weixin_access_token';
$_refresh_token_meta_key = 'tt_weixin_refresh_token';
$_token_expiration_meta_key = 'tt_weixin_token_expiration';
break;
}
$user_id = wp_insert_user($userdata);
$_data_transient_key = $data['open_data_key'];
$oauth_data_cache = get_transient($_data_transient_key);
$oauth_data = (array)maybe_unserialize($oauth_data_cache);
if(is_wp_error($user_id)) {
return $user_id;
}elseif(!empty($data['oauth']) && $reg_ver_option){
update_user_meta($user_id, $openid_meta_key, $oauth_data['openid']);
update_user_meta($user_id, $_access_token_meta_key, $oauth_data['access_token']);
update_user_meta($user_id, $_refresh_token_meta_key, $oauth_data['refresh_token']);
update_user_meta($user_id, $_token_expiration_meta_key, $oauth_data['expiration']);
if($data['oauth'] === 'weixin'){
update_user_meta($user_id, 'tt_weixin_avatar', set_url_scheme($oauth_data['headimgurl'], 'https'));
update_user_meta($user_id, 'tt_weixin_unionid', $oauth_data['unionid']);
update_user_meta($user_id, 'tt_user_country', $oauth_data['country']);
update_user_meta($user_id, 'tt_user_province', $oauth_data['province']);
update_user_meta($user_id, 'tt_user_city', $oauth_data['city']);
update_user_meta($user_id, 'tt_user_sex', $oauth_data['sex']==2 ? 'female' : 'male');
没有合适的资源?快使用搜索试试~ 我知道了~
Cute主题-WP响应式带商城主题模板-开心版
共1173个文件
png:496个
php:395个
gif:144个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 145 浏览量
2023-09-27
22:45:49
上传
评论
收藏 12.24MB ZIP 举报
温馨提示
Cute主题为多功能Wordpress卡片主题,适合用于资源分享站、福利站、虚拟商城、素材下载等类型站点,集会员中心、商城系统、注册系统、推广系统、邀请系统等众多实用功能于一体,且每独立系列功能都做到了可延展性最大化,商城支付等相关的复杂操作步骤提供有设置教程,与操作说明,保障了主题整体设置功能的简洁性与易用性。
资源推荐
资源详情
资源评论
收起资源包目录
Cute主题-WP响应式带商城主题模板-开心版 (1173个子文件)
app.css 216KB
style.css 177KB
custom.css 116KB
thread.css 42KB
product.css 32KB
home.css 30KB
single.css 28KB
page.css 28KB
uc.css 24KB
me.css 18KB
manage.css 16KB
error-page.css 10KB
site-utils.css 10KB
optionsframework.css 9KB
archive.css 8KB
actions.css 8KB
products.css 6KB
editor-preview.css 2KB
oauth.css 975B
style.css 697B
404.css 623B
front-page.css 208B
Tico.eot 52KB
擦汗.gif 25KB
鼓掌.gif 25KB
委屈.gif 23KB
转圈.gif 22KB
调皮.gif 22KB
挥动.gif 21KB
哈欠.gif 20KB
吐.gif 19KB
抠鼻.gif 19KB
折磨.gif 18KB
惊讶.gif 17KB
流泪.gif 17KB
回头.gif 16KB
发怒.gif 16KB
便便.gif 14KB
闭嘴.gif 14KB
啤酒.gif 14KB
吓.gif 13KB
大兵.gif 13KB
左哼哼.gif 13KB
右哼哼.gif 13KB
咒骂.gif 12KB
疑问.gif 11KB
惊恐.gif 11KB
抓狂.gif 11KB
嗅大了.gif 10KB
阴险.gif 10KB
怄火.gif 10KB
流汗.gif 9KB
大哭.gif 9KB
咖啡.gif 9KB
勾引.gif 9KB
憨笑.gif 9KB
爱情.gif 9KB
白眼.gif 8KB
困.gif 8KB
激动.gif 8KB
左太极.gif 8KB
撇嘴.gif 8KB
街舞.gif 8KB
发呆.gif 8KB
害羞.gif 8KB
右太极.gif 7KB
晕.gif 7KB
菜刀.gif 7KB
饥饿.gif 7KB
再见.gif 7KB
足球.gif 7KB
NO.gif 7KB
磕头.gif 7KB
冷汗.gif 7KB
弱.gif 6KB
心碎.gif 6KB
强.gif 6KB
睡.gif 6KB
爱你.gif 6KB
胜利.gif 6KB
握手.gif 6KB
蜡烛.gif 6KB
尴尬.gif 6KB
色.gif 6KB
拥抱.gif 6KB
跳绳.gif 5KB
刀.gif 5KB
抱拳.gif 5KB
拳头.gif 5KB
差劲.gif 5KB
坏笑.gif 5KB
鄙视.gif 5KB
篮球.gif 5KB
吻.gif 5KB
瓢虫.gif 4KB
可爱.gif 4KB
蛋糕.gif 4KB
得意.gif 4KB
衰.gif 4KB
loading.gif 4KB
共 1173 条
- 1
- 2
- 3
- 4
- 5
- 6
- 12
资源评论
办公模板库素材蛙
- 粉丝: 1580
- 资源: 2298
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功