public static function checkUpdate() { $version = get_option('qhshoutbox_version'); if ($version && $version != QH_SHOUTBOX_VERSION) { QHShoutboxMessage::updateTable(); QHShoutboxUser::checkUpdate(); add_option('qhshoutbox_version', QH_SHOUTBOX_VERSION); } }
public static function run() { $instance = self::getInstance(); //setup global $wpdb; self::$wpdb = $wpdb; //table name self::$table = self::$wpdb->prefix . 'qhshoutbox_user'; return $instance; }
public static function save($message, $user_login = '******') { if (current_user_can('moderate_comments')) { QHShoutboxUser::checkCommand($message, $user_login); } elseif (!current_user_can('moderate_comments') && !QHShoutboxUser::checkUser($user_login)) { return false; } self::$wpdb->insert(self::$table, array('user_login' => $user_login, 'message' => htmlspecialchars($message), 'time' => current_time('mysql'))); return true; }