<?php
/**
* @author tshirtecommerce - www.tshirtecommerce.com
* @date: 2015-01-10
*
* @copyright Copyright (C) 2015 tshirtecommerce.com. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*
*/
if ( ! defined('ROOT')) exit('No direct script access allowed');
class dg{
public function __construct()
{
$this->path_data = ROOT .DS. 'data';
$this->components = ROOT .DS. 'components';
$this->platform = $this->getPlatform();
}
public function getPlatform()
{
$platform = 'wordpress';
$file = ROOT.'/version.json';
if (file_exists($file)) {
$json = json_decode(file_get_contents($file), true);
if (isset($json['platforms'])) {
$platform = $json['platforms'];
}
}
return $platform;
}
public function url(){
$pageURL = 'http';
if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on" || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') || (isset($_SERVER['HTTP_HTTPSSL']) && $_SERVER['HTTP_HTTPSSL'] == true)) {$pageURL .= "s";}
$pageURL .= "://";
$pageURL .= $_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"];
$url = explode('tshirtecommerce/', $pageURL);
return $url[0];
}
function openURL($url)
{
$data = false;
if( function_exists('curl_exec') )
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($ch);
curl_close($ch);
}
if( $data == false && function_exists('file_get_contents') )
{
$data = file_get_contents($url);
}
return $data;
}
// load language
public function lang($file = 'lang.ini', $cookie = true)
{
$file_lang = ROOT .DS. 'data' .DS. 'languages.json';
$lang = '';
if (file_exists($file_lang))
{
$languages = json_decode(file_get_contents($file_lang));
if (count($languages))
{
if (!empty($_GET['lang']))
{
$lang = $_GET['lang'];
$file_active = 'language_'.$lang.'.ini';
}
elseif (!empty($_POST['lang']))
{
$lang = $_POST['lang'];
$file_active = 'language_'.$lang.'.ini';
}
$check = true;
if (isset($file_active))
{
$check_published = true;
foreach($languages as $language)
{
if ($lang == $language->code)
{
if (isset($language->published) && $language->published == 0)
{
$check_published = false;
}
break;
}
}
if (file_exists($this->path_data .DS. $file_active) && $check_published == true)
{
$file = $file_active;
$check = false;
}
}
if($check == true)
{
foreach($languages as $language)
{
if (isset($language->default) && $language->default == 1)
{
if (file_exists(ROOT .DS. 'data' .DS. $language->file))
{
$file = $language->file;
$lang = $language->code;
}
}
}
}
}
}
$file = $this->path_data .DS. $file;
$GLOBALS['lang_active'] = $lang;
if (file_exists($file))
{
$data = parse_ini_file($file);
if ($data === false || $data == null)
{
$content = file_get_contents($file);
$data = parse_ini_string($content);
}
}
else
{
$data = array();
}
// update text from extra file
$lang_plus = $this->path_data .DS. 'lang_plus.ini';
if (file_exists($lang_plus))
{
$langs = parse_ini_file($lang_plus);
if ($langs === false || $langs == null)
{
$content = file_get_contents($lang_plus);
$langs = parse_ini_string($content);
}
if (count($langs))
{
foreach($langs as $key => $text)
{
if (empty($data[$key]))
{
$data[$key] = $text;
}
}
}
}
return $data;
}
// load themes
public function theme($name = 'index', $product = array())
{
if(isset($product->is_mobile) && $product->is_mobile == true)
{
$layouts = $this->getLayouts();
if(count($layouts))
{
foreach($layouts as $id => $layout)
{
if($layout['theme'] == 'editor')
{
$product->theme = $id;
break;
}
}
}
}
$theme = '';
if(isset($product->theme) && $product->theme != '')
{
$layouts = $this->getLayouts();
if( $layouts != false && count($layouts) && isset($layouts[$product->theme]) )
{
$layout = $layouts[$product->theme];
$new_file = ROOT .DS. 'themes' .DS. $layout['theme'] .DS. $name. '.php';
if (file_exists($new_file))
{
$theme = $layout['theme'];
$settings = new StdClass();
$settings->theme = new StdClass();
$settings->theme->{$theme} = json_decode(json_encode($layout['options']));
require_once($new_file);
}
}
}
if (isset($this->settings) && $theme == '')
{
$settings = $this->settings;
if ( isset($settings->themes) && $settings->themes != '' )
{
$new_file = ROOT .DS. 'themes' .DS. $settings->themes .DS. $name. '.php';
if (file_exists($new_file))
{
$theme = $settings->themes;
require_once($new_file);
}
}
}
$this->theme_active = $theme;
}
public function getLayouts()
{
$file = ROOT .DS. 'data' .DS. 'layouts.json';
if(!file_exists($file))
{
return false;
}
$content = file_get_contents($file);
if($content !== false)
{
$layouts = json_decode($content, true);
return $layouts;
}
return false;
}
// load view layout
public function view($name, $path = '')
{
$file = $this->components .DS. $name. '.php';
$file_new = $file;
if ($path != '')
{
$file_new = $this->components .DS. $path .DS. $name. '.php';
}
$theme = '';
if(isset($this->product->theme) && $this->product->theme != '')
{
$layouts = $this->getLayouts();
if( $layouts != false && count($layouts) && isset($layouts[$this->product->theme]) )
{
$layout = $layouts[$this->product->theme];
$theme = $layout['theme'];
if($path != '')
{
$temp = ROOT .DS. 'themes' .DS. $layout['theme'] .DS. 'components' .DS. $path .DS. $name. '.php';
if (file_exists($temp))
{
$file_new1 = $temp;
}
}
if(isset($file_new1))
{
$file_new = $file_new1;
}
else
{
$temp = ROOT .DS. 'themes' .DS. $layout['theme'] .DS. 'components' .DS. $name. '.php';
if (file_exists($temp))
{
$file_new = $temp;
}
}
}
}
if ( isset($this->settings) && $theme == '' )
{
$settings = $this->settings;
if ( isset($settings->themes) && $settings->themes != '' )
{
if($path != '')
{
$temp = ROOT .DS. 'themes' .DS. $settings->themes .DS. 'components' .DS. $path .DS. $name. '.php';
if (file_exists($temp))
{
$file_new1 = $temp;
}
}
if(isset($file_new1))
{
$file_new = $file_new1;
}
else
{
$temp = ROOT .DS. 'themes' .DS. $settings->themes .DS. 'components' .DS. $name. '.php';
if (file_exists($temp))
{
$file_new = $temp;
}
}
}
}
if (file_exists($file_new))
{
require_once($file_new);
}
elseif(file_exists($file))
{
require_once($file);
}
}
// get products
public function getProducts()
{
$file = $this->path_data .DS. 'products.json';
if (file_exists($file))
{
$data = file_get_contents($file);
$products = json_decode($data);
return $products->products;
}
else
{
return array();
}
}
// get attribute of product
public function getAttributes($attribute)
{
if (isset($attribute->name) && $attribute->name != '')
{
$attrs = new stdClass();
if (is_string($attribute->name))
$attrs->name = json_decode($attribute->name);
else
$attrs->name = $attribute->name;
if (is_string($attribute->titles))
$attrs->titles = json_decode($attribute->titles);
else
$attrs->titles = $attribute->titles;
if (is_string($attribute->prices))
$attrs->prices = json_d
没有合适的资源?快使用搜索试试~ 我知道了~
【WordPress插件】2022年最新版完整功能demo+插件v1.12.0.zip
共551个文件
php:224个
js:173个
ini:47个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 150 浏览量
2022-04-03
13:34:16
上传
评论
收藏 1.64MB ZIP 举报
温馨提示
"【WordPress插件】2022年最新版完整功能demo+插件v1.12.0 Ultimate Addons for Custom Product Designer (WooCommerce, Opencart, Prestashop) 定制产品设计师的终极插件(Woocommerce,OpenCart,Prestashop)" ---------- 泰森云每天更新发布最新WordPress主题、HTML主题、WordPress插件、shopify主题、opencart主题、PHP项目源码、安卓项目源码、ios项目源码,更有超10000个资源可供选择,如有需要请站内联系。
资源推荐
资源详情
资源评论
收起资源包目录
【WordPress插件】2022年最新版完整功能demo+插件v1.12.0.zip (551个子文件)
bootstrap.css 124KB
style-mobile.min.css 54KB
style.css 50KB
style.min.css 47KB
style.css 36KB
style.css 26KB
bootstrap-responsive.css 22KB
style.min.css 22KB
gallery.css 21KB
gallery.css 18KB
app.css 13KB
spectrum.css 11KB
style-backup.css 11KB
flaticon.css 8KB
flaticon.css 7KB
jquery.contextMenu.min.css 5KB
crop-image.css 5KB
documenter_style.css 4KB
style_mobile.css 4KB
introduction.css 4KB
admin.css 4KB
pages.css 3KB
product.css 3KB
image-shape.css 2KB
text.css 2KB
shape-filter.css 2KB
store.css 2KB
style_bottom.css 2KB
selectAll.css 1KB
style_top.css 1KB
pages.css 925B
prettify.css 815B
printing_type.css 752B
layers.css 540B
feed_news.css 525B
style_right.css 518B
art-color-area-change.css 508B
clear-background-color.css 495B
affection-text-pattern.css 476B
user_design.css 296B
printing_type.css 294B
store-treeview.css 217B
test.css 5B
Flaticon.eot 29KB
Flaticon.eot 29KB
flaticon.html 63KB
flaticon.html 63KB
index.html 5KB
index.html 114B
index.html 114B
index.html 114B
index.html 114B
index.html 114B
index.html 114B
index.html 114B
index.html 114B
index.html 114B
index.html 114B
index.html 114B
index.html 114B
index.html 114B
index.html 114B
lang_plus.ini 7KB
introduction.ini 5KB
printing.ini 3KB
printing_type.ini 2KB
printing_type.ini 2KB
submitprice.ini 1KB
submitprice.ini 1KB
item-limit.ini 1KB
store.ini 1017B
taxes.ini 873B
language.ini 870B
price-format.ini 808B
lock-size-rotate.ini 794B
product_design_layout.ini 679B
email.ini 644B
store.ini 632B
item-limit.ini 617B
clear_background_color.ini 486B
user_design.ini 397B
color-picker.ini 374B
design-fit.ini 367B
art-color-area-change.ini 357B
minifyjs.ini 293B
save-design.ini 272B
crop-image.ini 232B
shape-filter.ini 201B
upload-facebook.ini 174B
product.ini 171B
instagram.ini 158B
design-fit.ini 155B
upload-instagram.ini 153B
facebook.ini 151B
text_arc.ini 151B
setting.ini 138B
share_email.ini 124B
acreage.ini 122B
affection-text-pattern.ini 107B
text-setup.ini 99B
共 551 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
Lee达森
- 粉丝: 969
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- ffmpeg-master-latest-win64-gpl-shared
- Ghostscript 10.03.1 for Windows (32 bit)
- 基于 python 实现对电信公司的数据做出分析,特征可视化,建立模型预测未知客户是否为要流失的客户
- Three.js可视化系统课程WebGL(2024年6月最新版49章)
- 微信小程序 MD5 AES SHA 加密解密
- 海光平台兼容性指南-国产化海光平台技术培训系列一
- AMQ28-SR4-M1-V1.0
- 基于STM32单片机的蓝牙小车.doc
- 《PHP网站开发实例教程》源代码.zip
- 2023年甘肃省职业院校技能大赛高职学生组网络系统管理赛项样卷.rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功