Page 1 of 1

Can I use php calls in CMSMS pages? (extracting data from a vBulletin forum)

Posted: Thu Aug 17, 2006 12:52 am
by zeroality
I'm trying to extract data from a vBulletin forum. It works on a test.php file that I upload but doesn't work when I insert it into CMSMS.

It says that it requires all page extensions to be .php not .htm or .html - would that be the problem? Any way to make this work?

I'm not sure what information I need to provide for something like this, so if you need more information, let me know.

Would my only option be an iframe or something? (ugh)

Re: Can I use php calls in CMSMS pages? (extracting data from a vBulletin forum)

Posted: Thu Aug 17, 2006 1:08 am
by calguy1000

Re: Can I use php calls in CMSMS pages? (extracting data from a vBulletin forum)

Posted: Thu Aug 17, 2006 1:29 am
by zeroality
Right, thanks for both links.

I got excited when I read that development article but it doesn't work. :(

I created a user-defined tag called 'phpcall' then inserted the code:
  chdir('./forums');
  require_once('global.php');


and when I tried to put the {phpcall} in my page, it gave me the error:
Warning: array_keys() [function.array-keys]: The first argument should be an array in /includes/functions.php on line 3291

Warning: Invalid argument supplied for foreach() in /includes/functions.php on line 3291
:( Any tips?

Re: Can I use php calls in CMSMS pages? (extracting data from a vBulletin forum)

Posted: Thu Aug 17, 2006 1:37 am
by calguy1000
okay..... now we have something different...

includes/functions.php isn't a CMSmade simple file, and I don't have vbulletin, so it's gonna get dicey.  but.

I would guess that if you looked in the includes/functions.php file there's probably an array_keys function, or a call to array_keys

I'd do a grep through vbulletin source for the word array_keys on the same line as 'function' i.e:  (hope you have shell access).

Code: Select all

cd forms
find . -name '*php' -exec grep array_keys {} /dev/null \; | grep function
my bet is that there's a naming conflict somewhere that needs to be resolved (somehow).  This can get difficult with two php applications occupying the same instance.   

Let me know how this goes.

Re: Can I use php calls in CMSMS pages? (extracting data from a vBulletin forum)

Posted: Thu Aug 17, 2006 1:55 am
by zeroality
I'm not sure what to do. I don't know how to fix the problem without screwing up vBulleting or CMSMS.

I changed functions.php to a txt file and uploaded it if you'd mind taking a look? I'd really appreciate it.

http://www.pokerealm.net/functions.txt

foreach (array_keys($vbulletin->forumcache) AS $forumid)

That's line 3291.

Re: Can I use php calls in CMSMS pages? (extracting data from a vBulletin forum)

Posted: Thu Aug 17, 2006 2:15 am
by calguy1000
it sounds like the $vbulletin object isn't being completely initialized.  as either $vbulletin doesn't exist, or $vbulletin->forumcache doesn't exist (or isn't set properly).

Is there something else you have to call to set up $vbulletin after you include your one file ?

Does this little function work in it's on php file ?

Re: Can I use php calls in CMSMS pages? (extracting data from a vBulletin forum)

Posted: Thu Aug 17, 2006 3:06 am
by zeroality
No, it should be fine if I put only that code - it was on my test php page. I did set one up, yeah.

http://www.pokerealm.net/test.php

http://www.pokerealm.net/test.txt

But to be sure, I included both calls and still got the same error.

Re: Can I use php calls in CMSMS pages? (extracting data from a vBulletin forum)

Posted: Thu Aug 17, 2006 2:02 pm
by zeroality
I was hoping to wake up to an awesome post which fixed all my problems just like that! lol :(

Sigh, I just need this one problem fixed and I'll be sitting in butter. I really hope I don't have to go with another CMS, I like this one.

Re: Can I use php calls in CMSMS pages? (extracting data from a vBulletin forum)

Posted: Thu Aug 17, 2006 2:49 pm
by calguy1000
unfortunately it looks like it's gonna be a painful debugging process.  You'll have to modify the functions.php to
print out the $vbulletin->forumcache and then trace back to see where it's being initialized (probably something in global.php) and figure out why it's not being set properly.

But I'd start with dumping the $vbulletin->forumcache variable and see what is in it.

it may be something that gives a nice obvious indication as to what is happening.

Re: Can I use php calls in CMSMS pages? (extracting data from a vBulletin forum)

Posted: Thu Aug 17, 2006 6:26 pm
by zeroality
Ah, I appreciate your time and help but unfortunately, I am not an advanced PHP programmer. I know my way around a little but not enough to fix this apparently.

I found a vBulletin-integrated CMS but I really appreciate your help and I have already recommended CMSMS to two other people and it will work great for them. Thanks again.

Edit: Actually that didn't work out so well, I'll just stick an iframe in there and see if that works. If not, I suppose I can live without vBulletin integration.

That would be a good thing for CMSMS to look into for a future version though. A vBulletin integration module would probably get a lot of downloads.

Edit 2: iframe worked good. I'm happy.