vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   in_array() Turning Up Parse Error (https://vborg.vbsupport.ru/showthread.php?t=316740)

Digital Jedi 01-18-2015 08:34 AM

in_array() Turning Up Parse Error
 
I've had these plugins for years, something Lynne showed me a long while back. I'm not sure when they started turning up this parse error on the affected forum, but now the comma is an unexpected ',' and I'm not quite seeing why:

PHP Code:

if(in_array($this->forum['forumid'], array(645646682683684684685686688)) AND $post['postid'] == $this->thread['firstpostid']) 

    
$this->templatename 'postbit_story'


It let's you set your own templates for the first post in a thread. It seems to be working fine, still. But, for whatever reason, the forums with the IDs in the array display a parse error with the comma being the culprit. Did something in PHP change that I missed? http://www.cogonline.net/forums/forumdisplay.php?f=773

ozzy47 01-18-2015 08:38 AM

What version of PHP are you running?

Digital Jedi 01-18-2015 08:41 AM

5.3.29.

ozzy47 01-18-2015 08:47 AM

Just for kicks, try this.

Code:

if($this->thread['firstpostid'] == $this->post['postid'] AND in_array($this->thread['forumid'], array(645, 646, 682, 683, 684, 684, 685, 686, 688)))
And add this to the top of your plugin.

Code:

global $vbulletin;

Digital Jedi 01-18-2015 08:53 AM

Same error on the same line. Also didn't change the postbit. Confuzzled.

ozzy47 01-18-2015 08:55 AM

And when you disable the plugin, the error goes away.

Digital Jedi 01-18-2015 09:03 AM

Geez, it's a completely different plugin. One I started earlier today and didn't finish. Remind me to just stop working on vBulletin at 6 AM.

ozzy47 01-18-2015 09:05 AM

LOL, it's cool brother, it happens to all of us. :)

Lynne 01-18-2015 03:24 PM

LOL


All times are GMT. The time now is 02:44 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
  • Page Generation 0.01025 seconds
  • Memory Usage 1,725KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete