<?php if (empty($_GET['key']) || empty($_GET['view'])) { ?> <div class="col-md-12 alert alert-danger" role="alert"> <strong>Design Not Found!</strong> </div> <?php } else { $key = $_GET['key']; $position = $_GET['view']; include_once ROOT . DS . 'includes' . DS . 'functions.php'; $dg = new dg(); $data = array(); if (empty($_GET['idea'])) { $file = 'download.php'; $cache = $dg->cache('cart'); $data = $cache->get($key); //print_r($data); } else { $file = 'download_idea.php'; $cache = $dg->cache('design'); $params = explode(':', $key); $user_id = $cache->get($params[0]); if ($user_id != false && count($user_id[$params[1]]) > 0) { $data = $user_id[$params[1]]; } else { $cache = $dg->cache('admin'); $params = explode(':', $key); $user_id = $cache->get($params[0]); if ($user_id != false && count($user_id[$params[1]]) > 0) { $data = $user_id[$params[1]];
* * API * * @copyright Copyright (C) 2015 tshirtecommerce.com. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE * */ error_reporting(0); define('ROOT', dirname(__FILE__)); define('DS', DIRECTORY_SEPARATOR); if (isset($_GET['key'])) { include_once ROOT . DS . 'includes' . DS . 'functions.php'; $key = $_GET['key']; $position = $_GET['view']; $dg = new dg(); $cache = $dg->cache('design'); $params = explode(':', $key); $user_id = $cache->get($params[0]); if ($user_id == false or count($user_id) == 0) { return false; } $data = $user_id[$params[1]]; if (count($data) > 0) { $product_id = $params[2]; // get product $products = $dg->getProducts(); for ($i = 0; $i < count($products); $i++) { if ($products[$i]->id == $product_id) { $product = $products[$i]; break; }
// save design case 'saveDesign': $dg->saveDesign(); break; // remove design // remove design case 'removeDesign': $user = $_COOKIE['design']; $id = $_GET['id']; $ids = explode(':', $id); if (count($ids) == 2) { if ($user == $ids[0]) { include_once ROOT . DS . 'admin' . DS . 'config' . DS . 'config.php'; $code = md5($config['email'] . $config['password']); if ($user == $code) { $cache = $dg->cache('admin'); } else { $cache = $dg->cache(); } $designs = $cache->get($user); unset($designs[$ids[1]]); $cache->set($user, $designs); } } break; // load design // load design case 'userDesign': $user = $_COOKIE['design']; include_once ROOT . DS . 'admin' . DS . 'config' . DS . 'config.php'; $code = md5($config['email'] . $config['password']);
} return $data; } if (isset($_GET['name']) && isset($_GET['type'])) { $font_name = $_GET['name']; $font_type = $_GET['type']; if ($font_type == 'google') { $file = 'google-' . $font_name; } else { $file = 'add-' . $font_name; } $file = str_replace(' ', '_', $file); $file = str_replace('+', '_', $file); include_once ROOT . DS . 'includes' . DS . 'functions.php'; $dg = new dg(); $cache = $dg->cache('fonts'); $content = $cache->get($file); if ($content == false) { if ($font_type == 'google') { $font_name = str_replace(' ', '+', $font_name); $url = 'http://fonts.googleapis.com/css?family=' . $font_name; $data = openURL($url); if ($data === false) { echo 0; exit; } preg_match_all("/url\\((.*)\\.ttf\\)/s", $data, $links); if (isset($links[1]) && isset($links[1][0])) { $content = openURL($links[1][0] . '.ttf'); if ($content == false) { echo 0;
* * @copyright Copyright (C) 2015 tshirtecommerce.com. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE * */ error_reporting(0); session_start(); define('ROOT', dirname(__FILE__)); define('DS', DIRECTORY_SEPARATOR); include_once ROOT . DS . 'includes' . DS . 'functions.php'; // call language $dg = new dg(); $lang = $dg->lang(); $site_url = $dg->url(); // get design $cache = $dg->cache(); $path = ROOT . DS . 'cache' . DS . 'design'; $files = $dg->getFiles($path); $designs = array(); if ($files !== false) { $i = 0; foreach ($files as $file) { $key = str_replace('.txt', '', $file); $designs[$key] = $cache->get($key); } } // Paginition. $url = $_SERVER['REQUEST_URI']; $params = explode('admin-users.php/', $url); if (count($params) > 1) { $segment = (int) $params[1];
* * API * * @copyright Copyright (C) 2015 tshirtecommerce.com. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE * */ error_reporting(0); define('ROOT', dirname(__FILE__)); define('DS', DIRECTORY_SEPARATOR); if (isset($_GET['key']) && isset($_GET['view'])) { include_once ROOT . DS . 'includes' . DS . 'functions.php'; $key = $_GET['key']; $position = $_GET['view']; $dg = new dg(); $cache = $dg->cache('cart'); $data = $cache->get($key); if (count($data) > 0) { // get product $products = $dg->getProducts(); for ($i = 0; $i < count($products); $i++) { if ($products[$i]->id == $data['item']['product_id']) { $product = $products[$i]; break; } } if (isset($product)) { $design = $product->design; if (count($design)) { $files = array(); if (isset($_GET['type'])) {