Announcement

Collapse
No announcement yet.

Can anyone with php+vB3 knowledge help me a little with this...

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

  • Can anyone with php+vB3 knowledge help me a little with this...

    Code:
    <?php
    require("global.php");
    // unregistered error message
            if ($bbuserinfo['usergroupid'] == 0 or $bbuserinfo['usergroupid'] ==3) {
              eval("standarderror(\"".gettemplate("galleryerror")."\");");
            }
    ?>
    That makes my gallery script give a custom error telling people to register and/or activate their account before they can actually view it.

    Can anyone help me make that vB3 compatible?

  • #2
    PHP Code:
    <?php
    require_once('global.php');
    if (
    $bbuserinfo['usergroupid'] == '0' or $bbuserinfo['usergroupid'] == '3')
    {
     eval(
    print_standard_error('galleryerror'));
    }
    ?>

    Comment


    • #3
      I get vBulletin Message:

      Could not find phrase 'galleryerror'.

      That code above didnt work when I logged out and tried to view it, it gave me that error. If I login it works fine.

      Comment


      • #4
        You will need to add a phrase with the name galleryerror to use that method or use standard_error (I think) if you plan on using templates for the error message.
        vBulletin.org Moderator
        The Sisters Three Charmed Discussion Forums

        Comment


        • #5
          I did both, added a template with that name and a phrase, I still got the error.

          Comment


          • #6
            Damn, there is no use! I tried copying a vB3 file and editing in the right template names and phrases, but it keeps telling me there is no phrase! Its there tho.

            Comment


            • #7
              You'll have to put the phrase in a group that gets extracted at the start of your script, and if you don't have that, copy the block of code to get the necessary phrases in the script and put it above the require_once() for global.php

              Comment


              • #8
                This did the trick:

                PHP Code:
                <?php
                define
                ('THIS_SCRIPT''gallery');
                require_once(
                './global.php');
                if (
                $bbuserinfo['usergroupid'] == '1' or $bbuserinfo['usergroupid'] == '3')
                {
                eval(
                print_standard_error('nopermission_gallery'));
                }
                ?>

                Comment

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