PDA

View Full Version : Can anyone with php+vB3 knowledge help me a little with this...


Mijae
Wed 6th Aug '03, 10:52pm
<?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?

Brad.loo
Thu 7th Aug '03, 3:15am
<?php
require_once('global.php');
if ($bbuserinfo['usergroupid'] == '0' or $bbuserinfo['usergroupid'] == '3')
{
eval(print_standard_error('galleryerror'));
}
?>

Mijae
Thu 7th Aug '03, 8:45am
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.

NTLDR
Thu 7th Aug '03, 12:01pm
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.

Mijae
Thu 7th Aug '03, 2:23pm
I did both, added a template with that name and a phrase, I still got the error.

Mijae
Thu 7th Aug '03, 10:05pm
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.

Faruk
Fri 8th Aug '03, 6:47am
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

Mijae
Fri 8th Aug '03, 1:34pm
This did the trick:


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