Beispiel #1
0
 public static function checkUpdate()
 {
     $version = get_option('shshoutboxVersion');
     if ($version && $version != SH_SHOUTBOX_VERSION) {
         SHShoutboxMessage::updateTable();
         SHShoutboxUser::updateTable();
         update_option('shshoutboxVersion', SH_SHOUTBOX_VERSION);
     }
 }
 public static function run()
 {
     $instance = self::getInstance();
     global $wpdb;
     self::$wpdb = $wpdb;
     self::$table = self::$wpdb->prefix . 'shshoutbox_user';
     self::$option = get_option('shSetting');
     return $instance;
 }
 public static function save($message, $user_login = '******')
 {
     if (current_user_can('moderate_comments')) {
         SHShoutboxUser::checkCommand($message, $user_login);
     } else {
         if (!SHShoutboxUser::checkUser($user_login)) {
             return false;
         }
     }
     self::$wpdb->insert(self::$table, ['user_login' => $user_login, 'message' => htmlspecialchars($message), 'time' => current_time('mysql')]);
     return true;
 }