当前位置: 首页>>代码示例>>PHP>>正文


PHP get_content函数代码示例

本文整理汇总了PHP中get_content函数的典型用法代码示例。如果您正苦于以下问题:PHP get_content函数的具体用法?PHP get_content怎么用?PHP get_content使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_content函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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, '&nbsp; ', '.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


注:本文中的get_content函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。