本文整理汇总了PHP中get_content函数的典型用法代码示例。如果您正苦于以下问题:PHP get_content函数的具体用法?PHP get_content怎么用?PHP get_content使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_content函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: b_categories_list_show
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;
}
开发者ID:trabisdementia,项目名称:xuups,代码行数:25,代码来源:categories_list.php
示例2: get_files
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;
}
开发者ID:Atlasmuseum,项目名称:AM,代码行数:33,代码来源:create_credits.php
示例3: get_seo_info
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;
}
开发者ID:repodevs,项目名称:web_admin_tools,代码行数:34,代码来源:function.php
示例4: get_facebook_infos
/**
* 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);
}
开发者ID:hafedhbou,项目名称:hetic-p2017,代码行数:12,代码来源:index.php
示例5: testPages
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']);
}
开发者ID:microweber,项目名称:microweber,代码行数:26,代码来源:ContentTest.php
示例6: getImage
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'];
}
开发者ID:nathancoleman,项目名称:SeeSpotQueue,代码行数:8,代码来源:add_to_queue.php
示例7: find_content
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 "";
}
开发者ID:bianle,项目名称:www2,代码行数:10,代码来源:www2-board.php
示例8: main_menu
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);
}
开发者ID:Karpec,项目名称:gizd,代码行数:10,代码来源:blocks.php
示例9: get_content_end
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;
}
开发者ID:hkulekci,项目名称:TinyCms,代码行数:11,代码来源:db_funcs.php
示例10: update_news
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();
}
开发者ID:reake,项目名称:share-travel,代码行数:12,代码来源:news_detail.php
示例11: get_notice_data
/**
* 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;
}
开发者ID:Atlasmuseum,项目名称:AM,代码行数:20,代码来源:API_GetNoticeData.php
示例12: product
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();
}
开发者ID:wuwenbao,项目名称:paimai,代码行数:14,代码来源:IndexController.class.php
示例13: account_data
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);
}
开发者ID:matthew0x40,项目名称:apply,代码行数:15,代码来源:account.php
示例14: print_admin_panel
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";
}
开发者ID:bjh7242,项目名称:ISTS14-Stuff,代码行数:16,代码来源:content.php
示例15: load_data
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();
}
}
}
}
开发者ID:eugenrein,项目名称:sunoikisislemma,代码行数:17,代码来源:functions.php
示例16: update_sight
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 />';
}
开发者ID:reake,项目名称:share-travel,代码行数:19,代码来源:caiji.php
示例17: kirimquo
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);
}
开发者ID:akivaron,项目名称:toko,代码行数:20,代码来源:kirim_email_att.php
示例18: ngps_article_lookup
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;
}
开发者ID:denverpost,项目名称:most-popular,代码行数:20,代码来源:get.php
示例19: kirimEmail
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);
}
开发者ID:iwan14102065,项目名称:yes_wptheme,代码行数:21,代码来源:email.php
示例20: show_content
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;
}
开发者ID:racontemoi,项目名称:mamp,代码行数:36,代码来源:functions.php
注:本文中的get_content函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论