Changeset 558 for trunk/b2-include/b2functions.php
- Timestamp:
- 11/25/2003 12:46:52 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/b2-include/b2functions.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/b2-include/b2functions.php
r555 r558 479 479 // determine the post ID it represents. 480 480 function url_to_postid($url = '') { 481 global $wpdb, $ tableposts, $siteurl;481 global $wpdb, $querycount, $tableposts, $siteurl; 482 482 483 483 // Take a link like 'http://example.com/blog/something' … … 537 537 538 538 // Run the query to get the post ID: 539 return intval($wpdb->get_var("SELECT ID FROM $tableposts WHERE 1 = 1 " . $where)); 539 ++$querycount; 540 return intval($wpdb->get_var("SELECT ID FROM $tableposts WHERE 1 = 1 " . $where)); 540 541 } 541 542 … … 682 683 $default = $postdata["Category"]; 683 684 } 685 ++$querycount; 684 686 foreach($results as $post) { 685 687 echo "<option value=\"".$post->cat_ID."\""; … … 1440 1442 */ 1441 1443 function wp_get_comment_status($comment_id) { 1442 global $wpdb, $ tablecomments;1444 global $wpdb, $querycount, $tablecomments; 1443 1445 1444 1446 $result = $wpdb->get_var("SELECT comment_approved FROM $tablecomments WHERE comment_ID='$comment_id' LIMIT 1"); 1447 ++$querycount; 1445 1448 if ($result == NULL) { 1446 return "deleted";1449 return "deleted"; 1447 1450 } else if ($result == "1") { 1448 return "approved";1451 return "approved"; 1449 1452 } else if ($result == "0") { 1450 return "unapproved";1453 return "unapproved"; 1451 1454 } else { 1452 return false;1455 return false; 1453 1456 } 1454 1457 } 1455 1458 1456 1459 function wp_notify_postauthor($comment_id, $comment_type) { 1457 global $wpdb, $ tablecomments, $tableposts, $tableusers;1460 global $wpdb, $querycount, $tablecomments, $tableposts, $tableusers; 1458 1461 global $querystring_start, $querystring_equal, $querystring_separator; 1459 1462 global $blogfilename, $blogname, $siteurl; 1460 1463 1461 1464 $comment = $wpdb->get_row("SELECT * FROM $tablecomments WHERE comment_ID='$comment_id' LIMIT 1"); 1465 ++$querycount; 1462 1466 $post = $wpdb->get_row("SELECT * FROM $tableposts WHERE ID='$comment->comment_post_ID' LIMIT 1"); 1467 ++$querycount; 1463 1468 $user = $wpdb->get_row("SELECT * FROM $tableusers WHERE ID='$post->post_author' LIMIT 1"); 1469 ++$querycount; 1464 1470 1465 1471 if ('' == $user->user_email) return false; // If there's no email to send the comment to … … 1512 1518 */ 1513 1519 function wp_notify_moderator($comment_id) { 1514 global $wpdb, $ tablecomments, $tableposts, $tableusers;1520 global $wpdb, $querycount, $tablecomments, $tableposts, $tableusers; 1515 1521 global $querystring_start, $querystring_equal, $querystring_separator; 1516 1522 global $blogfilename, $blogname, $siteurl; 1517 1523 1518 1524 $comment = $wpdb->get_row("SELECT * FROM $tablecomments WHERE comment_ID='$comment_id' LIMIT 1"); 1525 ++$querycount; 1519 1526 $post = $wpdb->get_row("SELECT * FROM $tableposts WHERE ID='$comment->comment_post_ID' LIMIT 1"); 1527 ++$querycount; 1520 1528 $user = $wpdb->get_row("SELECT * FROM $tableusers WHERE ID='$post->post_author' LIMIT 1"); 1529 ++$querycount; 1521 1530 1522 1531 $comment_author_domain = gethostbyaddr($comment->comment_author_IP); 1523 1532 $comments_waiting = $wpdb->get_var("SELECT count(comment_ID) FROM $tablecomments WHERE comment_approved = '0'"); 1533 ++$querycount; 1524 1534 1525 1535 $notify_message = "A new comment on the post #$comment->comment_post_ID \"".stripslashes($post->post_title)."\" is waiting for your approval\r\n\r\n";
Note: See TracChangeset
for help on using the changeset viewer.