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


PHP get_links函数代码示例

本文整理汇总了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)));
}
开发者ID:BackupTheBerlios,项目名称:diarusie-svn,代码行数:7,代码来源:index.inc.php

示例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";
        }
    }
}
开发者ID:BGCX261,项目名称:zhiqiang-blog-svn-to-git,代码行数:26,代码来源:linkpage.php

示例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();
}
开发者ID:ECP-Black,项目名称:ECP,代码行数:11,代码来源:links.php

示例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;
}
开发者ID:JamieKnight,项目名称:Bouncer,代码行数:13,代码来源:index.php

示例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
        }
    }
}
开发者ID:pilif,项目名称:linktrail,代码行数:14,代码来源:editlink.php

示例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 }
开发者ID:baroquon,项目名称:charolais,代码行数:15,代码来源:functions.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);
        }
    }
}
开发者ID:manishkhanchandani,项目名称:mkgxy,代码行数:48,代码来源:viewer-links.php

示例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 
}
开发者ID:phatboyg,项目名称:phatboyg.github.io,代码行数:19,代码来源:functions.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;*/
 }
开发者ID:salahbj,项目名称:smoothoperator,代码行数:20,代码来源:layout.php

示例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;
}
开发者ID:NaszvadiG,项目名称:BurgeCMF,代码行数:20,代码来源:init_helper.php

示例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 
}
开发者ID:jeremylightsmith,项目名称:blog,代码行数:23,代码来源:functions.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] -->
开发者ID:howardlei82,项目名称:IGSM-Website,代码行数:30,代码来源:sidebar.php

示例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">
开发者ID:hscale,项目名称:builder-engine,代码行数:31,代码来源:add_link.php

示例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>
开发者ID:jeremylightsmith,项目名称:blog,代码行数:31,代码来源:sidebar.php

示例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);
//.........这里部分代码省略.........
开发者ID:hoelzro,项目名称:Bifrost,代码行数:101,代码来源:spider.php


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