The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Parse Error in Showthread help needed please
I am getting this error when I try to use my code below.. can anyone please help me fix it?
Parse error: syntax error, unexpected $end in home/xxx/xxx/showthread.php(2169) : eval()'d code(10) : eval()'d code on line 1 Parse error: syntax error, unexpected T_ENDIF in home/xxx/xxx/showthread.php(2169) : eval()'d code(12) : eval()'d code on line 1 Here is the code for the beginning of my showthread. <head> <if condition="in_array($thread['forumid'], array(22, 30, 31, 32, 33, 34)) AND !is_member_of($bbuserinfo, 6, 7, 10)"> <script type="text/javascript">ap_loaded = false;</script> <script type="text/javascript" src="http://ad.leadbolt.net/show_cu.js?section_id=xxxx"></script> <script type="text/javascript">if (!ap_loaded) { window.location = 'http://ad.leadbolt.net/adblock?section_id=xxxx'; }</script> <?php if (strpos($_SERVER['HTTP_USER_AGENT'],'Googlebot') !== false) : ?> <noscript><meta http-equiv="refresh" content="0;url='http://ad.leadbolt.net/noscript?section_id=xxxx'" /></noscript> <?php endif ?> </if> $headinclude |
#2
|
|||
|
|||
I think the problem is in plugin code. It looks like hook location 'showthread_complete'. You might be able to look at the plugin manager and see which product it is.
|
#3
|
|||
|
|||
OK, I don't understand... I've never had this problem before until I put in this part of the code, and it's not a plugin. Could you please be more specific?
<script type="text/javascript">ap_loaded = false;</script> <script type="text/javascript" src="http://ad.leadbolt.net/show_cu.js?section_id=xxxx"></script> <script type="text/javascript">if (!ap_loaded) { window.location = 'http://ad.leadbolt.net/adblock?section_id=xxxx'; }</script> <?php if (strpos($_SERVER['HTTP_USER_AGENT'],'Googlebot') !== false) : ?> <noscript><meta http-equiv="refresh" content="0;url='http://ad.leadbolt.net/noscript?section_id=xxxx'" /></noscript> <?php endif ?> |
#4
|
|||
|
|||
Oh yeah, sorry, I'm wrong. I Jumped to that conclusion because that's the same error you get when a plugin has a problem, but you're right, it's obviously something in that template.
ETA: I don't use the :/endif thing so I'm not sure, but doesn't it need a ; after the endif? BTW - are you even allowed to put php in a template like that? |
#5
|
||||
|
||||
I've never run across a php if statement in a template.
EDIT: I found where you missed it. Try this for the endif statement. You forgot the trailing ; <?php endif; ?> |
#6
|
|||
|
|||
Hi,
I tried <?php endif; ?> and now the error changed just a bit to this... (I bolded the changes) Parse error: syntax error, unexpected $end in home/xxx/xxx/showthread.php(2169) : eval()'d code(12) : eval()'d code on line 1 Parse error: syntax error, unexpected T_ENDIF in home/xxx/xxx/showthread.php(2169) : eval()'d code(14) : eval()'d code on line 1 |
#7
|
|||
|
|||
Try getting rid of the red lines:
Code:
<head> <if condition="in_array($thread['forumid'], array(22, 30, 31, 32, 33, 34)) AND !is_member_of($bbuserinfo, 6, 7, 10)"> <script type="text/javascript">ap_loaded = false;</script> <script type="text/javascript" src="http://ad.leadbolt.net/show_cu.js?section_id=xxxx"></script> <script type="text/javascript">if (!ap_loaded) { window.location = 'http://ad.leadbolt.net/adblock?section_id=xxxx'; }</script> <?php if (strpos($_SERVER['HTTP_USER_AGENT'],'Googlebot') !== false) : ?> <noscript><meta http-equiv="refresh" content="0;url='http://ad.leadbolt.net/noscript?section_id=xxxx'" /></noscript> <?php endif ?> </if> $headinclude |
#8
|
|||
|
|||
That does work, but is there anyway I can still implement:
if (strpos($_SERVER['HTTP_USER_AGENT'],'Googlebot') !== false) : I want to hide the no script section of my code from Googlebot. |
#9
|
||||
|
||||
This won't work?
<if condition="strpos($_SERVER['HTTP_USER_AGENT'],'Googlebot') !== false"> |
#10
|
|||
|
|||
Thanks for the suggestion, but it didn't work.... I got this when I clicked save.
The following template conditional expression contains function calls: <if condition="strpos($_SERVER['HTTP_USER_AGENT'],'Googlebot') !== false"> Function Name Usage in Expression strpos strpos($_SERVER['HTTP_USER_AGENT'],'Googlebot') With a few exceptions, function calls are not permitted in template conditional expressions. Please go back and re-write this expression. The following functions are allowed in template conditional expressions: in_array() is_array() is_numeric() isset() empty() defined() array() can_moderate() can_moderate_calendar() exec_switch_bg() is_browser() is_member_of() |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|