function RemindPassword($Email) { global $Db, $Logs, $nsProduct, $nsLang, $LangConfig, $Lang; $Query = "SELECT * FROM " . PFX . "_system_user WHERE EMAIL = ?"; $User = $Db->Select($Query, false, $Email); if (!ValidId($User->ID)) { $Logs->Err($Lang['NoEmail']); return false; } $NewPass = substr(md5(uniqid(rand())), 0, 10); $Query = "UPDATE " . PFX . "_system_user SET PWD= '" . md5($NewPass) . "' WHERE ID = " . $User->ID; $Db->Query($Query); $Query = "SELECT LANG FROM " . PFX . "_system_user2lang WHERE PROD_ID=" . $nsProduct->ID . " AND UID = " . $User->ID; $ULang = $Db->ReturnValue($Query); if ($ULang && $ULang != $nsLang->CurrentLang) { $LConfig = $nsLang->ReturnConfig($ULang); $nsLang->TplInc("admin.remind", $ULang); } else { $LConfig = $LangConfig; } $Query = "SELECT FROM_EMAIL FROM " . PFX . "_tracker_config WHERE COMPANY_ID=0"; $FromEmail = $Db->ReturnValue($Query); $FromEmail = $FromEmail ? $FromEmail : $Email; $Message = $Lang['MsgBody']; $Message = str_replace("{LOGIN}", $User->LOGIN, $Message); $Message = str_replace("{PASS}", $NewPass, $Message); $Message = str_replace("{LINK}", getURL("login", "", "admin"), $Message); $Subject = $Lang['MsgSubject']; $Headers = "From: {$FromEmail}\n"; $Headers .= "Content-Type: text/plain; charset=" . $LConfig['charset'] . "\n"; mail($Email, $Subject, $Message, $Headers); $Logs->Msg(str_replace("{EMAIL}", $Email, $Lang['PasswordSent'])); }
public function do_url() { if (!isset(Vars::$get['blogname']) || trim(Vars::$get['blogname']) == '') { throw new PluginException('パラメータが足りません。', $this); } $blogname = trim(Vars::$get['blogname']); $num = isset(Vars::$get['recent']) && Vars::$get['recent'] > 0 ? (int) Vars::$get['recent'] : 15; $db = DataBase::getinstance(); $_exp = $db->escape('^' . mb_ereg_quote($blogname) . '/\\d{4}-\\d{2}-\\d{2}/'); $query = "SELECT pagename,timestamp FROM page"; $query .= " WHERE php('mb_ereg', '{$_exp}', pagename)"; $query .= " ORDER BY timestamp DESC, pagename ASC LIMIT {$num}"; $result = $db->query($query); $list = array(); $prefixsize = mb_strlen($blogname . '/9999-99-99/'); while ($row = $db->fetch($result)) { $item['timestamp'] = $row['timestamp']; $item['pagename'] = mb_substr($row['pagename'], $prefixsize); $item['url'] = getURL(Page::getinstance($row['pagename'])); $list[] = $item; } $smarty = $this->getSmarty(); $smarty->assign('rssurl', SCRIPTURL . '?' . htmlspecialchars($_SERVER['QUERY_STRING'])); $smarty->assign('sitename', SITENAME); $smarty->assign('blogurl', getURL(Page::getinstance($blogname))); $smarty->assign('blogname', $blogname); $smarty->assign('list', $list); header('Content-Type: application/xml; charset=UTF-8'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $item['timestamp'][0]) . ' GMT'); $smarty->display('blogrss10.tpl.htm'); exit; }
function smarty_function_online_payment_link($params, &$smarty) { global $LANG; $domain_id = domain_id::get($params['domain_id']); $url = getURL(); if (in_array("paypal", explode(",", $params['type']))) { $link = "<a \n\t\t\t\thref=\"https://www.paypal.com/xclick/?business=" . urlencode($params['business']) . "&item_name=" . urlencode($params['item_name']) . "&invoice=" . urlencode($params['invoice']) . "&amount=" . urlencode(number_format($params['amount'], 2, '.', '')) . "¤cy_code=" . urlencode($params['currency_code']) . "¬ify_url=" . urlencode($params['notify_url']) . "&return=" . urlencode($params['return_url']) . "&no_shipping=1&no_note=1&custom=domain_id:" . urlencode($domain_id) . "; \">"; if ($params['include_image'] == "true") { $link .= "<img border='0' src='" . urlsafe($url) . "/images/common/pay_with_paypal.gif'/>"; } else { $link .= htmlsafe($params['link_wording']); } $link .= "</a>"; echo $link; } if (in_array("eway_shared", explode(",", $params['type']))) { $link = "<a \n\t\t\t\thref=\"https://www.paypal.com/xclick/?business=" . urlencode($params['business'] . "\n\t\t\t\t&item_name=" . urlencode($params['item_name']) . "&invoice=" . urlencode($params['invoice']) . "\n\t\t\t\t&amount=" . urlencode(number_format($params['amount'], 2, '.', '')) . "¤cy_code=" . $params['currency_code']) . "\n\t\t\t\t&return=http://vcsweb.com.au&no_shipping=1&no_note=1\">"; if ($params['include_image'] == "true") { $link .= "<img border='0' src='" . urlsafe($url) . "/images/common/pay_with_eway.gif'/>"; } else { $link .= htmlsafe($params['link_wording']); } $link .= "</a>"; echo $link; } }
function GetCampTree($ParentId = 0, $CompId = false) { if (!ValidId($ParentId)) { return false; } global $Db, $Lang, $nsUser; if ($CompId) { $Where = " AND COMPANY_ID={$CompId} "; } else { $Where = ""; } $Query = "SELECT * FROM " . PFX . "_tracker_campaign WHERE PARENT_ID = {$ParentId} AND COMPANY_ID={$CompId} ORDER BY NAME ASC"; $Sql = new Query($Query); $Sql->ReadSkinConfig(); $CampArr = array(); while ($Row = $Sql->Row()) { if ($Sql->Position > 0) { $Row->_UP = true; } else { $Row->_UP = false; } $Row->_DOWN = true; $Row->NAME = stripslashes($Row->NAME); $Row->DESCRIPTION = stripslashes($Row->DESCRIPTION); $Row->_STYLE = $Sql->_STYLE; $SubCnt = $Db->CNT(PFX . "_tracker_campaign", "PARENT_ID=" . $Row->ID); $Row->CHILD_COUNT = $SubCnt > 0 ? $SubCnt : 0; $Row->_UPLINK = getURL("campaign", "SortId=" . $Row->ID . "&SortTo=Up&ParentId=" . $Row->PARENT_ID); $Row->_DOWNLINK = getURL("campaign", "SortId=" . $Row->ID . "&SortTo=Down&ParentId=" . $Row->PARENT_ID); if ($nsUser->Columns->ROI || $nsUser->Columns->CONVERSIONS) { $Row->Report = new Paid_v2(); $Row->Report->GrpId = $Row->ID; $Row->Report->CpId = $Row->COMPANY_ID; $Row->Report->ShowPerClick = true; $Row->Report->ShowTotalCost = true; $Row->Report->DisableAll(); if ($nsUser->Columns->ROI) { $Row->Report->ShowROI = true; } if ($nsUser->Columns->CONVERSIONS) { $Row->Report->ShowActionConv = true; } if ($nsUser->Columns->CONVERSIONS) { $Row->Report->ShowSaleConv = true; } $Row->Report->Calculate(); //Dump($Row->Report); $Row->CampStat =& $Row->Report->CampStat; } $Row->_MOVE = true; $CampArr[$Sql->Position] = $Row; $PrevRow =& $CampArr[$Sql->Position]; } $PrevRow->_DOWN = false; if (count($CampArr) < 1) { return false; } //if (count($CampArr)==1) $PrevRow->_MOVE=false; return $CampArr; }
function isConnected($URL = false) { if (!SESSION("ZanUser")) { redirect($URL !== false ? $URL : path("users/login/?return_to=" . urlencode(getURL()))); } return true; }
public function do_url() { $num = isset(Vars::$get['recent']) && Vars::$get['recent'] > 0 ? (int) Vars::$get['recent'] : 15; $db = DataBase::getinstance(); $query = "SELECT pagename,timestamp FROM page"; if (isset(Vars::$get['exp']) && trim(Vars::$get['exp']) != '') { $_inc = $db->escape(Vars::$get['exp']); $query .= " WHERE php('mb_ereg', '{$_inc}', pagename)"; } else { if (isset(Vars::$get['include']) && trim(Vars::$get['include']) != '') { $_inc = $db->escape(glob2ereg(Vars::$get['include'])); $query .= " WHERE php('mb_ereg', '{$_inc}', pagename)"; } } $query .= " ORDER BY timestamp DESC, pagename ASC LIMIT {$num}"; $result = $db->query($query); $list = array(); while ($row = $db->fetch($result)) { $item['timestamp'] = $row['timestamp']; $item['pagename'] = $row['pagename']; $item['url'] = getURL(Page::getinstance($row['pagename'])); $list[] = $item; } $smarty = $this->getSmarty(); $smarty->assign('rssurl', SCRIPTURL . '?' . htmlspecialchars($_SERVER['QUERY_STRING'])); $smarty->assign('sitename', SITENAME); $smarty->assign('baseurl', SCRIPTURL); $smarty->assign('list', $list); header('Content-Type: application/xml; charset=UTF-8'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $item['timestamp'][0]) . ' GMT'); $smarty->display('rss10.tpl.htm'); exit; }
protected function getPage(array $data) { $data['alerts'] = System::alerts(); $data['jumbotron'] = view('install.jumbotron', ['title' => 'Database connection', 'description' => 'Setup your default database connection.', 'logo' => asset('opis-colibri/system', 'opis-colibri.png'), 'button' => ['link' => getURL('/install/account'), 'text' => 'Skip this step']]); $data['supported'] = class_exists('\\PDO'); return ['title' => 'Database', 'content' => view('install.page.database', $data)]; }
function printHeadingImage($randomImage) { global $_zp_themeroot; $id = getAlbumId(); echo '<div id="randomhead">'; if (is_null($randomImage)) { echo '<img src="' . $_zp_themeroot . '/images/zen-logo.jpg" alt="' . gettext('There were no images from which to select the random heading.') . '" />'; } else { $randomAlbum = $randomImage->getAlbum(); $randomAlt1 = $randomAlbum->getTitle(); if ($randomAlbum->getAlbumId() != $id) { $randomAlbum = $randomAlbum->getParent(); while (!is_null($randomAlbum) && $randomAlbum->getAlbumId() != $id) { $randomAlt1 = $randomAlbum->getTitle() . ":\n" . $randomAlt1; $randomAlbum = $randomAlbum->getParent(); } } $randomImageURL = html_encode(getURL($randomImage)); if (getOption('allow_upscale')) { $wide = 620; $high = 180; } else { $wide = min(620, $randomImage->getWidth()); $high = min(180, $randomImage->getHeight()); } echo "<a href='" . $randomImageURL . "' title='" . gettext('Random picture...') . "'>"; $html = "<img src='" . html_encode($randomImage->getCustomImage(NULL, $wide, $high, $wide, $high, NULL, NULL, !getOption('Watermark_head_image'))) . "' width='{$wide}' height='{$high}' alt=" . '"' . html_encode($randomAlt1) . ":\n" . html_encode($randomImage->getTitle()) . '" />'; $html = zp_apply_filter('custom_image_html', $html, false); echo $html; echo '</a>'; } echo '</div>'; }
function printHeadingImage($randomImage) { global $_zp_themeroot; $id = getAlbumId(); echo '<div id="randomhead">'; if (is_null($randomImage) || checkforPassword(true)) { echo '<img src="' . $_zp_themeroot . '/images/zen-logo.jpg" alt="' . gettext('There were no images from which to select the random heading.') . '" />'; } else { $randomAlbum = $randomImage->getAlbum(); $randomAlt1 = $randomAlbum->getTitle(); if ($randomAlbum->getAlbumId() != $id) { $randomAlbum = $randomAlbum->getParent(); while (!is_null($randomAlbum) && $randomAlbum->getAlbumId() != $id) { $randomAlt1 = $randomAlbum->getTitle() . ":\n" . $randomAlt1; $randomAlbum = $randomAlbum->getParent(); } } $randomImageURL = htmlspecialchars(getURL($randomImage)); if (getOption('allow_upscale')) { $wide = 620; $high = 180; } else { $wide = min(620, $randomImage->getWidth()); $high = min(180, $randomImage->getHeight()); } echo "<a href='" . $randomImageURL . "' title='" . gettext('Random picture...') . "'><img src='" . htmlspecialchars($randomImage->getCustomImage(NULL, $wide, $high, $wide, $high, NULL, NULL, !getOption('Watermark_head_image'))) . "' width={$wide} height={$high} alt=" . '"' . htmlspecialchars($randomAlt1, ENT_QUOTES) . ":\n" . htmlspecialchars($randomImage->getTitle(), ENT_QUOTES) . '" /></a>'; } echo '</div>'; }
function getLogo($biller) { $url = getURL(); if (!empty($biller['logo'])) { return $url . "/templates/invoices/logos/{$biller['logo']}"; } else { return $url . "/templates/invoices/logos/_default_blank_logo.png"; } }
function visitT_Heading($e) { static $list = array('', '<h3 id=\\"{$id}\\"><a href=\\"{$link}#{$id}\\"><span class=\\"sanchor\\">■</span></a> {$str}</h3>', '<h4 id=\\"{$id}\\">{$str}</h4>', '<h5 id=\\"{$id}\\">{$str}</h5>', '<h6 id=\\"{$id}\\">{$str}</h6>'); $level = $e->getlevel(); $id = 'id' . substr(md5($level . $e->getsource()), 0, 6); $link = getURL($e->getcontext()->pagename); $str = $e->getelem()->accept($this); return eval("return \"{$list[$level]}\";"); }
function getLogo($biller) { $url = getURL(); if(!empty($biller['logo'])) { return $url."/images/logos/$biller[logo]"; } else { return $url."/images/logos/_default_blank_logo.png"; } }
public function __construct(array $form = []) { $form += array('id' => 'form-module-manager', 'method' => 'post', 'action' => getURL('/module-manager/module')); $modules = array(); foreach (app()->getModules() as $module) { if (!$module->isHidden()) { $modules[$module->name()] = new ModuleInfo($module, $form['id']); } } ksort($modules); parent::__construct('manager.module.list', ['list' => $modules, 'form' => $form]); }
function smarty_function_online_payment_link($params, &$smarty) { global $LANG; global $siUrl; global $config; global $siUrl; $domain_id = domain_id::get($params['domain_id']); $url = getURL(); if (in_array("paypal", explode(",", $params['type']))) { $link = "<a \n href=\"https://www.paypal.com/xclick/?business=" . urlencode($params['business']) . "&item_name=" . urlencode($params['item_name']) . "&invoice=" . urlencode($params['invoice']) . "&amount=" . urlencode(number_format($params['amount'], 2, '.', '')) . "¤cy_code=" . urlencode($params['currency_code']) . "¬ify_url=" . urlencode($params['notify_url']) . "&return=" . urlencode($params['return_url']) . "&no_shipping=1&no_note=1&custom=domain_id:" . urlencode($domain_id) . "; \">"; if ($params['include_image'] == "true") { $link .= "<img border='0' src='" . urlsafe($url) . "/images/common/pay_with_paypal.gif'/>"; } else { $link .= htmlsafe($params['link_wording']); } $link .= "</a>"; echo $link; } if (in_array("eway_shared", explode(",", $params['type']))) { $link = "<a \n href=\"https://www.paypal.com/xclick/?business=" . urlencode($params['business'] . "\n &item_name=" . urlencode($params['item_name']) . "&invoice=" . urlencode($params['invoice']) . "\n &amount=" . urlencode(number_format($params['amount'], 2, '.', '')) . "¤cy_code=" . $params['currency_code']) . "\n &return=http://vcsweb.com.au&no_shipping=1&no_note=1\">"; if ($params['include_image'] == "true") { $link .= "<img border='0' src='" . urlsafe($url) . "/images/common/pay_with_eway.gif'/>"; } else { $link .= htmlsafe($params['link_wording']); } $link .= "</a>"; echo $link; } if (in_array("paymentsgateway", explode(",", $params['type']))) { // $today = date('Y-m-d',$x); /* $datetime1 = new DateTime('0001-01-01'); $datetime2 = new DateTime('now', new DateTimeZone('UTC')); $interval = $datetime1->diff($datetime2); //$interval->format('%a %h %i %s ') ; $seconds = ( $interval->format('%a') * 24 * 60 * 60) + ( $interval->format('%h') * 60 * 60 )+ ($interval->format('%i') * 60) + ( $interval->format('%s') ) ; */ //$time = time() + 62135596800; //$seconds = $time . '0000000'; //get biller secure trans key here // $hash_info = $params['api_id'] ."|1|1.0|". number_format($params['amount'], 2, '.', '') ."|". $seconds. "|". $params['invoice'] ; //$hash = hash_hmac('md5', $hash_info, $params['transaction_password']) ; $link = "<a \n href='https://swp.paymentsgateway.net/co/default.aspx?pg_api_login_id=" . urlencode($params['api_id']) . "&pg_billto_postal_name_company=" . urlencode($params['customer']['name']) . "&pg_version_number=1.0&pg_total_amount=" . urlencode(number_format($params['amount'], 2, '.', '')) . "&pg_transaction_order_number=" . urlencode($params['invoice']) . "&pg_billto_postal_name_first=" . urlencode($params['customer']['attention']) . "&pg_billto_postal_name_last=-&pg_billto_postal_street_line1=" . urlencode($params['customer']['street_address']) . "&pg_billto_postal_street_line2=" . urlencode($params['customer']['street_address2']) . "&pg_billto_postal_city=" . urlencode($params['customer']['city']) . "&pg_billto_postal_stateprov=" . urlencode($params['customer']['state']) . "&pg_billto_postal_postalcode=" . urlencode($params['customer']['zip_code']) . "&pg_billto_telecom_phone_number=" . urlencode($params['customer']['phone']) . "&pg_billto_online_email=" . $params['customer']['email'] . "&pg_consumerorderid=" . $params['invoice'] . "&pg_return_url=" . $siUrl . "/api-ach&pg_save_client=2'>"; if ($params['include_image'] == "true") { $link .= "<img border='0' src='" . urlsafe($url) . "/images/common/pay_with_ach.gif'/>"; } else { $link .= htmlsafe($params['link_wording']); } $link .= "</a>"; echo $link; } }
public static function isLoggedInFilter(Context $context) { if (session()->get('is_system_admin', false)) { if ($context->path() === '/module-manager/login') { redirect(getURL('/module-manager')); } } else { if ($context->path() !== '/module-manager/login') { redirect(getURL('/module-manager/login')); } } return true; }
public function get() { $messages = $this->getMessages(); if ($messages['hasErrors']) { $description = 'Fix all issues marked in red, then refresh this page.'; $button = ['link' => '', 'text' => 'Reload page']; } else { $description = 'Green light! You may proceed to the next step.'; $button = ['link' => getURL('/install/timezone'), 'text' => 'Next step']; } $jumbotron = ['title' => 'Verify requirements', 'description' => $description, 'logo' => asset('opis-colibri/system', 'opis-colibri.png'), 'button' => $button]; return ['title' => 'Requirements', 'content' => view('install.page.requirements', ['messages' => $messages['list'], 'jumbotron' => view('install.jumbotron', $jumbotron)])]; }
function doHeader($pageName) { echo ' <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content="' . $pageName . '"> <meta name="author" content="Eric Ghildyal"> <link rel="icon" href="../img/favicon.ico"> <title>' . $pageName . ' | ergh.co</title> <!-- Bootstrap core CSS --> <link href="http://ergh.co/new/css/bootstrap.min.css" rel="stylesheet"> <!-- Custom CSS --> <link href="http://ergh.co/new/css/custom.css" rel="stylesheet"> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <nav class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="' . getURL() . '">ergh.co</a> </div> <div id="navbar" class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li class=""><a href="' . getURL("aboutme.php", "content") . '">About Me</a></li> <li class=""><a href="' . getURL("blog.php") . '">Blog</a></li> </ul> </div><!--/.navbar-collapse --> </div> </nav> <div class="container"> '; }
public function login() { $this->title("Login"); $this->CSS("login", "users"); if (POST("connect")) { $this->Users_Controller = $this->controller("Users_Controller"); $this->Users_Controller->login("cpanel"); } else { $this->vars["URL"] = getURL(); $this->vars["view"] = $this->view("login", TRUE); } $this->render("include", $this->vars); $this->rendering("header", "footer"); }
public function enhanceTweet($tweet) { $imgs = array(); $links = findURLs($tweet['text']); foreach ($links as $link => $l) { if (is_array($l) && array_key_exists("host", $l) && array_key_exists("path", $l)) { $domain = domain($l['host']); $imgid = imgid($l['path']); if ($imgid) { if ($domain == "twitpic.com") { $imgs[$link] = "http://twitpic.com/show/thumb/" . $imgid; } if ($domain == "yfrog.com" || $domain == "yfrog.us") { $imgs[$link] = "http://yfrog.com/" . $imgid . ".th.jpg"; } if ($domain == "tweetphoto.com" || $domain == "pic.gd" || $domain == "plixi.com") { $imgs[$link] = "http://tweetphotoapi.com/api/TPAPI.svc/imagefromurl?size=thumbnail&url=" . $link; } if ($domain == "twitgoo.com") { $values = simplexml_load_string(getURL("http://twitgoo.com/api/message/info/" . $imgid)); $imgs[$link] = (string) $values->thumburl; } if ($domain == "img.ly") { $imgs[$link] = "http://img.ly/show/thumb/" . $imgid; } if ($domain == "pict.mobi") { $imgs[$link] = "http://pict.mobi/show/thumb/" . $imgid; } if ($domain == "imgur.com") { $imgs[$link] = "http://i.imgur.com/" . $imgid . "s.jpg"; } if ($domain == "twitvid.com") { $imgs[$link] = "http://images.twitvid.com/" . $imgid . ".jpg"; } if ($domain == "instagr.am") { $html = (string) getURL($link); preg_match('/<meta property="og:image" content="[^"]+"\\/>/i', $html, $matches); if (isset($matches[0])) { $imgs[$link] = substr($matches[0], 35, -3); } } } } } if (count($imgs) > 0) { $tweet['extra']['imgs'] = $imgs; } return $tweet; }
public function index() { //组装分享信息数组 $shareinfo = array('sharetitle' => "哈这里是分享标题可以自定义", 'sharedesc' => "这里是分享描述可以自定义", 'sharelink' => getURL(), 'shareimg' => 'http://res.eqxiu.com/group3/M00/39/B4/yq0KZFYA3dyADBSjAABdkK-lZ5w964.png'); //获得appid和appsecret $appId = C("appID"); $appSecret = C("appsecret"); //实例化对象Jssdk, $jssdk = new Jssdk($appId, $appSecret); //获得分享功能数组 $data = $jssdk->getSignPackage(); //组装视图所需要的必要信息 $this->assign('signPackage', array_merge($shareinfo, $data)); //展示视图,具有分享功能的视图需要用到公共视图,具体参见实例 $this->display('share'); }
function content_4efca472c71d8($_smarty_tpl) { ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><?php echo $_smarty_tpl->tpl_vars['Title']->value; ?> </title> </head> <body> ===== <?php echo getURL(array(), $_smarty_tpl); ?> <?php echo C(array('cStr' => 'db_host'), $_smarty_tpl); ?> ======= <?php $_smarty_tpl->tpl_vars['rows'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['rows']->_loop = false; $_from = $_smarty_tpl->tpl_vars['list']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['rows']->key => $_smarty_tpl->tpl_vars['rows']->value) { $_smarty_tpl->tpl_vars['rows']->_loop = true; ?> <li><?php echo $_smarty_tpl->tpl_vars['rows']->value["title"]; ?> </li> <?php } ?> </body> </html> <?php }
function GetPiecesList() { global $Get, $CurrentCompany, $Lang, $nsUser; $InCampArr = array(); $Query = "\n\t\tSELECT \n\t\t\tTCP.*,\n\t\t\tTST.ID AS SPLIT_TEST\n\t\t\tFROM " . PFX . "_tracker_camp_piece TCP\n\t\t\tINNER JOIN " . PFX . "_tracker_split_test TST\n\t\t\t\tON TST.SUB_ID=TCP.ID\n\t\t\tWHERE TST.COMPANY_ID=" . $CurrentCompany->ID . "\n\t\t\tORDER BY TCP.NAME\n\t"; $Sql = new Query($Query); $Sql->ReadSkinConfig(); while ($Row = $Sql->Row()) { if (!$Row->COMPANY_ID) { continue; } $Row->NAME = stripslashes($Row->NAME); $Row->DESCRIPTION = stripslashes($Row->DESCRIPTION); $Row->_EDITLINK = getURL("split_test", "EditId=" . $Row->ID); $Row->_CODELINK = getURL("campaign_link", "SplitId=" . $Row->ID); $Row->_DELETELINK = getURL("split_test", "DeleteId=" . $Row->ID); //$Row->_TYPE=$Lang['SplitTest']; $Row->_STAT_LINK = getURL("split_test", "SplitId=" . $Row->ID, "report"); $Row->Report = new SplitStat_v2(); $Row->Report->SplitId = $Row->ID; $Row->Report->CpId = $Row->COMPANY_ID; $Row->Report->DisableAll(); if ($nsUser->Columns->CLICKS) { $Row->Report->ShowVisitors = true; } if ($nsUser->Columns->CONVERSIONS) { $Row->Report->ShowActionConv = true; } if ($nsUser->Columns->CONVERSIONS) { $Row->Report->ShowSaleConv = true; } $Row->Report->Calculate(); $Row->SplitStat =& $Row->Report->SplitStat; $Row->_STYLE = $Sql->_STYLE; $InCampArr[$Sql->Position] = $Row; $PrevRow =& $InCampArr[$Sql->Position]; } if (count($InCampArr) > 0) { return $InCampArr; } else { return false; } }
function webInfo() { include_once 'url.php'; //$baseURL $baseURL = getURL(); $file = 'webInfo.json'; $webInfo_json = file_get_contents($file); $teamInfo_json = file_get_contents('teamInfo.json'); $obj_Arr = json_decode($webInfo_json, true); $obj2_Arr = json_decode($teamInfo_json, true); $logo = $baseURL . $obj_Arr['result']['Logo']; $img = $baseURL . $obj_Arr['result']['HeadImg']; $obj_Arr['result']['Logo'] = $logo; $obj_Arr['result']['HeadImg'] = $img; $obj_Arr['result']['TeamIntr'] = $obj2_Arr['result']['Intr']; $obj_Arr['result']['TeamURL'] = $obj2_Arr['result']['FileURL']; $json = json_encode($obj_Arr); $this->_setHeader(); echo $json; }
public function do_url() { //numはフィードに含める項目数。 //GET引数でrecent(>0)が与えられればnumとして採用。そうでなければnum=15とする。 $num = isset(Vars::$get['recent']) && Vars::$get['recent'] > 0 ? (int) Vars::$get['recent'] : 15; $db = DataBase::getinstance(); $query = "SELECT pagename,timestamp FROM page"; //GET引数に正規表現exp(またはワイルドカードパターンinclude)が設定され、 //かつ空でないなら、exp(またはinclude)と一致するページだけを検索。 if (isset(Vars::$get['exp']) && trim(Vars::$get['exp']) != '') { $_inc = $db->escape(Vars::$get['exp']); $query .= " WHERE php('mb_ereg', '{$_inc}', pagename)"; } else { if (isset(Vars::$get['include']) && trim(Vars::$get['include']) != '') { $_inc = $db->escape(glob2ereg(Vars::$get['include'])); $query .= " WHERE php('mb_ereg', '{$_inc}', pagename)"; } } $query .= " ORDER BY timestamp DESC, pagename ASC LIMIT {$num}"; $result = $db->query($query); $list = array(); while ($row = $db->fetch($result)) { $item['timestamp'] = $row['timestamp']; $item['pagename'] = $row['pagename']; $_p = Page::getinstance($row['pagename']); $item['url'] = getURL($_p); $item['description'] = htmlspecialchars(convert_Page($_p)); $list[] = $item; } $smarty = $this->getSmarty(); $smarty->assign('list', $list); $smarty->assign('rssurl', SCRIPTURL . '?' . htmlspecialchars($_SERVER['QUERY_STRING'])); $smarty->assign('sitename', SITENAME); $smarty->assign('baseurl', SCRIPTURL); header('Content-Type: application/xml; charset=UTF-8'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $item['timestamp'][0]) . ' GMT'); $smarty->display('rss20.tpl.htm'); exit; }
public function enhanceTweet($tweet) { $imgs = array(); $links = findURLs($tweet['text']); foreach ($links as $link => $l) { if (is_array($l) && array_key_exists("host", $l) && array_key_exists("path", $l)) { $domain = domain($l['host']); $imgid = imgid($l['path']); if ($imgid) { if ($domain == "twitpic.com") { $imgs[$link] = "http://twitpic.com/show/thumb/" . $imgid; } if ($domain == "yfrog.com") { $imgs[$link] = "http://yfrog.com/" . $imgid . ".th.jpg"; } if ($domain == "tweetphoto.com" || $domain == "pic.gd") { $imgs[$link] = "http://tweetphotoapi.com/api/TPAPI.svc/imagefromurl?size=thumbnail&url=" . $link; } if ($domain == "twitgoo.com") { $values = simplexml_load_string(getURL("http://twitgoo.com/api/message/info/" . $imgid)); $imgs[$link] = (string) $values->thumburl; } if ($domain == "img.ly") { $imgs[$link] = "http://img.ly/show/thumb/" . $imgid; } if ($domain == "imgur.com") { $imgs[$link] = "http://i.imgur.com/" . $imgid . "s.jpg"; } if ($domain == "twitvid.com") { $imgs[$link] = "http://images.twitvid.com/" . $imgid . ".jpg"; } } } } if (count($imgs) > 0) { $tweet['extra']['imgs'] = $imgs; } return $tweet; }
public function query($path, $format = "json", $auth = NULL, $ssl = true) { $format = mb_strtolower(trim($format)); $path = ltrim($path, "/"); if ($format != "xml" && $format != "json") { return false; } $url = "http" . ($ssl ? "s" : "") . "://api.twitter.com/" . $path; $file = ""; do { if ($file != "") { sleep(2); } // Wait two secs if we got a failwhale $file = getURL($url, $auth); if (is_array($file)) { return $file; } // Error } while (($format == "xml" && mb_substr($file, 0, 2) != "<?" || $format == "json" && !in_array(mb_substr($file, 0, 1), array("[", "{"))) && mb_substr_count(mb_strtolower($file), "over capacity") > 0); if ($format == "xml") { $data = simplexml_load_string($file); if (!empty($data->error)) { die($data->error); } return $data; } if ($format == "json") { // Prevent issues with long ints on 32-bit systems $file = preg_replace("/\"([a-z_]+_)?id\":(\\d+)(,|\\}|\\])/", "\"\$1id\":\"\$2\"\$3", $file); $data = json_decode($file); if (!empty($data->error)) { die($data->error); } return $data; } return false; }
function dbConnect() { try { if (strpos(getURL(), 'http://localhost') !== false) { $DB_SERVER = "localhost"; $DB_USER = "******"; $DB_PASSWORD = "******"; $DB = "pigeon"; } else { $DB_SERVER = "TSLMS.db.7752695.hostedresource.com"; $DB_USER = "******"; $DB_PASSWORD = "******"; $DB = "TSLMS"; } $db = mysql_connect($DB_SERVER, $DB_USER, $DB_PASSWORD); if ($db) { mysql_select_db($DB, $db); } return $db; } catch (Exception $ex) { echo "Warning Message:" . $ex->getMessage(); } }
function dbConnect() { try { if (strpos(getURL(), 'http://localhost') !== false) { $DB_SERVER = "localhost"; $DB_USER = "******"; $DB_PASSWORD = "******"; $DB = "camfox"; } else { $DB_SERVER = "tentinternal.db.7752695.hostedresource.com"; $DB_USER = "******"; $DB_PASSWORD = "******"; $DB = "tentinternal"; } $db = mysql_connect($DB_SERVER, $DB_USER, $DB_PASSWORD); if ($db) { mysql_select_db($DB, $db); } return $db; } catch (Exception $ex) { echo "Warning Message:" . $ex->getMessage(); } }
public function post() { $modules = request()->post('module', []); if (!is_array($modules)) { redirect(getURL('/module-manager')); } foreach ($modules as $module => $action) { if (!in_array($action, array('enable', 'disable', 'install', 'uninstall'))) { continue; } $module = getModule($module); if (!$module->exists()) { continue; } if ($module->{$action}()) { $text = r('Module <stron>@module</strong> was @action', ['module' => $module->name(), 'action' => t($action . 'd')]); System::alerts()->success($text); } else { $text = r('Module <stron>@module</strong> could not be @action', array('module' => $module->name(), 'action' => t($action . 'd'))); System::alerts()->error($text); } } redirect(getURL('/module-manager')); }
protected function getMenu() { return view('manager.menu', ['links' => ['Home' => ['class' => 'fa fa-home fa-lg', 'title' => t('Back to site'), 'href' => getURL('/')], 'Settings' => ['class' => 'fa fa-wrench fa-lg', 'title' => t('Account setup'), 'href' => getURL('/module-manager/setup')]], 'action' => getURL('/module-manager'), 'collect' => true, 'is_system_admin' => true]); }