Monster administration update. Tables fixed, format streamlined, HTML cleaned up.

git-svn-id: http://svn.automattic.com/wordpress/trunk@44 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2003-05-23 08:29:51 +00:00
parent 7d9d847945
commit 0737f2a8cf
12 changed files with 740 additions and 371 deletions

View File

@ -12,7 +12,9 @@
#wphead a span {
display: none;
}
p {
line-height: 130%;
}
#adminmenu {
list-style: none outside;
padding: 0;
@ -65,10 +67,13 @@ a:hover {
color: #069;
}
.panelbody {
/* empty style - for you to customize it.
this style applies to b2's interface, the part where the sections are displayed */
h2 {
margin: 0 5px 2px 5px;
padding: 3px;
color: #333;
border-bottom: 2px solid #333;
}
.table {
color: #000000;
font-size: 10pt;
@ -134,3 +139,33 @@ xmp { /* Just in case */
padding: 10px;
}
form { margin: 0; padding: 0; } /* thanks #mozilla */
td.menutop {
padding-top: 2px;
padding-bottom: 2px;
border-color: #999999;
border-top-width: 1px;
border-bottom-width: 1px;
border-left-width: 0px;
border-right-width: 0px;
border-style: dashed;
}
textarea, input, select {
background-color: #f0f0f0;
border-width: 1px;
border-color: #cccccc;
border-style: solid;
padding: 2px;
margin: 1px;
font-family: Georgia, "Times New Roman", Times, serif;
}
.checkbox {
background-color: #ffffff;
border-width: 0px;
padding: 0px;
margin: 0px;
}
label {
font-weight: bold;
}

255
wp-admin/b2bookmarklet.php Normal file
View File

@ -0,0 +1,255 @@
<?php
/* <Bookmarklet> */
$mode = "bookmarklet";
$standalone = 1;
require("b2header.php");
if ($user_level == 0)
die ("Cheatin' uh ?");
if ($a=="b") {
?><html>
<head>
<script language="javascript">
<!--
window.close()
-->
</script>
</head>
<body></body>
</html><?php
} else {
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>WordPress > Bookmarklet</title>
<link rel="stylesheet" href="b2.css" type="text/css" />
<?php
if ($use_spellchecker) {
?><script type="text/javascript" language="javascript">
<!--
function DoSpell(formname, subject, body) {
document.SPELLDATA.formname.value=formname
document.SPELLDATA.subjectname.value=subject
document.SPELLDATA.messagebodyname.value=body
document.SPELLDATA.companyID.value="custom\\http://cafelog.com"
document.SPELLDATA.language.value=1033
document.SPELLDATA.opener.value="sproxy.pl"
document.SPELLDATA.formaction.value="http://www.spellchecker.com/spell/startspelling.asp "
window.open("b2spell.php","Spell",
"toolbar=no,directories=no,location=yes,urlbar=yes,resizable=yes,width=620,height=600,top=100,left=100")
}
function preview(form) {
var preview_date = "<?php echo date("Y-m-d H:i:s"); ?>";
var preview_userid = "<?php echo $user_ID ?>";
var preview_title = form.post_title.value;
var preview_category = form.post_category.value;
var preview_content = form.content.value;
var preview_autobr = form.post_autobr.value;
preview_date = escape(preview_date);
preview_userid = escape(preview_userid);
preview_title = escape(preview_title);
preview_category = escape(preview_category);
preview_content = escape(preview_content);
preview_autobr = escape(preview_autobr);
window.open ("<?php echo "$siteurl/$blogfilename" ?>?preview=1&preview_date="+preview_date +"&preview_userid="+preview_userid +"&preview_title="+preview_title +"&preview_category="+preview_category +"&preview_content="+preview_content +"&preview_autobr="+preview_autobr ,"Preview", "location=0,menubar=1,resizable=1,scrollbars=yes,status=1,toolbar=0");
}
function launchupload() {
window.open ("b2upload.php", "b2upload", "width=380,height=360,location=0,menubar=0,resizable=1,scrollbars=yes,status=1,toolbar=0");
}
//-->
</script>
<?php
}
?>
<style type="text/css">
<!--
body {
background-image: url('<?php
if ($is_gecko || $is_IE) {
?>b2-img/bgbookmarklet1.gif<?php
} else {
?>b2-img/bgbookmarklet3.gif<?php
}
?>');
background-repeat: no-repeat;
}
<?php
if (!$is_NS4) {
?>
textarea,input,select {
background-color: transparent;
<?php if ($is_gecko || $is_macIE) { ?>
background-image: url('b2-img/bgbookmarklet.png');
<?php } elseif ($is_winIE) { ?>
background-color: #cccccc;
filter: alpha(opacity:80);
<?php } ?>
border-width: 1px;
border-color: #cccccc;
border-style: solid;
padding: 2px;
margin: 1px;
}
<?php if (!$is_gecko) { ?>
.checkbox {
background-color: #ffffff;
border-width: 0px;
padding: 0px;
margin: 0px;
}
<?php } ?>
<?php
}
?>
textarea {
font-family: Verdana, Geneva, Arial, Helvetica;
font-size: 0.9em;
}
-->
</style>
</head>
<body>
<form name="post" action="b2edit.php" method="POST">
<input type="hidden" name="action" value="post" />
<input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />
<input type="hidden" name="mode" value="bookmarklet" />
<div align="right">
<?php
$popuptitle = stripslashes($popuptitle);
$text = stripslashes($text);
/* big funky fixes for browsers' javascript bugs */
if (($is_macIE) && (!isset($IEMac_bookmarklet_fix))) {
$popuptitle = preg_replace($b2_macIE_correction["in"],$b2_macIE_correction["out"],$popuptitle);
$text = preg_replace($b2_macIE_correction["in"],$b2_macIE_correction["out"],$text);
}
if (($is_winIE) && (!isset($IEWin_bookmarklet_fix))) {
$popuptitle = preg_replace("/\%u([0-9A-F]{4,4})/e", "'&#'.base_convert('\\1',16,10).';'", $popuptitle);
$text = preg_replace("/\%u([0-9A-F]{4,4})/e", "'&#'.base_convert('\\1',16,10).';'", $text);
}
if (($is_gecko) && (!isset($Gecko_bookmarklet_fix))) {
$popuptitle = preg_replace($b2_gecko_correction["in"],$b2_gecko_correction["out"],$popuptitle);
$text = preg_replace($b2_gecko_correction["in"],$b2_gecko_correction["out"],$text);
}
/* /big funky fixes */
?>
<table width="100%" cellpadding="8" cellspacing="0" width="415">
<tr>
<td width="40">&nbsp;</td>
<td align="left" width="415">
<table cellspacing="0" cellpadding="0">
<td height="50" width="250" align="left" valign="bottom"><b>Title</b><br />
<input type="text" name="post_title" size="20" tabindex="1" style="width: 215px;" value="<?php echo stripslashes($popuptitle) ?>" /></td>
<td width="165" align="left" valign="bottom"><b>Category</b><br /><?php dropdown_categories(); ?></td>
</table>
</td>
</tr>
<tr height="40">
<td width="40">&nbsp;</td>
<td width="415" align="left" height="40">
<table width="415" cellpadding="0" cellspacing="0">
<td align="left" valign="bottom"><b>Post</b></td>
<td align="right" valign="bottom"><?php if ($use_quicktags) include($b2inc."/b2quicktags.php"); ?></td>
</table>
<?php
if ((preg_match("/Nav/",$HTTP_USER_AGENT)) || (preg_match("/Mozilla\/4\.7/",$HTTP_USER_AGENT))) {
$rows="6";
} else {
$rows="8";
} ?>
<?php
// stuff to fix textism.com's WEIRD characters conflict with javascript on IE5Mac
preg_match("/\%u[1-9A-F][1-9A-F][1-9A-F][1-9A-F]/is", $text, $stufftofix);
// ... and so on. currently coding the fix
?>
<textarea rows="<?php echo $rows ?>" cols="48" style="width:415px;" name="content" tabindex="2" class="postform"><?php echo "<a href=\"$popupurl\">$popuptitle</a>\n$text" ?></textarea><br />
<table cellpadding="0" cellspacing="0">
<td align="left" width="90">
<input type="checkbox" name="post_autobr" value="1" <?php if ($autobr) echo " checked" ?> tabindex="4" class="checkbox" id="autobr" /><label for="autobr"> Auto-BR</label>
</td>
<?php if ($pingback) { ?>
<td align="left">
<input type="checkbox" class="checkbox" name="post_pingback" value="1" checked="checked" tabindex="7" id="pingback" /><label for="pingback"> PingBack</label>
</td>
<?php } ?>
</table>
<?php if ($use_preview) { ?>
<input type="button" value="preview" onclick="preview(this.form);" class="search" tabindex="8" />
<?php } ?>
<input type="submit" name="submit" value="Blog this !" class="search" tabindex="3" />
<?php if ($use_spellchecker) { ?>
<!--<input type = "button" value = "Spell Check" onclick="var f=document.forms[0]; doSpell( 'en', f.post_content, '<?php echo $spellchecker_url ?>/sproxy.cgi', true);" class="search" tabindex="5" />-->
<input type="button" value="Spellcheck" onclick="DoSpell
('post','content','');" class="search" />
<?php } ?>
<?php if ( ($use_fileupload) && ($user_level >= $fileupload_minlevel) && ((ereg(" ".$user_login." ", $fileupload_allowedusers)) || (trim($fileupload_allowedusers)=="")) ) { ?>
<input type="button" value="upload a file" onclick="launchupload();" class="search" />
<?php } ?>
<script language="JavaScript">
<!--
window.focus();
// document.blog.post_content.focus();
//-->
</script>
</td>
</tr>
<?php if ($trackback) { ?>
<tr>
<td width="40">&nbsp;</td>
<td width="415" align="left" height="40">
<b>TrackBack</b> an URL:<br />
<input type="text" name="trackback_url" style="width: 415px" />
</td>
</tr>
<?php } ?>
</table>
</div>
</form>
<!-- this is for the spellchecker -->
<form name="SPELLDATA"><div>
<input name="formname" type="hidden" value="">
<input name="messagebodyname" type="hidden" value="">
<input name="subjectname" type="hidden" value="">
<input name="companyID" type="hidden" value="">
<input name="language" type="hidden" value="">
<input name="opener" type="hidden" value="">
<input name="formaction" type="hidden" value="">
</div></form>
</body>
</html><?php
}
?>

View File

@ -1,5 +1,5 @@
<?php
$title = "Categories";
$title = 'Categories';
/* <Categories> */
function add_magic_quotes($array) {
@ -37,114 +37,110 @@ for ($i=0; $i<count($b2varstoreset); $i += 1) {
switch($action) {
case "addcat":
case 'addcat':
$standalone = 1;
require_once("./b2header.php");
require_once('b2header.php');
if ($user_level < 3)
die ("Cheatin' uh ?");
die ('Cheatin&#8217; uh?');
$cat_name=addslashes($HTTP_POST_VARS["cat_name"]);
$query="INSERT INTO $tablecategories (cat_ID,cat_name) VALUES ('0', '$cat_name')";
$result=mysql_query($query) or die("Couldn't add category <b>$cat_name</b>");
$query = "INSERT INTO $tablecategories (cat_ID,cat_name) VALUES ('0', '$cat_name')";
$result = mysql_query($query) or die("Couldn't add category <b>$cat_name</b>");
header("Location: b2categories.php");
header('Location: b2categories.php');
break;
case "Delete":
case 'Delete':
$standalone = 1;
require_once("./b2header.php");
require_once('b2header.php');
$cat_ID = $HTTP_POST_VARS["cat_ID"];
$cat_name=get_catname($cat_ID);
$cat_name=addslashes($cat_name);
$cat_ID = intval($HTTP_POST_VARS["cat_ID"]);
$cat_name = get_catname($cat_ID);
$cat_name = addslashes($cat_name);
if ($cat_ID=="1")
die("Can't delete the <b>$cat_name</b> category: this is the default one");
if (1 == $cat_ID)
die("Can't delete the <strong>$cat_name</strong> category: this is the default one");
if ($user_level < 3)
die ("Cheatin' uh ?");
die ('Cheatin&#8217; uh?');
$query="DELETE FROM $tablecategories WHERE cat_ID=\"$cat_ID\"";
$result=mysql_query($query) or die("Couldn't delete category <b>$cat_name</b>".mysql_error());
$query = "DELETE FROM $tablecategories WHERE cat_ID = $cat_ID";
$result = mysql_query($query) or die("Couldn't delete category <b>$cat_name</b>".mysql_error());
$query="UPDATE $tableposts SET post_category='1' WHERE post_category='$cat_ID'";
$result=mysql_query($query) or die("Couldn't reset category on posts where category was <b>$cat_name</b>");
$query = "UPDATE $tableposts SET post_category='1' WHERE post_category='$cat_ID'";
$result = mysql_query($query) or die("Couldn't reset category on posts where category was <b>$cat_name</b>");
header("Location: b2categories.php");
header('Location: b2categories.php');
break;
case "Rename":
case 'Rename':
require_once ("./b2header.php");
$cat_name=get_catname($HTTP_POST_VARS["cat_ID"]);
$cat_name=addslashes($cat_name);
require_once ('b2header.php');
$cat_name = get_catname($HTTP_POST_VARS["cat_ID"]);
$cat_name = addslashes($cat_name);
?>
<?php echo $blankline; ?>
<?php echo $tabletop; ?>
<p><b>Old</b> name: <?php echo $cat_name ?></p>
<div class="wrap">
<p><strong>Old</strong> name: <?php echo $cat_name ?></p>
<p>
<form name="renamecat" action="b2categories.php" method="post">
<b>New</b> name:<br />
<strong>New</strong> name:<br />
<input type="hidden" name="action" value="editedcat" />
<input type="hidden" name="cat_ID" value="<?php echo $HTTP_POST_VARS["cat_ID"] ?>" />
<input type="text" name="cat_name" value="<?php echo $cat_name ?>" /><br />
<input type="submit" name="submit" value="Edit it !" class="search" />
</form>
<?php echo $tablebottom; ?>
</div>
<?php
break;
case "editedcat":
case 'editedcat':
$standalone = 1;
require_once("./b2header.php");
require_once('b2header.php');
if ($user_level < 3)
die ("Cheatin' uh ?");
die ('Cheatin&#8217; uh?');
$cat_name=addslashes($HTTP_POST_VARS["cat_name"]);
$cat_ID=addslashes($HTTP_POST_VARS["cat_ID"]);
$cat_name = addslashes($HTTP_POST_VARS["cat_name"]);
$cat_ID = addslashes($HTTP_POST_VARS["cat_ID"]);
$query="UPDATE $tablecategories SET cat_name='$cat_name' WHERE cat_ID=$cat_ID";
$result=mysql_query($query) or die("Couldn't edit category <b>$cat_name</b>: ".mysql_error());
$query = "UPDATE $tablecategories SET cat_name='$cat_name' WHERE cat_ID = $cat_ID";
$result = mysql_query($query) or die("Couldn't edit category <b>$cat_name</b>: ".mysql_error());
header("Location: b2categories.php");
header('Location: b2categories.php');
break;
default:
$standalone=0;
require_once ("./b2header.php");
$standalone = 0;
require_once ('b2header.php');
if ($user_level < 3) {
die("You have no right to edit the categories for this blog.<br>Ask for a promotion to your <a href=\"mailto:$admin_email\">blog admin</a> :)");
die("You have no right to edit the categories for this blog.<br />Ask for a promotion to your <a href='mailto:$admin_email'>blog admin</a>. :)");
}
?>
<?php echo $blankline ?>
<?php echo $tabletop ?>
<table width="" cellpadding="5" cellspacing="0">
<form></form>
<tr>
<td>
<div class="wrap">
<form name="cats" method="post">
<b>Edit</b> a category:<br />
<h3>Edit a category:</h3>
<p>
<?php
$query="SELECT * FROM $tablecategories ORDER BY cat_ID";
$result=mysql_query($query);
echo "<select name=\"cat_ID\">\n";
$query = "SELECT * FROM $tablecategories ORDER BY cat_ID";
$result = mysql_query($query);
echo "<select name='cat_ID'>\n";
while($row = mysql_fetch_object($result)) {
echo "\t<option value=\"".$row->cat_ID."\"";
echo "\t<option value='$row->cat_ID'";
if ($row->cat_ID == $cat)
echo " selected";
echo ' selected="selected"';
echo ">".$row->cat_ID.": ".$row->cat_name."</option>\n";
}
echo "</select>\n";
@ -153,24 +149,27 @@ default:
<input type="submit" name="action" value="Rename" class="search" />
</form>
</p>
<p>
<b>Add</b> a category:<br />
<h3>Add a category:</h3>
<form name="addcat" action="b2categories.php" method="post">
<input type="hidden" name="action" value="addcat" />
<input type="text" name="cat_name" /><br />
<input type="submit" name="submit" value="Add it !" class="search" /></form></td></tr></table>
<?php echo $tablebottom ?>
<input type="submit" name="submit" value="Add it!" class="search" /></form>
</div>
<br />
<?php echo $tabletop ?>
<b>Note:</b><br />
Deleting a category does not delete posts from that category.<br />It will just set them back to the default category <b><?php echo get_catname(1) ?></b>.
<?php echo $tablebottom ?>
<div class="wrap">
<p><strong>Note:</strong><br />
Deleting a category does not delete posts from that category, it will just
set them back to the default category <strong><?php echo get_catname(1) ?></strong>.
</p>
</div>
<?php
break;
}
/* </Categories> */
include("b2footer.php"); ?>
include('b2footer.php');
?>

View File

@ -1,38 +1,38 @@
<div class="wrap">
<?php
echo $tabletop;
switch($action) {
case "post":
$submitbutton_text = "Blog this !";
$toprow_title = "New Post";
$form_action = "post";
$form_extra = "";
case 'post':
$submitbutton_text = 'Blog this!';
$toprow_title = 'New Post';
$form_action = 'post';
$form_extra = '';
if ($use_pingback) {
$form_pingback = '<input type="checkbox" class="checkbox" name="post_pingback" value="1" checked="checked" tabindex="7" id="pingback" /><label for="pingback"> PingBack the URLs in this post</label><br />';
$form_pingback = '<input type="checkbox" class="checkbox" name="post_pingback" value="1" checked="checked" tabindex="7" id="pingback" /> <label for="pingback">PingBack the URLs in this post</label><br />';
} else {
$form_pingback = '';
}
if ($use_trackback) {
$form_trackback = '<br /><br /><label for="trackback"><b>TrackBack</b> an URL:</label><br /><input type="text" name="trackback_url" style="width: 415px" id="trackback" />';
$form_trackback = '<p><label for="trackback"><strong>TrackBack</strong> an <acronym title="Uniform Resource Locator">URL</acronym>:</label> (Seperate multiple URLs with commas.)<br /><input type="text" name="trackback_url" style="width: 415px" id="trackback" /></p>';
} else {
$form_trackback = '';
}
$colspan = 3;
break;
case "edit":
$submitbutton_text ="Edit this !";
$toprow_title = "Editing Post #".$postdata["ID"];
$form_action = "editpost";
$form_extra = "\" />\n<input type=\"hidden\" name=\"post_ID\" value=\"$post";
$submitbutton_text = 'Edit this!';
$toprow_title = 'Editing Post #' . $postdata["ID"];
$form_action = 'editpost';
$form_extra = "' />\n<input type='hidden' name='post_ID' value='$post";
$colspan = 2;
$form_pingback = '<input type="hidden" name="post_pingback" value="0" />';
$form_trackback = '';
break;
case "editcomment":
$submitbutton_text ="Edit this !";
$toprow_title = "Editing Comment #".$commentdata["comment_ID"];
$form_action = "editedcomment";
$form_extra = "\" />\n<input type=\"hidden\" name=\"comment_ID\" value=\"$comment\" />\n<input type=\"hidden\" name=\"comment_post_ID\" value=\"".$commentdata["comment_post_ID"];
$submitbutton_text = 'Edit this!';
$toprow_title = 'Editing Comment # '.$commentdata["comment_ID"];
$form_action = 'editedcomment';
$form_extra = "' />\n<input type='hidden' name='comment_ID' value='$comment' />\n<input type='hidden' name='comment_post_ID' value='".$commentdata["comment_post_ID"];
$colspan = 3;
$form_pingback = '<input type="hidden" name="post_pingback" value="0" />';
$form_trackback = '';
@ -43,87 +43,84 @@ switch($action) {
<form name="post" action="b2edit.php" method="POST">
<input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />
<input type="hidden" name="action" value="<?php echo $form_action.$form_extra ?>" />
<input type="hidden" name="action" value='<?php echo $form_action . $form_extra ?>' />
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<?php if ($action != "editcomment") {
// this is for everything but comment editing
?> <td>
<table height="60" align="left" cellpadding="0" cellspacing="0">
<td height="60" width="190">
<label for="title"><b>Title :</b></label><br />
<input type="text" name="post_title" size="20" tabindex="1" style="width: 170px;" value="<?php echo $edited_post_title; ?>" id="title" />
?>
<table>
<tr>
<td width="210">
<label for="title">Title:</label><br />
<input type="text" name="post_title" size="25" tabindex="1" style="width: 190px;" value="<?php echo $edited_post_title; ?>" id="title" />
</td>
<td>
<label for="category"><b>Category :</b></label><br /><?php dropdown_categories(); ?>
<label for="category">Category :</label>
<br /><?php dropdown_categories(); ?>
</td>
</tr>
</table>
<?php
} else {
// this is for comment editing
?> <td colspan="2">&nbsp;</td>
</tr>
<tr>
?>
<table>
<tr>
<td>
<label for="name"><b>Name :</b></label><br />
<input type="text" name="newcomment_author" size="20" value="<?php echo format_to_edit($commentdata["comment_author"]) ?>" tabindex="1" id="name" /></td>
<label for="name">Name:</label>
<br />
<input type="text" name="newcomment_author" size="22" value="<?php echo format_to_edit($commentdata["comment_author"]) ?>" tabindex="1" id="name" /></td>
<td>
<label for="email"><b>E-mail :</b></label><br />
<input type="text" name="newcomment_author_email" size="20" value="<?php echo format_to_edit($commentdata["comment_author_email"]) ?>" tabindex="2" id="email" /></td>
<label for="email">E-mail:</label>
<br />
<input type="text" name="newcomment_author_email" size="30" value="<?php echo format_to_edit($commentdata["comment_author_email"]) ?>" tabindex="2" id="email" /></td>
<td>
<label for="URL"><b>URL :</b></label><br />
<input type="text" name="newcomment_author_url" size="20" value="<?php echo format_to_edit($commentdata["comment_author_url"]) ?>" tabindex="3" id="URL" />
<label for="URL">URL:</label>
<br />
<input type="text" name="newcomment_author_url" size="35" value="<?php echo format_to_edit($commentdata["comment_author_url"]) ?>" tabindex="3" id="URL" /></td>
</tr>
</table>
<?php
} // end else comment editing
?>
</td>
</tr>
<tr>
<td colspan="<?php echo $colspan; ?>">
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<td valign="bottom">
<?php
if ($action != 'editcomment') {
echo '<label for="excerpt"><b>Excerpt :</b></label>';
} else {
echo '<br /><label for="content"><b>Comment :</b></label>';
}
?>
</td>
<td valign="bottom" align="right">&nbsp;</td>
</table>
<textarea rows="3" cols="40" style="width:100%" name="excerpt" tabindex="4" wrap="virtual" id="excerpt"><?php echo $excerpt ?></textarea><br />
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<?php
if ($action != 'editcomment') {
echo '<label for="content"><b>Post :</b></label>';
echo '<label for="excerpt">Excerpt:</label>';
?>
<p><textarea rows="3" cols="40" style="width:100%" name="excerpt" tabindex="4" wrap="virtual" id="excerpt"><?php echo $excerpt ?></textarea></p>
<?php
} // if not a comment
?>
<table width="100%">
<tr>
<td>
<?php
if ($action != 'editcomment') {
echo '<label for="content">Post:</label>';
} else {
echo '<br /><label for="content"><b>Comment :</b></label>';
echo '<br /><label for="content">Comment:</label>';
}
?>
</td>
<td valign="bottom" align="right">
<?php if ($use_quicktags) include('b2quicktags.php'); ?>
</td>
</td>
<td align="right">
<?php if ($use_quicktags) {
include('b2quicktags.php');
}
?>
</td>
</tr>
</table>
<textarea rows="9" cols="40" style="width:100%" name="content" tabindex="4" wrap="virtual" id="content"><?php echo $content ?></textarea><br />
<?php echo $form_pingback ?>
<?php if ($use_preview) { ?>
<input type="button" value="preview" onclick="preview(this.form);" class="search" tabindex="8" />
<?php } ?>
<input type="submit" name="submit" value="<?php echo $submitbutton_text ?>" class="search" style="font-weight: bold;" tabindex="5" />
<p><input type="submit" name="submit" value="<?php echo $submitbutton_text ?>" class="search" style="font-weight: bold;" tabindex="5" /></p>
<?php if ( ($use_fileupload) && ($user_level >= $fileupload_minlevel) && ((ereg(" ".$user_login." ", $fileupload_allowedusers)) || (trim($fileupload_allowedusers)=="")) ) { ?>
@ -133,18 +130,11 @@ if ($action != 'editcomment') {
echo $form_trackback;
// if the level is 5+, allow user to edit the timestamp - not on 'new post' screen though
#if (($user_level > 4) && ($action != "post"))
// if (($user_level > 4) && ($action != "post"))
if ($user_level > 4) {
touch_time(($action=="edit"));
touch_time(($action == 'edit'));
}
?>
<script language="JavaScript" type="text/javascript">
<!--
// document.blog.post_content.focus();
//-->
</script>
</td>
</tr>
</table>
<?php echo $tablebottom ?>
</form>
</div>

View File

@ -40,7 +40,7 @@ switch($action) {
case 'post':
$standalone = 1;
require_once('./b2header.php');
require_once('b2header.php');
$post_autobr = intval($HTTP_POST_VARS["post_autobr"]);
$post_pingback = intval($HTTP_POST_VARS["post_pingback"]);
@ -52,7 +52,7 @@ case 'post':
$post_category = intval($HTTP_POST_VARS["post_category"]);
if ($user_level == 0)
die ("Cheatin' uh ?");
die ("Cheatin' uh ?");
if (($user_level > 4) && (!empty($HTTP_POST_VARS["edit_date"]))) {
$aa = $HTTP_POST_VARS["aa"];
@ -67,10 +67,10 @@ case 'post':
$ss = ($ss > 59) ? $ss - 60 : $ss;
$now = "$aa-$mm-$jj $hh:$mn:$ss";
} else {
$now = date("Y-m-d H:i:s",(time() + ($time_difference * 3600)));
$now = date("Y-m-d H:i:s", (time() + ($time_difference * 3600)));
}
$query = "INSERT INTO $tableposts (ID, post_author, post_date, post_content, post_title, post_category, post_excerpt) VALUES ('0','$user_ID','$now','$content','".$post_title."','".$post_category."','".$excerpt."')";
$query = "INSERT INTO $tableposts (ID, post_author, post_date, post_content, post_title, post_category, post_excerpt) VALUES ('0','$user_ID','$now','$content','$post_title','$post_category','$excerpt')";
$result = mysql_query($query) or mysql_oops($query);
$post_ID = mysql_insert_id();
@ -79,7 +79,6 @@ case 'post':
sleep($sleep_after_edit);
}
rss_update($blog_ID);
pingWeblogs($blog_ID);
pingCafelog($cafelogID, $post_title, $post_ID);
pingBlogs($blog_ID);
@ -117,25 +116,24 @@ case 'post':
break;
case "edit":
case 'edit':
$standalone=0;
require_once ("./b2header.php");
$post = $HTTP_GET_VARS["post"];
$standalone = 0;
require_once('b2header.php');
$post = $HTTP_GET_VARS['post'];
if ($user_level > 0) {
$postdata=get_postdata($post) or die("Oops, no post with this ID. <a href=\"b2edit.php\">Go back</a> !");
$postdata=get_postdata($post) or die('Oops, no post with this ID. <a href="b2edit.php">Go back</a>!');
$authordata = get_userdata($postdata["Author_ID"]);
if ($user_level < $authordata[13])
die ("You don't have the right to edit <b>".$authordata[1]."</b>'s posts.");
die ('You don&#8217;t have the right to edit <strong>'.$authordata[1].'</strong>&#8217;s posts.');
$content = $postdata["Content"];
$content = $postdata['Content'];
$content = format_to_edit($content);
$excerpt = $postdata["Excerpt"];
$excerpt = $postdata['Excerpt'];
$excerpt = format_to_edit($excerpt);
$edited_post_title = format_to_edit($postdata["Title"]);
$edited_post_title = format_to_edit($postdata['Title']);
echo $blankline;
include("b2edit.form.php");
include('b2edit.form.php');
} else {
?>
@ -190,7 +188,6 @@ case "editpost":
sleep($sleep_after_edit);
}
rss_update($blog_ID);
// pingWeblogs($blog_ID);
$location = "Location: b2edit.php";
@ -225,31 +222,29 @@ case "delete":
sleep($sleep_after_edit);
}
rss_update($blog_ID);
// pingWeblogs($blog_ID);
header ("Location: b2edit.php");
header ('Location: b2edit.php');
break;
case "editcomment":
case 'editcomment':
$standalone=0;
require_once ("./b2header.php");
$standalone = 0;
require_once ('b2header.php');
get_currentuserinfo();
if ($user_level == 0) {
die ("Cheatin' uh ?");
die ('Cheatin&#8217; uh?');
}
$comment = $HTTP_GET_VARS['comment'];
$commentdata = get_commentdata($comment,1) or die("Oops, no comment with this ID. <a href=\"javascript:history.go(-1)\">Go back</a> !");
$content = $commentdata["comment_content"];
$commentdata = get_commentdata($comment, 1) or die('Oops, no comment with this ID. <a href="javascript:history.go(-1)">Go back</a>!');
$content = $commentdata['comment_content'];
$content = format_to_edit($content);
echo $blankline;
include("b2edit.form.php");
include('b2edit.form.php');
break;

View File

@ -1,6 +1,6 @@
<div class="wrap">
<?php
echo $tabletop;
require_once('b2config.php');
if (!$posts) {
@ -44,7 +44,7 @@ if ($previousXstart < 0) {
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td colspan="2" align="center"><!-- show next/previous X posts -->
<form name="previousXposts" method="get">
<form name="previousXposts" method="get" action="">
<?php
if ($previousXstart > 0) {
?>
@ -57,7 +57,7 @@ if ($previousXstart > 0) {
</form>
</td>
<td>
<form name="nextXposts" method="get">
<form name="nextXposts" method="get" action="">
<input type="hidden" name="poststart" value="<?php echo $nextXstart; ?>" />
<input type="hidden" name="postend" value="<?php echo $nextXend; ?>" />
<input type="submit" name="submitnext" class="search" value="<?php echo $posts ?> >" />
@ -69,59 +69,57 @@ if ($previousXstart > 0) {
</tr>
<tr>
<td valign="top" width="200"><!-- show X first/last posts -->
<form name="showXfirstlastposts" method="get">
<form name="showXfirstlastposts" method="get" action="">
<input type="text" name="posts" value="<?php echo $posts ?>" style="width:40px;" /?>
<?php
if (!isset($order))
$order="DESC";
$i = $order;
if ($i == "DESC")
$besp_selected = "selected";
$besp_selected = "selected='selected'";
?>
<select name="order">&nbsp;
<option value="DESC" "<?= $besp_selected ?>">last posts</option>
<select name="order">
<option value="DESC" <?php echo $besp_selected ?>>last posts</option>
<?php
$besp_selected = "";
if ($i == "ASC")
$besp_selected = "selected";
$besp_selected = "selected='selected'";
?>
<option value="ASC" "<?= $besp_selected?>">first posts</option>
<option value="ASC" <?php echo $besp_selected?>>first posts</option>
</select>&nbsp;
<input type="submit" name="submitfirstlast" class="search" value="OK" />
</form>
</td>
<td valign="top"><!-- show post X to post X -->
<form name="showXfirstlastposts" method="get">
<form name="showXfirstlastposts" method="get" action="">
<input type="text" name="poststart" value="<?php echo $poststart ?>" style="width:40px;" /?>&nbsp;to&nbsp;<input type="text" name="postend" value="<?php echo $postend ?>" style="width:40px;" /?>&nbsp;
<select name="order">
<?php
$besp_selected = "";
$i = $order;
if ($i == "DESC")
$besp_selected = "selected";
$besp_selected = "selected='selected'";
?>
<option value="DESC" "<?= $besp_selected ?>">from the end</option>
<option value="DESC" "<?php echo $besp_selected ?>">from the end</option>
<?php
$besp_selected = "";
if ($i == "ASC")
$besp_selected = "selected";
?> <option value="ASC" "<?= $besp_selected ?>">from the start</option>
$besp_selected = "selected='selected'";
?> <option value="ASC" "<?php echo $besp_selected ?>">from the start</option>
</select>&nbsp;
<input type="submit" name="submitXtoX" class="search" value="OK" />
</form>
</td>
</tr>
</table>
<?php echo $tablebottom ?>
</div>
<br />
<?php echo $tabletop ?>
<div class="wrap">
<table width="100%">
<td valign="top" width="33%">
<form name="searchform" action="b2edit.php" method="get">
<input type="hidden" name="a" value="s" />
<input onFocus="this.value='';" onBlur="if (this.value=='') {this.value='search...';}" type="text" name="s" value="search..." size="7" style="width: 100px;" />
<input onfocus="this.value='';" onblur="if (this.value=='') {this.value='search...';}" type="text" name="s" value="search..." size="7" style="width: 100px;" />
<input type="submit" name="submit" value="search" class="search" />
</form>
</td>
@ -137,7 +135,7 @@ if ($i == "ASC")
while($row = mysql_fetch_object($result)) {
echo "<option value=\"".$row->cat_ID."\"";
if ($row->cat_ID == $postdata["Category"])
echo " selected";
echo " selected='selected'";
echo ">".$row->cat_name."</option>";
}
?>
@ -227,9 +225,7 @@ if ($i == "ASC")
</td>
</table>
<br />
<table cellspacing="0" cellpadding="5" border="0" width="100%">
<?php
// these lines are b2's "motor", do not alter nor remove them
include("blog.header.php");
@ -237,17 +233,15 @@ if ($i == "ASC")
while($row = mysql_fetch_object($result)) {
$posts_per_page = 10;
start_b2(); ?>
<tr>
<td>
<p>
<b><?php the_time('Y/m/d @ H:i:s'); ?></b> [ <a href="b2edit.php?p=<?php echo $id ?>&c=1"><?php comments_number('no comment', '1 comment', "% comments") ?><?php trackback_number('', ', 1 trackback', ', % trackbacks') ?><?php pingback_number('', ', 1 pingback', ', % pingbacks') ?></a>
<strong><?php the_time('Y/m/d @ H:i:s'); ?></strong> [ <a href="b2edit.php?p=<?php echo $id ?>&c=1"><?php comments_number('no comment', '1 comment', "% comments") ?><?php trackback_number('', ', 1 trackback', ', % trackbacks') ?><?php pingback_number('', ', 1 pingback', ', % pingbacks') ?></a>
<?php
if (($user_level > $authordata[13]) or ($user_login == $authordata[1])) {
echo " - <a href=\"b2edit.php?action=edit&post=".$postdata["ID"];
echo " - <a href=\"b2edit.php?action=edit&amp;post=".$postdata["ID"];
if ($m)
echo "&m=$m";
echo "\">Edit</a>";
echo " - <a href=\"b2edit.php?action=delete&post=".$postdata["ID"]."\" onclick=\"return confirm('You are about to delete this post \'".$row->post_title."\'\\n \'Cancel\' to stop, \'OK\' to delete.')\">Delete</a> ";
echo " - <a href=\"b2edit.php?action=delete&amp;post=".$postdata["ID"]."\" onclick=\"return confirm('You are about to delete this post \'".$row->post_title."\'\\n \'Cancel\' to stop, \'OK\' to delete.')\">Delete</a> ";
}
?>
]
@ -280,8 +274,7 @@ if ($i == "ASC")
if ($resultc) {
?>
<a name="comments"></a>
<p><b><font color="#ff3300">::</font> comments</b></p>
<h3 id="comments">comments</h3>
<?php
while($rowc = mysql_fetch_object($resultc)) {
@ -294,7 +287,7 @@ if ($i == "ASC")
<br />
<?php comment_text() ?>
<br />
<?php comment_date('Y/m/d') ?> @ <?php comment_time() ?><br />
<?php comment_date('Y/m/d') ?> @ <?php comment_time() ?>
<?php
if (($user_level > $authordata[13]) or ($user_login == $authordata[1])) {
echo "[ <a href=\"b2edit.php?action=editcomment&comment=".$commentdata["comment_ID"]."\">Edit</a>";
@ -312,7 +305,7 @@ if ($i == "ASC")
echo "<p><font color=\"red\">Error: please fill the required fields (name & comment)</font></p>";
?>
<p><b><font color="#ff3300">::</font> leave a comment</b></p>
<h3>Leave Comment</h3>
<!-- form to add a comment -->
@ -324,7 +317,6 @@ if ($i == "ASC")
<input type="text" name="email" class="textarea" value="<?php echo $user_email ?>" size="20" tabindex="2" /><br />
<input type="text" name="url" class="textarea" value="<?php echo $user_url ?>" size="20" tabindex="3" /><br />
<textarea cols="40" rows="4" name="comment" tabindex="4" class="textarea">comment</textarea><br />
<input type="checkbox" name="comment_autobr" value="1" checked tabindex="6" class="checkbox" /> Auto-BR (line-breaks become &lt;br> tags)<br />
<input type="submit" name="submit" class="buttonarea" value="ok" tabindex="5" />
</form>
@ -338,19 +330,18 @@ if ($i == "ASC")
}
?>
<br />
</td>
</tr>
<?php
}
?>
</table>
<?php echo $tablebottom ?>
<br />
<?php echo $tabletop ?>
</div>
<div class="wrap">
<table width="100%">
<tr>
<td valign="top" width="200">Show posts: </td>
<td valign="top" width="200">Show posts:</td>
<td>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
@ -409,4 +400,4 @@ echo " selected";
</td>
</tr>
</table>
<?php echo $tablebottom ?>
</div>

View File

@ -1,6 +1,6 @@
<?php
require_once("../b2config.php");
require("../b2config.php");
require_once($b2inc."/b2template.functions.php");
require_once("b2verifauth.php");
require_once($b2inc."/b2vars.php");
@ -15,7 +15,7 @@ timer_start();
get_currentuserinfo();
$request = " SELECT * FROM $tablesettings ";
$request = "SELECT * FROM $tablesettings";
$result = mysql_query($request);
$querycount++;
while($row = mysql_fetch_object($result)) {
@ -23,14 +23,13 @@ while($row = mysql_fetch_object($result)) {
$what_to_show=$row->what_to_show;
$archive_mode=$row->archive_mode;
$time_difference=$row->time_difference;
$autobr=$row->AutoBR;
$date_format=stripslashes($row->date_format);
$time_format=stripslashes($row->time_format);
}
// let's deactivate quicktags on IE Mac and Lynx, because they don't work there.
if (($is_macIE) || ($is_lynx))
$use_quicktags=0;
$use_quicktags = 0;
$b2varstoreset = array('profile','standalone','redirect','redirect_url','a','popuptitle','popupurl','text', 'trackback', 'pingback');
for ($i=0; $i<count($b2varstoreset); $i += 1) {
@ -50,49 +49,13 @@ for ($i=0; $i<count($b2varstoreset); $i += 1) {
if ($standalone == 0) {
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>wordpress > <?php echo $title; ?></title>
<link rel="stylesheet" href="b2.css" type="text/css">
<style type="text/css">
<!--
<?php
if (!$is_NS4) {
?>
td.menutop {
padding-top: 2px;
padding-bottom: 2px;
border-color: #999999;
border-top-width: 1px;
border-bottom-width: 1px;
border-left-width: 0px;
border-right-width: 0px;
border-style: dashed;
}
textarea,input,select {
background-color: #f0f0f0;
border-width: 1px;
border-color: #cccccc;
border-style: solid;
padding: 2px;
margin: 1px;
font-family: Georgia, "Times New Roman", Times, serif;
}
.checkbox {
<?php
if ((preg_match("/MSIE/",$HTTP_USER_AGENT)) && (!preg_match("/Mac/",$HTTP_USER_AGENT))) {
?> background-color: #ffffff;
border-width: 0px;
padding: 0px;
margin: 0px;
}
<?php
}
}
?>
-->
</style>
<title>WordPress > <?php echo $title; ?></title>
<link rel="stylesheet" href="b2.css" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<?php
if ($redirect==1) {
?>
@ -105,8 +68,9 @@ setTimeout("redirect();", 600);
//-->
</script>
<?php
}
} // redirect
?>
<script language="javascript" type="text/javascript">
<!-- hiding from old terrible browsers
@ -114,22 +78,6 @@ setTimeout("redirect();", 600);
window.open ("b2profile.php?action=viewprofile&user="+userID, "Profile", "width=500, height=450, location=0, menubar=0, resizable=0, scrollbars=1, status=1, titlebar=0, toolbar=0, screenX=60, left=60, screenY=60, top=60");
}
function preview(form) {
var preview_date = "<?php echo date("Y-m-d H:i:s"); ?>";
var preview_userid = "<?php echo $user_ID ?>";
var preview_title = form.post_title.value;
var preview_category = form.post_category.value;
var preview_content = form.content.value;
var preview_autobr = form.post_autobr.value;
preview_date = escape(preview_date);
preview_userid = escape(preview_userid);
preview_title = escape(preview_title);
preview_category = escape(preview_category);
preview_content = escape(preview_content);
preview_autobr = escape(preview_autobr);
window.open ("<?php echo "$siteurl/$blogfilename" ?>?preview=1&preview_date="+preview_date +"&preview_userid="+preview_userid +"&preview_title="+preview_title +"&preview_category="+preview_category +"&preview_content="+preview_content +"&preview_autobr="+preview_autobr ,"Preview", "location=0,menubar=1,resizable=1,scrollbars=yes,status=1,toolbar=0");
}
function launchupload() {
window.open ("b2upload.php", "b2upload", "width=380,height=360,location=0,menubar=0,resizable=1,scrollbars=yes,status=1,toolbar=0");
}
@ -139,21 +87,12 @@ setTimeout("redirect();", 600);
</head>
<body>
<table width="100%" cellpadding="0" cellspacing="0" align="center">
<?php
if ($profile==0) {
?>
<tr height="60">
<td valign="top">
<?php include('b2menutop.php') ?>
</td>
</tr><tr>
<?php
include('b2menutop.php');
}
?>
<td valign="top">
<div class="panelbody">
<?php
<?php
}
?>

View File

@ -24,7 +24,8 @@ while ($j != "") {
}
?>
<li><a href="<?php echo $siteurl."/".$blogfilename; ?>">View site</a></li>
<li><a href="<?php echo $siteurl ?>/b2login.php?action=logout">Logout</a></li>
<li id="last"><a href="<?php echo $siteurl ?>/b2login.php?action=logout">Logout</a></li>
</ul>
<br clear="all" />
<h2><?php echo $title; ?></h2>
<h2><?php echo $title; ?></h2>

169
wp-admin/b2sidebar.php Normal file
View File

@ -0,0 +1,169 @@
<?php
/* <Sidebar> */
$mode = "sidebar";
$standalone = 1;
require_once("b2header.php");
get_currentuserinfo();
// just your usual browser thing because we're still too far from standards
$is_gecko = preg_match("/Gecko/",$HTTP_USER_AGENT);
$is_winIE = ((preg_match("/MSIE/",$HTTP_USER_AGENT)) && (preg_match("/Win/",$HTTP_USER_AGENT)));
$is_macIE = ((preg_match("/MSIE/",$HTTP_USER_AGENT)) && (preg_match("/Mac/",$HTTP_USER_AGENT)));
$is_IE = (($is_macIE) || ($is_winIE));
if ($user_level == 0)
die ("Cheatin' uh ?");
$request = " SELECT * FROM $tablesettings ";
$result = mysql_query($request);
while($row = mysql_fetch_object($result)) {
$time_difference=$row->time_difference;
$autobr=$row->AutoBR;
}
if ($a=="b") {
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="<?php echo $b2inc; ?>/b2.css" type="text/css" />
</head>
<body>
<br />
<table cellspacing="0" cellpadding="15" width="90%" border="0" style="border-color: #cccccc; border-width:1; border-style: solid;" align="center">
<td>
<p>Posted !</p>
<p><a href="b2sidebar.php">Click here</a> to post again.</p>
</td>
</table>
</body>
</html><?php
} else {
?><html>
<head>
<title>b2 > sidebar</title>
<link rel="stylesheet" href="<?php echo $b2inc; ?>/b2.css" type="text/css">
<?php
if ($use_spellchecker) {
?><script type="text/javascript" language="javascript">
<!--
function DoSpell(formname, subject, body)
{
document.SPELLDATA.formname.value=formname
document.SPELLDATA.subjectname.value=subject
document.SPELLDATA.messagebodyname.value=body
document.SPELLDATA.companyID.value="custom\\http://cafelog.com"
document.SPELLDATA.language.value=1033
document.SPELLDATA.opener.value="<?php echo $pathserver ?>/sproxy.pl"
document.SPELLDATA.formaction.value="http://www.spellchecker.com/spell/startspelling.asp "
window.open("<?php echo $pathserver ?>/b2spell.php","Spell",
"toolbar=no,directories=no,location=yes,resizable=yes,width=620,height=400,top=100,left=100")
}
//-->
</script><?php
}
?>
<style type="text/css">
<!--
body {
background-image: url('b2-img/b2minilogo.png');
background-repeat: no-repeat;
background-position: 50px 90px;
padding: 3px;
}
textarea,input,select {
font-family: arial,helvetica,sans serif;
font-size: 12px;
background-color: transparent;
<?php if ($is_gecko || $is_macIE) { ?>
background-image: url('b2-img/bgbookmarklet.png');
<?php } elseif ($is_winIE) { ?>
background-color: #dddddd;
filter: alpha(opacity:80);
<?php } ?>
border-width: 1px;
border-color: #cccccc;
border-style: solid;
padding: 2px;
margin: 1px;
}
<?php if (!$is_gecko) { ?>
.checkbox {
background-color: #ffffff;
border-width: 0px;
padding: 0px;
margin: 0px;
}
<?php } ?>
-->
</style>
</head>
<body>
<!--<table width="100%" cellpadding="0" cellspacing="0">
<td><img src="b2-img/b2minilogo.png"></td>
</table>
-->
<form name="post" action="b2edit.php" method="POST" accept-charset="iso-8859-1">
<input type="hidden" name="action" value="post" />
<input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />
<input type="hidden" name="mode" value="sidebar" />
<input type="text" name="post_title" size="20" tabindex="1" style="width: 100%;" value="Title" onFocus="if (this.value=='Title') { this.value='';}" onBlur="if (this.value=='') {this.value='Title';}" />
<?php dropdown_categories(); ?>
<textarea rows="8" cols="12" style="width: 100%" name="content" tabindex="2" class="postform" wrap="virtual" onFocus="if (this.value=='Post') { this.value='';}" onBlur="if (this.value=='') {this.value='Post';}">Post</textarea>
<input type="checkbox" name="post_autobr" value="1" <?php if ($autobr) echo " checked" ?> tabindex="4" class="checkbox" id="autobr" /><label for="autobr"> Auto-BR</label><br />
<?php if ($use_pingback) { ?>
<input type="checkbox" class="checkbox" name="post_pingback" value="1" checked="checked" tabindex="5" id="pingback" /><label for="pingback"> PingBack</label>
<?php } ?>
<input type="submit" name="submit" value="Blog this !" class="search" tabindex="3" />
<?php if ($use_spellchecker) { ?>
<!--<input type = "button" value = "Spell Check" onclick="var f=document.forms[0]; doSpell( 'en', f.post_content, '<?php echo $spellchecker_url ?>/sproxy.cgi', true);" class="search" tabindex="5" />-->
<input type="button" value="Spellcheck" onclick="DoSpell
('post','content','');" class="search" tabindex="9"/>
<?php }
if ($use_trackback) { ?>
<br /><label for="trackback"><b>TrackBack</b> an URL:</label><br /><input type="text" name="trackback_url" style="width: 100%" id="trackback" tabindex="7" />
<?php } ?>
<script language="JavaScript">
<!--
// document.blog.post_content.focus();
//-->
</script>
</td>
</tr>
</table>
</div>
</form>
<!-- this is for the spellchecker -->
<form name="SPELLDATA"><div>
<input name="formname" type="hidden" value="">
<input name="messagebodyname" type="hidden" value="">
<input name="subjectname" type="hidden" value="">
<input name="companyID" type="hidden" value="">
<input name="language" type="hidden" value="">
<input name="opener" type="hidden" value="">
<input name="formaction" type="hidden" value="">
</div></form>
</body>
</html><?php
}
?>

View File

@ -1,5 +1,5 @@
<?php
$title = "Team management";
$title = 'Team management';
/* <Team> */
$b2varstoreset = array('action','standalone','redirect','profile');
@ -20,79 +20,75 @@ for ($i=0; $i<count($b2varstoreset); $i += 1) {
switch ($action) {
case "promote":
case 'promote':
$standalone = 1;
require_once("./b2header.php");
require_once('b2header.php');
if (empty($HTTP_GET_VARS["prom"])) {
header("Location: b2team.php");
header('Location: b2team.php');
}
$id = $HTTP_GET_VARS["id"];
$prom = $HTTP_GET_VARS["prom"];
$user_data=get_userdata($id);
$usertopromote_level=$user_data[13];
$user_data = get_userdata($id);
$usertopromote_level = $user_data[13];
if ($user_level <= $usertopromote_level) {
die("Can't change the level of an user whose level is higher than yours.");
die('Can&#8217;t change the level of an user whose level is higher than yours.');
}
if ($prom == "up") {
if ('up' == $prom) {
$sql="UPDATE $tableusers SET user_level=user_level+1 WHERE ID = $id";
} elseif ($prom == "down") {
} elseif ('down' == $prom) {
$sql="UPDATE $tableusers SET user_level=user_level-1 WHERE ID = $id";
}
$result=mysql_query($sql) or die("Couldn't change $id's level.");
$result = mysql_query($sql) or die("Couldn't change $id's level.");
header("Location: b2team.php");
header('Location: b2team.php');
break;
case "delete":
case 'delete':
$standalone = 1;
require_once("./b2header.php");
require_once('b2header.php');
$id = $HTTP_GET_VARS["id"];
if (!$id) {
header("Location: b2team.php");
header('Location: b2team.php');
}
$user_data=get_userdata($id);
$usertodelete_level=$user_data[13];
$user_data = get_userdata($id);
$usertodelete_level = $user_data[13];
if ($user_level <= $usertodelete_level)
die("Can't delete an user whose level is higher than yours.");
die('Can&#8217;t delete an user whose level is higher than yours.');
$sql="DELETE FROM $tableusers WHERE ID = $id";
$result=mysql_query($sql) or die("Couldn't delete user #$id.");
$result = mysql_query($sql) or die("Couldn&#8217;t delete user #$id.");
$sql="DELETE FROM $tableposts WHERE post_author = $id";
$result=mysql_query($sql) or die("Couldn't delete user #$id's posts.");
$result = mysql_query($sql) or die("Couldn&#8217;t delete user #$id&#8217;s posts.");
header("Location: b2team.php");
header('Location: b2team.php');
break;
default:
$standalone=0;
include ("./b2header.php");
$standalone = 0;
include ('b2header.php');
?>
<?php echo $blankline.$tabletop ?>
<table cellspacing="0" cellpadding="5" border="0" width="100%">
<tr>
<td>Click on an user's login name to see his/her complete Profile.<br />
To edit your Profile, click on your login name.</td>
</tr>
</table>
<?php echo $tablebottom ?>
<br />
<?php echo $tabletop ?>
<p><b>Active users</b>
<div class="wrap"><p>Click on an user&#8217;s login name to see his complete profile.<br />
To edit your profile, click on your login name.</p>
</div>
<div class="wrap">
<h3>Active users</h3>
<table cellpadding="5" cellspacing="0">
<tr>
<td class="tabletoprow">ID</td>
@ -106,7 +102,7 @@ default:
<?php } ?>
</tr>
<?php
$request = " SELECT * FROM $tableusers WHERE user_level>0 ORDER BY ID";
$request = "SELECT * FROM $tableusers WHERE user_level>0 ORDER BY ID";
$result = mysql_query($request);
while($row = mysql_fetch_object($result)) {
$user_data = get_userdata2($row->ID);
@ -138,16 +134,16 @@ default:
?>
</table>
</p>
<?php echo $tablebottom ?>
</div>
<?php
$request = " SELECT * FROM $tableusers WHERE user_level=0 ORDER BY ID";
$result = mysql_query($request);
if (mysql_num_rows($result)) {
?>
<br />
<?php echo $tabletop ?>
<p><b>Inactive users (level 0)</b>
<div class="wrap">
<h3>Inactive users (level 0)</h3>
<table cellpadding="5" cellspacing="0">
<tr>
<td class="tabletoprow">ID</td>
@ -191,17 +187,16 @@ default:
?>
</table>
</p>
<?php echo $tablebottom ?>
</div>
<?php
}
if ($user_level >= 3) { ?>
<br />
<?php echo $tabletop ?>
To delete an user, bring his/her level to zero, then click on the red cross.<br />
<b>Warning:</b> deleting an user also deletes all posts made by this user.
<?php echo $tablebottom ?>
<div class="wrap">
<p>To delete an user, bring his level to zero, then click on the red X.<br />
<strong>Warning:</strong> deleting an user also deletes all posts made by this user.
</p>
</div>
<?php
}
@ -209,4 +204,5 @@ break;
}
/* </Team> */
include("b2footer.php") ?>
include('b2footer.php');
?>

View File

@ -101,8 +101,7 @@ switch ($action) {
$cat_name=addslashes($cat_name);
$auto_toggle=get_autotoggle($cat_id);
?>
<?php echo $blankline; ?>
<?php echo $tabletop; ?>
<div class="wrap">
<p><b>Old</b> name: <?php echo $cat_name ?></p>
<p>
<form name="editcat" method="post">
@ -114,7 +113,7 @@ switch ($action) {
<input type="submit" name="submit" value="Edit it !" class="search" />
</form>
</p>
<?php echo $tablebottom; ?>
</div>
<?php
break;
} // end Edit
@ -144,8 +143,7 @@ switch ($action) {
die("You have no right to edit the link categories for this blog.<br>Ask for a promotion to your <a href=\"mailto:$admin_email\">blog admin</a> :)");
}
?>
<?php echo $blankline ?>
<?php echo $tabletop ?>
<div class="wrap">
<table width="" cellpadding="5" cellspacing="0" border="0">
<tr><td><b>Link Categories:</b></td></tr>
<tr>
@ -186,16 +184,13 @@ $result = mysql_query($query) or die("Couldn't execute query. ".mysql_error());
</tr>
</table>
<?php echo $tablebottom ?>
<?php echo $blankline ?>
</div>
<?php echo $tabletop ?>
<div class="wrap">
<b>Note:</b><br />
Deleting a link category does not delete links from that category.<br />It will
just set them back to the default category <b><?php echo get_linkcatname(1) ?></b>.
<?php echo $tablebottom ?>
<?php echo $blankline ?>
</div>
<?php
break;
} // end default
@ -203,4 +198,4 @@ $result = mysql_query($query) or die("Couldn't execute query. ".mysql_error());
?>
</table>
<?php include("b2footer.php") ?>
<?php include('b2footer.php'); ?>

View File

@ -30,7 +30,7 @@
include_once('../wp-links/links.config.php');
include_once("../wp-links/links.php");
$title = "Manage Links";
$title = 'Manage Links';
function add_magic_quotes($array) {
foreach ($array as $k => $v) {
@ -69,13 +69,13 @@ for ($i=0; $i<count($b2varstoreset); $i += 1) {
$links_show_cat_id = $HTTP_COOKIE_VARS["links_show_cat_id"];
//error_log("start, links_show_cat_id=$links_show_cat_id");
// error_log("start, links_show_cat_id=$links_show_cat_id");
switch ($action) {
case "Add":
case 'Add':
{
$standalone = 1;
include_once("./b2header.php");
include_once('b2header.php');
$link_url = $HTTP_POST_VARS["linkurl"];
$link_name = $HTTP_POST_VARS["name"];
@ -106,11 +106,11 @@ switch ($action) {
$sql_result = mysql_query($sql) or die("Couldn't execute query."."sql=[$sql]". mysql_error());
header("Location: linkmanager.php");
header('Location: linkmanager.php');
break;
} // end Add
case "editlink":
case 'editlink':
{
if (isset($submit) && ($submit == "Save")) {
@ -124,7 +124,7 @@ switch ($action) {
$links_show_cat_id = $cat_id;
$standalone = 1;
include_once("./b2header.php");
include_once('b2header.php');
$link_id = $HTTP_POST_VARS["link_id"];
$link_url = $HTTP_POST_VARS["linkurl"];
@ -164,10 +164,10 @@ switch ($action) {
break;
} // end Save
case "Delete":
case 'Delete':
{
$standalone = 1;
include_once("./b2header.php");
include_once('b2header.php');
$link_id = $HTTP_POST_VARS["link_id"];
@ -189,12 +189,13 @@ switch ($action) {
header("Location: linkmanager.php");
break;
} // end Delete
case "linkedit":
case 'linkedit':
{
$standalone=0;
include_once ("./b2header.php");
include_once ('b2header.php');
if ($user_level < $minadminlevel) {
die("You have no right to edit the links for this blog.<br>Ask for a promotion to your <a href=\"mailto:$admin_email\">blog admin</a> :)");
die("You have no right to edit the links for this blog.<br />Ask for a promotion to your <a href=\"mailto:$admin_email\">blog admin</a>. :)");
}
$sql = "SELECT link_url, link_name, link_image, link_target, link_description, link_visible, link_category AS cat_id, link_rating, link_rel " .
@ -215,8 +216,8 @@ switch ($action) {
}
?>
<?php echo $blankline ?>
<?php echo $tabletop ?>
<div class="wrap">
<table width="95%" cellpadding="5" cellspacing="0" border="0">
<form name="editlink" method="post">
<input type="hidden" name="action" value="editlink" />
@ -293,7 +294,7 @@ switch ($action) {
</td>
</tr>
</table>
</div>
<?php
break;
} // end linkedit
@ -344,8 +345,8 @@ switch ($action) {
if ($action != "popup") {
?>
<?php echo $blankline ?>
<?php echo $tabletop ?>
<div class="wrap">
<form name="cats" method="post">
<table width="50%" cellpadding="5" cellspacing="0" border="0">
<tr><td><b>Link Categories:</b></td><td colspan="2"><a href="linkcategories.php">Manage Link Categories</a></td></tr>
@ -396,9 +397,9 @@ switch ($action) {
</table>
</form>
<?php echo $tablebottom ?>
<?php echo $blankline ?>
<?php echo $tabletop ?>
</div>
<div class="wrap">
<table width="100%" cellpadding="1" cellspacing="0" border="0">
<form name="links" method="post">
@ -480,10 +481,9 @@ switch ($action) {
<?php
} // end if !popup
?>
<?php echo $tablebottom ?>
<?php echo $blankline ?>
</div>
<?php echo $tabletop ?>
<div class="wrap">
<table width="95%" cellpadding="5" cellspacing="0" border="0">
<form name="addlink" method="post">
@ -555,13 +555,17 @@ switch ($action) {
</td>
</tr>
</table>
</div>
<div class="wrap">
<p>You can drag <a href="javascript:void(linkmanpopup=window.open('<?php echo $siteurl; ?>/wp-admin/linkmanager.php?action=popup&linkurl='+escape(location.href)+'&name='+escape(document.title),'Link Manager','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
break;
} // end default
} // end case
?>
<?php echo $tablebottom ?>
<?php include("b2footer.php") ?>
<?php include('b2footer.php'); ?>