本文整理汇总了PHP中getLinks函数的典型用法代码示例。如果您正苦于以下问题:PHP getLinks函数的具体用法?PHP getLinks怎么用?PHP getLinks使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getLinks函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLinks
function getLinks($childrens, $links = array())
{
foreach ($childrens as $child) {
if (isset($child['childrens'])) {
echo "Iterate childrens\n";
$links = getLinks($child['childrens'], $links);
} else {
echo "Children load it for url: {$child['url']}\n";
$pages = range(1, 5);
foreach ($pages as $page) {
echo "Children load it for url: {$child['url']}&pagina={$page}\n";
$listado = fetch($child['url'] . '&pagina=' . $page);
$doc = phpQuery::newDocumentHTML($listado);
phpQuery::selectDocument($doc);
foreach (pq('.aviso h3 a') as $el) {
$url = 'http://www.pac.com.ve' . pq($el)->attr('href');
if (strpos($url, '&ubicacion=')) {
$href = substr($url, 0, strpos($url, '&ubicacion='));
} else {
$href = $url;
}
$links[] = $href;
}
}
}
}
return $links;
}
示例2: getBlogContentForCoverPage
function getBlogContentForCoverPage()
{
global $blogid, $blog, $service, $stats, $skinSetting;
global $pd_category, $pd_categoryXhtml, $pd_archive, $pd_calendar, $pd_tags, $pd_notices, $pd_recentEntry;
global $pd_recentComment, $pd_recentTrackback, $pd_link, $pd_authorList;
$categories = getCategories($blogid);
$totalPosts = getEntriesTotalCount($blogid);
$pd_category = getCategoriesView($totalPosts, $categories, isset($category) ? $category : true);
$pd_categoryXhtml = getCategoriesView($totalPosts, $categories, isset($category) ? $category : true, true);
$pd_archive = getArchives($blogid);
$pd_calendar = getCalendarView(getCalendar($blogid, true));
$pd_tags = getRandomTags($blogid);
$pd_notices = getNotices($blogid);
$pd_recentEntry = getRecentEntries($blogid);
$pd_recentComment = getRecentComments($blogid);
$pd_recentTrackback = getRecentTrackbacks($blogid);
$pd_link = getLinks($blogid);
$pd_authorList = User::getUserNamesOfBlog($blogid);
}
示例3: scan
function scan($url)
{
global $scans;
global $documentsToScan;
$document = getPageContents($url);
if (!DBdocumentExists($url)) {
$keywords = EXTRACTkeywords($document);
DBinsertKeywords($url, $keywords);
$scans--;
}
if ($scans <= 0) {
DBclose();
exit;
}
$links = getLinks($document);
$documentsToScan = array_merge($documentsToScan, $links);
$nextScan = array_shift($documentsToScan);
if ($nextScan != null) {
scan($nextScan);
}
}
示例4: link_to
?>
<?php
echo link_to(1, $url . (isset($order) && $order != 'pd' ? (!preg_match("/\\?/", $url) ? '?' : '&') . "o={$order}" : ''), array('class' => 'numerosPag'));
?>
<?php
if ($page > 4) {
?>
...
<?php
}
?>
<?php
}
?>
<?php
$links = getLinks($last, $page);
foreach ($links as $aPage) {
?>
<?php
echo $aPage == $page ? $page : link_to($aPage, $url . ($aPage == 1 ? '' : (!preg_match("/\\?/", $url) ? '?' : '&') . "page=" . $aPage) . (isset($order) && $order != 'pd' ? (!preg_match("/\\?/", $url) && $aPage == 1 ? '?' : '&') . "o={$order}" : ''), array('class' => 'numerosPag'));
?>
<?php
if ($aPage != $links[count($links) - 1]) {
?>
<?php
}
?>
<?php
}
?>
<?php
示例5: loop
function loop($source)
{
//voorrang geven aan gesavede content!
global $end, $depth, $source;
switch ($source) {
case "notfoundorg":
while (!$end && $depth < 1000) {
$runDepth = $depth;
$link = scraperwiki::scrape("http://www.notfound.org/participants?page=" . $runDepth);
$html = str_get_html($link);
if (!is_object($html->find("ul.participant-list", 0))) {
break;
}
$urls = getLinks($html);
$depth++;
if ($depth == 9999) {
$end = true;
}
}
if (sizeof($urls) > 0) {
foreach ($urls as $key => $value) {
echo $value . "\n";
}
} else {
echo "No match found";
}
break;
case "google":
// wat met landen / taal versies?
echo "to do";
break;
case "bing":
// wat met landen / taal versies?
echo "to do";
break;
case "yahoo":
// wat met landen / taal versies?
echo "to do";
break;
default:
echo "Choose an option";
break;
}
}
示例6: define
<?php
/// Copyright (c) 2004-2012, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
define('__TEXTCUBE_IPHONE__', true);
require ROOT . '/library/preprocessor.php';
requireView('iphoneView');
printMobileHTMLHeader();
printMobileHTMLMenu();
$linkView .= '<ul data-role="listview" class="posts" id="links" title="' . _text('링크') . '" selected="false">' . CRLF;
$linkView .= printMobileLinksView(getLinks($blogid));
$linkView .= '</ul>';
print $linkView;
printMobileHTMLFooter();
示例7: followContact
$response = followContact($_REQUEST['username']);
break;
case "unfollow_contact":
$response = unfollowContact($_REQUEST['username']);
break;
case "get_contact_list":
$response = getContactList();
break;
case "add_link":
$response = addLink($_REQUEST['from_url'], $_REQUEST['from_url_param'], $_REQUEST['to_url'], $_REQUEST['to_url_param'], $_REQUEST['note']);
break;
case "delete_link":
$response = deleteLink($_REQUEST['from_url'], $_REQUEST['from_url_param'], $_REQUEST['to_url'], $_REQUEST['to_url_param']);
break;
case "get_links":
$response = getLinks($_REQUEST['url'], $_REQUEST['url_param']);
break;
case "rate_link":
$response = rateLink($_REQUEST['from_url'], $_REQUEST['from_url_param'], $_REQUEST['to_url'], $_REQUEST['to_url_param'], $_REQUEST['up']);
break;
case "get_link_comment":
$response = getLinkComment($_REQUEST['from_url'], $_REQUEST['from_url_param'], $_REQUEST['to_url'], $_REQUEST['to_url_param']);
break;
case "verify_user":
$response = verifyUser($_REQUEST['confirm_code']);
break;
case "invite_user":
$response = inviteUser($_REQUEST['email']);
break;
case "get_title":
$response = getTitle($_REQUEST['url'], $_REQUEST['url_param']);
示例8: connectDB
<?php
include "connection_openDB.php";
include "connection_closeDB.php";
include "getData.php";
$iterval = $_POST['itervalue'];
$file_id = $_POST['file_id'];
$db = connectDB();
createTransaction_file($db, $file_id);
getLinks($db, $nodes_array, $iterval);
closeDB($db);
示例9: explode
<?php
$page = 'health-page';
require_once '-functions.php';
require_once '-setup.php';
require_once '-head.php';
$path = [];
if (isset($_GET['path']) && strlen($_GET['path'])) {
$path = explode('.', $_GET['path']);
}
$links = getLinks($path, $practiceID);
?>
<main>
<div class="page-header">
<a class="button back" href=".">
<img src="img/arrow-circle-left.svg" alt="">
<span>Main Menu</span>
</a>
<?php
if (count($path)) {
$arr = $path;
array_pop($arr);
?>
<a class="button back" href="health.php?path=<?php
echo implode('.', $arr);
?>
&id=<?php
echo html($deviceID);
?>
&pid=<?php
示例10: array
$addon = "\nOptions (Eg: Reply with 1 for Next Page):";
}
$key = 1;
if ($validity == 1) {
$addon .= "\n{$key}: Unlimited search at Rs {$price_point}/day";
} else {
$addon .= "\n{$key}: Unlimited search at Rs {$price_point}/{$validity} days";
}
// "Subscribe at Rs $pricepoint/$pricepoint days"; //Subscribe option";
$options[] = array("content" => "sub_gyan", "count" => 1);
}
echo "\n<br>no read more<br>\n";
if (strlen($out_text) > 4 && preg_match("~[\\w\\d]+~", $out_text)) {
$query = 'update request set position=-1 where mobile="' . $numbers . '"';
mysql_query($query) or trigger_error("Error in {$query}: " . mysql_error(), E_USER_ERROR);
$content = getLinks($content);
$outs = serialize($options);
file_put_contents(DATA_PATH . "/lists/{$numbers}", $outs);
// $lq = "REPLACE INTO lists (machine_id,number,query_id) VALUES ('$machine_id','$numbers','$query_id')";
// mysql_query($lq) or trigger_error(mysql_error() . " in $lq", E_USER_ERROR);
$to_cache['m'] = $machine_id;
$to_cache['q'] = $query_id;
$url = "http://IP/cache/write.php?name=ls{$numbers}&data=" . urlencode(json_encode($to_cache)) . "&ttl=18000";
$cache_res = file_get_contents($url);
echo "<br>Cache res : {$cache_res}";
$out_text = $out_text . $addon;
} else {
echo "\n<br>EMPTY OUTPUT 2<br>\n";
$out_text = 'Sorry, no more data available';
}
if ($has_options) {
示例11: array
$pisah = $ticketvalues[2]->plaintext;
$railway = array("id" => $id, "from_city" => $from_city, "destination" => $destination, "pisah" => $pisah);
// Save the record.
saveData(array("from_city", "destination", "pisah"), $railway);
}
getLinks("http://splitticket.moneysavingexpert.com/results.php?departure=NCL&arrival=LDS&railcard=&travellers=adult&type=walkonsingle&hour=18&minute=41");
require "scraperwiki/simple_html_dom.php";
define("BASE_URL", "http://splitticket.moneysavingexpert.com/results.php?");
// Save a record to the data store.
function saveData($unique, $railway)
{
scraperWiki::save_sqlite($unique, $railway);
}
function getLinks($page)
{
global $destination, $id, $from_city, $pisah;
$id = 0;
$source = scraperWiki::scrape($page);
$html = new simple_html_dom();
$html->load($source);
$id = $id + 1;
$ticketvalues = $html->find("td[@class='ticketvalue']");
$from_city = $ticketvalues[0]->plaintext;
$destination = $ticketvalues[5]->plaintext;
$pisah = $ticketvalues[2]->plaintext;
$railway = array("id" => $id, "from_city" => $from_city, "destination" => $destination, "pisah" => $pisah);
// Save the record.
saveData(array("from_city", "destination", "pisah"), $railway);
}
getLinks("http://splitticket.moneysavingexpert.com/results.php?departure=NCL&arrival=LDS&railcard=&travellers=adult&type=walkonsingle&hour=18&minute=41");
示例12: exit
if (!file_exists($file)) {
exit("File ' . {$file} . ' first not found.\n");
}
$objPHPExcel = PHPExcel_IOFactory::load($file);
$relations = getSheetData($objPHPExcel, 0);
$definitions = getSheetData($objPHPExcel, 1);
$additionalData = getSheetData($objPHPExcel, 2);
$returns = array();
if (count($relations) > 0 && count($definitions) > 0 && count($additionalData)) {
$groups = getGroups($relations);
$nodes = getNodes($relations, $definitions, $groups);
/*echo '<pre>';
var_dump($nodes);
echo '</pre>';
die;*/
$links = getLinks($relations, $nodes);
$additionalNodesData = getAdditionalNodesData($additionalData, $nodes);
$returns = array('nodes' => $nodes, 'links' => $links, 'groups' => $groups, 'additionalNodesData' => $additionalNodesData);
echo json_encode($returns);
}
// helper functions
function getSheetData($objPHPExcel, $number = 0)
{
$result = array();
$objPHPExcel->setActiveSheetIndex($number);
$data = $objPHPExcel->getActiveSheet()->toArray();
if (count($data) > 0) {
for ($i = 1; $i < count($data); $i++) {
$result[] = $data[$i];
}
}
示例13: submit
/**
* Main wrapper function for submit task
* - get parameters from the form
* - save config
* - do several checks
* - call main crawling function (getLinks) to get all the links at once
* - complete it with priority information
* - generate sitemap XML file
*
* @param string $option the component name
* @return nothing
*/
function submit($option)
{
$db =& JFactory::getDBO();
$query = "TRUNCATE TABLE `#__jcrawler_urls`";
$db->setQuery($query);
$db->query();
$app =& JFactory::getApplication();
// get parameters from gui of script
if (!defined('HTTP_HOST')) {
define('HTTP_HOST', JRequest::getVar('http_host', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML));
}
$website = HTTP_HOST;
if (substr($website, -1) != "/") {
$website = $website . "/";
}
$page_root = JRequest::getVar('document_root', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML);
$sitemap_file = $page_root . JRequest::getVar('sitemap_url', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML);
$sitemap_url = $website . JRequest::getVar('sitemap_url', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML);
$sitemap_form = JRequest::getVar('sitemap_url', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML);
$priority = JRequest::getVar('priority', '1.0', 'POST', 'STRING', JREQUEST_ALLOWHTML);
$forbidden_types = toTrimmedArray(JRequest::getVar('forbidden_types', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML));
$exclude_names = toTrimmedArray(JRequest::getVar('exclude_names', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML));
$freq = JRequest::getVar('freq', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML);
$modifyrobots = JRequest::getVar('robots', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML);
$method = JRequest::getVar('method', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML);
$level = JRequest::getVar('levels', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML);
$maxcon = JRequest::getVar('maxcon', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML);
$timeout = JRequest::getVar('timeout', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML);
$whitelist = JRequest::getVar('whitelist', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML);
if ($priority >= 1) {
$priority = "1.0";
}
$xmlconfig = genConfig($priority, $forbidden_types, $exclude_names, $freq, $method, $level, $maxcon, $sitemap_form, $page_root, $timeout);
if (substr($page_root, -1) != "/") {
$page_root = $page_root . "/";
}
$robots = @JFile::read($page_root . 'robots.txt');
preg_match_all("/Disallow:(.*?)\n/", $robots, $pos);
if ($exclude_names[0] == "") {
unset($exclude_names[0]);
}
foreach ($pos[1] as $disallow) {
$disallow = trim($disallow);
if (strpos($disallow, $website) === false) {
$disallow = $website . $disallow;
}
$exclude_names[] = $disallow;
}
$forbidden_strings = array("print=1", "format=pdf", "option=com_mailto", "component/mailto", "/mailto/", "mailto:", "login", "register", "reset", "remind");
foreach ($exclude_names as $name) {
if ($name != "") {
$forbidden_strings[] = $name;
}
}
$s = microtime(true);
if ($whitelist == "yes") {
AntiFloodControl($website);
}
$file = genSitemap($priority, getLinks($website, $forbidden_types, $level, $forbidden_strings, $method, $maxcon, $timeout), $freq, $website);
writeXML($file, $sitemap_file, $option, $sitemap_url);
writeXML($xmlconfig, $page_root . "/administrator/components/com_jcrawler/config.xml", $option, $sitemap_url);
$app->enqueueMessage("total time: " . round(microtime(true) - $s, 4) . " seconds");
if ($modifyrobots == 1) {
modifyrobots($sitemap_url, $page_root);
}
require_once JApplicationHelper::getPath('admin_html', 'com_jcrawler');
HTML_jcrawler::showNotifyForm($option, $sitemap_url);
}
示例14: dirname
require_once dirname(__FILE__) . '/../System.php';
if (isset($_REQUEST['db'])) {
$dbName = $_REQUEST['db'];
// Initialize a System object that uses the requested database
$system = new System();
if ($system->init($dbName)) {
// Result object
$result = new stdClass();
$result->HeuristVersion = HEURIST_VERSION;
$result->HeuristBaseURL = HEURIST_BASE_URL;
$result->HeuristDBName = $dbName;
// Retrieving all nodes
$rectypes = getRectypes($system);
$result->nodes = $rectypes;
// Retrieving all links
$links = getLinks($system, $rectypes);
$result->links = $links;
// Returning result as JSON
header('Content-type: application/json');
print json_encode($result);
} else {
// Show construction error
echo $system->getError();
}
} else {
echo "\"db\" parameter is required";
}
/**
* Retrieves all RecTypes
* @param mixed $system System reference
* @return Array of nodes
示例15: getLinks
</div>
<div class="panel_wrapper">
<div id="general_panel" class="panel current">
<fieldset>
<legend>{#advlink_dlg.general_props}</legend>
<table border="0" cellpadding="4" cellspacing="0">
<tr>
<td class="nowrap"><label id="hreflabel" for="href">{#advlink_dlg.url}</label></td>
<td><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<?php
echo getLinks($id_value, "", "href", "mceFocus", "onchange=\"selectByValue(this.form,'linklisthref',this.value);\"", "../../");
?>
</td>
<td id="hrefbrowsercontainer" style="display:none;"> </td>
<td id=""> <a href="link.php">Manual link</a></td>
</tr>
</table></td>
</tr>
<tr id="linklisthrefrow">
<td class="column1"><label for="linklisthref">{#advlink_dlg.list}</label></td>
<td colspan="2" id="linklisthrefcontainer"><select id="linklisthref"><option value=""></option></select></td>
</tr>
<tr>
<td class="column1"><label for="anchorlist">{#advlink_dlg.anchor_names}</label></td>