Missing querycount
git-svn-id: http://svn.automattic.com/wordpress/trunk@558 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1c5322e065
commit
3e120068f9
|
@ -478,7 +478,7 @@ function get_usernumposts($userid) {
|
||||||
// examine a url (supposedly from this blog) and try to
|
// examine a url (supposedly from this blog) and try to
|
||||||
// determine the post ID it represents.
|
// determine the post ID it represents.
|
||||||
function url_to_postid($url = '') {
|
function url_to_postid($url = '') {
|
||||||
global $wpdb, $tableposts, $siteurl;
|
global $wpdb, $querycount, $tableposts, $siteurl;
|
||||||
|
|
||||||
// Take a link like 'http://example.com/blog/something'
|
// Take a link like 'http://example.com/blog/something'
|
||||||
// and extract just the '/something':
|
// and extract just the '/something':
|
||||||
|
@ -536,6 +536,7 @@ function url_to_postid($url = '') {
|
||||||
if ($postname) $where .= " AND post_name = '" . $wpdb->escape($postname) . "' ";
|
if ($postname) $where .= " AND post_name = '" . $wpdb->escape($postname) . "' ";
|
||||||
|
|
||||||
// Run the query to get the post ID:
|
// Run the query to get the post ID:
|
||||||
|
++$querycount;
|
||||||
return intval($wpdb->get_var("SELECT ID FROM $tableposts WHERE 1 = 1 " . $where));
|
return intval($wpdb->get_var("SELECT ID FROM $tableposts WHERE 1 = 1 " . $where));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -681,6 +682,7 @@ function dropdown_categories($blog_ID=1, $default=1) {
|
||||||
if ($postdata["Category"] != '') {
|
if ($postdata["Category"] != '') {
|
||||||
$default = $postdata["Category"];
|
$default = $postdata["Category"];
|
||||||
}
|
}
|
||||||
|
++$querycount;
|
||||||
foreach($results as $post) {
|
foreach($results as $post) {
|
||||||
echo "<option value=\"".$post->cat_ID."\"";
|
echo "<option value=\"".$post->cat_ID."\"";
|
||||||
if ($post->cat_ID == $default)
|
if ($post->cat_ID == $default)
|
||||||
|
@ -1439,9 +1441,10 @@ function wp_set_comment_status($comment_id, $comment_status) {
|
||||||
a (boolean) false signals an error
|
a (boolean) false signals an error
|
||||||
*/
|
*/
|
||||||
function wp_get_comment_status($comment_id) {
|
function wp_get_comment_status($comment_id) {
|
||||||
global $wpdb, $tablecomments;
|
global $wpdb, $querycount, $tablecomments;
|
||||||
|
|
||||||
$result = $wpdb->get_var("SELECT comment_approved FROM $tablecomments WHERE comment_ID='$comment_id' LIMIT 1");
|
$result = $wpdb->get_var("SELECT comment_approved FROM $tablecomments WHERE comment_ID='$comment_id' LIMIT 1");
|
||||||
|
++$querycount;
|
||||||
if ($result == NULL) {
|
if ($result == NULL) {
|
||||||
return "deleted";
|
return "deleted";
|
||||||
} else if ($result == "1") {
|
} else if ($result == "1") {
|
||||||
|
@ -1454,13 +1457,16 @@ function wp_get_comment_status($comment_id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function wp_notify_postauthor($comment_id, $comment_type) {
|
function wp_notify_postauthor($comment_id, $comment_type) {
|
||||||
global $wpdb, $tablecomments, $tableposts, $tableusers;
|
global $wpdb, $querycount, $tablecomments, $tableposts, $tableusers;
|
||||||
global $querystring_start, $querystring_equal, $querystring_separator;
|
global $querystring_start, $querystring_equal, $querystring_separator;
|
||||||
global $blogfilename, $blogname, $siteurl;
|
global $blogfilename, $blogname, $siteurl;
|
||||||
|
|
||||||
$comment = $wpdb->get_row("SELECT * FROM $tablecomments WHERE comment_ID='$comment_id' LIMIT 1");
|
$comment = $wpdb->get_row("SELECT * FROM $tablecomments WHERE comment_ID='$comment_id' LIMIT 1");
|
||||||
|
++$querycount;
|
||||||
$post = $wpdb->get_row("SELECT * FROM $tableposts WHERE ID='$comment->comment_post_ID' LIMIT 1");
|
$post = $wpdb->get_row("SELECT * FROM $tableposts WHERE ID='$comment->comment_post_ID' LIMIT 1");
|
||||||
|
++$querycount;
|
||||||
$user = $wpdb->get_row("SELECT * FROM $tableusers WHERE ID='$post->post_author' LIMIT 1");
|
$user = $wpdb->get_row("SELECT * FROM $tableusers WHERE ID='$post->post_author' LIMIT 1");
|
||||||
|
++$querycount;
|
||||||
|
|
||||||
if ('' == $user->user_email) return false; // If there's no email to send the comment to
|
if ('' == $user->user_email) return false; // If there's no email to send the comment to
|
||||||
|
|
||||||
|
@ -1511,16 +1517,20 @@ function wp_notify_postauthor($comment_id, $comment_type) {
|
||||||
always returns true
|
always returns true
|
||||||
*/
|
*/
|
||||||
function wp_notify_moderator($comment_id) {
|
function wp_notify_moderator($comment_id) {
|
||||||
global $wpdb, $tablecomments, $tableposts, $tableusers;
|
global $wpdb, $querycount, $tablecomments, $tableposts, $tableusers;
|
||||||
global $querystring_start, $querystring_equal, $querystring_separator;
|
global $querystring_start, $querystring_equal, $querystring_separator;
|
||||||
global $blogfilename, $blogname, $siteurl;
|
global $blogfilename, $blogname, $siteurl;
|
||||||
|
|
||||||
$comment = $wpdb->get_row("SELECT * FROM $tablecomments WHERE comment_ID='$comment_id' LIMIT 1");
|
$comment = $wpdb->get_row("SELECT * FROM $tablecomments WHERE comment_ID='$comment_id' LIMIT 1");
|
||||||
|
++$querycount;
|
||||||
$post = $wpdb->get_row("SELECT * FROM $tableposts WHERE ID='$comment->comment_post_ID' LIMIT 1");
|
$post = $wpdb->get_row("SELECT * FROM $tableposts WHERE ID='$comment->comment_post_ID' LIMIT 1");
|
||||||
|
++$querycount;
|
||||||
$user = $wpdb->get_row("SELECT * FROM $tableusers WHERE ID='$post->post_author' LIMIT 1");
|
$user = $wpdb->get_row("SELECT * FROM $tableusers WHERE ID='$post->post_author' LIMIT 1");
|
||||||
|
++$querycount;
|
||||||
|
|
||||||
$comment_author_domain = gethostbyaddr($comment->comment_author_IP);
|
$comment_author_domain = gethostbyaddr($comment->comment_author_IP);
|
||||||
$comments_waiting = $wpdb->get_var("SELECT count(comment_ID) FROM $tablecomments WHERE comment_approved = '0'");
|
$comments_waiting = $wpdb->get_var("SELECT count(comment_ID) FROM $tablecomments WHERE comment_approved = '0'");
|
||||||
|
++$querycount;
|
||||||
|
|
||||||
$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";
|
$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";
|
||||||
$notify_message .= "Author : $comment->comment_author (IP: $comment->comment_author_IP , $comment_author_domain)\r\n";
|
$notify_message .= "Author : $comment->comment_author (IP: $comment->comment_author_IP , $comment_author_domain)\r\n";
|
||||||
|
|
|
@ -232,11 +232,12 @@ function get_archives($type='', $limit='', $format='html', $before = "", $after
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_calendar($daylength = 1) {
|
function get_calendar($daylength = 1) {
|
||||||
global $wpdb, $HTTP_GET_VARS, $m, $monthnum, $year, $timedifference, $month, $weekday, $tableposts, $posts;
|
global $wpdb, $HTTP_GET_VARS, $m, $monthnum, $year, $timedifference, $month, $weekday, $tableposts, $posts, $querycount;
|
||||||
|
|
||||||
// Quick check. If we have no posts at all, abort!
|
// Quick check. If we have no posts at all, abort!
|
||||||
if (!$posts) {
|
if (!$posts) {
|
||||||
$gotsome = $wpdb->get_var("SELECT ID from $tableposts WHERE post_status = 'publish' AND post_category > 0 ORDER BY post_date DESC LIMIT 1");
|
$gotsome = $wpdb->get_var("SELECT ID from $tableposts WHERE post_status = 'publish' AND post_category > 0 ORDER BY post_date DESC LIMIT 1");
|
||||||
|
++$querycount;
|
||||||
if (!$gotsome)
|
if (!$gotsome)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -253,6 +254,7 @@ function get_calendar($daylength = 1) {
|
||||||
$thisyear = ''.intval(substr($m, 0, 4));
|
$thisyear = ''.intval(substr($m, 0, 4));
|
||||||
$d = (($w - 1) * 7) + 6; //it seems MySQL's weeks disagree with PHP's
|
$d = (($w - 1) * 7) + 6; //it seems MySQL's weeks disagree with PHP's
|
||||||
$thismonth = $wpdb->get_var("SELECT DATE_FORMAT((DATE_ADD('${thisyear}0101', INTERVAL $d DAY) ), '%m')");
|
$thismonth = $wpdb->get_var("SELECT DATE_FORMAT((DATE_ADD('${thisyear}0101', INTERVAL $d DAY) ), '%m')");
|
||||||
|
++$querycount;
|
||||||
} elseif (!empty($m)) {
|
} elseif (!empty($m)) {
|
||||||
$calendar = substr($m, 0, 6);
|
$calendar = substr($m, 0, 6);
|
||||||
$thisyear = ''.intval(substr($m, 0, 4));
|
$thisyear = ''.intval(substr($m, 0, 4));
|
||||||
|
@ -275,6 +277,7 @@ function get_calendar($daylength = 1) {
|
||||||
AND post_status = 'publish'
|
AND post_status = 'publish'
|
||||||
ORDER BY post_date DESC
|
ORDER BY post_date DESC
|
||||||
LIMIT 1");
|
LIMIT 1");
|
||||||
|
++$querycount;
|
||||||
$next = $wpdb->get_row("SELECT DISTINCT MONTH( post_date ) AS month, YEAR( post_date ) AS year
|
$next = $wpdb->get_row("SELECT DISTINCT MONTH( post_date ) AS month, YEAR( post_date ) AS year
|
||||||
FROM $tableposts
|
FROM $tableposts
|
||||||
WHERE post_date > '$thisyear-$thismonth-01'
|
WHERE post_date > '$thisyear-$thismonth-01'
|
||||||
|
@ -282,6 +285,7 @@ function get_calendar($daylength = 1) {
|
||||||
AND post_status = 'publish'
|
AND post_status = 'publish'
|
||||||
ORDER BY post_date ASC
|
ORDER BY post_date ASC
|
||||||
LIMIT 1");
|
LIMIT 1");
|
||||||
|
++$querycount;
|
||||||
|
|
||||||
echo '<table id="wp-calendar">
|
echo '<table id="wp-calendar">
|
||||||
<caption>' . $month[zeroise($thismonth, 2)] . ' ' . date('Y', $unixmonth) . '</caption>
|
<caption>' . $month[zeroise($thismonth, 2)] . ' ' . date('Y', $unixmonth) . '</caption>
|
||||||
|
@ -329,7 +333,7 @@ function get_calendar($daylength = 1) {
|
||||||
AND YEAR(post_date) = $thisyear
|
AND YEAR(post_date) = $thisyear
|
||||||
AND post_status = 'publish'
|
AND post_status = 'publish'
|
||||||
AND post_date < '" . date("Y-m-d H:i:s", (time() + ($time_difference * 3600)))."'", ARRAY_N);
|
AND post_date < '" . date("Y-m-d H:i:s", (time() + ($time_difference * 3600)))."'", ARRAY_N);
|
||||||
|
++$querycount;
|
||||||
if ($dayswithposts) {
|
if ($dayswithposts) {
|
||||||
foreach ($dayswithposts as $daywith) {
|
foreach ($dayswithposts as $daywith) {
|
||||||
$daywithpost[] = $daywith[0];
|
$daywithpost[] = $daywith[0];
|
||||||
|
@ -355,6 +359,7 @@ function get_calendar($daylength = 1) {
|
||||||
."AND post_date < '".date("Y-m-d H:i:s", (time() + ($time_difference * 3600)))."' "
|
."AND post_date < '".date("Y-m-d H:i:s", (time() + ($time_difference * 3600)))."' "
|
||||||
."AND post_status = 'publish'"
|
."AND post_status = 'publish'"
|
||||||
);
|
);
|
||||||
|
++$querycount;
|
||||||
if ($ak_post_titles) {
|
if ($ak_post_titles) {
|
||||||
foreach ($ak_post_titles as $ak_post_title) {
|
foreach ($ak_post_titles as $ak_post_title) {
|
||||||
if (empty($ak_titles_for_day["$ak_post_title->dom"])) { // first one
|
if (empty($ak_titles_for_day["$ak_post_title->dom"])) { // first one
|
||||||
|
@ -405,7 +410,8 @@ function get_calendar($daylength = 1) {
|
||||||
/***** Links *****/
|
/***** Links *****/
|
||||||
function get_permalink($id=false) {
|
function get_permalink($id=false) {
|
||||||
global $post, $wpdb, $tableposts;
|
global $post, $wpdb, $tableposts;
|
||||||
global $siteurl, $blogfilename, $querystring_start, $querystring_equal;
|
global $siteurl, $blogfilename, $querystring_start, $querystring_equal, $querycount;
|
||||||
|
|
||||||
$rewritecode = array(
|
$rewritecode = array(
|
||||||
'%year%',
|
'%year%',
|
||||||
'%monthnum%',
|
'%monthnum%',
|
||||||
|
@ -427,6 +433,7 @@ function get_permalink($id=false) {
|
||||||
}
|
}
|
||||||
} else { // if an ID is given
|
} else { // if an ID is given
|
||||||
$idpost = $wpdb->get_row("SELECT post_date, post_name FROM $tableposts WHERE ID = $id");
|
$idpost = $wpdb->get_row("SELECT post_date, post_name FROM $tableposts WHERE ID = $id");
|
||||||
|
++$querycount;
|
||||||
if ('' != get_settings('permalink_structure')) {
|
if ('' != get_settings('permalink_structure')) {
|
||||||
$unixtime = strtotime($idpost->post_date);
|
$unixtime = strtotime($idpost->post_date);
|
||||||
$rewritereplace = array(
|
$rewritereplace = array(
|
||||||
|
@ -1350,7 +1357,7 @@ function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_orde
|
||||||
$query .= " ORDER BY $sort_column $sort_order, post_date DESC";
|
$query .= " ORDER BY $sort_column $sort_order, post_date DESC";
|
||||||
|
|
||||||
$categories = $wpdb->get_results($query);
|
$categories = $wpdb->get_results($query);
|
||||||
|
++$querycount;
|
||||||
if (!$categories) {
|
if (!$categories) {
|
||||||
if ($list) {
|
if ($list) {
|
||||||
$before = '<li>';
|
$before = '<li>';
|
||||||
|
@ -1359,7 +1366,6 @@ function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_orde
|
||||||
echo $before . "No categories" . $after . "\n";
|
echo $before . "No categories" . $after . "\n";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
++$querycount;
|
|
||||||
if (intval($optionall) == 1) {
|
if (intval($optionall) == 1) {
|
||||||
$all = apply_filters('list_cats', $all);
|
$all = apply_filters('list_cats', $all);
|
||||||
$link = "<a href=\"".$file.$querystring_start.'cat'.$querystring_equal.'all">'.$all."</a>";
|
$link = "<a href=\"".$file.$querystring_start.'cat'.$querystring_equal.'all">'.$all."</a>";
|
||||||
|
@ -1405,11 +1411,12 @@ function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_orde
|
||||||
|
|
||||||
function comments_number($zero='No Comments', $one='1 Comment', $more='% Comments', $include_unapproved = false) {
|
function comments_number($zero='No Comments', $one='1 Comment', $more='% Comments', $include_unapproved = false) {
|
||||||
global $id, $comment, $tablecomments, $querycount, $wpdb;
|
global $id, $comment, $tablecomments, $querycount, $wpdb;
|
||||||
$query = "SELECT COUNT(*) FROM $tablecomments WHERE comment_post_ID = '$id'";
|
$query = "SELECT COUNT(*) FROM $tablecomments WHERE comment_post_ID = $id";
|
||||||
if (false == $include_unapproved) {
|
if (false == $include_unapproved) {
|
||||||
$query .= " AND comment_approved = '1'";
|
$query .= " AND comment_approved = '1'";
|
||||||
}
|
}
|
||||||
$number = $wpdb->get_var($query);
|
$number = $wpdb->get_var($query);
|
||||||
|
++$querycount;
|
||||||
if ($number == 0) {
|
if ($number == 0) {
|
||||||
$blah = $zero;
|
$blah = $zero;
|
||||||
} elseif ($number == 1) {
|
} elseif ($number == 1) {
|
||||||
|
@ -1438,9 +1445,10 @@ function comments_popup_script($width=400, $height=400, $file='b2commentspopup.p
|
||||||
}
|
}
|
||||||
|
|
||||||
function comments_popup_link($zero='No Comments', $one='1 Comment', $more='% Comments', $CSSclass='', $none='Comments Off') {
|
function comments_popup_link($zero='No Comments', $one='1 Comment', $more='% Comments', $CSSclass='', $none='Comments Off') {
|
||||||
global $id, $b2commentspopupfile, $b2commentsjavascript, $post, $wpdb, $tablecomments, $HTTP_COOKIE_VARS, $cookiehash;
|
global $id, $b2commentspopupfile, $b2commentsjavascript, $post, $wpdb, $querycount, $tablecomments, $HTTP_COOKIE_VARS, $cookiehash;
|
||||||
global $querystring_start, $querystring_equal, $querystring_separator, $siteurl;
|
global $querystring_start, $querystring_equal, $querystring_separator, $siteurl;
|
||||||
$number = $wpdb->get_var("SELECT COUNT(*) FROM $tablecomments WHERE comment_post_ID = $id AND comment_approved = '1'");
|
$number = $wpdb->get_var("SELECT COUNT(*) FROM $tablecomments WHERE comment_post_ID = $id AND comment_approved = '1'");
|
||||||
|
++$querycount;
|
||||||
if (0 == $number && 'closed' == $post->comment_status) {
|
if (0 == $number && 'closed' == $post->comment_status) {
|
||||||
echo $none;
|
echo $none;
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
$comment_author_url = trim($HTTP_COOKIE_VARS["comment_author_url_".$cookiehash]);
|
$comment_author_url = 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");
|
$comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = $id AND comment_approved = '1' ORDER BY comment_date");
|
||||||
|
++$querycount;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- You can start editing here. -->
|
<!-- You can start editing here. -->
|
||||||
|
|
|
@ -39,7 +39,7 @@ $user_ip = $HTTP_SERVER_VARS['REMOTE_ADDR'];
|
||||||
$user_domain = gethostbyaddr($user_ip);
|
$user_domain = gethostbyaddr($user_ip);
|
||||||
|
|
||||||
$commentstatus = $wpdb->get_var("SELECT comment_status FROM $tableposts WHERE ID = $comment_post_ID");
|
$commentstatus = $wpdb->get_var("SELECT comment_status FROM $tableposts WHERE ID = $comment_post_ID");
|
||||||
|
++$querycount;
|
||||||
if ('closed' == $commentstatus)
|
if ('closed' == $commentstatus)
|
||||||
die('Sorry, comments are closed for this item.');
|
die('Sorry, comments are closed for this item.');
|
||||||
|
|
||||||
|
@ -68,6 +68,7 @@ $url = addslashes($url);
|
||||||
|
|
||||||
/* Flood-protection */
|
/* Flood-protection */
|
||||||
$lasttime = $wpdb->get_var("SELECT comment_date FROM $tablecomments WHERE comment_author_IP = '$user_ip' ORDER BY comment_date DESC LIMIT 1");
|
$lasttime = $wpdb->get_var("SELECT comment_date FROM $tablecomments WHERE comment_author_IP = '$user_ip' ORDER BY comment_date DESC LIMIT 1");
|
||||||
|
++$querycount;
|
||||||
$ok = true;
|
$ok = true;
|
||||||
if (!empty($lasttime)) {
|
if (!empty($lasttime)) {
|
||||||
$time_lastcomment= mysql2date('U', $lasttime);
|
$time_lastcomment= mysql2date('U', $lasttime);
|
||||||
|
@ -100,6 +101,7 @@ if ($ok) { // if there was no comment from this IP in the last 10 seconds
|
||||||
");
|
");
|
||||||
|
|
||||||
$comment_ID = $wpdb->get_var('SELECT last_insert_id()');
|
$comment_ID = $wpdb->get_var('SELECT last_insert_id()');
|
||||||
|
++$querycount;
|
||||||
|
|
||||||
if (($moderation_notify) && (!$approved)) {
|
if (($moderation_notify) && (!$approved)) {
|
||||||
wp_notify_moderator($comment_ID);
|
wp_notify_moderator($comment_ID);
|
||||||
|
|
|
@ -30,7 +30,9 @@ foreach ($posts as $post) { start_b2();
|
||||||
<?php
|
<?php
|
||||||
// this line is WordPress' motor, do not delete it.
|
// this line is WordPress' motor, do not delete it.
|
||||||
$comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = $id AND comment_approved = '1' ORDER BY comment_date");
|
$comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = $id AND comment_approved = '1' ORDER BY comment_date");
|
||||||
|
++$querycount;
|
||||||
$commentstatus = $wpdb->get_row("SELECT comment_status, post_password FROM $tableposts WHERE ID = $id");
|
$commentstatus = $wpdb->get_row("SELECT comment_status, post_password FROM $tableposts WHERE ID = $id");
|
||||||
|
++$querycount;
|
||||||
if (!empty($commentstatus->post_password) && $HTTP_COOKIE_VARS['wp-postpass_'.$cookiehash] != $commentstatus->post_password) { // and it doesn't match the cookie
|
if (!empty($commentstatus->post_password) && $HTTP_COOKIE_VARS['wp-postpass_'.$cookiehash] != $commentstatus->post_password) { // and it doesn't match the cookie
|
||||||
echo(get_the_password_form());
|
echo(get_the_password_form());
|
||||||
} else { ?>
|
} else { ?>
|
||||||
|
|
|
@ -86,9 +86,11 @@ case 'login':
|
||||||
$pass_is_md5 = 1;
|
$pass_is_md5 = 1;
|
||||||
$password = substr($password, 4, strlen($password));
|
$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'";
|
$query = "SELECT ID, user_login, user_pass FROM $tableusers WHERE user_login = '$user_login' AND MD5(user_pass) = '$password'";
|
||||||
|
++$querycount;
|
||||||
} else {
|
} else {
|
||||||
$pass_is_md5 = 0;
|
$pass_is_md5 = 0;
|
||||||
$query = "SELECT ID, user_login, user_pass FROM $tableusers WHERE user_login = '$user_login' AND user_pass = '$password'";
|
$query = "SELECT ID, user_login, user_pass FROM $tableusers WHERE user_login = '$user_login' AND user_pass = '$password'";
|
||||||
|
++$querycount;
|
||||||
}
|
}
|
||||||
$login = $wpdb->get_row($query);
|
$login = $wpdb->get_row($query);
|
||||||
|
|
||||||
|
|
|
@ -204,6 +204,7 @@ for ($iCount=1; $iCount<=$Count; $iCount++) {
|
||||||
|
|
||||||
$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 = $wpdb->get_row($sql);
|
$result = $wpdb->get_row($sql);
|
||||||
|
++$querycount;
|
||||||
|
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
echo '<p><b>Wrong login or password.</b></p></div>';
|
echo '<p><b>Wrong login or password.</b></p></div>';
|
||||||
|
|
|
@ -80,6 +80,7 @@ case 'register':
|
||||||
|
|
||||||
/* checking the login isn't already used by another user */
|
/* checking the login isn't already used by another user */
|
||||||
$result = $wpdb->get_results("SELECT user_login FROM $tableusers WHERE user_login = '$user_login'");
|
$result = $wpdb->get_results("SELECT user_login FROM $tableusers WHERE user_login = '$user_login'");
|
||||||
|
++$querycount;
|
||||||
if (count($result) >= 1) {
|
if (count($result) >= 1) {
|
||||||
die ('<strong>ERROR</strong>: This login is already registered, please choose another one.');
|
die ('<strong>ERROR</strong>: This login is already registered, please choose another one.');
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,7 @@ if ((strlen(''.$tb_id)) && (empty($HTTP_GET_VARS['__mode'])) && (strlen(''.$tb_u
|
||||||
trackback_response(1, 'Sorry, this weblog does not allow you to trackback its posts.');
|
trackback_response(1, 'Sorry, this weblog does not allow you to trackback its posts.');
|
||||||
|
|
||||||
$pingstatus = $wpdb->get_var("SELECT ping_status FROM $tableposts WHERE ID = $tb_id");
|
$pingstatus = $wpdb->get_var("SELECT ping_status FROM $tableposts WHERE ID = $tb_id");
|
||||||
|
++$querycount;
|
||||||
|
|
||||||
if ('closed' == $pingstatus)
|
if ('closed' == $pingstatus)
|
||||||
trackback_response(1, 'Sorry, trackbacks are closed for this item.');
|
trackback_response(1, 'Sorry, trackbacks are closed for this item.');
|
||||||
|
@ -86,6 +87,7 @@ if ((strlen(''.$tb_id)) && (empty($HTTP_GET_VARS['__mode'])) && (strlen(''.$tb_u
|
||||||
die ("There is an error with the database, it can't store your comment...<br />Please contact the <a href='mailto:$admin_email'>webmaster</a>.");
|
die ("There is an error with the database, it can't store your comment...<br />Please contact the <a href='mailto:$admin_email'>webmaster</a>.");
|
||||||
} else {
|
} else {
|
||||||
$comment_ID = $wpdb->get_var('SELECT last_insert_id()');
|
$comment_ID = $wpdb->get_var('SELECT last_insert_id()');
|
||||||
|
++$querycount;
|
||||||
if ($comments_notify)
|
if ($comments_notify)
|
||||||
wp_notify_postauthor($comment_ID, 'trackback');
|
wp_notify_postauthor($comment_ID, 'trackback');
|
||||||
trackback_response(0);
|
trackback_response(0);
|
||||||
|
|
|
@ -304,7 +304,7 @@ if ($preview) {
|
||||||
// error_log("$request");
|
// error_log("$request");
|
||||||
// echo $request;
|
// echo $request;
|
||||||
$posts = $wpdb->get_results($request);
|
$posts = $wpdb->get_results($request);
|
||||||
|
++$querycount;
|
||||||
if (1 == count($posts)) {
|
if (1 == count($posts)) {
|
||||||
if ($p || $name) {
|
if ($p || $name) {
|
||||||
$more = 1;
|
$more = 1;
|
||||||
|
|
|
@ -103,6 +103,7 @@ default:
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
$users = $wpdb->get_results("SELECT ID FROM $tableusers WHERE user_level>0 ORDER BY ID");
|
$users = $wpdb->get_results("SELECT ID FROM $tableusers WHERE user_level>0 ORDER BY ID");
|
||||||
|
++$querycount;
|
||||||
foreach ($users as $user) {
|
foreach ($users as $user) {
|
||||||
$user_data = get_userdata($user->ID);
|
$user_data = get_userdata($user->ID);
|
||||||
echo "<tr>\n<!--".$user_data->user_login."-->\n";
|
echo "<tr>\n<!--".$user_data->user_login."-->\n";
|
||||||
|
@ -138,6 +139,7 @@ default:
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$users = $wpdb->get_results("SELECT * FROM $tableusers WHERE user_level=0 ORDER BY ID");
|
$users = $wpdb->get_results("SELECT * FROM $tableusers WHERE user_level=0 ORDER BY ID");
|
||||||
|
++$querycount;
|
||||||
if ($users) {
|
if ($users) {
|
||||||
?>
|
?>
|
||||||
<div class="wrap">
|
<div class="wrap">
|
||||||
|
|
|
@ -5,7 +5,7 @@ require_once('../wp-config.php');
|
||||||
/* checking login & pass in the database */
|
/* checking login & pass in the database */
|
||||||
function veriflog() {
|
function veriflog() {
|
||||||
global $HTTP_COOKIE_VARS,$cookiehash;
|
global $HTTP_COOKIE_VARS,$cookiehash;
|
||||||
global $tableusers, $wpdb;
|
global $tableusers, $wpdb, $querycount;
|
||||||
|
|
||||||
if (!empty($HTTP_COOKIE_VARS["wordpressuser_".$cookiehash])) {
|
if (!empty($HTTP_COOKIE_VARS["wordpressuser_".$cookiehash])) {
|
||||||
$user_login = $HTTP_COOKIE_VARS["wordpressuser_".$cookiehash];
|
$user_login = $HTTP_COOKIE_VARS["wordpressuser_".$cookiehash];
|
||||||
|
@ -20,6 +20,7 @@ function veriflog() {
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$login = $wpdb->get_row("SELECT user_login, user_pass FROM $tableusers WHERE user_login = '$user_login'");
|
$login = $wpdb->get_row("SELECT user_login, user_pass FROM $tableusers WHERE user_login = '$user_login'");
|
||||||
|
++$querycount;
|
||||||
|
|
||||||
if (!$login) {
|
if (!$login) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -136,6 +136,7 @@ echo $comments_nav_bar;
|
||||||
ORDER BY comment_date $commentorder
|
ORDER BY comment_date $commentorder
|
||||||
LIMIT $commentstart, $commentend"
|
LIMIT $commentstart, $commentend"
|
||||||
);
|
);
|
||||||
|
++$querycount;
|
||||||
|
|
||||||
// need to account for offet, etc.
|
// need to account for offet, etc.
|
||||||
|
|
||||||
|
|
|
@ -268,6 +268,7 @@ foreach ($posts as $post) { start_b2();
|
||||||
if (($withcomments) or ($c)) {
|
if (($withcomments) or ($c)) {
|
||||||
|
|
||||||
$comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = $id ORDER BY comment_date");
|
$comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = $id ORDER BY comment_date");
|
||||||
|
++$querycount;
|
||||||
if ($comments) {
|
if ($comments) {
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
|
@ -139,6 +139,7 @@ if (!$got_links) {
|
||||||
echo "<p>... may need to update it though. Looking for column link_updated...</p>\n";
|
echo "<p>... may need to update it though. Looking for column link_updated...</p>\n";
|
||||||
$query = "SELECT link_updated FROM $tablelinks LIMIT 1";
|
$query = "SELECT link_updated FROM $tablelinks LIMIT 1";
|
||||||
$q = @mysql_query($query);
|
$q = @mysql_query($query);
|
||||||
|
++$querycount;
|
||||||
if ($q != false) {
|
if ($q != false) {
|
||||||
if ($row = mysql_fetch_object($q)) {
|
if ($row = mysql_fetch_object($q)) {
|
||||||
echo "<p>You have column link_updated. Good!</p>\n";
|
echo "<p>You have column link_updated. Good!</p>\n";
|
||||||
|
@ -150,6 +151,7 @@ if (!$got_links) {
|
||||||
}
|
}
|
||||||
echo "<p>Looking for column link_rel...</p>\n";
|
echo "<p>Looking for column link_rel...</p>\n";
|
||||||
$query = "SELECT link_rel FROM $tablelinks LIMIT 1";
|
$query = "SELECT link_rel FROM $tablelinks LIMIT 1";
|
||||||
|
++$querycount;
|
||||||
$q = @mysql_query($query);
|
$q = @mysql_query($query);
|
||||||
if ($q != false) {
|
if ($q != false) {
|
||||||
if ($row = mysql_fetch_object($q)) {
|
if ($row = mysql_fetch_object($q)) {
|
||||||
|
@ -166,6 +168,7 @@ if (!$got_links) {
|
||||||
if ($got_links && $got_cats) {
|
if ($got_links && $got_cats) {
|
||||||
echo "<p>Looking for category 1...</p>\n";
|
echo "<p>Looking for category 1...</p>\n";
|
||||||
$sql = "SELECT * FROM $tablelinkcategories WHERE cat_id=1 ";
|
$sql = "SELECT * FROM $tablelinkcategories WHERE cat_id=1 ";
|
||||||
|
++$querycount;
|
||||||
$result = mysql_query($sql) or print ("Can't query '$tablelinkcategories'.<br />" . $sql . "<br />" . mysql_error());
|
$result = mysql_query($sql) or print ("Can't query '$tablelinkcategories'.<br />" . $sql . "<br />" . mysql_error());
|
||||||
if ($result != false) {
|
if ($result != false) {
|
||||||
if ($row = mysql_fetch_object($result)) {
|
if ($row = mysql_fetch_object($result)) {
|
||||||
|
|
|
@ -69,6 +69,7 @@ case "step1":
|
||||||
$post_author = trim(addslashes($postinfo[1]));
|
$post_author = trim(addslashes($postinfo[1]));
|
||||||
// we'll check the author is registered already
|
// we'll check the author is registered already
|
||||||
$user = $wpdb->get_row("SELECT * FROM $tableusers WHERE user_login = '$post_author'");
|
$user = $wpdb->get_row("SELECT * FROM $tableusers WHERE user_login = '$post_author'");
|
||||||
|
++$querycount;
|
||||||
if (!$user) { // seems s/he's not, so let's register
|
if (!$user) { // seems s/he's not, so let's register
|
||||||
$user_ip = '127.0.0.1';
|
$user_ip = '127.0.0.1';
|
||||||
$user_domain = 'localhost';
|
$user_domain = 'localhost';
|
||||||
|
@ -111,6 +112,7 @@ case "step1":
|
||||||
}
|
}
|
||||||
|
|
||||||
$post_author_ID = $wpdb->get_var("SELECT ID FROM $tableusers WHERE user_login = '$post_author'");
|
$post_author_ID = $wpdb->get_var("SELECT ID FROM $tableusers WHERE user_login = '$post_author'");
|
||||||
|
++$querycount;
|
||||||
|
|
||||||
$post_date = explode(' ', $post_date);
|
$post_date = explode(' ', $post_date);
|
||||||
$post_date_Ymd = explode('/', $post_date[0]);
|
$post_date_Ymd = explode('/', $post_date[0]);
|
||||||
|
@ -134,6 +136,7 @@ case "step1":
|
||||||
|
|
||||||
// Quick-n-dirty check for dups:
|
// Quick-n-dirty check for dups:
|
||||||
$dupcheck = $wpdb->get_results("SELECT ID,post_date,post_title FROM $tableposts WHERE post_date='$post_date' AND post_title='$post_title' LIMIT 1",ARRAY_A);
|
$dupcheck = $wpdb->get_results("SELECT ID,post_date,post_title FROM $tableposts WHERE post_date='$post_date' AND post_title='$post_title' LIMIT 1",ARRAY_A);
|
||||||
|
++$querycount;
|
||||||
if ($dupcheck[0]['ID']) {
|
if ($dupcheck[0]['ID']) {
|
||||||
print "<br />\nSkipping duplicate post, ID = '" . $dupcheck[0]['ID'] . "'<br />\n";
|
print "<br />\nSkipping duplicate post, ID = '" . $dupcheck[0]['ID'] . "'<br />\n";
|
||||||
print "Timestamp: " . $post_date . "<br />\n";
|
print "Timestamp: " . $post_date . "<br />\n";
|
||||||
|
|
|
@ -139,6 +139,7 @@ textarea,input,select {
|
||||||
// we'll check the author is registered, or if it's a deleted author
|
// we'll check the author is registered, or if it's a deleted author
|
||||||
$sql = "SELECT * FROM $tableusers WHERE user_login = '$post_author'";
|
$sql = "SELECT * FROM $tableusers WHERE user_login = '$post_author'";
|
||||||
$result = mysql_query($sql);
|
$result = mysql_query($sql);
|
||||||
|
++$querycount;
|
||||||
if (!mysql_num_rows($result)) { // if deleted from GM, we register the author as a level 0 user in b2
|
if (!mysql_num_rows($result)) { // if deleted from GM, we register the author as a level 0 user in b2
|
||||||
$user_ip="127.0.0.1";
|
$user_ip="127.0.0.1";
|
||||||
$user_domain="localhost";
|
$user_domain="localhost";
|
||||||
|
@ -159,6 +160,7 @@ textarea,input,select {
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT * FROM $tableusers WHERE user_login = '$post_author'";
|
$sql = "SELECT * FROM $tableusers WHERE user_login = '$post_author'";
|
||||||
|
++$querycount;
|
||||||
$result = mysql_query($sql);
|
$result = mysql_query($sql);
|
||||||
$myrow = mysql_fetch_array($result);
|
$myrow = mysql_fetch_array($result);
|
||||||
$post_author_ID=$myrow[0];
|
$post_author_ID=$myrow[0];
|
||||||
|
@ -195,6 +197,7 @@ textarea,input,select {
|
||||||
die ("Error in posting... contact the <a href=\"mailto:$admin_email\">webmaster</a>");
|
die ("Error in posting... contact the <a href=\"mailto:$admin_email\">webmaster</a>");
|
||||||
|
|
||||||
$sql2 = "SELECT * FROM $tableposts WHERE 1=1 ORDER BY ID DESC LIMIT 1";
|
$sql2 = "SELECT * FROM $tableposts WHERE 1=1 ORDER BY ID DESC LIMIT 1";
|
||||||
|
++$querycount;
|
||||||
$result2 = mysql_query($sql2);
|
$result2 = mysql_query($sql2);
|
||||||
$myrow2 = mysql_fetch_array($result2);
|
$myrow2 = mysql_fetch_array($result2);
|
||||||
$post_ID=$myrow2[0];
|
$post_ID=$myrow2[0];
|
||||||
|
|
|
@ -80,9 +80,12 @@ $database = @mysql_select_db($tp_database_name);
|
||||||
|
|
||||||
// For now we're going to give everything the same author and same category
|
// For now we're going to give everything the same author and same category
|
||||||
$author = $wpdb->get_var("SELECT ID FROM $tableusers WHERE user_level = 10 LIMIT 1");
|
$author = $wpdb->get_var("SELECT ID FROM $tableusers WHERE user_level = 10 LIMIT 1");
|
||||||
|
++$querycount;
|
||||||
$category = $wpdb->get_var("SELECT cat_ID FROM $tablecategories LIMIT 1");
|
$category = $wpdb->get_var("SELECT cat_ID FROM $tablecategories LIMIT 1");
|
||||||
|
++$querycount;
|
||||||
|
|
||||||
$posts = mysql_query('SELECT * FROM textpattern', $connection);
|
$posts = mysql_query('SELECT * FROM textpattern', $connection);
|
||||||
|
++$querycount;
|
||||||
|
|
||||||
while ($post = mysql_fetch_array($posts)) {
|
while ($post = mysql_fetch_array($posts)) {
|
||||||
// ID, AuthorID, LastMod, LastModID, Posted, Title, Body, Body_html, Abstract, Category1, Category2, Annotate, AnnotateInvite, Status, Listing1, Listing2, Section
|
// ID, AuthorID, LastMod, LastModID, Posted, Title, Body, Body_html, Abstract, Category1, Category2, Annotate, AnnotateInvite, Status, Listing1, Listing2, Section
|
||||||
|
@ -108,10 +111,12 @@ while ($post = mysql_fetch_array($posts)) {
|
||||||
|
|
||||||
// Get wordpress post id
|
// Get wordpress post id
|
||||||
$wp_post_ID = $wpdb->get_var("SELECT ID FROM $tableposts ORDER BY ID DESC LIMIT 1");
|
$wp_post_ID = $wpdb->get_var("SELECT ID FROM $tableposts ORDER BY ID DESC LIMIT 1");
|
||||||
|
++$querycount;
|
||||||
|
|
||||||
// Now let's insert comments if there are any for the TP post
|
// Now let's insert comments if there are any for the TP post
|
||||||
$tp_id = $post['ID'];
|
$tp_id = $post['ID'];
|
||||||
$comments = mysql_query("SELECT * FROM txp_Discuss WHERE parentid = $tp_id");
|
$comments = mysql_query("SELECT * FROM txp_Discuss WHERE parentid = $tp_id");
|
||||||
|
++$querycount;
|
||||||
if ($comments) {
|
if ($comments) {
|
||||||
while($comment = mysql_fetch_object($comments)) {
|
while($comment = mysql_fetch_object($comments)) {
|
||||||
// discussid, parentid, name, email, web, ip, posted, message
|
// discussid, parentid, name, email, web, ip, posted, message
|
||||||
|
|
|
@ -134,6 +134,7 @@ switch ($action) {
|
||||||
$row = $wpdb->get_row("SELECT cat_id, cat_name, auto_toggle, show_images, show_description, "
|
$row = $wpdb->get_row("SELECT cat_id, cat_name, auto_toggle, show_images, show_description, "
|
||||||
. " show_rating, show_updated, sort_order, sort_desc, text_before_link, text_after_link, "
|
. " show_rating, show_updated, sort_order, sort_desc, text_before_link, text_after_link, "
|
||||||
. " text_after_all, list_limit FROM $tablelinkcategories WHERE cat_id=$cat_id");
|
. " text_after_all, list_limit FROM $tablelinkcategories WHERE cat_id=$cat_id");
|
||||||
|
++$querycount;
|
||||||
if ($row) {
|
if ($row) {
|
||||||
if ($row->list_limit == -1) {
|
if ($row->list_limit == -1) {
|
||||||
$row->list_limit = '';
|
$row->list_limit = '';
|
||||||
|
@ -324,6 +325,7 @@ switch ($action) {
|
||||||
$results = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle, show_images, show_description, "
|
$results = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle, show_images, show_description, "
|
||||||
. " show_rating, show_updated, sort_order, sort_desc, text_before_link, text_after_link, "
|
. " show_rating, show_updated, sort_order, sort_desc, text_before_link, text_after_link, "
|
||||||
. " text_after_all, list_limit FROM $tablelinkcategories ORDER BY cat_id");
|
. " text_after_all, list_limit FROM $tablelinkcategories ORDER BY cat_id");
|
||||||
|
++$querycount;
|
||||||
foreach ($results as $row) {
|
foreach ($results as $row) {
|
||||||
if ($row->list_limit == -1) {
|
if ($row->list_limit == -1) {
|
||||||
$row->list_limit = 'none';
|
$row->list_limit = 'none';
|
||||||
|
|
|
@ -33,9 +33,10 @@ $title = 'Manage Links';
|
||||||
$this_file = 'linkmanager.php';
|
$this_file = 'linkmanager.php';
|
||||||
|
|
||||||
function category_dropdown($fieldname, $selected = 0) {
|
function category_dropdown($fieldname, $selected = 0) {
|
||||||
global $wpdb, $tablelinkcategories;
|
global $wpdb, $querycount, $tablelinkcategories;
|
||||||
|
|
||||||
$results = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle FROM $tablelinkcategories ORDER BY cat_id");
|
$results = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle FROM $tablelinkcategories ORDER BY cat_id");
|
||||||
|
++$querycount;
|
||||||
echo ' <select name="'.$fieldname.'" size="1">'."\n";
|
echo ' <select name="'.$fieldname.'" size="1">'."\n";
|
||||||
foreach ($results as $row) {
|
foreach ($results as $row) {
|
||||||
echo " <option value=\"".$row->cat_id."\"";
|
echo " <option value=\"".$row->cat_id."\"";
|
||||||
|
@ -109,6 +110,7 @@ switch ($action) {
|
||||||
}
|
}
|
||||||
$all_links = join(',', $linkcheck);
|
$all_links = join(',', $linkcheck);
|
||||||
$results = $wpdb->get_results("SELECT link_id, link_owner, user_level FROM $tablelinks LEFT JOIN $tableusers ON link_owner = ID WHERE link_id in ($all_links)");
|
$results = $wpdb->get_results("SELECT link_id, link_owner, user_level FROM $tablelinks LEFT JOIN $tableusers ON link_owner = ID WHERE link_id in ($all_links)");
|
||||||
|
++$querycount;
|
||||||
foreach ($results as $row) {
|
foreach ($results as $row) {
|
||||||
if (!get_settings('links_use_adminlevels') || ($user_level >= $row->user_level)) { // ok to proceed
|
if (!get_settings('links_use_adminlevels') || ($user_level >= $row->user_level)) { // ok to proceed
|
||||||
$ids_to_change[] = $row->link_id;
|
$ids_to_change[] = $row->link_id;
|
||||||
|
@ -138,6 +140,7 @@ switch ($action) {
|
||||||
}
|
}
|
||||||
$all_links = join(',', $linkcheck);
|
$all_links = join(',', $linkcheck);
|
||||||
$results = $wpdb->get_results("SELECT link_id, link_visible FROM $tablelinks WHERE link_id in ($all_links)");
|
$results = $wpdb->get_results("SELECT link_id, link_visible FROM $tablelinks WHERE link_id in ($all_links)");
|
||||||
|
++$querycount;
|
||||||
foreach ($results as $row) {
|
foreach ($results as $row) {
|
||||||
if ($row->link_visible == 'Y') { // ok to proceed
|
if ($row->link_visible == 'Y') { // ok to proceed
|
||||||
$ids_to_turnoff[] = $row->link_id;
|
$ids_to_turnoff[] = $row->link_id;
|
||||||
|
@ -304,6 +307,7 @@ switch ($action) {
|
||||||
$row = $wpdb->get_row("SELECT link_url, link_name, link_image, link_target, link_description, link_visible, link_category AS cat_id, link_rating, link_rel, link_notes " .
|
$row = $wpdb->get_row("SELECT link_url, link_name, link_image, link_target, link_description, link_visible, link_category AS cat_id, link_rating, link_rel, link_notes " .
|
||||||
" FROM $tablelinks " .
|
" FROM $tablelinks " .
|
||||||
" WHERE link_id = $link_id");
|
" WHERE link_id = $link_id");
|
||||||
|
++$querycount;
|
||||||
|
|
||||||
if ($row) {
|
if ($row) {
|
||||||
$link_url = stripslashes($row->link_url);
|
$link_url = stripslashes($row->link_url);
|
||||||
|
@ -498,6 +502,7 @@ function checkAll(form)
|
||||||
<td>
|
<td>
|
||||||
<?php
|
<?php
|
||||||
$results = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle FROM $tablelinkcategories ORDER BY cat_id");
|
$results = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle FROM $tablelinkcategories ORDER BY cat_id");
|
||||||
|
++$querycount;
|
||||||
echo " <select name=\"cat_id\">\n";
|
echo " <select name=\"cat_id\">\n";
|
||||||
echo " <option value=\"All\"";
|
echo " <option value=\"All\"";
|
||||||
if ($cat_id == 'All')
|
if ($cat_id == 'All')
|
||||||
|
@ -560,6 +565,7 @@ function checkAll(form)
|
||||||
FROM $tablelinks
|
FROM $tablelinks
|
||||||
LEFT JOIN $tablelinkcategories ON $tablelinks.link_category = $tablelinkcategories.cat_id
|
LEFT JOIN $tablelinkcategories ON $tablelinks.link_category = $tablelinkcategories.cat_id
|
||||||
LEFT JOIN $tableusers ON $tableusers.ID = $tablelinks.link_owner ";
|
LEFT JOIN $tableusers ON $tableusers.ID = $tablelinks.link_owner ";
|
||||||
|
++$querycount;
|
||||||
|
|
||||||
if (isset($cat_id) && ($cat_id != 'All')) {
|
if (isset($cat_id) && ($cat_id != 'All')) {
|
||||||
$sql .= " WHERE link_category = $cat_id ";
|
$sql .= " WHERE link_category = $cat_id ";
|
||||||
|
@ -630,6 +636,7 @@ LINKS;
|
||||||
<input type="submit" name="action2" value="Assign" /> ownership <?php echo gethelp_link($this_file,'assign_ownership');?> to:
|
<input type="submit" name="action2" value="Assign" /> ownership <?php echo gethelp_link($this_file,'assign_ownership');?> to:
|
||||||
<?php
|
<?php
|
||||||
$results = $wpdb->get_results("SELECT ID, user_login FROM $tableusers WHERE user_level > 0 ORDER BY ID");
|
$results = $wpdb->get_results("SELECT ID, user_login FROM $tableusers WHERE user_level > 0 ORDER BY ID");
|
||||||
|
++$querycount;
|
||||||
echo " <select name=\"newowner\" size=\"1\">\n";
|
echo " <select name=\"newowner\" size=\"1\">\n";
|
||||||
foreach ($results as $row) {
|
foreach ($results as $row) {
|
||||||
echo " <option value=\"".$row->ID."\"";
|
echo " <option value=\"".$row->ID."\"";
|
||||||
|
|
|
@ -73,6 +73,7 @@ switch ($step) {
|
||||||
Category: <?php echo gethelp_link($this_file,'link_category');?><select name="cat_id">
|
Category: <?php echo gethelp_link($this_file,'link_category');?><select name="cat_id">
|
||||||
<?php
|
<?php
|
||||||
$categories = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle FROM $tablelinkcategories ORDER BY cat_id");
|
$categories = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle FROM $tablelinkcategories ORDER BY cat_id");
|
||||||
|
++$querycount;
|
||||||
foreach ($categories as $category) {
|
foreach ($categories as $category) {
|
||||||
?>
|
?>
|
||||||
<option value="<?php echo $category->cat_id; ?>"><?php echo $category->cat_id.': '.$category->cat_name; ?></option>
|
<option value="<?php echo $category->cat_id; ?>"><?php echo $category->cat_id.': '.$category->cat_name; ?></option>
|
||||||
|
|
|
@ -50,6 +50,7 @@ SELECT;
|
||||||
."FROM $tableoptionvalues "
|
."FROM $tableoptionvalues "
|
||||||
."WHERE option_id = $option_result->option_id "
|
."WHERE option_id = $option_result->option_id "
|
||||||
."ORDER BY optionvalue_seq");
|
."ORDER BY optionvalue_seq");
|
||||||
|
++$querycount;
|
||||||
if ($select) {
|
if ($select) {
|
||||||
foreach($select as $option) {
|
foreach($select as $option) {
|
||||||
$ret .= '<option value="'.$option->optionvalue.'"';
|
$ret .= '<option value="'.$option->optionvalue.'"';
|
||||||
|
@ -67,6 +68,7 @@ SELECT;
|
||||||
case 7: // SQL select
|
case 7: // SQL select
|
||||||
// first get the sql to run
|
// first get the sql to run
|
||||||
$sql = $wpdb->get_var("SELECT optionvalue FROM $tableoptionvalues WHERE option_id = $option_result->option_id");
|
$sql = $wpdb->get_var("SELECT optionvalue FROM $tableoptionvalues WHERE option_id = $option_result->option_id");
|
||||||
|
++$querycount;
|
||||||
if (!$sql) {
|
if (!$sql) {
|
||||||
return $option_result->option_name . $editable;
|
return $option_result->option_name . $editable;
|
||||||
}
|
}
|
||||||
|
|
|
@ -271,6 +271,7 @@ echo $posts_nav_bar;
|
||||||
if (($withcomments) or ($c)) {
|
if (($withcomments) or ($c)) {
|
||||||
|
|
||||||
$comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = $id ORDER BY comment_date");
|
$comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = $id ORDER BY comment_date");
|
||||||
|
++$querycount;
|
||||||
if ($comments) {
|
if ($comments) {
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,7 @@ foreach ($posts as $post) { start_b2();
|
||||||
AND post_date < '".date("Y-m-d H:i:s")."'
|
AND post_date < '".date("Y-m-d H:i:s")."'
|
||||||
ORDER BY comment_date
|
ORDER BY comment_date
|
||||||
LIMIT $posts_per_rss");
|
LIMIT $posts_per_rss");
|
||||||
|
++$querycount;
|
||||||
}
|
}
|
||||||
else { // if no post id passed in, we'll just ue the last 10 comments.
|
else { // if no post id passed in, we'll just ue the last 10 comments.
|
||||||
$comments = $wpdb->get_results("SELECT comment_ID,
|
$comments = $wpdb->get_results("SELECT comment_ID,
|
||||||
|
@ -78,6 +79,7 @@ foreach ($posts as $post) { start_b2();
|
||||||
AND post_date < '".date("Y-m-d H:i:s")."'
|
AND post_date < '".date("Y-m-d H:i:s")."'
|
||||||
ORDER BY comment_date DESC
|
ORDER BY comment_date DESC
|
||||||
LIMIT $posts_per_rss");
|
LIMIT $posts_per_rss");
|
||||||
|
++$querycount;
|
||||||
}
|
}
|
||||||
// this line is WordPress' motor, do not delete it.
|
// this line is WordPress' motor, do not delete it.
|
||||||
if ($comments) {
|
if ($comments) {
|
||||||
|
|
|
@ -11,7 +11,7 @@ include('blog.header.php');
|
||||||
$sql = "SELECT max(post_date) FROM $tableposts";
|
$sql = "SELECT max(post_date) FROM $tableposts";
|
||||||
|
|
||||||
$maxdate = $wpdb->get_var($sql);
|
$maxdate = $wpdb->get_var($sql);
|
||||||
|
++$querycount;
|
||||||
$unixtime = strtotime($maxdate);
|
$unixtime = strtotime($maxdate);
|
||||||
|
|
||||||
// format timestamp for Last-Modified header
|
// format timestamp for Last-Modified header
|
||||||
|
|
|
@ -11,7 +11,7 @@ include('blog.header.php');
|
||||||
$sql = "SELECT max(post_date) FROM $tableposts";
|
$sql = "SELECT max(post_date) FROM $tableposts";
|
||||||
|
|
||||||
$maxdate = $wpdb->get_var($sql);
|
$maxdate = $wpdb->get_var($sql);
|
||||||
|
++$querycount;
|
||||||
$unixtime = strtotime($maxdate);
|
$unixtime = strtotime($maxdate);
|
||||||
|
|
||||||
// format timestamp for Last-Modified header
|
// format timestamp for Last-Modified header
|
||||||
|
|
|
@ -11,6 +11,7 @@ include('blog.header.php');
|
||||||
$sql = "SELECT max(post_date) FROM $tableposts";
|
$sql = "SELECT max(post_date) FROM $tableposts";
|
||||||
|
|
||||||
$maxdate = $wpdb->get_var($sql);
|
$maxdate = $wpdb->get_var($sql);
|
||||||
|
++$querycount;
|
||||||
|
|
||||||
$unixtime = strtotime($maxdate);
|
$unixtime = strtotime($maxdate);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue