Announcement

Collapse
No announcement yet.

report this thread to a mod... question

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

  • report this thread to a mod... question

    Is there a way to set this feature to also notify administrators? Or even to just notify admins and not the mods. That is without adding the admins on as moderators as well.

  • #2
    Not sure if it works but find this in report.php:
    PHP Code:
      // get mods for forum
      
    $post=getpostinfo($postid);
      
    $thread=getthreadinfo($post[threadid]);
      
    $forumlist=getforumlist($thread[forumid],"forumid");
      
    $moderators=$DB_site->query("SELECT user.email FROM moderator,user WHERE user.userid=moderator.userid AND $forumlist");

      
    $thread[title]=unhtmlspecialchars($thread[title]);

      if (
    $DB_site->num_rows($moderators)==0) {
        
    // get admins if no mods
        
    $moderators=$DB_site->query("SELECT user.email FROM user,usergroup WHERE user.usergroupid=usergroup.usergroupid AND usergroup.cancontrolpanel=1");
      } 
    change it to:
    PHP Code:
      // get mods for forum
      
    $post=getpostinfo($postid);
      
    $thread=getthreadinfo($post[threadid]);
      
    $forumlist=getforumlist($thread[forumid],"forumid");
      
    $moderators=$DB_site->query("SELECT user.email FROM user,usergroup WHERE user.usergroupid=usergroup.usergroupid AND usergroup.cancontrolpanel=1");

      
    $thread[title]=unhtmlspecialchars($thread[title]); 
    So what did I try to do is:

    I deleted the if section which checks if there is a moderatr for thsi forum, and if not send an email to the admin.
    Then I copy the database querry for the admin and replaced the moderator querry with it!

    Think it should work....let me know if it does or not!
    The Sisko
    SciFi-Forum.de

    Comment


    • #3
      Thanks for this! Yes, it did work. It sends the notification to the admins only, but not the mods.

      It would be nice if vB implemented an addition to the report feature which would notify admins as well as mods, maybe make it optional.


      Thanks

      Comment


      • #4
        Not sure if I am allowed to post so much code but here another try for those of you who wouldn't like to add the admin to the moderators, but also want the admin to get an email to.

        Then again in report.php:
        PHP Code:
          // get mods for forum
          
        $post=getpostinfo($postid);
          
        $thread=getthreadinfo($post[threadid]);
          
        $forumlist=getforumlist($thread[forumid],"forumid");
          
        $moderators=$DB_site->query("SELECT user.email FROM moderator,user WHERE user.userid=moderator.userid AND $forumlist");

          
        $thread[title]=unhtmlspecialchars($thread[title]);

          if (
        $DB_site->num_rows($moderators)==0) {
            
        // get admins if no mods
            
        $moderators=$DB_site->query("SELECT user.email FROM user,usergroup WHERE user.usergroupid=usergroup.usergroupid AND usergroup.cancontrolpanel=1");
          }

          while (
        $moderator=$DB_site->fetch_array($moderators)) {
            eval(
        "\$message = \"".gettemplate("email_reportbadpost",1,0)."\";");
            eval(
        "\$subject = \"".gettemplate("emailsubject_reportbadpost",1,0)."\";");

            
        mail ($moderator[email],$subject,$message,"From: \"$bbtitle Mailer\" <$webmasteremail>");
          } 
        and change it to:
        PHP Code:
          // get mods for forum
          
        $post=getpostinfo($postid);
          
        $thread=getthreadinfo($post[threadid]);
          
        $forumlist=getforumlist($thread[forumid],"forumid");
          
        $moderators=$DB_site->query("SELECT user.email FROM moderator,user WHERE user.userid=moderator.userid AND $forumlist");
          
        $admins=$DB_site->query("SELECT user.email FROM user,usergroup WHERE user.usergroupid=usergroup.usergroupid AND usergroup.cancontrolpanel=1");

          
        $thread[title]=unhtmlspecialchars($thread[title]);

            while (
        $moderator=$DB_site->fetch_array($moderators)) {
            eval(
        "\$message = \"".gettemplate("email_reportbadpost",1,0)."\";");
            eval(
        "\$subject = \"".gettemplate("emailsubject_reportbadpost",1,0)."\";");

            
        mail ($moderator[email],$subject,$message,"From: \"$bbtitle Mailer\" <$webmasteremail>");
        }
           while (
        $admins=$DB_site->fetch_array($admins)) {
            eval(
        "\$message = \"".gettemplate("email_reportbadpost",1,0)."\";");
            eval(
        "\$subject = \"".gettemplate("emailsubject_reportbadpost",1,0)."\";");

            
        mail ($admins[email],$subject,$message,"From: \"$bbtitle Mailer\" <$webmasteremail>");
          } 
        It is untested, but I think it will work. I'll give it a try when I am at home. Nt good for me doing so much vB from work !
        The Sisko
        SciFi-Forum.de

        Comment


        • #5
          I tried it, it gave me a parse error, something about code 1.

          The good news is that it sent an email to both the admins and the mods! Although they were blank, lol! But it's getting closer. Thank you for helping!! I do hope you don't get in trouble at work for working on this.


          Comment


          • #6
            So here is a tested and working version of it:

            In report.php find:
            PHP Code:
              // get mods for forum
              
            $post=getpostinfo($postid);
              
            $thread=getthreadinfo($post[threadid]);
              
            $forumlist=getforumlist($thread[forumid],"forumid");
              
            $moderators=$DB_site->query("SELECT user.email FROM moderator,user WHERE user.userid=moderator.userid AND $forumlist");
              
            $admins=$DB_site->query("SELECT user.email FROM user,usergroup WHERE user.usergroupid=usergroup.usergroupid AND usergroup.cancontrolpanel=1");
              
            $thread[title]=unhtmlspecialchars($thread[title]);

              while (
            $moderator=$DB_site->fetch_array($moderators)) {
                eval(
            "\$message = \"".gettemplate("email_reportbadpost",1,0)."\";");
                eval(
            "\$subject = \"".gettemplate("emailsubject_reportbadpost",1,0)."\";");

                
            mail ($moderator[email],$subject,$message,"From: \"$bbtitle Mailer\" <$webmasteremail>");
              }

              while (
            $admin=$DB_site->fetch_array($admins)) {
                eval(
            "\$message = \"".gettemplate("email_reportbadpost",1,0)."\";");
                eval(
            "\$subject = \"".gettemplate("emailsubject_reportbadpost",1,0)."\";");

                
            mail ($admin[email],$subject,$message,"From: \"$bbtitle Mailer\" <$webmasteremail>");
              }

              eval(
            "standardredirect(\"".gettemplate("redirect_reportthanks")."\",\"$url\");");

            and replace it with:
            PHP Code:
            // get mods for forum
              
            $post=getpostinfo($postid);
              
            $thread=getthreadinfo($post[threadid]);
              
            $forumlist=getforumlist($thread[forumid],"forumid");
              
            $moderators=$DB_site->query("SELECT user.email FROM moderator,user WHERE user.userid=moderator.userid AND $forumlist");

              
            $thread[title]=unhtmlspecialchars($thread[title]);

              if (
            $DB_site->num_rows($moderators)==0) {
                
            // get admins if no mods
                
            $moderators=$DB_site->query("SELECT user.email FROM user,usergroup WHERE user.usergroupid=usergroup.usergroupid AND usergroup.cancontrolpanel=1");
              }

              while (
            $moderator=$DB_site->fetch_array($moderators)) {
                eval(
            "$message = \"".gettemplate("email_reportbadpost",1,0)."\";");
                eval(
            "$subject = \"".gettemplate("emailsubject_reportbadpost",1,0)."\";");

                
            mail ($moderator[email],$subject,$message,"From: \"$bbtitle Mailer\" <$webmasteremail>");
              } 
            Tested on my test board and it worked. Please let me know if it worked for you!?

            BTW: No, I don't get in trouble for doing this while I'm working. I had to do some rendering today and as you as this took some time. SO I spend my time on the vBulletin forum
            The Sisko
            SciFi-Forum.de

            Comment


            • #7
              It gave me an error 'parse error on eval code line 1' or similar.

              it looked like this was left out, so i added this back:

              Code:
              eval("standardredirect(\"".gettemplate("redirect_reportthanks")."\",\"$url\");");
              }
              but still received an error.

              I'm so sorry to put you to so much trouble. I truly appreciate your help here

              Comment


              • #8
                I don't have moderators assigned to different forums. Instead I have a moderator team that helps in every forum.

                All I did was put them all in one group (Super Moderator) and changed:
                Code:
                    $moderators=$DB_site->query("SELECT user.email FROM user,usergroup WHERE user.usergroupid=usergroup.usergroupid AND usergroup.cancontrolpanel=1");
                to:
                Code:
                    $moderators=$DB_site->query("SELECT user.email FROM user,usergroup WHERE user.usergroupid IN (5,6)");
                Translations provided by Google.

                Wayne Luke
                The Rabid Badger - a vBulletin Cloud demonstration site.
                vBulletin 5 API

                Comment


                • #9
                  You only need the:
                  PHP Code:
                  eval("standardredirect(\"".gettemplate("redirect_reportthanks")."\",\"$url\");");

                  on time, or do you want a double redirect?
                  But wht wluke said is a good solution, but without usergroups the way I change is ok I think.

                  BTW: Which beta do you run? I run vB2.0 beta 2 on my test board and it works!
                  The Sisko
                  SciFi-Forum.de

                  Comment


                  • #10
                    Thanks I am using 2, beta2 as well, but it's still not working. I will definitely use the code you made which will send the notices to admins only, as that will still be a great benefit to our forum, and we thank you for that

                    Thanks,
                    Suzanne

                    Comment


                    • #11
                      Could you please provide the whole error message you get?
                      Or try to ICQ me.....
                      The Sisko
                      SciFi-Forum.de

                      Comment

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