Some options functions.
git-svn-id: http://svn.automattic.com/wordpress/trunk@468 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
cc169363e2
commit
912a5ab9ff
|
@ -463,6 +463,8 @@ function get_usernumposts($userid) {
|
||||||
return $wpdb->get_var("SELECT COUNT(*) FROM $tableposts WHERE post_author = $userid");
|
return $wpdb->get_var("SELECT COUNT(*) FROM $tableposts WHERE post_author = $userid");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Options functions */
|
||||||
|
|
||||||
function get_settings($setting) {
|
function get_settings($setting) {
|
||||||
global $wpdb, $cache_settings, $use_cache, $querycount;
|
global $wpdb, $cache_settings, $use_cache, $querycount;
|
||||||
if ((empty($cache_settings)) OR (!$use_cache)) {
|
if ((empty($cache_settings)) OR (!$use_cache)) {
|
||||||
|
@ -489,6 +491,18 @@ function get_alloptions() {
|
||||||
return $all_options;
|
return $all_options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function update_option($option_name, $newvalue) {
|
||||||
|
global $wpdb, $tableoptions;
|
||||||
|
// No validation at the moment
|
||||||
|
$wpdb->query("UPDATE $tableoptions SET option_value = '$newvalue' WHERE option_name = '$option_name'");
|
||||||
|
}
|
||||||
|
|
||||||
|
function add_option() {
|
||||||
|
// Adds an option if it doesn't already exist
|
||||||
|
global $wpdb, $tableoptions;
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
function get_postdata($postid) {
|
function get_postdata($postid) {
|
||||||
global $tableusers, $tablecategories, $tableposts, $tablecomments, $querycount, $wpdb;
|
global $tableusers, $tablecategories, $tableposts, $tablecomments, $querycount, $wpdb;
|
||||||
$post = $wpdb->get_row("SELECT * FROM $tableposts WHERE ID = $postid");
|
$post = $wpdb->get_row("SELECT * FROM $tableposts WHERE ID = $postid");
|
||||||
|
|
Loading…
Reference in New Issue