Some options functions.

git-svn-id: http://svn.automattic.com/wordpress/trunk@468 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2003-10-26 00:19:23 +00:00
parent cc169363e2
commit 912a5ab9ff
1 changed files with 15 additions and 1 deletions

View File

@ -463,6 +463,8 @@ function get_usernumposts($userid) {
return $wpdb->get_var("SELECT COUNT(*) FROM $tableposts WHERE post_author = $userid");
}
/* Options functions */
function get_settings($setting) {
global $wpdb, $cache_settings, $use_cache, $querycount;
if ((empty($cache_settings)) OR (!$use_cache)) {
@ -489,6 +491,18 @@ function get_alloptions() {
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) {
global $tableusers, $tablecategories, $tableposts, $tablecomments, $querycount, $wpdb;
$post = $wpdb->get_row("SELECT * FROM $tableposts WHERE ID = $postid");