Removed global $siteurl and $blogfilename, use get_settings. Syntax fix for wp-db.
git-svn-id: http://svn.automattic.com/wordpress/trunk@945 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -203,8 +203,9 @@ function get_usernumposts($userid) {
|
||||
// examine a url (supposedly from this blog) and try to
|
||||
// determine the post ID it represents.
|
||||
function url_to_postid($url = '') {
|
||||
global $wpdb, $tableposts, $siteurl;
|
||||
global $wpdb, $tableposts;
|
||||
|
||||
$siteurl = get_settings('siteurl');
|
||||
// Take a link like 'http://example.com/blog/something'
|
||||
// and extract just the '/something':
|
||||
$uri = preg_replace("#$siteurl#i", '', $url);
|
||||
@@ -536,10 +537,12 @@ function timer_stop($display=0,$precision=3) { //if called like timer_stop(1), w
|
||||
// pings Weblogs.com
|
||||
function pingWeblogs($blog_ID = 1) {
|
||||
// original function by Dries Buytaert for Drupal
|
||||
global $use_weblogsping, $blogname,$siteurl,$blogfilename;
|
||||
if ((!(($blogname=="my weblog") && ($siteurl=="http://example.com") && ($blogfilename=="wp.php"))) && (!preg_match("/localhost\//",$siteurl)) && ($use_weblogsping)) {
|
||||
global $use_weblogsping, $blogname;
|
||||
if ((!(($blogname=="my weblog") && (get_settings('siteurl')=="http://example.com") && (get_settings('blogfilename') == "wp.php"))) && (!preg_match("/localhost\//", get_settings('siteurl'))) && ($use_weblogsping)) {
|
||||
$client = new xmlrpc_client("/RPC2", "rpc.weblogs.com", 80);
|
||||
$message = new xmlrpcmsg("weblogUpdates.ping", array(new xmlrpcval($blogname), new xmlrpcval($siteurl."/".$blogfilename)));
|
||||
$message = new xmlrpcmsg("weblogUpdates.ping", array(new xmlrpcval($blogname),
|
||||
new xmlrpcval(get_settings('siteurl') . '/' . get_settings('blogfilename')
|
||||
)));
|
||||
$result = $client->send($message);
|
||||
if (!$result || $result->faultCode()) {
|
||||
return false;
|
||||
@@ -568,8 +571,8 @@ function pingWeblogsRss($blog_ID = 1, $rss_url) {
|
||||
|
||||
// pings Caf<61>Log.com
|
||||
function pingCafelog($cafelogID,$title='',$p='') {
|
||||
global $use_cafelogping, $blogname, $siteurl, $blogfilename;
|
||||
if ((!(($blogname=="my weblog") && ($siteurl=="http://example.com") && ($blogfilename=="wp.php"))) && (!preg_match("/localhost\//",$siteurl)) && ($use_cafelogping) && ($cafelogID != '')) {
|
||||
global $use_cafelogping, $blogname;
|
||||
if ((!(($blogname=="my weblog") && (get_settings('siteurl') == "http://example.com") && (get_settings('blogfilename')=="wp.php"))) && (!preg_match("/localhost\//", get_settings('siteurl'))) && ($use_cafelogping) && ($cafelogID != '')) {
|
||||
$client = new xmlrpc_client("/xmlrpc.php", "cafelog.tidakada.com", 80);
|
||||
$message = new xmlrpcmsg("b2.ping", array(new xmlrpcval($cafelogID), new xmlrpcval($title), new xmlrpcval($p)));
|
||||
$result = $client->send($message);
|
||||
@@ -584,12 +587,12 @@ function pingCafelog($cafelogID,$title='',$p='') {
|
||||
|
||||
// pings Blo.gs
|
||||
function pingBlogs($blog_ID="1") {
|
||||
global $use_blodotgsping, $blodotgsping_url, $use_rss, $blogname, $siteurl, $blogfilename;
|
||||
if ((!(($blogname=='my weblog') && ($siteurl=='http://example.com') && ($blogfilename=='wp.php'))) && (!preg_match('/localhost\//',$siteurl)) && ($use_blodotgsping)) {
|
||||
$url = ($blodotgsping_url == 'http://example.com') ? $siteurl.'/'.$blogfilename : $blodotgsping_url;
|
||||
global $use_blodotgsping, $blodotgsping_url, $use_rss, $blogname;
|
||||
if ((!(($blogname=='my weblog') && (get_settings('siteurl')=='http://example.com') && (get_settings('blogfilename')=='wp.php'))) && (!preg_match('/localhost\//',get_settings('siteurl'))) && ($use_blodotgsping)) {
|
||||
$url = ($blodotgsping_url == 'http://example.com') ? get_settings('siteurl').'/'.get_settings('blogfilename') : $blodotgsping_url;
|
||||
$client = new xmlrpc_client('/', 'ping.blo.gs', 80);
|
||||
if ($use_rss) {
|
||||
$message = new xmlrpcmsg('weblogUpdates.extendedPing', array(new xmlrpcval($blogname), new xmlrpcval($url), new xmlrpcval($url), new xmlrpcval($siteurl.'/b2rss.xml')));
|
||||
$message = new xmlrpcmsg('weblogUpdates.extendedPing', array(new xmlrpcval($blogname), new xmlrpcval($url), new xmlrpcval($url), new xmlrpcval(get_settings('siteurl').'/b2rss.xml')));
|
||||
} else {
|
||||
$message = new xmlrpcmsg('weblogUpdates.ping', array(new xmlrpcval($blogname), new xmlrpcval($url)));
|
||||
}
|
||||
@@ -657,7 +660,6 @@ function trackback_response($error = 0, $error_message = '') {
|
||||
}
|
||||
|
||||
function make_url_footnote($content) {
|
||||
global $siteurl;
|
||||
preg_match_all('/<a(.+?)href=\"(.+?)\"(.*?)>(.+?)<\/a>/', $content, $matches);
|
||||
$j = 0;
|
||||
for ($i=0; $i<count($matches[0]); $i++) {
|
||||
@@ -668,7 +670,7 @@ function make_url_footnote($content) {
|
||||
$link_url = $matches[2][$i];
|
||||
$link_text = $matches[4][$i];
|
||||
$content = str_replace($link_match, $link_text.' '.$link_number, $content);
|
||||
$link_url = (strtolower(substr($link_url,0,7)) != 'http://') ? $siteurl.$link_url : $link_url;
|
||||
$link_url = (strtolower(substr($link_url,0,7)) != 'http://') ? get_settings('siteurl') . $link_url : $link_url;
|
||||
$links_summary .= "\n".$link_number.' '.$link_url;
|
||||
}
|
||||
$content = strip_tags($content);
|
||||
@@ -735,7 +737,7 @@ function debug_fclose($fp) {
|
||||
|
||||
function pingback($content, $post_ID) {
|
||||
// original code by Mort (http://mort.mine.nu:8080)
|
||||
global $siteurl, $blogfilename, $wp_version;
|
||||
global $wp_version;
|
||||
$log = debug_fopen('./pingback.log', 'a');
|
||||
$post_links = array();
|
||||
debug_fwrite($log, 'BEGIN '.time()."\n");
|
||||
@@ -1014,7 +1016,7 @@ function wp_get_comment_status($comment_id) {
|
||||
function wp_notify_postauthor($comment_id, $comment_type='comment') {
|
||||
global $wpdb, $tablecomments, $tableposts, $tableusers;
|
||||
global $querystring_start, $querystring_equal, $querystring_separator;
|
||||
global $blogfilename, $blogname, $siteurl, $blog_charset;
|
||||
global $blogname, $blog_charset;
|
||||
|
||||
$comment = $wpdb->get_row("SELECT * FROM $tablecomments WHERE comment_ID='$comment_id' LIMIT 1");
|
||||
$post = $wpdb->get_row("SELECT * FROM $tableposts WHERE ID='$comment->comment_post_ID' LIMIT 1");
|
||||
@@ -1075,7 +1077,7 @@ function wp_notify_postauthor($comment_id, $comment_type='comment') {
|
||||
function wp_notify_moderator($comment_id) {
|
||||
global $wpdb, $tablecomments, $tableposts, $tableusers;
|
||||
global $querystring_start, $querystring_equal, $querystring_separator;
|
||||
global $blogfilename, $blogname, $siteurl, $blog_charset;
|
||||
global $blogname, $blog_charset;
|
||||
|
||||
$comment = $wpdb->get_row("SELECT * FROM $tablecomments WHERE comment_ID='$comment_id' LIMIT 1");
|
||||
$post = $wpdb->get_row("SELECT * FROM $tableposts WHERE ID='$comment->comment_post_ID' LIMIT 1");
|
||||
@@ -1090,10 +1092,10 @@ function wp_notify_moderator($comment_id) {
|
||||
$notify_message .= "URL : $comment->comment_author_url\r\n";
|
||||
$notify_message .= "Whois : http://ws.arin.net/cgi-bin/whois.pl?queryinput=$comment->comment_author_IP\r\n";
|
||||
$notify_message .= "Comment:\r\n".stripslashes($comment->comment_content)."\r\n\r\n";
|
||||
$notify_message .= "To approve this comment, visit: $siteurl/wp-admin/post.php?action=mailapprovecomment&p=".$comment->comment_post_ID."&comment=$comment_id\r\n";
|
||||
$notify_message .= "To delete this comment, visit: $siteurl/wp-admin/post.php?action=confirmdeletecomment&p=".$comment->comment_post_ID."&comment=$comment_id\r\n";
|
||||
$notify_message .= "To approve this comment, visit: " . get_settings('siteurl') . "/wp-admin/post.php?action=mailapprovecomment&p=".$comment->comment_post_ID."&comment=$comment_id\r\n";
|
||||
$notify_message .= "To delete this comment, visit: " . get_settings('siteurl') . "/wp-admin/post.php?action=confirmdeletecomment&p=".$comment->comment_post_ID."&comment=$comment_id\r\n";
|
||||
$notify_message .= "Currently $comments_waiting comments are waiting for approval. Please visit the moderation panel:\r\n";
|
||||
$notify_message .= "$siteurl/wp-admin/moderation.php\r\n";
|
||||
$notify_message .= get_settings('siteurl') . "/wp-admin/moderation.php\r\n";
|
||||
|
||||
$subject = '[' . stripslashes($blogname) . '] Please approve: "' .stripslashes($post->post_title).'"';
|
||||
$admin_email = get_settings("admin_email");
|
||||
@@ -1278,9 +1280,8 @@ function get_search_query_terms($engine = 'google') {
|
||||
}
|
||||
|
||||
function is_referer_search_engine($engine = 'google') {
|
||||
global $siteurl;
|
||||
|
||||
$referer = urldecode($_SERVER[HTTP_REFERER]);
|
||||
$siteurl = get_settings('siteurl');
|
||||
$referer = urldecode($_SERVER['HTTP_REFERER']);
|
||||
//echo "referer is: $referer<br />";
|
||||
if ( ! $engine ) {
|
||||
return 0;
|
||||
|
||||
@@ -16,18 +16,18 @@ function get_the_category() {
|
||||
}
|
||||
|
||||
function get_category_link($echo = false, $category_id, $category_nicename) {
|
||||
global $wpdb, $tablecategories, $post, $querystring_start, $querystring_equal, $siteurl, $blogfilename, $cache_categories;
|
||||
global $wpdb, $tablecategories, $post, $querystring_start, $querystring_equal, $cache_categories;
|
||||
$cat_ID = $category_id;
|
||||
$permalink_structure = get_settings('permalink_structure');
|
||||
|
||||
if ('' == $permalink_structure) {
|
||||
$file = "$siteurl/$blogfilename";
|
||||
$file = get_settings('siteurl') . '/' . get_settings('blogfilename');
|
||||
$link = $file.$querystring_start.'cat'.$querystring_equal.$cat_ID;
|
||||
} else {
|
||||
if ('' == $category_nicename) $category_nicename = $cache_categories[$category_id]->category_nicename;
|
||||
// Get any static stuff from the front
|
||||
$front = substr($permalink_structure, 0, strpos($permalink_structure, '%'));
|
||||
$link = $siteurl . $front . 'category/';
|
||||
$link = get_settings('siteurl') . $front . 'category/';
|
||||
if ($parent=$cache_categories[$category_id]->category_parent) $link .= get_category_parents($parent, FALSE, '/', TRUE);
|
||||
$link .= $category_nicename . '/';
|
||||
}
|
||||
@@ -37,12 +37,12 @@ function get_category_link($echo = false, $category_id, $category_nicename) {
|
||||
}
|
||||
|
||||
function get_category_rss_link($echo = false, $category_id, $category_nicename) {
|
||||
global $querystring_start, $querystring_equal, $siteurl;
|
||||
global $querystring_start, $querystring_equal;
|
||||
$cat_ID = $category_id;
|
||||
$permalink_structure = get_settings('permalink_structure');
|
||||
|
||||
if ('' == $permalink_structure) {
|
||||
$file = "$siteurl/wp-rss2.php";
|
||||
$file = get_settings('siteurl') . '/wp-rss2.php';
|
||||
$link = $file . $querystring_start . 'cat' . $querystring_equal . $category_id;
|
||||
} else {
|
||||
$link = get_category_link(0, $category_id, $category_nicename);
|
||||
@@ -185,9 +185,9 @@ function dropdown_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_
|
||||
$optiondates = 0, $optioncount = 0, $hide_empty = 1, $optionnone=FALSE,
|
||||
$selected=0, $hide=0) {
|
||||
global $tablecategories, $tableposts, $tablepost2cat, $wpdb;
|
||||
global $pagenow, $siteurl, $blogfilename;
|
||||
global $pagenow;
|
||||
global $querystring_start, $querystring_equal, $querystring_separator;
|
||||
if (($file == 'blah') || ($file == '')) $file = "$siteurl/$blogfilename";
|
||||
if (($file == 'blah') || ($file == '')) $file = get_settings('siteurl') . '/' . get_settings('blogfilename');
|
||||
if (!$selected) $selected=$cat;
|
||||
$sort_column = 'cat_'.$sort_column;
|
||||
|
||||
@@ -252,11 +252,11 @@ function wp_list_cats($args = '') {
|
||||
|
||||
function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0, $optioncount = 0, $hide_empty = 1, $use_desc_for_title = 1, $children=FALSE, $child_of=0, $categories=0, $recurse=0) {
|
||||
global $tablecategories, $tableposts, $tablepost2cat, $wpdb;
|
||||
global $pagenow, $siteurl, $blogfilename;
|
||||
global $pagenow;
|
||||
global $querystring_start, $querystring_equal, $querystring_separator;
|
||||
// Optiondates now works
|
||||
if ('' == $file) {
|
||||
$file = "$siteurl/$blogfilename";
|
||||
$file = "$siteurl/" . get_settings('blogfilename');
|
||||
}
|
||||
if (intval($categories)==0){
|
||||
$sort_column = 'cat_'.$sort_column;
|
||||
|
||||
@@ -60,7 +60,7 @@ function comments_popup_script($width=400, $height=400, $file='wp-comments-popup
|
||||
|
||||
function comments_popup_link($zero='No Comments', $one='1 Comment', $more='% Comments', $CSSclass='', $none='Comments Off') {
|
||||
global $id, $wpcommentspopupfile, $wpcommentsjavascript, $post, $wpdb, $tablecomments, $HTTP_COOKIE_VARS, $cookiehash;
|
||||
global $querystring_start, $querystring_equal, $querystring_separator, $siteurl;
|
||||
global $querystring_start, $querystring_equal, $querystring_separator;
|
||||
global $comment_count_cache, $single;
|
||||
if (!$single) {
|
||||
if ('' == $comment_count_cache["$id"]) {
|
||||
@@ -80,7 +80,7 @@ function comments_popup_link($zero='No Comments', $one='1 Comment', $more='% Com
|
||||
}
|
||||
echo '<a href="';
|
||||
if ($wpcommentsjavascript) {
|
||||
echo $siteurl.'/'.$wpcommentspopupfile.$querystring_start.'p'.$querystring_equal.$id.$querystring_separator.'c'.$querystring_equal.'1';
|
||||
echo get_settings('siteurl') . '/' . $wpcommentspopupfile.$querystring_start.'p'.$querystring_equal.$id.$querystring_separator.'c'.$querystring_equal.'1';
|
||||
//echo get_permalink();
|
||||
echo '" onclick="wpopen(this.href); return false"';
|
||||
} else {
|
||||
@@ -227,12 +227,12 @@ function comment_time($d='') {
|
||||
|
||||
function comments_rss_link($link_text='Comments RSS', $commentsrssfilename = 'wp-commentsrss2.php') {
|
||||
global $id;
|
||||
global $querystring_start, $querystring_equal, $querystring_separator, $siteurl;
|
||||
global $querystring_start, $querystring_equal, $querystring_separator;
|
||||
|
||||
if ('' != get_settings('permalink_structure')) {
|
||||
$url = trailingslashit(get_permalink()) . 'rss2/';
|
||||
} else {
|
||||
$url = $siteurl.'/'.$commentsrssfilename.$querystring_start.'p'.$querystring_equal.$id;
|
||||
$url = get_settings('siteurl') . '/' . $commentsrssfilename.$querystring_start.'p'.$querystring_equal.$id;
|
||||
}
|
||||
|
||||
echo "<a href='$url'>$link_text</a>";
|
||||
@@ -284,8 +284,8 @@ function trackback_url($display = true) {
|
||||
|
||||
|
||||
function trackback_rdf($timezone = 0) {
|
||||
global $siteurl, $id, $HTTP_SERVER_VARS;
|
||||
if (!stristr($HTTP_SERVER_VARS['HTTP_USER_AGENT'], 'W3C_Validator')) {
|
||||
global $id;
|
||||
if (!stristr($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator')) {
|
||||
echo '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
|
||||
|
||||
@@ -22,57 +22,57 @@ function bloginfo_unicode($show='') {
|
||||
}
|
||||
|
||||
function get_bloginfo($show='') {
|
||||
global $siteurl, $blogfilename, $blogname, $blogdescription, $siteurl, $admin_email;
|
||||
global $blogname, $blogdescription, $admin_email;
|
||||
|
||||
$do_perma = 0;
|
||||
$feed_url = $siteurl;
|
||||
$comment_feed_url = $siteurl;
|
||||
$feed_url = get_settings('siteurl');
|
||||
$comment_feed_url = get_settings('siteurl');
|
||||
|
||||
if ('' != get_settings('permalink_structure')) {
|
||||
$do_perma = 1;
|
||||
$feed_url = $siteurl . '/feed';
|
||||
$comment_feed_url = $siteurl . '/comments/feed';
|
||||
$feed_url = get_settings('siteurl') . '/feed';
|
||||
$comment_feed_url = get_settings('siteurl') . '/comments/feed';
|
||||
}
|
||||
|
||||
switch($show) {
|
||||
case 'url':
|
||||
$output = $siteurl.'/'.$blogfilename;
|
||||
$output = get_settings('siteurl') .'/'. get_settings('blogfilename');
|
||||
break;
|
||||
case 'description':
|
||||
$output = $blogdescription;
|
||||
break;
|
||||
case 'rdf_url':
|
||||
$output = $siteurl.'/wp-rdf.php';
|
||||
$output = get_settings('siteurl') .'/wp-rdf.php';
|
||||
if ($do_perma) {
|
||||
$output = $feed_url . '/rdf/';
|
||||
}
|
||||
break;
|
||||
case 'rss_url':
|
||||
$output = $siteurl.'/wp-rss.php';
|
||||
$output = get_settings('siteurl') .'/wp-rss.php';
|
||||
if ($do_perma) {
|
||||
$output = $feed_url . '/rss/';
|
||||
}
|
||||
break;
|
||||
case 'rss2_url':
|
||||
$output = $siteurl.'/wp-rss2.php';
|
||||
$output = get_settings('siteurl') .'/wp-rss2.php';
|
||||
if ($do_perma) {
|
||||
$output = $feed_url . '/rss2/';
|
||||
}
|
||||
break;
|
||||
case 'atom_url':
|
||||
$output = $siteurl.'/wp-atom.php';
|
||||
$output = get_settings('siteurl') .'/wp-atom.php';
|
||||
if ($do_perma) {
|
||||
$output = $feed_url . '/atom/';
|
||||
}
|
||||
break;
|
||||
case 'comments_rss2_url':
|
||||
$output = $siteurl.'/wp-commentsrss2.php';
|
||||
$output = get_settings('siteurl') .'/wp-commentsrss2.php';
|
||||
if ($do_perma) {
|
||||
$output = $comment_feed_url . '/rss2/';
|
||||
}
|
||||
break;
|
||||
case 'pingback_url':
|
||||
$output = $siteurl.'/xmlrpc.php';
|
||||
$output = get_settings('siteurl') .'/xmlrpc.php';
|
||||
break;
|
||||
case 'admin_email':
|
||||
$output = $admin_email;
|
||||
@@ -204,7 +204,7 @@ function get_archives_link($url, $text, $format = "html", $before = "", $after =
|
||||
}
|
||||
|
||||
function get_archives($type='', $limit='', $format='html', $before = "", $after = "", $show_post_count = false) {
|
||||
global $tableposts, $time_difference, $siteurl, $blogfilename;
|
||||
global $tableposts, $time_difference;
|
||||
global $querystring_start, $querystring_equal, $querystring_separator, $month, $wpdb, $start_of_week;
|
||||
|
||||
if ('' == $type) {
|
||||
@@ -219,9 +219,9 @@ function get_archives($type='', $limit='', $format='html', $before = "", $after
|
||||
$archive_week_separator = '–';
|
||||
|
||||
// archive link url
|
||||
$archive_link_m = $siteurl.'/'.$blogfilename.$querystring_start.'m'.$querystring_equal; # monthly archive;
|
||||
$archive_link_w = $siteurl.'/'.$blogfilename.$querystring_start.'w'.$querystring_equal; # weekly archive;
|
||||
$archive_link_p = $siteurl.'/'.$blogfilename.$querystring_start.'p'.$querystring_equal; # post-by-post archive;
|
||||
$archive_link_m = get_settings('siteurl').'/'.get_settings('blogfilename').$querystring_start.'m'.$querystring_equal; # monthly archive;
|
||||
$archive_link_w = get_settings('siteurl').'/'.get_settings('blogfilename').$querystring_start.'w'.$querystring_equal; # weekly archive;
|
||||
$archive_link_p = get_settings('siteurl').'/'.get_settings('blogfilename').$querystring_start.'p'.$querystring_equal; # post-by-post archive;
|
||||
|
||||
// over-ride general date format ? 0 = no: use the date format set in Options, 1 = yes: over-ride
|
||||
$archive_date_format_over_ride = 0;
|
||||
@@ -283,7 +283,7 @@ function get_archives($type='', $limit='', $format='html', $before = "", $after
|
||||
$arc_week = get_weekstartend($arcresult->yyyymmdd, $start_of_week);
|
||||
$arc_week_start = date_i18n($archive_week_start_date_format, $arc_week['start']);
|
||||
$arc_week_end = date_i18n($archive_week_end_date_format, $arc_week['end']);
|
||||
$url = sprintf('%s/%s%sm%s%s%sw%s%d', $siteurl, $blogfilename, $querystring_start,
|
||||
$url = sprintf('%s/%s%sm%s%s%sw%s%d', get_settings('siteurl'), get_settings('blogfilename'), $querystring_start,
|
||||
$querystring_equal, $arc_year, $querystring_separator,
|
||||
$querystring_equal, $arcresult->week);
|
||||
$text = $arc_week_start . $archive_week_separator . $arc_week_end;
|
||||
|
||||
@@ -35,13 +35,12 @@ function permalink_single($file = '') {
|
||||
}
|
||||
|
||||
function permalink_single_rss($file = '') {
|
||||
global $siteurl;
|
||||
echo get_permalink();
|
||||
}
|
||||
|
||||
function get_permalink($id=false) {
|
||||
global $post, $wpdb, $tableposts;
|
||||
global $siteurl, $blogfilename, $querystring_start, $querystring_equal;
|
||||
global $querystring_start, $querystring_equal;
|
||||
|
||||
$rewritecode = array(
|
||||
'%year%',
|
||||
@@ -60,9 +59,9 @@ function get_permalink($id=false) {
|
||||
$post->post_name,
|
||||
$post->ID
|
||||
);
|
||||
return $siteurl . str_replace($rewritecode, $rewritereplace, get_settings('permalink_structure'));
|
||||
return get_settings('siteurl') . str_replace($rewritecode, $rewritereplace, get_settings('permalink_structure'));
|
||||
} else { // if they're not using the fancy permalink option
|
||||
return $siteurl . '/' . $blogfilename.$querystring_start.'p'.$querystring_equal.$post->ID;
|
||||
return get_settings('siteurl') . '/' . get_settings('blogfilename').$querystring_start.'p'.$querystring_equal.$post->ID;
|
||||
}
|
||||
} else { // if an ID is given
|
||||
$idpost = $wpdb->get_row("SELECT post_date, post_name FROM $tableposts WHERE ID = $id");
|
||||
@@ -75,15 +74,15 @@ function get_permalink($id=false) {
|
||||
$idpost->post_name,
|
||||
$id
|
||||
);
|
||||
return $siteurl . str_replace($rewritecode, $rewritereplace, get_settings('permalink_structure'));
|
||||
return get_settings('siteurl') . str_replace($rewritecode, $rewritereplace, get_settings('permalink_structure'));
|
||||
} else {
|
||||
return $siteurl . '/' . $blogfilename.$querystring_start.'p'.$querystring_equal.$id;
|
||||
return get_settings('siteurl') . '/' . get_settings('blogfilename').$querystring_start.'p'.$querystring_equal.$id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function get_month_link($year, $month) {
|
||||
global $siteurl, $blogfilename, $querystring_start, $querystring_equal;
|
||||
global $querystring_start, $querystring_equal;
|
||||
if (!$year) $year = date('Y', time()+($time_difference * 3600));
|
||||
if (!$month) $month = date('m', time()+($time_difference * 3600));
|
||||
if ('' != get_settings('permalink_structure')) {
|
||||
@@ -94,14 +93,14 @@ function get_month_link($year, $month) {
|
||||
$monthlink = str_replace('%year%', $year, $monthlink);
|
||||
$monthlink = str_replace('%monthnum%', zeroise(intval($month), 2), $monthlink);
|
||||
$monthlink = str_replace('%post_id%', '', $monthlink);
|
||||
return $siteurl . $monthlink;
|
||||
return get_settings('siteurl') . $monthlink;
|
||||
} else {
|
||||
return $siteurl.'/'.$blogfilename.$querystring_start.'m'.$querystring_equal.$year.zeroise($month, 2);
|
||||
return get_settings('siteurl') .'/'. get_settings('blogfilename') .$querystring_start.'m'.$querystring_equal.$year.zeroise($month, 2);
|
||||
}
|
||||
}
|
||||
|
||||
function get_day_link($year, $month, $day) {
|
||||
global $siteurl, $blogfilename, $querystring_start, $querystring_equal;
|
||||
global $querystring_start, $querystring_equal;
|
||||
if (!$year) $year = date('Y', time()+($time_difference * 3600));
|
||||
if (!$month) $month = date('m', time()+($time_difference * 3600));
|
||||
if (!$day) $day = date('j', time()+($time_difference * 3600));
|
||||
@@ -114,14 +113,14 @@ function get_day_link($year, $month, $day) {
|
||||
$daylink = str_replace('%monthnum%', zeroise(intval($month), 2), $daylink);
|
||||
$daylink = str_replace('%day%', zeroise(intval($day), 2), $daylink);
|
||||
$daylink = str_replace('%post_id%', '', $daylink);
|
||||
return $siteurl . $daylink;
|
||||
return get_settings('siteurl') . $daylink;
|
||||
} else {
|
||||
return $siteurl.'/'.$blogfilename.$querystring_start.'m'.$querystring_equal.$year.zeroise($month, 2).zeroise($day, 2);
|
||||
return get_settings('siteurl') .'/'. get_settings('blogfilename') .$querystring_start.'m'.$querystring_equal.$year.zeroise($month, 2).zeroise($day, 2);
|
||||
}
|
||||
}
|
||||
|
||||
function edit_post_link($link = 'Edit This', $before = '', $after = '') {
|
||||
global $user_level, $post, $siteurl;
|
||||
global $user_level, $post;
|
||||
|
||||
get_currentuserinfo();
|
||||
|
||||
@@ -134,12 +133,12 @@ function edit_post_link($link = 'Edit This', $before = '', $after = '') {
|
||||
return;
|
||||
}
|
||||
|
||||
$location = "$siteurl/wp-admin/post.php?action=edit&post=$post->ID";
|
||||
$location = get_settings('siteurl') . "/wp-admin/post.php?action=edit&post=$post->ID";
|
||||
echo "$before <a href=\"$location\">$link</a> $after";
|
||||
}
|
||||
|
||||
function edit_comment_link($link = 'Edit This', $before = '', $after = '') {
|
||||
global $user_level, $post, $comment, $siteurl;
|
||||
global $user_level, $post, $comment;
|
||||
|
||||
get_currentuserinfo();
|
||||
|
||||
@@ -152,7 +151,7 @@ function edit_comment_link($link = 'Edit This', $before = '', $after = '') {
|
||||
return;
|
||||
}
|
||||
|
||||
$location = "$siteurl/wp-admin/post.php?action=editcomment&comment=$comment->comment_ID";
|
||||
$location = get_settings('siteurl') . "/wp-admin/post.php?action=editcomment&comment=$comment->comment_ID";
|
||||
echo "$before <a href=\"$location\">$link</a> $after";
|
||||
}
|
||||
|
||||
|
||||
@@ -261,7 +261,7 @@ function link_pages($before='<br />', $after='<br />', $next_or_number='number',
|
||||
|
||||
|
||||
function previous_post($format='%', $previous='previous post: ', $title='yes', $in_same_cat='no', $limitprev=1, $excluded_categories='') {
|
||||
global $tableposts, $id, $post, $siteurl, $blogfilename, $wpdb;
|
||||
global $tableposts, $id, $post, $wpdb;
|
||||
global $p, $posts, $posts_per_page, $s, $single;
|
||||
global $querystring_start, $querystring_equal, $querystring_separator;
|
||||
|
||||
@@ -299,7 +299,7 @@ function previous_post($format='%', $previous='previous post: ', $title='yes', $
|
||||
}
|
||||
|
||||
function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') {
|
||||
global $tableposts, $p, $posts, $id, $post, $siteurl, $blogfilename, $wpdb;
|
||||
global $tableposts, $p, $posts, $id, $post, $wpdb;
|
||||
global $time_difference, $single;
|
||||
global $querystring_start, $querystring_equal, $querystring_separator;
|
||||
if(($p) || ($posts==1) || 1 == $single) {
|
||||
@@ -339,7 +339,7 @@ function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat=
|
||||
}
|
||||
|
||||
function next_posts($max_page = 0) { // original by cfactor at cooltux.org
|
||||
global $HTTP_SERVER_VARS, $siteurl, $blogfilename, $p, $paged, $what_to_show, $pagenow;
|
||||
global $HTTP_SERVER_VARS, $p, $paged, $what_to_show, $pagenow;
|
||||
global $querystring_start, $querystring_equal, $querystring_separator;
|
||||
if (empty($p) && ($what_to_show == 'paged')) {
|
||||
$qstr = $HTTP_SERVER_VARS['QUERY_STRING'];
|
||||
@@ -358,7 +358,7 @@ function next_posts($max_page = 0) { // original by cfactor at cooltux.org
|
||||
if (!$paged) $paged = 1;
|
||||
$nextpage = intval($paged) + 1;
|
||||
if (!$max_page || $max_page >= $nextpage) {
|
||||
echo $siteurl.'/'.$pagenow.$querystring_start.
|
||||
echo get_settings('siteurl') .'/'.$pagenow.$querystring_start.
|
||||
($qstr == '' ? '' : $qstr.$querystring_separator) .
|
||||
'paged'.$querystring_equal.$nextpage;
|
||||
}
|
||||
@@ -392,7 +392,7 @@ function next_posts_link($label='Next Page »', $max_page=0) {
|
||||
|
||||
|
||||
function previous_posts() { // original by cfactor at cooltux.org
|
||||
global $HTTP_SERVER_VARS, $siteurl, $blogfilename, $p, $paged, $what_to_show, $pagenow;
|
||||
global $HTTP_SERVER_VARS, $p, $paged, $what_to_show, $pagenow;
|
||||
global $querystring_start, $querystring_equal, $querystring_separator;
|
||||
if (empty($p) && ($what_to_show == 'paged')) {
|
||||
$qstr = $HTTP_SERVER_VARS['QUERY_STRING'];
|
||||
@@ -410,7 +410,7 @@ function previous_posts() { // original by cfactor at cooltux.org
|
||||
}
|
||||
$nextpage = intval($paged) - 1;
|
||||
if ($nextpage < 1) $nextpage = 1;
|
||||
echo $siteurl.'/'.$pagenow.$querystring_start.
|
||||
echo get_settings('siteurl') .'/'.$pagenow.$querystring_start.
|
||||
($qstr == '' ? '' : $qstr.$querystring_separator) .
|
||||
'paged'.$querystring_equal.$nextpage;
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ $pagenow = trim($pagenow[(sizeof($pagenow)-1)]);
|
||||
$pagenow = explode('?', $pagenow);
|
||||
$pagenow = $pagenow[0];
|
||||
if (($querystring_start == '/') && ($pagenow != 'post.php')) {
|
||||
$pagenow = $siteurl.'/'.$blogfilename;
|
||||
$pagenow = get_settings('siteurl') . '/' . get_settings('blogfilename');
|
||||
}
|
||||
|
||||
# browser detection
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
// ==================================================================
|
||||
// Select a DB (if another one needs to be selected)
|
||||
|
||||
function select($db)x{
|
||||
function select($db) {
|
||||
if ( !@mysql_select_db($db,$this->dbh)) {
|
||||
die("
|
||||
<p>We're having a little trouble selecting the proper database for WordPress.</p>
|
||||
@@ -237,7 +237,7 @@
|
||||
}
|
||||
|
||||
// If the output is an object then return object using the row offset..
|
||||
if ( $output == OBJECT ) b{
|
||||
if ( $output == OBJECT ) {
|
||||
return $this->last_result[$y]?$this->last_result[$y]:null;
|
||||
}
|
||||
// If the output is an associative array then return row as such..
|
||||
|
||||
Reference in New Issue
Block a user