function b_categories_list_show($options) { include_once XOOPS_ROOT_PATH . "/modules/smartpartner/include/common.php"; $smartpartner_category_handler =& smartpartner_gethandler('category'); $criteria = new CriteriaCompo(); $criteria->setSort(isset($options[0]) ? $options[0] : 'name'); $criteria->setOrder(isset($options[1]) ? $options[1] : 'ASC'); $catsObj =& $smartpartner_category_handler->getobjects($criteria, true); $catArray = get_content(0, $catsObj, $options[2]); $block = array(); $block['categories'] = $catArray; $block['displaysubs'] = $options[2]; if (isset($_GET['view_category_id'])) { $current_id = $_GET['view_category_id']; $block['current'] = $catsObj[$current_id]->getVar('parentid') == 0 ? $current_id : $catsObj[$current_id]->getVar('parentid'); } elseif (isset($_GET['id'])) { $smartpartner_partner_handler =& smartpartner_gethandler('partner'); $partnerObj = $smartpartner_partner_handler->get($_GET['id']); if (is_object($partnerObj)) { $parent = $partnerObj->getVar('categoryid'); $block['current'] = $catsObj[$parent]->getVar('parentid') == 0 ? $parent : $catsObj[$parent]->getVar('parentid'); } } return $block; }
function get_files() { global $app_g_API_URL; $apcontinue = ""; $cnt = 0; do { if (empty($apcontinue)) { $postdata = http_build_query(array('action' => 'query', 'list' => 'allpages', 'apnamespace' => 6, 'aplimit' => 500, 'format' => 'json')); } else { $postdata = http_build_query(array('action' => 'query', 'list' => 'allpages', 'apnamespace' => 6, 'aplimit' => 500, 'apcontinue' => $apcontinue, 'format' => 'json')); } $content = json_decode(file_get_contents($app_g_API_URL . "?" . $postdata)); $data = $content->{'query'}->{'allpages'}; $cnt = 0; foreach ($data as &$value) { $pageid = $value->{'pageid'}; $title = $value->{'title'}; $credit = get_content($pageid); if ($cnt > 0) { print ","; } print "{\"pageid\":" . $pageid . ",\"title\":\"" . $title . "\",\"credit\":\"" . $credit . "\"}"; } if (isset($content->{'query-continue'})) { $apcontinue = json_encode($content->{'query-continue'}->{'allpages'}->{'apcontinue'}); $apcontinue = substr($apcontinue, 1, strlen($apcontinue) - 2); } else { $apcontinue = ""; } $cnt++; } while (!empty($apcontinue) && !is_null($apcontinue)); return null; }
function get_seo_info($domain, $selects, $pn) { global $ROBOT; $content = ''; $site_info = ''; $domain = $domain . "&lm=" . $selects; $content1 = get_content($ROBOT['site_url'] . $domain . "&pn=" . $pn); if (empty($content1)) { return 'Unkown Error...'; } $table = "/<table cellpadding=\"0\" cellspacing=\"0\" class=\"result\" id=\"(.*)\">(.*)<\\/table><br>/is"; preg_match($table, $content1, $arr); $con = $arr[0]; if (preg_match($ROBOT['site_pattern'], $content1, $matches)) { $site_info = $matches[1]; } preg_match_all('/\\d/', $site_info, $dd); $count = ''; for ($m = 0; $m < sizeof($dd[0]); $m++) { $count .= $dd[0][$m]; } $firstpage = 0; $lastpage = (ceil($count / 10) - 1) * 10; $nextpage = $pn == $lastpage ? $lastpage : $pn + 10; $pregpage = $pn == $firstpage ? 0 : $pn - 10; if ($count > 10) { $co = get_content($ROBOT['site_url'] . $domain . "&pn=" . $count); $di = "/<div class=\"p\">(.*)<\\/div>/Uis"; preg_match($di, $co, $art); preg_match_all('/[\\d]+/', $art[0], $www); $con3 = page_slice(max($www[0]) + 20, $pn / 10 + 1, 10, 'baidu.php?domain=' . $domain); } return $con3 . '<table><tr><td>百度总收录: <a href="' . $ROBOT['site_url'] . $domain . '" target="_blank">' . $site_info . '</a>个页面具体页面如下:<br/><hr/></td></tr><tr><td>' . $con . '</td></tr></table>' . $con3; }
/** * GET FACEBOOK INFOS * Use public API https://graph.facebook.com/ * Use get_content function above */ function get_facebook_infos($id) { $url = 'https://graph.facebook.com/'; $data = array('id' => $id); $url .= '?' . http_build_query($data); return get_content($url); }
function get_seo_info($domain, $selects, $start) { global $ROBOT; $site_info = ''; $domain = $domain . "&tbs=qdr:" . $selects; $content1 = get_content($ROBOT['site_url'] . $domain . "&start=" . $start); if (empty($content1)) { return 'Unkown Error...'; } $li = "/<li class=g>(.*)<\\/span><\\/span><\\/div>/is"; preg_match($li, $content1, $arr); $con = $arr[0]; if (preg_match($ROBOT['site_pattern'], $content1, $matches)) { $site_info = $matches[1]; } preg_match_all('/\\d/', $site_info, $dd); $count = ''; for ($m = 0; $m < sizeof($dd[0]); $m++) { $count .= $dd[0][$m]; } if ($count > 10) { $con3 = "<a href=google.php?domain=" . $domain . "&start=0>[1]</a> <a href=google.php?domain=" . $domain . "&start=10>[2]</a> <a href=google.php?domain=" . $domain . "&start=20>[3]</a> <a href=google.php?domain=" . $domain . "&start=30>[4]</a> <a href=google.php?domain=" . $domain . "&start=40>[5]</a> <a href=google.php?domain=" . $domain . "&start=50>[6]</a> <a href=google.php?domain=" . $domain . "&start=60>[7]</a> <a href=google.php?domain=" . $domain . "&start=70>[8]</a> <a href=google.php?domain=" . $domain . "&start=80>[9]</a> <a href=google.php?domain=" . $domain . "&start=90>[10]</a>"; } $site_info = $site_info ? $site_info : '0'; return $con3 . '<br/>¹È¸èÕÒµ½: <a href="' . $ROBOT['site_url'] . $domain . '" target="_blank">' . $site_info . '</a>Ìõ¼Ç¼<br/><hr/>' . $con . '<br/>' . $con3; }
public function testPages() { $params = array('title' => 'My test page', 'content_type' => 'page', 'is_active' => 1); //saving $parent_page = save_content($params); $page_link = content_link($parent_page); $params = array('title' => 'My test sub page', 'content_type' => 'page', 'parent' => $parent_page, 'is_active' => 1); $sub_page = save_content($params); //getting $params = array('parent' => $parent_page, 'content_type' => 'page', 'single' => true, 'is_active' => 1); $get_sub_page = get_content($params); $sub_page_parents = content_parents($get_sub_page['id']); //clean $delete_parent = delete_content($parent_page); $delete_sub_page = delete_content($sub_page); //PHPUnit $this->assertEquals(true, in_array($parent_page, $sub_page_parents)); $this->assertEquals(true, strval($page_link) != ''); $this->assertEquals(true, intval($parent_page) > 0); $this->assertEquals(true, intval($sub_page) > 0); $this->assertEquals(true, is_array($get_sub_page)); $this->assertEquals(true, is_array($delete_parent)); $this->assertEquals(true, is_array($delete_sub_page)); $this->assertEquals('My test sub page', $get_sub_page['title']); $this->assertEquals($sub_page, $get_sub_page['id']); }
function getImage($track_uri) { $url = "https://embed.spotify.com/oembed/index.php?url=" . $track_uri . "&format=json"; echo $url; $output = get_content($url); $output = json_decode($output, true); return $output['thumbnail_url']; }
function find_content($parent, $name) { $nodes = $parent->child_nodes(); while ($node = array_shift($nodes)) { if ($node->node_name() == $name) { return undo_html_format(urldecode(get_content($node))); } } return ""; }
function main_menu() { global $TABLE_PREFIX, $CURUSER, $tpl; $blocks = get_result('SELECT content FROM ' . $TABLE_PREFIX . 'blocks WHERE position="t" AND status=1 AND ' . $CURUSER['id_level'] . '>=minclassview AND ' . $CURUSER['id_level'] . '<=maxclassview ' . ($FORUMLINK == '' || $FORUMLINK == 'internal' || substr($FORUMLINK, 0, 3) == 'smf' || $FORUMLINK == 'ipb' ? '' : ' AND content!="forum"') . ' ORDER BY sortid', true, $CACHE_DURATION); $return = ''; foreach ($blocks as $entry) { $return .= get_content(realpath(dirname(__FILE__) . '/..') . '/blocks/' . $entry['content'] . '_block.php'); } return set_block('', 'justify', $return); }
function get_content_end($urlTipi, $turu = "content") { if ($turu == "content") { $con = "<h1>" . get_info("categories", $urlTipi, "Category") . "</h1>\n"; $con .= get_category_content($urlTipi) . "\n"; } else { $con = "<h1>" . get_info("contents", $urlTipi, "Title") . "</h1>\n"; $con .= get_content($urlTipi) . "\n"; } return $con; }
function update_news($url, $article_id) { global $db, $prefix; $news = array(); $html = @file_get_contents($url); $news['pub_date'] = get_content($html, ' ', '.0'); $news['content'] = get_tag_contents($html, 'div', '<div id="fontZoom">'); $db->update($prefix . 'article', $news, array('article_id' => $article_id)); //print_r($news); echo $url . ' 入库完毕<br />'; //die(); }
/** * get_notice_data returns the value of a specific field for a given page id * * @param string $notice page id * @param string $field name of the field * * @return string */ function get_notice_data($notice, $field) { $value = 'undefined'; $content = get_content($notice); $pattern = "/" . $field . "/"; $data = preg_grep($pattern, explode("\n", $content)); foreach ($data as &$value) { $value = ereg_replace("^[^=]*=", "", $value); break; } return $value; }
function get_seo_info($domain, $bot, $pn, $keys, $v, $output, $rn) { global $ROBOT; if (!array_key_exists($bot, $ROBOT)) { return 'Invalid Robot'; } $content = ''; $site_info = ''; $kws = ''; $kw = $sm = array(); $content1 = get_content($ROBOT[$bot]['site_url']); if (empty($content1)) { return 'Unkown Error...'; } $domain2 = substr($domain, 0, 4) == 'www.' ? substr($domain, 4) : $domain; if ($bot == "baidu") { $c1 = "/<table (border=\"0\")?(\\s)?cellpadding=\"0\" cellspacing=\"0\" class=\"result\" id=\"(.*)\">(.*)<\\/table><br>/Uis"; $c2 = "/<font color=\"#008000\">(.*)<\\/font>/Uis"; preg_match_all($c1, $content1, $arr1); for ($wu = 0; $wu < sizeof($arr1[0]); $wu++) { preg_match_all($c2, $arr1[0][$wu], $arr2); array_push($sm, $arr2[1][0]); } $con1 = $arr1[0]; $con2 = $sm; } else { $c1 = "/<li class=g(.*)?>(.*)<\\/div>/Uis"; $c2 = "/<span class=f><cite>(.*)<\\/cite>/Uis"; preg_match_all($c1, $content1, $arr1); preg_match_all($c2, $content1, $arr2); $con1 = $arr1[2]; $con2 = $arr2[1]; } for ($i = 0; $i < sizeof($con1); $i++) { $con2[$i] = str_replace("</b>", "", $con2[$i]); $conn[$i] = explode("/", $con2[$i]); if (strpos($conn[$i][0], $domain2, 0) !== false) { $kw[$i] = $con1[$i]; } } foreach ($kw as $key => $val) { $kws .= "第<font color=red> " . ($key + 1 + $pn) . " </font>个出现<br/>" . $val; } if (@preg_match($ROBOT[$bot]['site_pattern'], $content1, $matches)) { $site_info = $matches[1]; } $domain1 = "keys.php?domain=" . $domain . "&keys=" . $output . "&val=" . $v . "&rn=" . $rn; $cons = "排名:<a href=" . $domain1 . "&pn=0>1-" . $rn . "</a> <a href=" . $domain1 . "&pn=" . $rn * 1 . ">" . ($rn * 1 + 1) . "-" . $rn * 2 . "</a> <a href=" . $domain1 . "&pn=" . $rn * 2 . ">" . ($rn * 2 + 1) . "-" . $rn * 3 . "</a> <a href=" . $domain1 . "&pn=" . $rn * 3 . ">" . ($rn * 3 + 1) . "-" . $rn * 4 . "</a> <a href=" . $domain1 . "&pn=" . $rn * 4 . ">" . ($rn * 4 + 1) . "-" . $rn * 5 . "</a> <a href=" . $domain1 . "&pn=" . $rn * 5 . ">" . ($rn * 5 + 1) . "-" . $rn * 6 . "</a> <a href=" . $domain1 . "&pn=" . $rn * 6 . ">" . ($rn * 6 + 1) . "-" . $rn * 7 . "</a> <a href=" . $domain1 . "&pn=" . $rn * 7 . ">" . ($rn * 7 + 1) . "-" . $rn * 8 . "</a>"; $deta = "<font color=red>关键字</font> " . $keys . " <font color=red>在网站</font> " . $domain . " <font color=red>的</font> " . $bot . " <font color=red>收录结果</font> " . ($pn + 1) . "-" . ($pn + $rn) . " <font color=red>名中有</font> " . sizeof($kw) . " <font color=red>条记录</font>"; return $text = $cons . "<br/>" . $deta . "<br/>" . $kws; }
public function product($id) { $FxProduct = M('FxProduct'); $map = array('product_id' => $id); $product_info = $FxProduct->where($map)->find(); if (empty($product_info)) { $this->redirect('index'); } $product_info['images'] = unserialize($product_info['images']); $product_info['content'] = get_content($product_info['content']); // print_r($product_info); $this->assign('info', $product_info); $this->display(); }
function account_data($email) { static $_cache = array(); if (isset($_cache[$email])) { return $_cache[$email]; } if (!account_exists($email)) { return $_cache[$email] = null; } $content = get_content(account_file($email)); if (!$content) { return null; } return $_cache[$email] = json_decode($content, true); }
function print_admin_panel($page) { global $domain; if (!isset($_SESSION['username'])) { $username = ""; } else { $username = $_SESSION['username']; } echo '<script src="http://' . getLocalPath() . '/admin.js"></script>'; echo "<h1>Admin Panel</h1>\n Welcome " . htmlspecialchars($username) . "<br>"; echo "Your balance is: \$" . get_fed_balance(); //<li><a href=\"".$domain."admin/panel.php?page=transfer_internal_funds\">Transfer Internal User Funds</a></li> echo "<h2>Welcome to the Admin Panel</h2>\n Add the twitter feed here to see user feedback.<br />\n <ul>\n <li><a href=\"" . $domain . "admin/panel.php?page=add_user\">Add User</a></li>\n <li><a href=\"" . $domain . "admin/panel.php?page=change_fed_password\">Change Fed Password</a></li>\n <li><a href=\"" . $domain . "admin/panel.php?page=change_fed_pin\">Change Fed PIN</a></li>\n <li><a href=\"" . $domain . "admin/panel.php?page=transfer_to_bank\">Transfer Money to Other Bank</a></li>\n Transfers to external accounts must not exceed the bank's balance in the fed.\n Transfers to other banks must not exceed \$5000 within a 30 minute period.\n <li><a href=\"" . $domain . "admin/panel.php?page=view_account_funds\">View Internal User Funds</a></li>\n <li><a href=\"" . $domain . "admin/panel.php?page=view_transactions\">View Transaction List</a></li>\n <li><a href=\"" . $domain . "admin/panel.php?page=pay_bill\">Pay Bill</a></li>\n <li><a href=\"" . $domain . "admin/panel.php?page=change_page\">Modify Page</a></li>\n <li><a href=\"" . $domain . "admin/panel.php?page=change_local_password\">Change My Local Password</a></li>\n </ul>\n <div id=\"admin_content\">"; get_content($page); echo "</div>\n"; }
function get_seo_info($domain, $che) { global $ROBOT; $che = explode(',', $che); $ch = array_combine($che, $che); $content = ''; $site_info = ''; $link_info = ''; $jobs = array(); $jobs[1] = "baidu"; $jobs[2] = "google"; $jobs[3] = "yahoo"; $jobs[4] = "soso"; $jobs[5] = "vnet"; $jobs[6] = "so163"; $jobs[7] = "sogou"; $a = '<table border=1 width=100% bordercolordark=#FFFFFF cellspacing=0 cellpadding=0 bordercolorlight=#BBD7E6> <tr bgcolor=#D8F0FC><td colspan=9>网址<a href=http://' . $domain . ' target=_blank>http://' . $domain . '</a>在各大搜索引擎的收录查询结果</td></tr><tr><td>搜索引擎</td>'; for ($i = 1; $i <= sizeof($jobs); $i++) { if ($ch[$i]) { $a .= "<td>" . $ROBOT[$jobs[$i]]['name'] . "</td>"; } } $a .= "</tr><tr><td>收录数量</td>"; for ($i = 1; $i <= sizeof($jobs); $i++) { if ($ch[$i]) { eval('$__file__=__FILE__;'); define('ROOT_PATH', $__file__ ? dirname($__file__) . '/' : './'); $content[$i] = get_content($ROBOT[$jobs[$i]]['site_url'] . $domain); if ($i == 3 || $i == 5 || $i == 6) { require_once 'require/chinese.php'; $chs = new Chinese('utf-8', 'GB2312'); $content[$i] = $chs->Convert($content[$i]); } if (empty($content[$i])) { return 'Unkown Error...'; } if (preg_match($ROBOT[$jobs[$i]]['site_pattern'], $content[$i], $matches[$i])) { $site_info[$i] = $matches[$i][1]; } $site_info[$i] = $site_info[$i] ? $site_info[$i] : '--'; $a .= '<td><a href="' . $ROBOT[$jobs[$i]]['site_url'] . $domain . '" target="_blank">' . $site_info[$i] . '</a></td>'; } } $a .= "</tr><tr><td>相关查询</td><td colspan=7 align=left><a href=../ip/index.php?domain=" . $domain . " target=_blank>IP地址查询</a> <a href=../pr/pr.php?domain=" . $domain . " target=_blank>PR查询</a> <a href=../whois/index.php?domain=" . $domain . " target=_blank>域名Whois查询</a> <a href=/alexa target=_blank>Alexa排名查询</a> <a href=../friends/friends.php?domain=" . $domain . " target=_blank>友情链接查询</a> <a href=../friendlink/friendlink.php?domain=" . $domain . " target=_blank>友情链接IP查询</a></td></tr></table>"; return $a; }
function load_data($lemmata) { if (!empty($lemmata['lemmata'])) { $lemmata = $lemmata['lemmata']; $lemmata = str_replace(["\r\n", "\r", "\n"], "\n", $lemmata); $lemmata = explode("\n", $lemmata); $lemmata = array_map('trim', $lemmata); $lemmata = array_map('urlencode', $lemmata); foreach ($lemmata as $lemma) { $html = get_content($lemma); if (false !== $html) { echo extract_content($html); flush(); } } } }
function update_sight($url) { global $db, $prefix; $sight['add_time'] = date('Y-m-d H:i:s'); $html = @file_get_contents('http://destguides.ctrip.com/' . $url); $html = mb_convert_encoding($html, 'UTF-8', 'GBK'); $name = get_content($html, ' <em>', ' </em>'); $sight['name'] = $name; $name = str_replace(array('(', ')'), array('\\(', '\\)'), $name); //echo '#<img src="(.*?)" alt="'.$name.'" />#i'; //die(); preg_match('#<img src="(.*?)" alt="' . $name . '" />#i', $html, $matches); $sight['pic'] = $matches[1] ? $matches[1] : ''; $content = get_tag_contents($html, 'div', '<div class="block12">'); $sight['content'] = preg_replace('#[\\r\\n]{2,}#i', '<br />', trim(strip_tags($content))); //echo preg_replace('#(<br />){2,}#i', '<br />', nl2br(trim(strip_tags($content)))); $db->update($prefix . 'sight', $sight, array('url' => $url)); echo $sight['name'] . ' 更新完毕<br />'; }
function kirimquo($id, $email) { // setting nama file attachment $namafile = ".pdf"; // MIME type file PDF sbg attachment $fileType = "application/x-pdf"; // setting pesan intro di email //click <a href="'.site_url("gudang/accept_inv/".$kdbrang."/".$qlast).'">here</a> to konfrim $introPesan = ''; $fileContent = get_content(site_url('gudang/createpdf//')); // membuat attachment di email $semi_rand = md5(time()); $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; $headers = "MIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\""; $pesan = "This is a multi-part message in MIME format.\n\n" . "--{$mime_boundary}\n" . "Content-Type: text/html; charset=\"iso-8859-1\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $introPesan . "\n\n"; $data = chunk_split(base64_encode($fileContent)); $pesan .= "--{$mime_boundary}\n" . "Content-Type: {$fileType};\n" . " name=\"{$namafile}\"\n" . "Content-Disposition: attachment;\n" . " filename=\"{$namafile}\"\n" . "Content-Transfer-Encoding: base64\n\n" . $data . "\n\n" . "--{$mime_boundary}--\n"; // proses mengirim email dengan attachment mail($email, "JVM Service", $pesan, $headers); }
function ngps_article_lookup($article_id, $return = 'title') { // Pull an article, take its pieces. Sometimes we just want the title, sometimes we want more. $url = 'http://www.mercurynews.com/portlet/article/html/fragments/print_article.jsp?articleId=' . $article_id . '&siteId=36'; $content = get_content($url); preg_match('/<td class="articleTitle">([^<]+)<\\/td>/', $content, $matches); $article['title'] = $matches[1]; if ($return == 'title') { return $matches[1]; } // Line-endings in regex's are the tool of the devil. $content = str_replace("\n", '', $content); $content = str_replace('&', '&', $content); preg_match('/<td class="articleBody">(.*)<\\/td><\\/tr><tr><td>/', $content, $matches); if (count($matches) == 0) { return false; } $article['body'] = $matches[1]; return $article; }
function kirimEmail($email) { // setting nama file attachment $namafile = "Pesanan.pdf"; // MIME type file PDF sbg attachment $fileType = "application/x-pdf"; // setting pesan intro di email $introPesan = "Terimakasih sudah melakukan Pesanan. Bukti Pesanan ada di attachment email ini, silakan disimpan."; // membaca isi file pdf Pesanan berdasarkan id // yang dihasilkan oleh script pdf.php $fileContent = get_content(get_template_directory() . '/inc/fpdf/pdf.php'); // membuat attachment di email $semi_rand = md5(time()); $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; $headers = "MIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\""; $pesan = "This is a multi-part message in MIME format.\n\n" . "--{$mime_boundary}\n" . "Content-Type: text/html; charset=\"iso-8859-1\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $introPesan . "\n\n"; $data = chunk_split(base64_encode($fileContent)); $pesan .= "--{$mime_boundary}\n" . "Content-Type: {$fileType};\n" . " name=\"{$namafile}\"\n" . "Content-Disposition: attachment;\n" . " filename=\"{$namafile}\"\n" . "Content-Transfer-Encoding: base64\n\n" . $data . "\n\n" . "--{$mime_boundary}--\n"; // proses mengirim email dengan attachment mail($email, "Konfirmasi Pesanan", $pesan, $headers); }
function show_content($language, $str_type, $i_number) { $str_return = (string) ''; get_content($language, $str_type, $i_number); if ('German' != $language && 'English' != $language) { $str_language_folder = 'English'; } else { $str_language_folder = $language; } if (isset($GLOBALS[$str_type . '_' . $i_number]) && is_array($GLOBALS[$str_type . '_' . $i_number])) { switch ($str_type) { case 'ad': foreach ($GLOBALS[$str_type . '_' . $i_number] as $arr_data) { $str_image_path = '../' . $str_language_folder . '/' . $str_type . '-' . $i_number . '/' . $arr_data['str_image']; $arr_imagesize = (array) getimagesize($str_image_path); $str_return .= '<a href="' . $arr_data['str_url'] . '" target="_blank"><img src="' . $str_image_path . '" ' . $arr_imagesize[3] . ' alt="" /></a><br/><br/>'; } break; case 'news': $str_return .= '<ul class="news">'; foreach ($GLOBALS[$str_type . '_' . $i_number] as $arr_data) { if (!empty($arr_data['str_url'])) { $str_link_start = (string) '<a href="' . $arr_data['str_url'] . '" target="_blank">'; $str_link_end = (string) '</a>'; } else { $str_link_start = (string) ''; $str_link_end = (string) ''; } $str_return .= '<li><div class="headline">' . $str_link_start . htmlspecialchars($arr_data['str_headline']) . $str_link_end . '</div>' . (!empty($arr_data['str_text']) ? htmlspecialchars($arr_data['str_text']) : '') . '</li>'; } $str_return .= '</ul>'; break; } } return $str_return; }
'); fbBrowse('/');" src="/filebrowser/images/icon_home.gif" alt="Home" title="Home" /> </td> <td><b><?php echo $path; ?> </b></td> <td class="fbClose" align="right"> <img onClick="jQuery('#fbBrowser').fadeOut();" border="0" src="/filebrowser/images/icon_cancel.gif" alt="Close" title="Close" /> </td> </tr> <tr> <td id="fbCurrentDir" colspan="3" class="vexpl" align="left"> <?php // ----- read contents ----- if (is_dir($path)) { list($dirs, $files) = get_content($path); ?> </td> </tr> <?php } else { ?> Directory does not exist. </td> </tr> </table> <?php exit; } // ----- directories -----
{ $specification_back_url = $_SESSION['specification_back_url']; unlink($_SESSION['specification_back_url']); header('Location:'.$specification_back_url); exit; } if(!isset($_SESSION['specification_back_url'])) $_SESSION['specification_back_url'] = $_SERVER['HTTP_REFERER']; $path = 'agreement/agreements_templates/specification.tpl'; if(isset($_POST['submit_ok'])) { put_content($path,$_POST['page_content']); } $page_content = get_content($path); //$page_content = strip_tags($page_content,'<p><span><table><tr><td><tbody><div><strong><br /><br>'); include ('../../skins/tpl/admin/order_manager/agreement/tinymse_js_block.html'); ?> <div style="margin:auto;width:1200px;"> <div style="margin:10px 20px;"> <button type="button" onclick="location = '?<?php echo addOrReplaceGetOnURL('go_back=yes'); ?>';" style="cursor:pointer;">назад</button> </div> <div style="margin:0px 20px;"> <form action="" method="post"> <textarea id='elm1' name='page_content' style="width:1150px; height:600px;"><?php echo $page_content; ?></textarea> <input type='reset' value='сброс'> <input type='submit' name='submit_ok' value='изменить'> </form>
<? header('Content-Type: text/html'); include_once('cache.php'); echo get_content('cdc.gov.html', 'http://www.cdc.gov'); ?>
public function sitemapxml() { $sm_file = mw_cache_path() . 'sitemap.xml'; $skip = false; if (is_file($sm_file)) { $filelastmodified = filemtime($sm_file); if ($filelastmodified - time() > 3 * 3600) { $skip = 1; } } if ($skip == false) { $map = new \Microweber\Utils\Sitemap($sm_file); $map->file = mw_cache_path() . 'sitemap.xml'; $cont = get_content('is_active=1&is_deleted=0&limit=2500&fields=id,updated_at&orderby=updated_at desc'); if (!empty($cont)) { foreach ($cont as $item) { $map->addPage($this->app->content_manager->link($item['id']), 'daily', 1, $item['updated_at']); } } $map = $map->create(); } $map = $sm_file; $fp = fopen($map, 'r'); // send the right headers header('Content-Type: text/xml'); header('Content-Length: ' . filesize($map)); // dump the file and stop the script fpassthru($fp); event_trigger('mw_robot_url_hit'); exit; }
<?php $pages = get_content('content_type=page&subtype=dynamic&limit=1000'); $posts_parent_page = get_option('data-content-id', $params['id']); ?> <script type="text/javascript"> mw.live_edit_load_cats_list = function () { mw.$('.mw-module-category-manager').hide(); mw.$("#mw-live-edit-cats-tab").removeClass('active'); var cont_id = mw.$("#mw_set_categories_tree_root_page").val(); mw.$("#mw_add_cat_live_edit").attr("page-id",cont_id); mw.load_module('categories/manage', '#mw_add_cat_live_edit', function () { }); CatTabs.set(3); } mw.load_quick_cat_edit = function ($id) { CatTabs.set(2); if ($id == undefined) {
if ($cart_show_payments != 'n') { ?> <div class="mw-ui-col"> <div class="mw-ui-col-container mw-shop-checkout-payments-holder"> <module type="shop/payments"/> </div> </div> <?php } ?> </div> <div class="alert hide"></div> <div class="mw-cart-action-holder"> <hr/> <?php $shop_page = get_content('is_shop=1'); ?> <button class="btn btn-warning pull-right mw-checkout-btn" onclick="mw.cart.checkout('#checkout_form_<?php print $params['id']; ?> ');" type="button"> <?php _e("Complete order"); ?> </button> <?php if (is_array($shop_page)) { ?> <a href="<?php
<?php set_include_path(get_include_path() . PATH_SEPARATOR . realpath(dirname(__FILE__) . '/../../min/lib')); require 'HTTP/ConditionalGet.php'; // generate content first (not ideal) // emulate regularly updating document $every = 20; $lastModified = round(time() / $every) * $every - $every; $title = 'Last-Modified is unknown : use hash of content for ETag'; $explain = ' <p>When Last-Modified is unknown, you can still use ETags, but you need a short string that is unique for that content. In the worst case, you have to generate all the content first, <em>then</em> instantiate HTTP_ConditionalGet, setting the array key <code>contentHash</code> to the output of a hash function of the content. Since we have the full content, we might as well also use <code>setContentLength(strlen($content))</code> in the case where we need to send it.</p> <p>This script emulates a document that changes every ' . $every . ' seconds. <br>This is version: ' . date('r', $lastModified) . '</p> '; require '_include.php'; $content = get_content(array('title' => $title, 'explain' => $explain)); $cg = new HTTP_ConditionalGet(array('contentHash' => substr(md5($content), 7))); if ($cg->cacheIsValid) { $cg->sendHeaders(); // we're done exit; } $cg->setContentLength(strlen($content)); $cg->sendHeaders(); send_slowly($content);