Index: unk/b2comments.php =================================================================== --- /trunk/b2comments.php (revision 600) +++ (revision ) @@ -1,95 +1,0 @@ -post_password)) { // if there's a password - if ($HTTP_COOKIE_VARS['wp-postpass_'.$cookiehash] != $post->post_password) { // and it doesn't match the cookie - echo("
Enter your password to view comments.
"); - return; - } - } - - $comment_author = (isset($HTTP_COOKIE_VARS['comment_author_'.$cookiehash])) ? trim($HTTP_COOKIE_VARS['comment_author_'.$cookiehash]) : ''; - $comment_author_email = (isset($HTTP_COOKIE_VARS['comment_author_email_'.$cookiehash])) ? trim($HTTP_COOKIE_VARS['comment_author_email_'.$cookiehash]) : ''; - $comment_author_url = (isset($HTTP_COOKIE_VARS['comment_author_url_'.$cookiehash])) ? trim($HTTP_COOKIE_VARS['comment_author_url_'.$cookiehash]) : ''; - - $comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = $id AND comment_approved = '1' ORDER BY comment_date"); -?> - - - -
RSS feed for comments on this post.
- -ping_status) { ?> -The URI to TrackBack this entry is:
- - - - -No comments yet.
- - -Line and paragraph breaks automatic, website trumps email, HTML allowed:
Sorry, comments are closed at this time.
- - - - - Index: unk/b2comments.post.php =================================================================== --- /trunk/b2comments.post.php (revision 600) +++ (revision ) @@ -1,136 +1,0 @@ - $v) { - if (is_array($v)) { - $array[$k] = add_magic_quotes($v); - } else { - $array[$k] = addslashes($v); - } - } - return $array; -} - -if (!get_magic_quotes_gpc()) { - $HTTP_GET_VARS = add_magic_quotes($HTTP_GET_VARS); - $HTTP_POST_VARS = add_magic_quotes($HTTP_POST_VARS); - $HTTP_COOKIE_VARS = add_magic_quotes($HTTP_COOKIE_VARS); -} - -$author = trim(strip_tags($HTTP_POST_VARS['author'])); - -$email = trim(strip_tags($HTTP_POST_VARS['email'])); -if (strlen($email) < 6) - $email = ''; - -$url = trim(strip_tags($HTTP_POST_VARS['url'])); -$url = ((!stristr($url, '://')) && ($url != '')) ? 'http://'.$url : $url; -if (strlen($url) < 7) - $url = ''; - -$comment = trim($HTTP_POST_VARS['comment']); -$original_comment = $comment; -$comment_post_ID = intval($HTTP_POST_VARS['comment_post_ID']); -$user_ip = $HTTP_SERVER_VARS['REMOTE_ADDR']; -$user_domain = gethostbyaddr($user_ip); - -$commentstatus = $wpdb->get_var("SELECT comment_status FROM $tableposts WHERE ID = $comment_post_ID"); -if ('closed' == $commentstatus) - die('Sorry, comments are closed for this item.'); - -if ($require_name_email && ($email == '' || $author == '')) { //original fix by Dodo, and then Drinyth - die('Error: please fill the required fields (name, email).'); -} -if ($comment == 'comment' || $comment == '') { - die('Error: please type a comment.'); -} - - -$now = current_time('mysql'); - -$comment = strip_tags($comment, $comment_allowed_tags); -$comment = balanceTags($comment, 1); -$comment = convert_chars($comment); -$comment = format_to_post($comment); - -$comment_author = $author; -$comment_author_email = $email; -$comment_author_url = $url; - -$author = addslashes($author); -$email = addslashes($email); -$url = addslashes($url); - -/* Flood-protection */ -$lasttime = $wpdb->get_var("SELECT comment_date FROM $tablecomments WHERE comment_author_IP = '$user_ip' ORDER BY comment_date DESC LIMIT 1"); -$ok = true; -if (!empty($lasttime)) { - $time_lastcomment= mysql2date('U', $lasttime); - $time_newcomment= mysql2date('U', "$now"); - if (($time_newcomment - $time_lastcomment) < 10) - $ok = false; -} -/* End flood-protection */ - - - -if ($ok) { // if there was no comment from this IP in the last 10 seconds - $comment_moderation = get_settings('comment_moderation'); - $moderation_notify = get_settings('moderation_notify'); - $comments_notify = get_settings('comments_notify'); - - // o42: this place could be the hook for further comment spam checking - // $approved should be set according the final approval status - // of the new comment - if ('manual' == $comment_moderation) { - $approved = 0; - } else if ('auto' == $comment_moderation) { - $approved = 0; - } else { // none - $approved = 1; - } - $wpdb->query("INSERT INTO $tablecomments - (comment_ID, comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_content, comment_approved) - VALUES - ('0', '$comment_post_ID', '$author', '$email', '$url', '$user_ip', '$now', '$comment', '$approved') - "); - - $comment_ID = $wpdb->get_var('SELECT last_insert_id()'); - - if (($moderation_notify) && (!$approved)) { - wp_notify_moderator($comment_ID); - } - - if (($comments_notify) && ($approved)) { - wp_notify_postauthor($comment_ID, 'comment'); - } - - if ($email == '') - $email = ' '; // this to make sure a cookie is set for 'no email' - - if ($url == '') - $url = ' '; // this to make sure a cookie is set for 'no url' - - setcookie('comment_author_'.$cookiehash, $author, time()+30000000); - setcookie('comment_author_email_'.$cookiehash, $email, time()+30000000); - setcookie('comment_author_url_'.$cookiehash, $url, time()+30000000); - - header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); - header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); - header('Cache-Control: no-cache, must-revalidate'); - header('Pragma: no-cache'); - $location = (empty($HTTP_POST_VARS['redirect_to'])) ? $HTTP_SERVER_VARS["HTTP_REFERER"] : $HTTP_POST_VARS['redirect_to']; - if ($is_IIS) { - header("Refresh: 0;url=$location"); - } else { - header("Location: $location"); - } -} else { - die('Sorry, you can only post a new comment once every 10 seconds. Slow down cowboy.'); -} - -?> Index: unk/b2login.php =================================================================== --- /trunk/b2login.php (revision 600) +++ (revision ) @@ -1,319 +1,0 @@ - $v) { - if (is_array($v)) { - $array[$k] = add_magic_quotes($v); - } else { - $array[$k] = addslashes($v); - } - } - return $array; - } -} - -if (!get_magic_quotes_gpc()) { - $HTTP_GET_VARS = add_magic_quotes($HTTP_GET_VARS); - $HTTP_POST_VARS = add_magic_quotes($HTTP_POST_VARS); - $HTTP_COOKIE_VARS = add_magic_quotes($HTTP_COOKIE_VARS); -} - -$b2varstoreset = array('action','mode','error','text','popupurl','popuptitle'); - -for ($i = 0; $i < count($b2varstoreset); $i = $i + 1) { - $b2var = $b2varstoreset[$i]; - if (!isset($$b2var)) { - if (empty($HTTP_POST_VARS["$b2var"])) { - if (empty($HTTP_GET_VARS["$b2var"])) { - $$b2var = ''; - } else { - $$b2var = $HTTP_GET_VARS["$b2var"]; - } - } else { - $$b2var = $HTTP_POST_VARS["$b2var"]; - } - } -} - -switch($action) { - -case 'logout': - - setcookie('wordpressuser_'.$cookiehash); - setcookie('wordpresspass_'.$cookiehash); - header('Expires: Wed, 11 Jan 1984 05:00:00 GMT'); - header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); - header('Cache-Control: no-cache, must-revalidate'); - header('Pragma: no-cache'); - if ($is_IIS) { - header('Refresh: 0;url=b2login.php'); - } else { - header('Location: b2login.php'); - } - exit(); - -break; - -case 'login': - - if(!empty($HTTP_POST_VARS)) { - $log = $HTTP_POST_VARS["log"]; - $pwd = $HTTP_POST_VARS["pwd"]; - $redirect_to = $HTTP_POST_VARS["redirect_to"]; - } - - function login() { - global $wpdb, $log, $pwd, $error, $user_ID; - global $tableusers, $pass_is_md5; - $user_login = &$log; - $password = &$pwd; - if (!$user_login) { - $error="ERROR: the login field is empty"; - return false; - } - - if (!$password) { - $error="ERROR: the password field is empty"; - return false; - } - - if ('md5:' == substr($password, 0, 4)) { - $pass_is_md5 = 1; - $password = substr($password, 4, strlen($password)); - $query = "SELECT ID, user_login, user_pass FROM $tableusers WHERE user_login = '$user_login' AND MD5(user_pass) = '$password'"; - } else { - $pass_is_md5 = 0; - $query = "SELECT ID, user_login, user_pass FROM $tableusers WHERE user_login = '$user_login' AND user_pass = '$password'"; - } - $login = $wpdb->get_row($query); - - if (!$login) { - $error = 'ERROR: wrong login or password'; - $pwd = ''; - return false; - } else { - $user_ID = $login->ID; - if (($pass_is_md5 == 0 && $login->user_login == $user_login && $login->user_pass == $password) || ($pass_is_md5 == 1 && $login->user_login == $user_login && md5($login->user_pass) == $password)) { - return true; - } else { - $error = 'ERROR: wrong login or password'; - $pwd = ''; - return false; - } - } - } - - if (!login()) { - header('Expires: Wed, 11 Jan 1984 05:00:00 GMT'); - header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); - header('Cache-Control: no-cache, must-revalidate'); - header('Pragma: no-cache'); - if ($is_IIS) { - header('Refresh: 0;url=b2login.php'); - } else { - header('Location: b2login.php'); - } - exit(); - } else { - $user_login = $log; - $user_pass = $pwd; - setcookie('wordpressuser_'.$cookiehash, $user_login, time()+31536000); - if ($pass_is_md5) { - setcookie('wordpresspass_'.$cookiehash, $user_pass, time()+31536000); - } else { - setcookie('wordpresspass_'.$cookiehash, md5($user_pass), time()+31536000); - } - if (empty($HTTP_COOKIE_VARS['wordpressblogid_'.$cookiehash])) { - setcookie('wordpressblogid_'.$cookiehash, 1,time()+31536000); - } - header('Expires: Wed, 11 Jan 1984 05:00:00 GMT'); - header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); - header('Cache-Control: no-cache, must-revalidate'); - header('Pragma: no-cache'); - - switch($mode) { - case 'bookmarklet': - $location = "wp-admin/b2bookmarklet.php?text=$text&popupurl=$popupurl&popuptitle=$popuptitle"; - break; - case 'sidebar': - $location = "wp-admin/sidebar.php?text=$text&popupurl=$popupurl&popuptitle=$popuptitle"; - break; - case 'profile': - $location = "wp-admin/profile.php?text=$text&popupurl=$popupurl&popuptitle=$popuptitle"; - break; - default: - $location = "$redirect_to"; - break; - } - - if ($is_IIS) { - header("Refresh: 0;url=$location"); - } else { - header("Location: $location"); - } - } - -break; - - -case 'lostpassword': - - ?> - - - -Type your login here and click OK. You will receive an email with your password.
-$errorThe email could not be sent.
\n";
- echo "Possible reason: your host may have disabled the mail() function...
The email was sent successfully to $user_login's email address.
- Click here to login!
- Back to blog?
-
- Register?
-
- Lost your password?
-
$iCount
Subject: $subject
\n"; - - $subject = trim(str_replace($subjectprefix, '', $subject)); - - if ($content_type == 'multipart/alternative') { - $content = explode('--'.$boundary, $content); - $content = $content[2]; - $content = explode('Content-Transfer-Encoding: quoted-printable', $content); - $content = strip_tags($content[1], 'Content-type: $content_type, boundary: $boundary Raw content: Login: $user_login, Pass: $user_pass Wrong login or password. Posted title: $post_title".$content.'
';
-
- $btpos = strpos($content, $bodyterminator);
- if ($btpos) {
- $content = substr($content, 0, $btpos);
- }
- $content = trim($content);
-
- $blah = explode("\n", $content);
- $firstline = $blah[0];
- $secondline = $blah[1];
-
- if ($use_phoneemail) {
- $btpos = strpos($firstline, $phoneemail_separator);
- if ($btpos) {
- $userpassstring = trim(substr($firstline, 0, $btpos));
- $content = trim(substr($content, $btpos+strlen($phoneemail_separator), strlen($content)));
- $btpos = strpos($content, $phoneemail_separator);
- if ($btpos) {
- $userpassstring = trim(substr($content, 0, $btpos));
- $content = trim(substr($content, $btpos+strlen($phoneemail_separator), strlen($content)));
- }
- }
- $contentfirstline = $blah[1];
- } else {
- $userpassstring = $firstline;
- $contentfirstline = '';
- }
-
- $flat = 999.0;
- $flon = 999.0;
- $secondlineParts = explode(':',$secondline);
- if(strncmp($secondlineParts[0],"POS",3)==0) {
- echo "Found POS:
\n";
- //echo "Second parts is:".$secondlineParts[1];
- // the second line is the postion listing line
- $secLineParts = explode(',',$secondlineParts[1]);
- $flatStr = $secLineParts[0];
- $flonStr = $secLineParts[1];
- //echo "String are ".$flatStr.$flonStr;
- $flat = floatval($secLineParts[0]);
- $flon = floatval($secLineParts[1]);
- //echo "values are ".$flat." and ".$flon;
- // ok remove that position... we should not have it in the final output
- $content = str_replace($secondline,'',$content);
- }
-
- $blah = explode(':', $userpassstring);
- $user_login = $blah[0];
- $user_pass = $blah[1];
-
- $content = $contentfirstline.str_replace($firstline, '', $content);
- $content = trim($content);
-
- echo "
";
- echo "\nPosted content:".$content.'
Oops '.$pop3->ERROR.'
Mission complete, message $iCount deleted.
"; - } - - } else { - echo 'Level 0 users can\'t post.
'; - } - echo ''; - if ($output_debugging_info) { - ob_end_flush(); - } else { - ob_end_clean(); - } - } -} - -$pop3->quit(); - -timer_stop($output_debugging_info); -exit; - -?> Index: /trunk/b2rdf.php =================================================================== --- /trunk/b2rdf.php (revision 600) +++ /trunk/b2rdf.php (revision 601) @@ -2,5 +2,5 @@ $curpath = dirname(__FILE__).'/'; require_once ($curpath.'wp-config.php'); -require_once ($curpath.$b2inc.'/b2template.functions.php'); +require_once ($curpath.$b2inc.'/template-functions.php'); header('HTTP/1.0 301 Moved Permanently'); header('Location: ' . get_bloginfo('rdf_url') . "\n"); Index: /trunk/b2rss.php =================================================================== --- /trunk/b2rss.php (revision 600) +++ /trunk/b2rss.php (revision 601) @@ -2,5 +2,5 @@ $curpath = dirname(__FILE__).'/'; require_once ($curpath.'wp-config.php'); -require_once ($curpath.$b2inc.'/b2template.functions.php'); +require_once ($curpath.$b2inc.'/template-functions.php'); header('HTTP/1.0 301 Moved Permanently'); header('Location: ' . get_bloginfo('rss_url') . "\n"); Index: /trunk/b2rss2.php =================================================================== --- /trunk/b2rss2.php (revision 600) +++ /trunk/b2rss2.php (revision 601) @@ -2,5 +2,5 @@ $curpath = dirname(__FILE__).'/'; require_once ($curpath.'wp-config.php'); -require_once ($curpath.$b2inc.'/b2template.functions.php'); +require_once ($curpath.$b2inc.'/template-functions.php'); header('HTTP/1.0 301 Moved Permanently'); header('Location: ' . get_bloginfo('rss2_url') . "\n"); Index: /trunk/index-smarty.php =================================================================== --- /trunk/index-smarty.php (revision 600) +++ /trunk/index-smarty.php (revision 601) @@ -9,7 +9,7 @@ $wpsmarty->cache_dir = './wp-blogs/main/smartycache'; $wpsmarty->plugin_dir = './wp-plugins'; -require_once( 'b2-include/smarty.inc.php' ); +require_once( 'b2-include/class-smarty.php' ); $blog = 1; -require_once('blog.header.php'); +require_once('wp-blog-header.php'); require_once($abspath.'wp-links/links.php'); // not on by default: require_once($abspath.'wp-links/links.weblogs.com.php'); @@ -27,5 +27,5 @@ $content .= $wpsmarty->fetch( 'post.html' ); ob_start(); - include($abspath . 'b2comments.php'); + include($abspath . 'wp-comments.php'); $txt = ob_get_contents(); ob_end_clean(); Index: /trunk/index.php =================================================================== --- /trunk/index.php (revision 600) +++ /trunk/index.php (revision 601) @@ -1,7 +1,6 @@ - @@ -53,5 +52,5 @@ --> - + @@ -94,5 +93,5 @@weblogs.com.changes.cache
file. In b2comments.php, like in the main template file, please keep the first PHP lines, the "while" lines, and the "}" lines.
+In wp-comments.php, like in the main template file, please keep the first PHP lines, the "while" lines, and the "}" lines.
You can modify the form, but do not remove "<?php echo ... ?>" and all the name="..." attributes.
You can now post to your b2 blog with tools like BlogBuddy, Bloggar, WapBlogger (post from your Wap cellphone!), Radio Userland (which means you can use Radio's email-to-blog feature), Zempt, NewzCrawler, and other tools that support the Blogging APIs! :)
-Your XMLRPC server/path are as described here: if you login to b2 on http://example.com/me/b2login.php, then you have:
+Your XMLRPC server/path are as described here: if you login to b2 on http://example.com/me/wp-login.php, then you have:
You can post news from an email client!
But first you'll have to edit the options on the options screen, filling the appropriate values for your POP3 email account (this interface doesn't support IMAP yet, only POP3, sorry).
Once you have edited the options, you can make your webserver execute b2mail.php every set amount of time (depending on your host's performance, this script can be resource intensive, so don't make it run every minute or you'll be kicked).
-You can do it with Cron-jobs, or if your host doesn't support it you can look into the various website-monitoring services, and make them check your b2mail.php URL.
+Once you have edited the options, you can make your webserver execute wp-mail.php every set amount of time (depending on your host's performance, this script can be resource intensive, so don't make it run every minute or you'll be kicked).
+You can do it with Cron-jobs, or if your host doesn't support it you can look into the various website-monitoring services, and make them check your wp-mail.php URL.
It is strongly advised to send your email as text-only (Outlook and Outlook Express default to 'html', which may cause problems), but HTML email could work (the script would strip all your html tags though...).
Index: /trunk/wp-admin/admin-footer.php =================================================================== --- /trunk/wp-admin/admin-footer.php (revision 601) +++ /trunk/wp-admin/admin-footer.php (revision 601) @@ -0,0 +1,10 @@ + + +WordPress — Support Forums
+
+
by — @
-