Announcement

Collapse
No announcement yet.

Query to dis allow ratings

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Query to dis allow ratings

    How do i mass turn off ratinsg in forums?

    UPDATE forum SET allowratings='0' doesn't work
    Running vB since 4-14-2002

  • #2
    That query is for vB2, not vB3. The 'allowratings' field is no longer in the forum table. Unfortunately I don't know where this is sett now. I looked at the db but couldn't find it.
    Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
    Change CKEditor Colors to Match Style (for 4.1.4 and above)

    Steve Machol Photography


    Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


    Comment


    • #3
      Might just have to do it manually
      Running vB since 4-14-2002

      Comment


      • #4
        It's a bit field within forumoptions I believe.

        Comment


        • #5
          So what would teh query be?
          Running vB since 4-14-2002

          Comment


          • #6
            Originally posted by IDN
            So what would teh query be?
            A PHP script would be required, i would have to say.

            MYSQL does have built in functions to decipher bitwise fields. (see lower)

            Easiest way -> do it manually. (see lower, again)

            I could write you a script to do it if you want, though. (wouldnt take too long) (no need )
            Last edited by merk; Wed 18 Jun '03, 6:19am. Reason: corrected i stand!

            Comment


            • #7
              MySQL can decipher bitwise fields

              Like:
              SELECT something FROM table WHERE NOT(field & 2)

              Comment


              • #8
                Originally posted by MUG
                MySQL can decipher bitwise fields

                Like:
                SELECT something FROM table WHERE NOT(field & 2)
                I just learnt that looking at the global.php code too

                BACKUP YOUR DB FIRST!

                Code:
                UPDATE `forum` SET options=options-2048 WHERE (options & 2048) = 2048;
                I just ran it and it seemed to work. (it didnt break anything, but i dont think it fixed the problem)

                Comment


                • #9
                  Let the query run,

                  Then upload this file ->
                  PHP Code:
                  <?
                  #PHP Script to Automate removal of "allowrating" from all forums
                  //load config
                  require_once('./includes/config.php');
                  define('TABLE_PREFIX'$tableprefix);
                  define('DB_QUERIES'false);
                  require_once(
                  './includes/db_mysql.php');
                  $DB_site = new DB_Sql_vb;
                  $DB_site->appname 'vBulletin';
                  $DB_site->appshortname 'vBulletin (' VB_AREA ')';
                  $DB_site->database $dbname;
                  $DB_site->connect($servername$dbusername$dbpassword$usepconnect);
                  unset(
                  $servername$dbusername$dbpassword$usepconnect);
                  require_once(
                  "./includes/adminfunctions.php");
                  echo 
                  "Running build_forum_permissions()<br>";
                  build_forum_permissions();
                  ?>
                  Run it, then delete it, then see if you can use ratings.

                  It should update the forum caches updating all forums to disallow ratings. Hope it works, let us know.
                  Last edited by merk; Wed 18 Jun '03, 6:46am. Reason: merk is starting to like vb3 code~

                  Comment

                  widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                  Working...
                  X