Added ezSQL and small HTML fixes.

git-svn-id: https://develop.svn.wordpress.org/trunk@225 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg 2003-06-14 16:32:07 +00:00
parent 8d7e0372e5
commit 466c2804b5
1 changed files with 12 additions and 19 deletions

View File

@ -11,12 +11,10 @@ require_once($abspath.$b2inc.'/b2functions.php');
require_once($abspath.$b2inc."/xmlrpc.inc"); require_once($abspath.$b2inc."/xmlrpc.inc");
require_once($abspath.$b2inc."/xmlrpcs.inc"); require_once($abspath.$b2inc."/xmlrpcs.inc");
dbconnect();
timer_start(); timer_start();
$use_cache = 1; $use_cache = 1;
$output_debugging_info = 0; # =1 if you want to output debugging info $output_debugging_info = 0; # =1 if you want to output debugging info
$autobr = get_settings('AutoBR');
$time_difference = get_settings('time_difference'); $time_difference = get_settings('time_difference');
if ($use_phoneemail) { if ($use_phoneemail) {
@ -126,7 +124,7 @@ for ($iCount=1; $iCount<=$Count; $iCount++) {
ob_start(); ob_start();
if ($ddate_difference_days > 14) { if ($ddate_difference_days > 14) {
echo 'too old<br />'; echo 'Too old<br />';
continue; continue;
} }
@ -148,7 +146,7 @@ for ($iCount=1; $iCount<=$Count; $iCount++) {
$content = trim($content); $content = trim($content);
echo "<p><b>Content-type:</b> $content_type, <b>boundary:</b> $boundary</p>\n"; echo "<p><b>Content-type:</b> $content_type, <b>boundary:</b> $boundary</p>\n";
echo "<p><b>Raw content:</b><br /><xmp>".$content.'</xmp></p>'; echo "<p><b>Raw content:</b><br /><pre>".$content.'</pre></p>';
$btpos = strpos($content, $bodyterminator); $btpos = strpos($content, $bodyterminator);
if ($btpos) { if ($btpos) {
@ -186,16 +184,15 @@ for ($iCount=1; $iCount<=$Count; $iCount++) {
echo "<p><b>Login:</b> $user_login, <b>Pass:</b> $user_pass</p>"; echo "<p><b>Login:</b> $user_login, <b>Pass:</b> $user_pass</p>";
$sql = "SELECT ID, user_level FROM $tableusers WHERE user_login='$user_login' AND user_pass='$user_pass' ORDER BY ID DESC LIMIT 1"; $sql = "SELECT ID, user_level FROM $tableusers WHERE user_login='$user_login' AND user_pass='$user_pass' ORDER BY ID DESC LIMIT 1";
$result = mysql_query($sql); $result = $wpdb->get_row($sql);
if (!mysql_num_rows($result)) { if (!$result) {
echo '<p><b>Wrong login or password.</b></p></div>'; echo '<p><b>Wrong login or password.</b></p></div>';
continue; continue;
} }
$row = mysql_fetch_object($result); $user_level = $result->user_level;
$user_level = $row->user_level; $post_author = $result->ID;
$post_author = $row->ID;
if ($user_level > 0) { if ($user_level > 0) {
@ -209,15 +206,11 @@ for ($iCount=1; $iCount<=$Count; $iCount++) {
$post_category = $default_category; $post_category = $default_category;
} }
if ($autobr) {
$content = autobrize($content);
}
if (!$thisisforfunonly) { if (!$thisisforfunonly) {
$post_title = addslashes(trim($post_title)); $post_title = addslashes(trim($post_title));
$content = addslashes(trim($content)); $content = addslashes(trim($content));
$sql = "INSERT INTO $tableposts (post_author, post_date, post_content, post_title, post_category) VALUES ($post_author, '$post_date', '$content', '$post_title', $post_category)"; $sql = "INSERT INTO $tableposts (post_author, post_date, post_content, post_title, post_category) VALUES ($post_author, '$post_date', '$content', '$post_title', $post_category)";
$result = mysql_query($sql) or die('Couldn\'t add post: '.mysql_error()); $result = $wpdb->query($sql);
$post_ID = mysql_insert_id(); $post_ID = mysql_insert_id();
if (isset($sleep_after_edit) && $sleep_after_edit > 0) { if (isset($sleep_after_edit) && $sleep_after_edit > 0) {
@ -232,18 +225,18 @@ for ($iCount=1; $iCount<=$Count; $iCount++) {
pingback($content, $post_ID); pingback($content, $post_ID);
} }
echo "\n<p><b>Posted title:</b> $post_title<br />"; echo "\n<p><b>Posted title:</b> $post_title<br />";
echo "\n<b>Posted content:</b><br /><xmp>".$content.'</xmp></p>'; echo "\n<b>Posted content:</b><br /><pre>".$content.'</pre></p>';
if(!$pop3->delete($iCount)) { if(!$pop3->delete($iCount)) {
echo '<p>oops '.$pop3->ERROR.'</p></div>'; echo '<p>Oops '.$pop3->ERROR.'</p></div>';
$pop3->reset(); $pop3->reset();
exit; exit;
} else { } else {
echo "<p>Mission complete, message <b>$iCount</b> deleted </p>"; echo "<p>Mission complete, message <strong>$iCount</strong> deleted.</p>";
} }
} else { } else {
echo '<p><b>Level 0 users can\'t post.</b></p>'; echo '<p><strong>Level 0 users can\'t post.</strong></p>';
} }
echo '</div>'; echo '</div>';
if ($output_debugging_info) { if ($output_debugging_info) {
@ -259,4 +252,4 @@ $pop3->quit();
timer_stop($output_debugging_info); timer_stop($output_debugging_info);
exit; exit;
?> ?>