PDA

View Full Version : THIS_SCRIPT Conditionals in vb5


almai
03-03-2014, 10:02 PM
I'd like to redirect all users which are not logged in to index.php. For that reason I put following code into the header template:


<vb:if condition="$bbuserinfo['usergroupid'] == 1 AND THIS_SCRIPT != 'index'">
<meta HTTP-EQUIV="REFRESH" content="0; url={vb:raw baseurl}">
</vb:if>

The first part checks, if the user is logged in. This one works as intended. The second part should check, if index.php is being displayed and therefore avoid an infinite loop. But no matter what I try, the system doesn't recognize, that the home page is being displayed. The browser refreshes the page over and over again

So my questions is: Are conditionals with "THE_SCRIPT" still working in vb5 or is there another way to retrieve the information, which page is actually being displayed. Or is there another problem that prevents the code from working properly.

Thanks in advance

Zachery
03-03-2014, 10:33 PM
THIS_SCRIPT isn't in vBulletin 5, at all.

Trying to figure out if there is a way around this now.

--------------- Added 03 Mar 2014 at 18:39 ---------------

Lets try this though


<vb:if condition="!$user['userid'] AND page['pageid'] != 1">

Updated it a bit, more updates

almai
03-04-2014, 01:57 PM
Thank you for your reply. I will test this.

Would be great if you and your support team were more active in this forum. There are way to many unanswered threads here.

And another point to think about: A forum is no substitute for a well formed, profound technical documentation. What you provide here (https://www.vbulletin.com/docs/html/template_conditionals) is totally outdated and deficient! It's nothing a serious developer wants to work with.

Regards, Alex

Zachery
03-04-2014, 02:12 PM
Any time I, or any other support staff member spend here, is free time. We're not paid to be here :)

almai
03-04-2014, 04:55 PM
I really appreciate this. But as I wrote: Provide a better documentation and a lot of questions here would be needless.

But anyway, the conditional works. There was only a $ missing.

<vb:if condition="!$user['userid'] AND $page['pageid'] != 1">