![]() |
if conditional inside php file, how?
I'm trying to use an if conditional inside the skin file for my ipbpro arcade mode.
The problem is when I edit and reupload, I get a blank page due to the code I'm using but I'm not sure where I'm messing up. In a regular vb template it looks like this. Code:
<if condition="in_array($bbuserinfo['usergroupid'], array(2,6,7,35))"> It looks like this and results in a blank page Code:
<if condition='in_array($bbuserinfo['usergroupid'], array(2,6,7,35))'> |
If it's php, you can't use template conditions - you need to use actual php code. For instance:
PHP Code:
|
1 Attachment(s)
Thanks Lynne.
What about this one? <if condition="$bbuserinfo['posts'] > 4"> Is this the correct replacement? if (in_array($vbulletin->userinfo['bbuserinfo['posts'] > 4') Tried this: Code:
if (in_array($vbulletin->userinfo['usergroupid'], array(2, 6, 7, 35))) |
This is the entire portion of that file
Code:
function top_links_table($links,$width,$extra) { |
I think it will work with posts, but I'm not sure. You'll have to see if it's been formatted at the point that you go to use it.
You also cannot go in and out of html/php like you are doing. You may want to read up on using html in a php page and how to end your php and go into html and vice-versa. |
Can anyone else help me please?
I'm not a coder, so I have no idea how to really go about this and I tried looking at other default vb files for hints, not picking up on how it works. |
I've not fooled around with it too much and I only understand a little about it, but I know you can't jumble your HTML and PHP together like you have. Take a look at the one of the skin files for ibProArcade and take note of where HTML is being placed and how. Take note of how only variables are being used within the HTML and how it stands out from the code structure of PHP. For instance, if conditions are not being used inside of return <<<EOF EOF;
|
Try something like this...
PHP Code:
|
I tried your method HM and got this
http://pingy.us/?v=box.png The code Code:
function top_links_table($links,$width,$extra) { Code:
function top_links_table($links,$width,$extra) { |
I'm not entirely sure what your trying to do, but why not just use the standard vBulletin conditionals in the ARCADE template? Then you can set up an <else> in the conditional with a message or whatever else you want those usergroups to see. Seems like that would be easier and closer to what your trying to accomplish.
|
Because the pink box is my "media menu" and the if conditionals is for the live chat link in that media box.
I do not want anyone to be able to enter live chat unless they have at least 5 forum posts. There is no skin template for the arcade in the vb template area, only the php file. |
There is one template for ibProArcade. It's the ARCADE template. It looks like this:
HTML Code:
$stylevar[htmldoctype] |
I have a better idea.
How can I tell that php arcade file to fetch this vbulletin template called vbtpldw_01 ? vbtpldw_01 is a custom vbulletin template I use but have no idea how to tell the php file to fetch the content. I already tried editing the ARCADE template in vb but for some very odd reason, it just does not work. I used: $header $navbar $vbtpldw_01 I simply added that third line, and hard refreshed the main arcade page. That vbtpldw template does not show up at all. However, I have that same line in various other template areas such as album, live chat, photo gallery templates and that custom template pulls fine on those other templates/pages. --------------- Added [DATE]1254451208[/DATE] at [TIME]1254451208[/TIME] --------------- Ok, I got it working the manual way: using the actual code itself from that vbtpldw template instead of fetching it using the $ method. Any idea why it wouldn't fetch the template? |
All times are GMT. The time now is 05:02 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:
|