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='******' 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)));
}
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";
        }
    }
}
Exemple #3
0
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();
}
Exemple #4
0
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;
}
Exemple #5
0
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
        }
    }
}
Exemple #6
0
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 }
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);
        }
    }
}
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 
}
Exemple #9
0
 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;*/
 }
Exemple #10
0
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;
}
Exemple #11
0
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 
}
Exemple #12
0
			<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] -->
Exemple #13
0
    ?>
,<?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">
Exemple #14
0
				</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>
Exemple #15
0
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);
                $all_links = count($links);
                $numoflinks = 0;
                //if there are any, add to the temp table, but only if there isnt such url already
                if (is_array($links)) {
                    reset($links);
                    while ($thislink = each($links)) {
                        if ($tmp_urls[$thislink[1]] != 1) {
                            $tmp_urls[$thislink[1]] = 1;
                            $numoflinks++;
                            mysql_query("insert into " . $mysql_table_prefix . "temp (link, level, id) values ('{$thislink['1']}', '{$level}', '{$sessid}')");
                            echo mysql_error();
                        }
                    }
                }
            } else {
                printStandardReport('noFollow', $command_line);
            }
            if ($OKtoIndex == 1) {
                $title = $data['title'];
                $host = $data['host'];
                $path = $data['path'];
                $fulltxt = $data['fulltext'];
                $desc = substr($data['description'], 0, 254);
                $url_parts = parse_url($url);
                $domain_for_db = $url_parts['host'];
                if (isset($domain_arr[$domain_for_db])) {
                    $dom_id = $domain_arr[$domain_for_db];
                } else {
                    mysql_query("insert into " . $mysql_table_prefix . "domains (domain) values ('{$domain_for_db}')");
                    $dom_id = mysql_insert_id();
                    $domain_arr[$domain_for_db] = $dom_id;
                }
                $wordarray = calc_weights($wordarray, $title, $host, $path, $data['keywords']);
                //if there are words to index, add the link to the database, get its id, and add the word + their relation
                if (is_array($wordarray) && count($wordarray) > $min_words_per_page) {
                    if ($md5sum == '') {
                        mysql_query("insert into " . $mysql_table_prefix . "links (site_id, url, title, description, fulltxt, indexdate, size, md5sum, level) values ('{$site_id}', '{$url}', '{$title}', '{$desc}', '{$fulltxt}', curdate(), '{$pageSize}', '{$newmd5sum}', {$thislevel})");
                        echo mysql_error();
                        $result = mysql_query("select link_id from " . $mysql_table_prefix . "links where url='{$url}'");
                        echo mysql_error();
                        $row = mysql_fetch_row($result);
                        $link_id = $row[0];
                        save_keywords($wordarray, $link_id, $dom_id);
                        printStandardReport('indexed', $command_line);
                    } else {
                        if ($md5sum != '' && $md5sum != $newmd5sum) {
                            //if page has changed, start updating
                            $result = mysql_query("select link_id from " . $mysql_table_prefix . "links where url='{$url}'");
                            echo mysql_error();
                            $row = mysql_fetch_row($result);
                            $link_id = $row[0];
                            for ($i = 0; $i <= 15; $i++) {
                                $char = dechex($i);
                                mysql_query("delete from " . $mysql_table_prefix . "link_keyword{$char} where link_id={$link_id}");
                                echo mysql_error();
                            }
                            save_keywords($wordarray, $link_id, $dom_id);
                            $query = "update " . $mysql_table_prefix . "links set title='{$title}', description ='{$desc}', fulltxt = '{$fulltxt}', indexdate=now(), size = '{$pageSize}', md5sum='{$newmd5sum}', level={$thislevel} where link_id={$link_id}";
                            mysql_query($query);
                            echo mysql_error();
                            printStandardReport('re-indexed', $command_line);
                        }
                    }
                } else {
                    printStandardReport('minWords', $command_line);
                }
            }
        }
    } else {
        $deletable = 1;
        printUrlStatus($url_status['state'], $command_line);
    }
    if ($reindex == 1 && $deletable == 1) {
        check_for_removal($url);
    } else {
        if ($reindex == 1) {
        }
    }
    if (!isset($all_links)) {
        $all_links = 0;
    }
    if (!isset($numoflinks)) {
        $numoflinks = 0;
    }
    printLinksReport($numoflinks, $all_links, $command_line);
}
Exemple #16
0
    ?>
          </ul>
        </div>
      </div>
      <!--sidebox end -->

      <!--sidebox start -->
      <div id="links" class="dbx-box">
        <h3 class="dbx-handle"><?php 
    _e('Links', TDOMAIN);
    ?>
</h3>
        <div class="dbx-content">
          <ul>
            <?php 
    get_links('-1', '<li>', '</li>', '<br />', FALSE, 'id', FALSE, FALSE, -1, FALSE);
    ?>
          </ul>
        </div>
      </div>
      <!--sidebox end -->

      <!--sidebox start -->
      <div id="meta" class="dbx-box">
        <h3 class="dbx-handle"><?php 
    _e('Meta', TDOMAIN);
    ?>
</h3>
        <div class="dbx-content">
          <ul>
			<?php 
Exemple #17
0
	</ul>
	
	<?php 
if (is_single()) {
    ?>
	<h2>Related Entries</h2>
	<ul>
		<?php 
    UTW_ShowRelatedPostsForCurrentPost("posthtmllist");
    ?>
	</ul>               
	<?php 
}
?>
	
	<h2>My Homeboys (And Girls)</h2>
	<ul>
		<?php 
get_links('-1', '<li>', '</span></li>', '<span>', FALSE, 'id', TRUE, FALSE, 10, FALSE, TRUE);
?>
	</ul>
	
	<div id="footer">
		<p>Powered by <a href="http://wordpress.org/">Wordpress <?php 
bloginfo('version');
?>
</a></p>
		<p>Designed by <a href="http://whalesalad.com/">Michael Whalen</a></p>	
	</div>
		
</div>
Exemple #18
0
		<h2>Pages</h2>
		<ul>
		<?php 
wp_list_pages('title_li=&depth=1');
?>
		</ul>
		
		<h2>Archives</h2>
		<ul>
		<?php 
wp_get_archives('type=monthly');
?>
		</ul>
		
		<h2>Meta</h2>
		<ul>
			<?php 
wp_register();
?>
			<li><?php 
wp_loginout();
?>
</li>
		</ul>
		
		<h2>Blogroll</h2>
		<ul class="blogroll">
			<?php 
get_links('-1', '<li>', '</li>', '', FALSE, 'name', FALSE, FALSE, -1, TRUE);
?>
		</ul>
    }
}
// 获取最近文章列表
if ($page == 0) {
    $page = 1;
}
$query_sql = "SELECT a.id,a.cid,a.uid,a.ruid,a.title,a.addtime,a.edittime,a.comments,c.name as cname,u.avatar as uavatar,u.name as author,ru.name as rauthor\r\n    FROM `yunbbs_articles` a \r\n    LEFT JOIN `yunbbs_categories` c ON c.id=a.cid\r\n    LEFT JOIN `yunbbs_users` u ON a.uid=u.id\r\n    LEFT JOIN `yunbbs_users` ru ON a.ruid=ru.id\r\n    ORDER BY `edittime` DESC LIMIT " . ($page - 1) * $options['list_shownum'] . "," . $options['list_shownum'];
$query = $DBS->query($query_sql);
$articledb = array();
while ($article = $DBS->fetch_array($query)) {
    // 格式化内容
    $article['addtime'] = showtime($article['addtime']);
    $article['edittime'] = showtime($article['edittime']);
    $articledb[] = $article;
}
unset($article);
$DBS->free_result($query);
// 页面变量
$title = $options['name'] . ' - page ' . $page;
$site_infos = get_site_infos();
$newest_nodes = get_newest_nodes();
if (count($newest_nodes) == $options['newest_node_num']) {
    $bot_nodes = get_bot_nodes();
}
$show_sider_ad = "1";
$links = get_links();
if ($options['site_des']) {
    $meta_des = htmlspecialchars(mb_substr($options['site_des'], 0, 150, 'utf-8')) . ' - page ' . $page;
}
$pagefile = dirname(__FILE__) . '/templates/default/' . $tpl . 'indexpage.php';
include dirname(__FILE__) . '/templates/default/' . $tpl . 'layout.php';
Exemple #20
0
    <form id="searchform" method="get" action="<?php 
    echo htmlspecialchars($_SERVER['PHP_SELF']);
    ?>
">
    <div>
        <input class="searchfield" type="text" name="s" id="s" value="" title="Enter keyword to search" />
        <input class="submit" type="submit" value="search" title="Click to search archives" />
    </div>
    </form>
</div>
</div>

<h3>Blogroll</h3>
<ul>
<?php 
    get_links('-1', '<li>', '</li>', '', 0, 'name', 0, 0, -1, 0);
    ?>
</ul>

<h3>Archives</h3>
<ul>
<?php 
    wp_get_archives('type=monthly');
    ?>
</ul>

<h3>Categories</h3>
<ul>
    <?php 
    wp_list_cats();
    ?>
/** function get_links_withrating()
 ** Gets the links associated with category n and display rating stars/chars.
 ** Parameters:
 **   category (default -1)  - The category to use. If no category supplied
 **      uses all
 **   before (default '')  - the html to output before the link
 **   after (default '<br />')  - the html to output after the link
 **   between (default ' ')  - the html to output between the link/image
 **     and it's description. Not used if no image or show_images == true
 **   show_images (default true) - whether to show images (if defined).
 **   orderby (default 'id') - the order to output the links. E.g. 'id', 'name',
 **     'url' or 'description'. Or maybe owner. If you start the
 **     name with an underscore the order will be reversed.
 **     You can also specify 'rand' as the order which will return links in a
 **     random order.
 **   show_description (default true) - whether to show the description if
 **    show_images=false/not defined .
 **   limit (default -1) - Limit to X entries. If not specified, all entries
 **     are shown.
 **   show_updated (default 0) - whether to show last updated timestamp
 */
function get_links_withrating($category = -1, $before = '', $after = '<br />', $between = " ", $show_images = true, $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0)
{
    get_links($category, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated);
}
Exemple #22
0
function add_links($url, $is_index_page = true, $num = '')
{
    global $db;
    $new_links = array();
    $j = 1;
    $url_htmlcode = get_url_content($url);
    $url_htmlcode = get_encoding($url_htmlcode, "GB2312");
    $links = get_links($url_htmlcode, $url, 1, $url);
    if ($is_index_page) {
        foreach ($links as $value) {
            $new_links[] = GetSiteUrl($value);
        }
    } else {
        $new_links = $links;
    }
    $new_links = distinct_array($new_links);
    foreach ($new_links as $value) {
        echo $value . "<br>";
        flush();
        $query = $db->query("select * from ve123_links where url='{$value}'");
        $num = $db->num_rows($query);
        if ($num == 0) {
            if (!add_update_link($value, "", "", "add")) {
                continue;
            }
            $j++;
            if (!empty($num)) {
                if ($j >= $num) {
                    exit;
                }
            }
        }
    }
}
?>
</h2>
<?php 
wp_list_cats('list=0');
?>
</li>

<li>
	<h2><?php 
_e('Archives', 'benevolence');
?>
</h2>
<?php 
wp_get_archives('type=monthly&format=other&after=<br />');
?>
</li>

<li>
	<h2 class="title"><?php 
_e('Links', 'benevolence');
?>
</h2>
<?php 
get_links('-1', '', '<br />', '<br />', 0, 'name', 0, 0, -1, 0);
?>
 
</li>
</ul>
</div>

Exemple #24
0
            <li><h3>Archives</h3>
                <ul>
                    <?php 
    wp_get_archives('type=monthly');
    ?>
                </ul>
            </li>

            <?php 
    if (is_home()) {
        ?>
            <li><h3>Links</h3>
                <ul>
                    <?php 
        get_links('-1', '<li>', '</li>', ' ', TRUE, 'url', FALSE);
        ?>
                </ul>
            </li>
            <?php 
    }
    ?>

            <?php 
}
?>

        </ul>
    </div>

    <p align="center">
function get_links_list($order = 'name', $hide_if_empty = 'obsolete')
{
    global $wpdb;
    $order = strtolower($order);
    // Handle link category sorting
    if (substr($order, 0, 1) == '_') {
        $direction = ' DESC';
        $order = substr($order, 1);
    }
    // if 'name' wasn't specified, assume 'id':
    $cat_order = 'name' == $order ? 'cat_name' : 'cat_id';
    if (!isset($direction)) {
        $direction = '';
    }
    // Fetch the link category data as an array of hashesa
    $cats = $wpdb->get_results("\n\t\tSELECT DISTINCT link_category, cat_name, show_images, \n\t\t\tshow_description, show_rating, show_updated, sort_order, \n\t\t\tsort_desc, list_limit\n\t\tFROM `{$wpdb->links}` \n\t\tLEFT JOIN `{$wpdb->linkcategories}` ON (link_category = cat_id)\n\t\tWHERE link_visible =  'Y'\n\t\t\tAND list_limit <> 0\n\t\tORDER BY {$cat_order} {$direction} ", ARRAY_A);
    // Display each category
    if ($cats) {
        foreach ($cats as $cat) {
            // Handle each category.
            // First, fix the sort_order info
            $orderby = $cat['sort_order'];
            $orderby = (bool_from_yn($cat['sort_desc']) ? '_' : '') . $orderby;
            // Display the category name
            echo '	<li id="linkcat-' . $cat['link_category'] . '"><h2>' . $cat['cat_name'] . "</h2>\n\t<ul>\n";
            // Call get_links() with all the appropriate params
            get_links($cat['link_category'], '<li>', "</li>", "\n", bool_from_yn($cat['show_images']), $orderby, bool_from_yn($cat['show_description']), bool_from_yn($cat['show_rating']), $cat['list_limit'], bool_from_yn($cat['show_updated']));
            // Close the last category
            echo "\n\t</ul>\n</li>\n";
        }
    }
}
Exemple #26
0
function add_links($url, $is_index_page = true, $num = '')
{
    global $db;
    $new_links = array();
    $j = 1;
    $url_htmlcode = get_url_content($url);
    $url_htmlcode = get_encoding($url_htmlcode, "GB2312");
    $links = get_links($url_htmlcode, $url, 1, $url);
    echo "<br><b>url=";
    print_r($url);
    echo "<br></b>";
    if ($is_index_page) {
        foreach ($links as $value) {
            $new_links[] = GetSiteUrl($value);
        }
    } else {
        $new_links = $links;
    }
    $new_links = distinct_array($new_links);
    foreach ($new_links as $value) {
        //echo $value."<br>";
        //ob_flush();
        //flush();
        $query = $db->query("select * from ve123_links where url='{$value}'");
        $num = $db->num_rows($query);
        if ($num == 0) {
            echo "<font color=#C60A00><b>抓取到:</b></font>" . $value . "<br>";
            if (!add_update_link($value, "", "", "add")) {
                continue;
            }
            $j++;
            if (!empty($num)) {
                if ($j >= $num) {
                    exit;
                }
            }
        } else {
            echo "<b>已存在了:</b>";
            echo "<a href=" . $value . " target=_blank>" . $value . "</a>";
            echo "<br>";
        }
        ob_flush();
        flush();
    }
}
Exemple #27
0
?>
</li>
                   </ul>
               </div>
               <div class="side_bottom">
               </div>
           </div>
           <div class="side_block">
               <div class="side_mid">
                   <h3><?php 
echo _e('Links', 'lighterblue');
?>
</h3>
                   <ul>
                      <?php 
get_links(-1, '<li>', '</li>', 0, 0, 'Rand', 0, 0, 20, 0);
?>
                   </ul>
               </div>
               <div class="side_bottom">
               </div>
           </div>
	<div id="sidebar_bottom">
		<ul class="widgets">
			<?php 
if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('sidebar_bottom')) {
    ?>
		
			<?php 
}
?>
Exemple #28
0
 /**
  * @desc Output of plugin composing the get_links function call
  * @author Georg Leciejewski
  */
 function widget_king_links($args, $number = 1)
 {
     # $args is an array of strings that help widgets to conform to
     # the active theme: before_widget, before_title, after_widget,
     # and after_title are the array keys. Default tags: li and h2.
     extract($args, EXTR_PREFIX_ALL, "default");
     $options = get_option('widget_king_links');
     $title = $options[$number]['title'];
     $category = empty($options[$number]['category']) ? -1 : $options[$number]['category'];
     $show_category = $options[$number]['show_category'] ? 1 : 0;
     $category_id = $options[$number]['category_id'];
     $show_on_site_area = $options[$number]['show_on_site_area'] ? 1 : 0;
     $site_area_id = $options[$number]['site_area_id'];
     $site_area = $options[$number]['site_area'];
     $before = stripslashes($options[$number]['before']);
     $after = stripslashes($options[$number]['after']);
     $between = stripslashes($options[$number]['between']);
     $show_images = $options[$number]['show_images'] ? 1 : 0;
     $orderby = $options[$number]['orderby'];
     $show_description = $options[$number]['show_description'] ? 1 : 0;
     $show_rating = $options[$number]['show_rating'] ? 1 : 0;
     $limit = empty($options[$number]['limit']) ? -1 : $options[$number]['limit'];
     $show_updated = $options[$number]['show_updated'] ? 1 : 0;
     $before_widget = empty($options[$number]['before_widget']) ? $default_before_widget : stripslashes($options[$number]['before_widget']);
     $before_widget_title = empty($options[$number]['before_widget_title']) ? $default_before_title : stripslashes($options[$number]['before_widget_title']);
     $after_widget_title = empty($options[$number]['after_widget_title']) ? $default_after_title : stripslashes($options[$number]['after_widget_title']);
     $after_widget = empty($options[$number]['after_widget']) ? $default_after_widget : stripslashes($options[$number]['after_widget']);
     # These lines generate our output. Widgets can be very complex
     # but as you can see here, they can also be very, very simple.
     if (!empty($show_category)) {
         $post = $wp_query->post;
         if (in_category($category_id)) {
             if (!empty($options[$number]['use_wpgetlinks'])) {
                 echo $before_widget . "\n";
                 echo $before_widget_title . "\n";
                 echo $title . "\n";
                 echo $after_widget_title . "\n";
                 wp_get_links($category);
                 echo $after_widget . "\n";
             } else {
                 echo $before_widget . "\n";
                 echo $before_widget_title . "\n";
                 echo $title . "\n";
                 echo $after_widget_title . "\n";
                 get_links($category, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated, $echo = 1);
                 echo $after_widget . "\n";
             }
         }
     } elseif (!empty($show_on_site_area)) {
         # show only on specific site area
         if ($site_area($site_area_id)) {
             if (!empty($options[$number]['use_wpgetlinks'])) {
                 echo $before_widget . "\n";
                 echo $before_widget_title . "\n";
                 echo $title . "\n";
                 echo $after_widget_title . "\n";
                 wp_get_links($category);
                 echo $after_widget . "\n";
             } else {
                 echo $before_widget . "\n";
                 echo $before_widget_title . "\n";
                 echo $title . "\n";
                 echo $after_widget_title . "\n";
                 get_links($category, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated, $echo = 1);
                 echo $after_widget . "\n";
             }
         }
     } else {
         # always show
         if (!empty($options[$number]['use_wpgetlinks'])) {
             echo $before_widget . "\n";
             echo $before_widget_title . "\n";
             echo $title . "\n";
             echo $after_widget_title . "\n";
             wp_get_links($category);
             echo $after_widget . "\n";
         } else {
             echo $before_widget . "\n";
             echo $before_widget_title . "\n";
             echo $title . "\n";
             echo $after_widget_title . "\n";
             get_links($category, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated, $echo = 1);
             echo $after_widget . "\n";
         }
     }
     #end else if site area
     if (!empty($options[$number]['debug'])) {
         echo '<h2>' . __('Your Link Options are:', 'widgetKing') . '</h2>';
         echo "get_links({$category},{$before},{$after},{$between},{$show_images},{$orderby},{$show_description},{$show_rating},{$limit},{$show_updated},{$echo})";
     }
 }
Exemple #29
0
/**
 * Output entire list of links by category.
 *
 * Output a list of all links, listed by category, using the settings in
 * $wpdb->linkcategories and output it as a nested HTML unordered list.
 *
 * @since 1.0.1
 * @deprecated 2.1
 * @deprecated Use wp_list_bookmarks()
 * @see wp_list_bookmarks()
 *
 * @param string $order Sort link categories by 'name' or 'id'
 */
function get_links_list($order = 'name')
{
    _deprecated_function(__FUNCTION__, '2.1', 'wp_list_bookmarks()');
    $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(array('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->term_id . '" class="linkcat"><h2>' . apply_filters('link_category', $cat->name) . "</h2>\n\t<ul>\n";
            // Call get_links() with all the appropriate params
            get_links($cat->term_id, '<li>', "</li>", "\n", true, 'name', false);
            // Close the last category
            echo "\n\t</ul>\n</li>\n";
        }
    }
}
Exemple #30
0
    ?>
					</ul>
				</li>	
				<li>
					<h2>Pages</h2>
					<ul>
					<?php 
    wp_list_pages('title_li=');
    ?>
					</ul>
				</li>
				<li>
					<h2>Blogroll</h2>
					<ul>
						<?php 
    get_links(-1, '<li>', '</li>', 'between', FALSE, 'name', FALSE, FALSE, -1, FALSE);
    ?>
					</ul>
				</li>
				<li>
				    <h2>Tags</h2>
				    <ul>
				         <?php 
    wp_tag_cloud();
    ?>
                    </ul>
                 </li>
	<?php 
}
?>
		</ul>