本文整理汇总了PHP中get_links函数的典型用法代码示例。如果您正苦于以下问题:PHP get_links函数的具体用法?PHP get_links怎么用?PHP get_links使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_links函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show_main_page
function show_main_page($dbconn, $diary_login)
{
$sql = "SELECT u.uid, s.page_main, s.format_note FROM " . TABLE_SETTINGS . " AS s, " . TABLE_USERS . " AS u WHERE u.login='" . $diary_login . "' AND s.uid=u.uid LIMIT 1";
$result = pg_query($dbconn, $sql) or die(pg_last_error($dbconn));
$data = pg_fetch_object($result, NULL);
echo assign_vars($data->page_main, array('{login}' => $diary_login, '{diary}' => get_last_notes($dbconn, $diary_login, $data->format_note), '{hrefguestbook}' => 'http://' . $_SERVER['SERVER_NAME'] . '/' . PAGE_GUESTBOOK, '{archive}' => get_archive($dbconn, $diary_login), '{links}' => get_links($dbconn, $diary_login)));
}
示例2: get_links_list_ster
function get_links_list_ster($order = 'name', $hide_if_empty = 'obsolete')
{
$order = strtolower($order);
// Handle link category sorting
$direction = 'ASC';
if ('_' == substr($order, 0, 1)) {
$direction = 'DESC';
$order = substr($order, 1);
}
if (!isset($direction)) {
$direction = '';
}
$cats = get_categories("type=link&orderby={$order}&order={$direction}&hierarchical=0");
// Display each category
if ($cats) {
foreach ((array) $cats as $cat) {
// Handle each category.
// Display the category name
echo ' <li id="linkcat-' . $cat->cat_ID . '" class="linkcat"><h2>' . $cat->cat_name . "</h2>\n\t<ul>\n";
// Call get_links() with all the appropriate params
get_links($cat->cat_ID, '<li>', "</li>", ": ", true, 'name', true);
// Close the last category
echo "\n\t</ul>\n</li>\n";
}
}
}
示例3: admin_links
function admin_links()
{
global $db;
$tpl = new smarty();
ob_start();
$tpl->display(DESIGN . '/tpl/admin/links.html');
$content = ob_get_contents();
ob_end_clean();
main_content(SERVER, $content, '', 1);
get_links();
}
示例4: getPinboardLinks
function getPinboardLinks($username, $password)
{
$pinboard = '';
if ($xmlstr = get_links("https://api.pinboard.in/v1/posts/recent?count=5", $username, $password)) {
$xml = simplexml_load_string($xmlstr);
foreach ($xml->post as $post) {
$pinboard .= '<li><a href="' . $post->attributes()->href . '" target="_blank" on>' . $post->attributes()->description . '</a></li>';
}
} else {
$pinboard = '<li>No links :( </li>';
}
return $pinboard;
}
示例5: form
function form($predef = "")
{
global $mytrail, $i, $trailperms, $caps;
if (is_array($predef)) {
print_trail_direct(array(), $mytrail, $trailperms, -1, $predef, has_caps($caps, CAP_SUPERUSER));
} else {
$links = get_links($mytrail['path']);
if (is_array($links)) {
print_trail_direct($links, $mytrail, $trailperms, $i, "", has_caps($caps, CAP_SUPERUSER));
//the output is printed directly for usability reasons when
//hanling big trails under slow response time conditions
}
}
}
示例6: widget_links_with_style
function widget_links_with_style() {
global $wpdb;
$link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM $wpdb->linkcategories");
foreach ($link_cats as $link_cat) {
?>
<div class="widget_style">
<div class="right_bg">
<div class="right_head"><h2><?php echo $link_cat->cat_name; ?></h2></div>
<ul>
<?php get_links($link_cat->cat_id, '<li>', '</li>', '<br />', FALSE, 'id', TRUE, TRUE, -1, TRUE); ?>
</ul>
</div>
</div>
<?php } ?>
<?php }
示例7: get_links
function get_links($targetUrl, $depth)
{
global $urls, $linkFilter, $frameDepth, $actualFrameDepth;
if (!$targetUrl) {
return;
}
if ($frameDepth - $depth > $actualFrameDepth) {
$actualFrameDepth = $frameDepth - $depth;
}
$html = file_get_contents($targetUrl);
$dom = new DOMDocument();
@$dom->loadHTML($html);
$xpath = new DOMXPath($dom);
$bases = $xpath->evaluate("/html/head//base");
if ($bases->length > 0) {
$baseItem = $bases->item($bases->length - 1);
$base = $baseItem->getAttribute('href');
} else {
$base = $targetUrl;
}
if ($depth > 0) {
$frames = $xpath->evaluate("/html/body//iframe");
for ($i = 0; $i < $frames->length; $i++) {
$frame = $frames->item($i);
$url = make_absolute($frame->getAttribute('src'), $base);
if ($url != $targetUrl) {
get_links($url, $depth - 1);
}
}
$frames = $xpath->evaluate("/html/body//frame");
for ($i = 0; $i < $frames->length; $i++) {
$frame = $frames->item($i);
$url = make_absolute($frame->getAttribute('src'), $base);
if ($url != $targetUrl) {
get_links($url, $depth - 1);
}
}
}
$hrefs = $xpath->evaluate("/html/body//a");
for ($i = 0; $i < $hrefs->length; $i++) {
$href = $hrefs->item($i);
$url = $href->getAttribute('href');
$absolute = make_absolute($url, $base);
if (preg_match("@" . $linkFilter . "@i", parse_url($absolute, PHP_URL_PATH))) {
array_push($urls, $absolute);
}
}
}
示例8: widget_itheme_links
function widget_itheme_links()
{
?>
<!--sidebox start -->
<div id="links" class="dbx-box">
<h3 class="dbx-handle"><?php
_e('Links');
?>
</h3>
<div class="dbx-content">
<ul>
<?php
get_links('-1', '<li>', '</li>', '<br />', FALSE, 'id', FALSE, FALSE, -1, FALSE);
?>
</ul>
</div>
</div>
<!--sidebox end --><?php
}
示例9: get_menu_items
function get_menu_items($user_level, $connection)
{
return get_links($user_level, $connection, 1);
/*
$result = mysqli_query($connection, "SELECT * FROM menu_items WHERE security_level <= ".sanitize($user_level)." and language = 'en' and visible = 1 ORDER BY menu_order") or die(mysqli_error($connection));
if (mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_assoc($result)) {
$menu_names[] = $row['menu_text'];
if ($row['use_iframe'] == 1) {
$menu_links[] = "show_page.php?id=".$row['id'];
} else {
$menu_links[] = $row['link'];
}
}
}
$retval[0] = $menu_names;
$retval[1] = $menu_links;
return $retval;*/
}
示例10: get_initialized_data
function get_initialized_data($CUSOMER_ENV = TRUE)
{
$links =& get_links(TRUE);
$data = array();
//its not so wise to send all links for the possibility of usage
//its not also secure
foreach ($links as $key => $link) {
$data[$key] = get_link($key);
}
if (!$CUSOMER_ENV) {
return $data;
}
//
//now we are in customer env
$data['header_description'] = '';
$data['header_keywords'] = '';
$data['header_canonical_url'] = '';
$data['header_title'] = '';
return $data;
}
示例11: widget_links_with_style
function widget_links_with_style()
{
global $wpdb;
$link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM {$wpdb->linkcategories}");
foreach ($link_cats as $link_cat) {
?>
<h3><?php
echo $link_cat->cat_name;
?>
</h3>
<ul>
<?php
get_links($link_cat->cat_id, '<li>', '</li>', '<br />', FALSE, 'rand', TRUE, TRUE, -1, TRUE);
?>
</ul>
<?php
}
?>
<?php
}
示例12: wp_loginout
<li><?php
wp_loginout();
?>
</li>
</ul>
<h2><?php
_e('Monthly Archives');
?>
</h2>
<ul><?php
wp_get_archives('type=monthly');
?>
</ul>
<h2><?php
_e('Blogroll');
?>
</h2>
<ul><?php
get_links(-1, '<li>', '</li>', ' - ');
?>
</ul>
<?php
}
?>
</div>
<!-- [sidebar2] -->
</div> <!-- [sidebar] -->
示例13: foreach
?>
,<?php
echo $group->name;
}
?>
" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="tags">Parent</label>
<div class="controls controls-row">
<select name="parent">
<option value="0">No Parent</option>
<?php
foreach (get_links() as $db_link) {
?>
<option value="<?php
echo $db_link->id;
?>
"><?php
echo $db_link->name;
?>
</option>
<?php
}
?>
</select>
</div>
</div>
<div class="control-group">
示例14: wp_get_archives
</ul>
<h3>Archives</h3>
<ul>
<?php
wp_get_archives('type=monthly');
?>
</ul>
<h3>Resources</h3>
<ul>
<?php
get_links('-1', '<li>', '</li>', '<br />');
?>
</ul>
<h3>Meta</h3>
<ul>
<?php
wp_register();
?>
<li><?php
wp_loginout();
?>
</li>
<li><a href="http://validator.w3.org/check/referer" title="This page validates as XHTML 1.0 Transitional">Valid <abbr title="eXtensible HyperText Markup Language">XHTML</abbr></a></li>
示例15: index_url
function index_url($url, $level, $site_id, $md5sum, $domain, $indexdate, $sessid, $can_leave_domain, $reindex)
{
global $entities, $min_delay;
global $command_line;
global $min_words_per_page;
global $supdomain;
global $mysql_table_prefix, $user_agent, $tmp_urls, $delay_time, $domain_arr;
$needsReindex = 1;
$deletable = 0;
$url_status = url_status($url);
$thislevel = $level - 1;
if (strstr($url_status['state'], "Relocation")) {
$url = preg_replace("/ /", "", url_purify($url_status['path'], $url, $can_leave_domain));
if ($url != '') {
$result = mysql_query("select link from " . $mysql_table_prefix . "temp where link='{$url}' && id = '{$sessid}'");
echo mysql_error();
$rows = mysql_numrows($result);
if ($rows == 0) {
mysql_query("insert into " . $mysql_table_prefix . "temp (link, level, id) values ('{$url}', '{$level}', '{$sessid}')");
echo mysql_error();
}
}
$url_status['state'] == "redirected";
}
/*
if ($indexdate <> '' && $url_status['date'] <> '') {
if ($indexdate > $url_status['date']) {
$url_status['state'] = "Date checked. Page contents not changed";
$needsReindex = 0;
}
}*/
ini_set("user_agent", $user_agent);
if ($url_status['state'] == 'ok') {
$OKtoIndex = 1;
$file_read_error = 0;
if (time() - $delay_time < $min_delay) {
sleep($min_delay - (time() - $delay_time));
}
$delay_time = time();
if (!fst_lt_snd(phpversion(), "4.3.0")) {
$file = file_get_contents($url);
if ($file === FALSE) {
$file_read_error = 1;
}
} else {
$fl = @fopen($url, "r");
if ($fl) {
while ($buffer = @fgets($fl, 4096)) {
$file .= $buffer;
}
} else {
$file_read_error = 1;
}
fclose($fl);
}
if ($file_read_error) {
$contents = getFileContents($url);
$file = $contents['file'];
}
$pageSize = number_format(strlen($file) / 1024, 2, ".", "");
printPageSizeReport($pageSize);
if ($url_status['content'] != 'text') {
$file = extract_text($file, $url_status['content']);
}
printStandardReport('starting', $command_line);
$newmd5sum = md5($file);
if ($md5sum == $newmd5sum) {
printStandardReport('md5notChanged', $command_line);
$OKtoIndex = 0;
} else {
if (isDuplicateMD5($newmd5sum)) {
$OKtoIndex = 0;
printStandardReport('duplicate', $command_line);
}
}
if (($md5sum != $newmd5sum || $reindex == 1) && $OKtoIndex == 1) {
$urlparts = parse_url($url);
$newdomain = $urlparts['host'];
$type = 0;
/* if ($newdomain <> $domain)
$domainChanged = 1;
if ($domaincb==1) {
$start = strlen($newdomain) - strlen($supdomain);
if (substr($newdomain, $start) == $supdomain) {
$domainChanged = 0;
}
}*/
// remove link to css file
//get all links from file
$data = clean_file($file, $url, $url_status['content']);
if ($data['noindex'] == 1) {
$OKtoIndex = 0;
$deletable = 1;
printStandardReport('metaNoindex', $command_line);
}
$wordarray = unique_array(explode(" ", $data['content']));
if ($data['nofollow'] != 1) {
$links = get_links($file, $url, $can_leave_domain, $data['base']);
$links = distinct_array($links);
//.........这里部分代码省略.........