PDA

View Full Version : PHP Function in MEMBERINFO


ThePimp
04-04-2006, 05:55 AM
I need to call a PHP function in the MEMBERINFO template, with optional parameters.

myFunction("http://www.url.com");

I will setup a profile field to set the url of the function:

myFunction("$userinfo[field11]");

however, I am unsure of how to actually call the PHP in the template.

Can anyone assist with this?

Freesteyelz
04-04-2006, 06:30 AM
I don't think you can call a PHP function "<?php" inside a template.

ThePimp
04-04-2006, 07:35 AM
I don't think you can call a PHP function "<?php" inside a template.
There has to be a way, perhaps by code hacking, or via bbcode somehow.

ThePimp
04-06-2006, 05:33 PM
Bump

Majidm
04-06-2006, 05:37 PM
Yeah easy...

Go to the Plugin Manager, Add a New Plugin, Hook it to "memberinfo_complete" and in the Plugin put your PHP code and at the end of it, put the results into a variable (i.e $pluginresults )

Then goto your MEMBERINFO template in Edit Styles and put that variable where you want the results of the PHP code to go, just like this: $pluginresults (you don't have to put anything but the var name)

ThePimp
04-06-2006, 08:03 PM
Yeah easy...

Go to the Plugin Manager, Add a New Plugin, Hook it to "memberinfo_complete" and in the Plugin put your PHP code and at the end of it, put the results into a variable (i.e $pluginresults )

Then goto your MEMBERINFO template in Edit Styles and put that variable where you want the results of the PHP code to go, just like this: $pluginresults (you don't have to put anything but the var name)
I think you missed the part about:
I will setup a profile field to set the url of the function:

myFunction("$userinfo[field11]");

The function output will be different per user. They pass a userinfo var to the function. I can't do this with a plugin, if I'm not mistaken.

Freesteyelz
04-07-2006, 03:52 AM
There has to be a way, perhaps by code hacking, or via bbcode somehow.

I haven't come across it if it's available.