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:
parent
59da7f3f13
commit
8927968849
|
@ -15,7 +15,7 @@ require_once('wp-blog-header.php');
|
|||
|
||||
define( 'NODISPLAY', false );
|
||||
|
||||
$wpsmarty->assign( 'siteurl', $siteurl );
|
||||
$wpsmarty->assign( 'siteurl', get_settings('siteurl') );
|
||||
$wpsmarty->assign( 'b2_version', $wp_version );
|
||||
|
||||
if($posts)
|
||||
|
|
12
index.php
12
index.php
|
@ -15,10 +15,10 @@ require('wp-blog-header.php');
|
|||
<meta name="generator" content="WordPress <?php echo $wp_version; ?>" /> <!-- leave this for stats -->
|
||||
|
||||
<style type="text/css" media="screen">
|
||||
@import url( <?php echo $siteurl; ?>/wp-layout.css );
|
||||
@import url( <?php echo get_settings('siteurl'); ?>/wp-layout.css );
|
||||
</style>
|
||||
|
||||
<link rel="stylesheet" type="text/css" media="print" href="<?php echo $siteurl; ?>/print.css" />
|
||||
<link rel="stylesheet" type="text/css" media="print" href="<?php echo get_settings('siteurl'); ?>/print.css" />
|
||||
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
|
||||
<link rel="alternate" type="application/rdf+xml" title="RDF" href="<?php bloginfo('rdf_url'); ?>" />
|
||||
<link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
|
||||
|
@ -32,7 +32,7 @@ require('wp-blog-header.php');
|
|||
|
||||
<body>
|
||||
<div id="rap">
|
||||
<h1 id="header"><a href="<?php echo $siteurl; ?>" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a></h1>
|
||||
<h1 id="header"><a href="<?php echo get_settings('siteurl'); ?>" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a></h1>
|
||||
|
||||
<div id="content">
|
||||
<?php if ($posts) { foreach ($posts as $post) { start_wp(); ?>
|
||||
|
@ -76,7 +76,7 @@ require('wp-blog-header.php');
|
|||
</ul>
|
||||
</li>
|
||||
<li id="search">Search:
|
||||
<form id="searchform" method="get" action="<?php echo $PHP_SELF; /*$siteurl."/".$blogfilename*/ ?>">
|
||||
<form id="searchform" method="get" action="<?php echo $PHP_SELF; ?>">
|
||||
<div>
|
||||
<input type="text" name="s" size="15" /><br />
|
||||
<input type="submit" name="submit" value="search" />
|
||||
|
@ -93,8 +93,8 @@ require('wp-blog-header.php');
|
|||
</li>
|
||||
<li id="other">Other:
|
||||
<ul>
|
||||
<li><a href="<?php echo $siteurl; ?>/wp-login.php">login</a></li>
|
||||
<li><a href="<?php echo $siteurl; ?>/wp-register.php">register</a></li>
|
||||
<li><a href="<?php echo get_settings('siteurl'); ?>/wp-login.php">login</a></li>
|
||||
<li><a href="<?php echo get_settings('siteurl'); ?>/wp-register.php">register</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li id="meta">Meta:
|
||||
|
|
|
@ -4,12 +4,12 @@ require_once('../wp-config.php');
|
|||
|
||||
/* Checking login & pass in the database */
|
||||
function veriflog() {
|
||||
global $HTTP_COOKIE_VARS,$cookiehash;
|
||||
global $cookiehash;
|
||||
global $tableusers, $wpdb;
|
||||
|
||||
if (!empty($HTTP_COOKIE_VARS["wordpressuser_".$cookiehash])) {
|
||||
$user_login = $HTTP_COOKIE_VARS["wordpressuser_".$cookiehash];
|
||||
$user_pass_md5 = $HTTP_COOKIE_VARS["wordpresspass_".$cookiehash];
|
||||
if (!empty($_COOKIE['wordpressuser_' . $cookiehash])) {
|
||||
$user_login = $_COOKIE['wordpressuser_' . $cookiehash];
|
||||
$user_pass_md5 = $_COOKIE['wordpresspass_' . $cookiehash];
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
@ -37,10 +37,10 @@ if ( !veriflog() ) {
|
|||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
header('Cache-Control: no-cache, must-revalidate');
|
||||
header('Pragma: no-cache');
|
||||
if (!empty($HTTP_COOKIE_VARS["wordpressuser_".$cookiehash])) {
|
||||
if (!empty($_COOKIE['wordpressuser_' . $cookiehash])) {
|
||||
$error="<strong>Error</strong>: wrong login or password.";
|
||||
}
|
||||
$redir = "Location: $siteurl/wp-login.php?redirect_to=" . urlencode($HTTP_SERVER_VARS["REQUEST_URI"]);
|
||||
$redir = 'Location: ' . get_settings('siteurl') . '/wp-login.php?redirect_to=' . urlencode($_SERVER['REQUEST_URI']);
|
||||
header($redir);
|
||||
exit();
|
||||
}
|
||||
|
|
|
@ -6,9 +6,9 @@ require_once('auth.php');
|
|||
get_currentuserinfo();
|
||||
|
||||
if (0 == $user_level) {
|
||||
$redirect_to = $siteurl . '/wp-admin/profile.php';
|
||||
$redirect_to = get_settings('siteurl') . '/wp-admin/profile.php';
|
||||
} else {
|
||||
$redirect_to = $siteurl . '/wp-admin/post.php';
|
||||
$redirect_to = get_settings('siteurl') . '/wp-admin/post.php';
|
||||
}
|
||||
header ("Location: $redirect_to");
|
||||
?>
|
|
@ -676,7 +676,7 @@ $guessurl = str_replace('/wp-admin/install.php?step=2', '', 'http://' . $HTTP_HO
|
|||
|
||||
|
||||
<?php
|
||||
$url = $HTTP_POST_VARS['url'];
|
||||
$url = $_POST['url'];
|
||||
if (isset($url)) {
|
||||
$query= "UPDATE $tableoptions set option_value='$url' where option_id=1"; //siteurl
|
||||
$q = $wpdb->query($query);
|
||||
|
|
|
@ -237,7 +237,7 @@ No</label></td>
|
|||
</div>
|
||||
|
||||
<div class="wrap">
|
||||
<p>You can drag <a href="javascript:void(linkmanpopup=window.open('<?php echo $siteurl; ?>/wp-admin/link-add.php?action=popup&linkurl='+escape(location.href)+'&name='+escape(document.title),'LinkManager','scrollbars=yes,width=750,height=550,left=15,top=15,status=yes,resizable=yes'));linkmanpopup.focus();window.focus();linkmanpopup.focus();" title="Link add bookmarklet">Link This</a> to your toolbar and when you click it a window will pop up that will allow you to add whatever site you're on to your links! Right now this only works on Mozilla or Netscape, but we're working on it.</p>
|
||||
<p>You can drag <a href="javascript:void(linkmanpopup=window.open('<?php echo get_settings('siteurl'); ?>/wp-admin/link-add.php?action=popup&linkurl='+escape(location.href)+'&name='+escape(document.title),'LinkManager','scrollbars=yes,width=750,height=550,left=15,top=15,status=yes,resizable=yes'));linkmanpopup.focus();window.focus();linkmanpopup.focus();" title="Link add bookmarklet">Link This</a> to your toolbar and when you click it a window will pop up that will allow you to add whatever site you're on to your links! Right now this only works on Mozilla or Netscape, but we're working on it.</p>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
|
|
@ -21,6 +21,7 @@ foreach ($menu as $item) {
|
|||
}
|
||||
|
||||
?>
|
||||
<li><a href="<?php echo "$siteurl/$blogfilename"; ?>" title="View your site">View site</a></li>
|
||||
<li class="last"><a href="<?php echo $siteurl ?>/wp-login.php?action=logout" title="Logout of this account">Logout (<?php echo stripslashes($user_nickname) ?>)</a></li>
|
||||
<li><a href="<?php echo get_settings('siteurl') . '/' . get_settings('blogfilename'); ?>" title="View your site">View site</a></li>
|
||||
<li class="last"><a href="<?php echo get_settings('siteurl')
|
||||
?>/wp-login.php?action=logout" title="Logout of this account">Logout (<?php echo stripslashes($user_nickname) ?>)</a></li>
|
||||
</ul>
|
||||
|
|
|
@ -96,7 +96,7 @@ default:
|
|||
?>
|
||||
<p>Using the permalink structure value you currently have, <code><?php echo $permalink_structure; ?></code>, these are the mod_rewrite rules you should have in your <code>.htaccess</code> file.</p>
|
||||
<?php
|
||||
$site_root = str_replace('http://', '', trim($siteurl));
|
||||
$site_root = str_replace('http://', '', trim(get_settings('siteurl')));
|
||||
$site_root = preg_replace('|([^/]*)(.*)|i', '$2', $site_root);
|
||||
if ('/' != substr($site_root, -1)) $site_root = $site_root . '/';
|
||||
|
||||
|
|
|
@ -424,7 +424,7 @@ switch($action) {
|
|||
}
|
||||
|
||||
$sendback = $HTTP_SERVER_VARS['HTTP_REFERER'];
|
||||
if (strstr($sendback, 'post.php')) $sendback = $siteurl .'/wp-admin/post.php';
|
||||
if (strstr($sendback, 'post.php')) $sendback = get_settings('siteurl') .'/wp-admin/post.php';
|
||||
header ('Location: ' . $sendback);
|
||||
|
||||
break;
|
||||
|
@ -472,14 +472,14 @@ switch($action) {
|
|||
echo "</table>\n";
|
||||
echo "<p>Are you sure you want to do that?</p>\n";
|
||||
|
||||
echo "<form action=\"$siteurl/wp-admin/post.php\" method=\"get\">\n";
|
||||
echo "<form action='".get_settings('siteurl')."/wp-admin/post.php' method='get'>\n";
|
||||
echo "<input type=\"hidden\" name=\"action\" value=\"deletecomment\" />\n";
|
||||
echo "<input type=\"hidden\" name=\"p\" value=\"$p\" />\n";
|
||||
echo "<input type=\"hidden\" name=\"comment\" value=\"$comment\" />\n";
|
||||
echo "<input type=\"hidden\" name=\"noredir\" value=\"1\" />\n";
|
||||
echo "<input type=\"submit\" value=\"Yes\" />";
|
||||
echo " ";
|
||||
echo "<input type=\"button\" value=\"No\" onClick=\"self.location='$siteurl/wp-admin/edit.php?p=$p&c=1#comments';\" />\n";
|
||||
echo "<input type=\"button\" value=\"No\" onClick=\"self.location='". get_settings('siteurl') ."/wp-admin/edit.php?p=$p&c=1#comments';\" />\n";
|
||||
echo "</form>\n";
|
||||
echo "</div>\n";
|
||||
|
||||
|
@ -514,7 +514,7 @@ switch($action) {
|
|||
if (($HTTP_SERVER_VARS['HTTP_REFERER'] != "") && (false == $noredir)) {
|
||||
header('Location: ' . $HTTP_SERVER_VARS['HTTP_REFERER']);
|
||||
} else {
|
||||
header('Location: '.$siteurl.'/wp-admin/edit.php?p='.$p.'&c=1#comments');
|
||||
header('Location: '. get_settings('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments');
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -542,7 +542,7 @@ switch($action) {
|
|||
if (($HTTP_SERVER_VARS['HTTP_REFERER'] != "") && (false == $noredir)) {
|
||||
header('Location: ' . $HTTP_SERVER_VARS['HTTP_REFERER']);
|
||||
} else {
|
||||
header('Location: '.$siteurl.'/wp-admin/edit.php?p='.$p.'&c=1#comments');
|
||||
header('Location: '. get_settings('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments');
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -567,7 +567,7 @@ switch($action) {
|
|||
echo "<div class=\"wrap\">\n";
|
||||
echo "<p>Comment has been approved.</p>\n";
|
||||
|
||||
echo "<form action=\"$siteurl/wp-admin/edit.php?p=$p&c=1#comments\" method=\"get\">\n";
|
||||
echo "<form action=\"". get_settings('siteurl') ."/wp-admin/edit.php?p=$p&c=1#comments\" method=\"get\">\n";
|
||||
echo "<input type=\"hidden\" name=\"p\" value=\"$p\" />\n";
|
||||
echo "<input type=\"hidden\" name=\"c\" value=\"1\" />\n";
|
||||
echo "<input type=\"submit\" value=\"Ok\" />";
|
||||
|
@ -602,7 +602,7 @@ switch($action) {
|
|||
if (($HTTP_SERVER_VARS['HTTP_REFERER'] != "") && (false == $noredir)) {
|
||||
header('Location: ' . $HTTP_SERVER_VARS['HTTP_REFERER']);
|
||||
} else {
|
||||
header('Location: '.$siteurl.'/wp-admin/edit.php?p='.$p.'&c=1#comments');
|
||||
header('Location: '. get_settings('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments');
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -706,12 +706,12 @@ $bookmarklet_height= ($use_trackback) ? 460 : 420;
|
|||
|
||||
if ($is_NS4 || $is_gecko) {
|
||||
?>
|
||||
<a href="javascript:if(navigator.userAgent.indexOf('Safari') >= 0){Q=getSelection();}else{Q=document.selection?document.selection.createRange().text:document.getSelection();}void(window.open('<?php echo $siteurl ?>/wp-admin/bookmarklet.php?text='+escape(Q)+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title),'WordPress bookmarklet','scrollbars=yes,width=600,height=460,left=100,top=150,status=yes'));">Press It
|
||||
<a href="javascript:if(navigator.userAgent.indexOf('Safari') >= 0){Q=getSelection();}else{Q=document.selection?document.selection.createRange().text:document.getSelection();}void(window.open('<?php echo get_settings('siteurl') ?>/wp-admin/bookmarklet.php?text='+escape(Q)+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title),'WordPress bookmarklet','scrollbars=yes,width=600,height=460,left=100,top=150,status=yes'));">Press It
|
||||
- <?php echo $blogname ?></a>
|
||||
<?php
|
||||
} else if ($is_winIE) {
|
||||
?>
|
||||
<a href="javascript:Q='';if(top.frames.length==0)Q=document.selection.createRange().text;void(btw=window.open('<?php echo $siteurl ?>/wp-admin/bookmarklet.php?text='+escape(Q)+'<?php echo $bookmarklet_tbpb ?>&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title),'bookmarklet','scrollbars=yes,width=600,height=<?php echo $bookmarklet_height ?>,left=100,top=150,status=yes'));btw.focus();">Press it
|
||||
<a href="javascript:Q='';if(top.frames.length==0)Q=document.selection.createRange().text;void(btw=window.open('<?php echo get_settings('siteurl') ?>/wp-admin/bookmarklet.php?text='+escape(Q)+'<?php echo $bookmarklet_tbpb ?>&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title),'bookmarklet','scrollbars=yes,width=600,height=<?php echo $bookmarklet_height ?>,left=100,top=150,status=yes'));btw.focus();">Press it
|
||||
- <?php echo $blogname ?></a>
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
|
@ -727,12 +727,12 @@ function oneclickbookmarklet(blah) {
|
|||
<?php
|
||||
} else if ($is_opera) {
|
||||
?>
|
||||
<a href="javascript:void(window.open('<?php echo $siteurl ?>/wp-admin/bookmarklet.php?popupurl='+escape(location.href)+'&popuptitle='+escape(document.title)+'<?php echo $bookmarklet_tbpb ?>','bookmarklet','scrollbars=yes,width=600,height=<?php echo $bookmarklet_height ?>,left=100,top=150,status=yes'));">Press it
|
||||
<a href="javascript:void(window.open('<?php echo get_settings('siteurl'); ?>/wp-admin/bookmarklet.php?popupurl='+escape(location.href)+'&popuptitle='+escape(document.title)+'<?php echo $bookmarklet_tbpb ?>','bookmarklet','scrollbars=yes,width=600,height=<?php echo $bookmarklet_height ?>,left=100,top=150,status=yes'));">Press it
|
||||
- <?php echo $blogname ?></a>
|
||||
<?php
|
||||
} else if ($is_macIE) {
|
||||
?>
|
||||
<a href="javascript:Q='';if(top.frames.length==0);void(btw=window.open('<?php echo $siteurl ?>/wp-admin/bookmarklet.php?text='+escape(document.getSelection())+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title)+'<?php echo $bookmarklet_tbpb ?>','bookmarklet','scrollbars=yes,width=600,height=<?php echo $bookmarklet_height ?>,left=100,top=150,status=yes'));btw.focus();">Press it
|
||||
<a href="javascript:Q='';if(top.frames.length==0);void(btw=window.open('<?php echo get_settings('siteurl'); ?>/wp-admin/bookmarklet.php?text='+escape(document.getSelection())+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title)+'<?php echo $bookmarklet_tbpb ?>','bookmarklet','scrollbars=yes,width=600,height=<?php echo $bookmarklet_height ?>,left=100,top=150,status=yes'));btw.focus();">Press it
|
||||
- <?php echo $blogname ?></a>
|
||||
<?php
|
||||
}
|
||||
|
|
|
@ -191,7 +191,7 @@ case 'IErightclick':
|
|||
|
||||
<p>To have a one-click bookmarklet, just copy and paste this<br />into a new text file:</p>
|
||||
<?php
|
||||
$regedit = "REGEDIT4\r\n[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\Post To &WP : ".$blogname."]\r\n@=\"javascript:doc=external.menuArguments.document;Q=doc.selection.createRange().text;void(btw=window.open('".$siteurl."/wp-admin/bookmarklet.php?text='+escape(Q)+'".$bookmarklet_tbpb."&popupurl='+escape(doc.location.href)+'&popuptitle='+escape(doc.title),'bookmarklet','scrollbars=no,width=480,height=".$bookmarklet_height.",left=100,top=150,status=yes'));btw.focus();\"\r\n\"contexts\"=hex:31\"";
|
||||
$regedit = "REGEDIT4\r\n[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\Post To &WP : ".$blogname."]\r\n@=\"javascript:doc=external.menuArguments.document;Q=doc.selection.createRange().text;void(btw=window.open('". get_settings('siteurl') ."/wp-admin/bookmarklet.php?text='+escape(Q)+'".$bookmarklet_tbpb."&popupurl='+escape(doc.location.href)+'&popuptitle='+escape(doc.title),'bookmarklet','scrollbars=no,width=480,height=".$bookmarklet_height.",left=100,top=150,status=yes'));btw.focus();\"\r\n\"contexts\"=hex:31\"";
|
||||
?>
|
||||
<pre style="margin: 20px; background-color: #cccccc; border: 1px dashed #333333; padding: 5px; font-size: 12px;"><?php echo $regedit; ?></pre>
|
||||
<p>Save it as wordpress.reg, and double-click on this file in an Explorer<br />
|
||||
|
@ -323,7 +323,7 @@ default:
|
|||
function addPanel()
|
||||
{
|
||||
if ((typeof window.sidebar == "object") && (typeof window.sidebar.addPanel == "function"))
|
||||
window.sidebar.addPanel("WordPress Post: <?php echo $blogname ?>","<?php echo $siteurl ?>/wp-admin/sidebar.php","");
|
||||
window.sidebar.addPanel("WordPress Post: <?php echo $blogname ?>","<?php echo get_settings('siteurl'); ?>/wp-admin/sidebar.php","");
|
||||
else
|
||||
alert('No Sidebar found! You must use Mozilla 0.9.4 or later!');
|
||||
}
|
||||
|
@ -333,7 +333,8 @@ function addPanel()
|
|||
<?php } elseif (($is_winIE) || ($is_macIE)) { ?>
|
||||
<strong>SideBar</strong><br />
|
||||
Add this link to your favorites:<br />
|
||||
<a href="javascript:Q='';if(top.frames.length==0)Q=document.selection.createRange().text;void(_search=open('<?php echo $siteurl ?>/wp-admin/sidebar.php?text='+escape(Q)+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title),'_search'))">WordPress
|
||||
<a href="javascript:Q='';if(top.frames.length==0)Q=document.selection.createRange().text;void(_search=open('<?php echo get_settings('siteurl');
|
||||
?>/wp-admin/sidebar.php?text='+escape(Q)+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title),'_search'))">WordPress
|
||||
Sidebar</a>.
|
||||
|
||||
</div>
|
||||
|
|
|
@ -66,8 +66,8 @@ default:
|
|||
}
|
||||
|
||||
if ('' == $file) {
|
||||
if ('' != $blogfilename) {
|
||||
$file = $blogfilename;
|
||||
if ('' != get_settings('blogfilename')) {
|
||||
$file = get_settings('blogfilename');
|
||||
} else {
|
||||
$file = 'index.php';
|
||||
}
|
||||
|
|
|
@ -258,7 +258,7 @@ echo "\n<tr $style>
|
|||
} ?>
|
||||
<div class="wrap">
|
||||
<h2>Add User</h2>
|
||||
<p>Users can <a href="<?php echo $siteurl ?>/wp-register.php">register themselves</a> or you can manually create users here.</p>
|
||||
<p>Users can <a href="<?php echo get_settings('siteurl'); ?>/wp-register.php">register themselves</a> or you can manually create users here.</p>
|
||||
<form action="" method="post" name="adduser" id="adduser">
|
||||
<table border="0" cellspacing="5" cellpadding="3">
|
||||
<tr>
|
||||
|
|
|
@ -81,11 +81,11 @@ if (!isset($doing_rss) || !$doing_rss) {
|
|||
@header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
|
||||
@header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
@header("Pragma: no-cache"); // HTTP/1.0
|
||||
@header ("X-Pingback: $siteurl/xmlrpc.php");
|
||||
@header ('X-Pingback: '. get_settings('siteurl') . '/xmlrpc.php');
|
||||
} else {
|
||||
// We're showing a feed, so WP is indeed the only thing that last changed
|
||||
@header('Last Modified: ' . gmdate(get_lastpostmodified()));
|
||||
@header ("X-Pingback: $siteurl/xmlrpc.php");
|
||||
@header ('X-Pingback: ' . get_settings('siteurl') . '/xmlrpc.php');
|
||||
}
|
||||
|
||||
/* Getting settings from db */
|
||||
|
|
|
@ -23,7 +23,7 @@ foreach ($posts as $post) { start_wp();
|
|||
|
||||
<h2 id="comments">Comments</h2>
|
||||
|
||||
<p><a href="<?php echo $siteurl; ?>/wp-commentsrss2.php?p=<?php echo $post->ID; ?>">RSS feed for comments on this post.</a></p>
|
||||
<p><a href="<?php echo get_settings('siteurl'); ?>/wp-commentsrss2.php?p=<?php echo $post->ID; ?>">RSS feed for comments on this post.</a></p>
|
||||
|
||||
<?php if ('open' == $post->ping_status) { ?>
|
||||
<p>The <acronym title="Uniform Resource Identifier">URI</acronym> to TrackBack this entry is: <em><?php trackback_url() ?></em></p>
|
||||
|
@ -58,7 +58,7 @@ if (!empty($commentstatus->post_password) && $HTTP_COOKIE_VARS['wp-postpass_'.$c
|
|||
<h2>Leave a Comment</h2>
|
||||
<p>Line and paragraph breaks automatic, website trumps email, <acronym title="Hypertext Markup Language">HTML</acronym> allowed: <code><?php echo allowed_tags(); ?></code></p>
|
||||
|
||||
<form action="<?php echo $siteurl; ?>/wp-comments-post.php" method="post" id="commentform">
|
||||
<form action="<?php echo get_settings('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
|
||||
<p>
|
||||
<input type="text" name="author" id="author" class="textarea" value="<?php echo $comment_author; ?>" size="28" tabindex="1" />
|
||||
<label for="author">Name</label>
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
<?php if ('open' == $post->comment_status) { ?>
|
||||
<p>Line and paragraph breaks automatic, website trumps email, <acronym title="Hypertext Markup Language">HTML</acronym> allowed: <code><?php echo allowed_tags(); ?></code></p>
|
||||
|
||||
<form action="<?php echo $siteurl; ?>/wp-comments-post.php" method="post" id="commentform">
|
||||
<form action="<?php echo get_settings('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
|
||||
<p>
|
||||
<input type="text" name="author" id="author" class="textarea" value="<?php echo $comment_author; ?>" size="28" tabindex="1" />
|
||||
<label for="author">Name</label>
|
||||
|
|
|
@ -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é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..
|
||||
|
|
12
wp-login.php
12
wp-login.php
|
@ -163,7 +163,7 @@ case 'lostpassword':
|
|||
<head>
|
||||
<title>WordPress › Lost password ?</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $blog_charset; ?>" />
|
||||
<link rel="stylesheet" href="<?php echo $siteurl; ?>/wp-admin/wp-admin.css" type="text/css" />
|
||||
<link rel="stylesheet" href="<?php echo get_settings('siteurl'); ?>/wp-admin/wp-admin.css" type="text/css" />
|
||||
<script type="text/javascript">
|
||||
function focusit() {
|
||||
// focus on first input field
|
||||
|
@ -211,7 +211,7 @@ case 'retrievepassword':
|
|||
$wpdb->query("UPDATE $tableusers SET user_pass = MD5('$user_pass') WHERE user_login = '$user_login'");
|
||||
$message = "Login: $user_login\r\n";
|
||||
$message .= "Password: $user_pass\r\n";
|
||||
$message .= "Login at: $siteurl/wp-login.php";
|
||||
$message .= 'Login at: ' . get_settings('siteurl') . '/wp-login.php';
|
||||
|
||||
$m = mail($user_email, "[$blogname] Your weblog's login/password", $message);
|
||||
|
||||
|
@ -267,7 +267,7 @@ default:
|
|||
<head>
|
||||
<title>WordPress > <?php bloginfo('name') ?> > Login form</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $blog_charset; ?>" />
|
||||
<link rel="stylesheet" href="<?php echo $siteurl; ?>/wp-admin/wp-admin.css" type="text/css" />
|
||||
<link rel="stylesheet" href="<?php echo get_settings('siteurl'); ?>/wp-admin/wp-admin.css" type="text/css" />
|
||||
<script type="text/javascript">
|
||||
function focusit() {
|
||||
// focus on first input field
|
||||
|
@ -280,11 +280,11 @@ default:
|
|||
|
||||
<div id="login">
|
||||
<p>
|
||||
<a href="<?php echo $siteurl?>" title="Are you lost?">Back to blog?</a><br />
|
||||
<a href="<?php echo get_settings('siteurl'); ?>" title="Are you lost?">Back to blog?</a><br />
|
||||
<?php if ($users_can_register) { ?>
|
||||
<a href="<?php echo $siteurl; ?>/wp-register.php" title="Register to be an author">Register?</a><br />
|
||||
<a href="<?php echo get_settings('siteurl'); ?>/wp-register.php" title="Register to be an author">Register?</a><br />
|
||||
<?php } ?>
|
||||
<a href="<?php echo $siteurl; ?>/wp-login.php?action=lostpassword" title="Password Lost and Found">Lost your password?</a>
|
||||
<a href="<?php echo get_settings('siteurl'); ?>/wp-login.php?action=lostpassword" title="Password Lost and Found">Lost your password?</a>
|
||||
</p>
|
||||
|
||||
<?php
|
||||
|
|
|
@ -150,7 +150,7 @@ case 'disabled':
|
|||
<div id="login">
|
||||
<h2>Registration Disabled</h2>
|
||||
<p>User registration is currently not allowed.<br />
|
||||
<a href="<?php echo $siteurl.'/'.$blogfilename; ?>" title="Go back to the blog">Home</a>
|
||||
<a href="<?php echo get_settings('siteurl') .'/'. get_settings('blogfilename'); ?>" title="Go back to the blog">Home</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -48,8 +48,6 @@ require_once (ABSPATH . WPINC . '/kses.php');
|
|||
// get_settings() wherever these are needed OR
|
||||
// accessing a single global $all_settings var
|
||||
if (!strstr($_SERVER['REQUEST_URI'], 'install.php') && !strstr($_SERVER['REQUEST_URI'], 'wp-admin/import')) {
|
||||
$siteurl = get_settings('siteurl');
|
||||
$blogfilename = get_settings('blogfilename');
|
||||
$blogname = get_settings('blogname');
|
||||
$blogdescription = get_settings('blogdescription');
|
||||
$admin_email = get_settings('admin_email');
|
||||
|
@ -102,7 +100,7 @@ if (!strstr($_SERVER['REQUEST_URI'], 'install.php') && !strstr($_SERVER['REQUEST
|
|||
$querystring_separator = '&';
|
||||
//}
|
||||
// Used to guarantee unique cookies
|
||||
$cookiehash = md5($siteurl);
|
||||
$cookiehash = md5(get_settings('siteurl'));
|
||||
|
||||
} //end !$_wp_installing
|
||||
|
||||
|
|
2
wp.php
2
wp.php
|
@ -15,7 +15,7 @@ require_once("wp-blog-header.php");
|
|||
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
|
||||
</head>
|
||||
<body>
|
||||
<h1 id="header"><a href="<?php echo $siteurl; ?>" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a></h1>
|
||||
<h1 id="header"><a href="<?php echo get_settings('siteurl'); ?>" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a></h1>
|
||||
|
||||
<!-- // loop start -->
|
||||
<?php foreach ($posts as $post) { start_wp(); ?>
|
||||
|
|
Loading…
Reference in New Issue