![]() |
IF Condition for this?
I am trying to display something on specific pages only. Is there an IF like this?:
Example only: <if condition="url == http://example.com/example1.php"></if> |
depending on where you put it you might want to try <IF THIS_SCRIPT == "index">
that will show whatever the code is on the index only. |
Quote:
|
There are ways to check the url - there's a $_SERVER variable that has that info in various forms. Here's a reference: http://php.net/manual/en/reserved.variables.server.php (maybe $_SERVER['PHP_SELF'] is what you're talking about).
However, it sounds like what you want is to check the user id, like Code:
<if condition="$bbuserinfo['userid']==X"> if you want to put something in a template that's also included in other pages you could do like BigJohnny said, Code:
<if condition="THIS_SCRIPT=='member' AND $bbuserinfo['userid']==X"> and if you also want to show it for a page that has a "do=" on the URL (but only for certain values), there's a way to do that, too. Code:
<if condition="$_REQUEST['do'] == 'something'> |
Quote:
Also, I want this displayed on specific user profiles. However, I want it seen by every member. That's the reason why I need an IF. I intend to place it right under the username on certain profiles, like user ID 1, 5 and 7, yet seen by everybody. |
Oh, I see now - my mistake. I think you want:
Code:
<if condition="$userinfo['userid'] == X"> |
All times are GMT. The time now is 10:48 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|