PDA

View Full Version : [How 2..?] Add php code to template with plugin


Stagehandspace
07-13-2009, 01:35 PM
I've created a plugin (not product) which adds a random password string to the register page generated by php,

it shows ok but its stuck up in the top left corner of the page...how can I now add a "placement" hook so it will show in the password area of the register page?

I know about this:
How to Include a PHP or HTML File (http://www.vbulletin.com/forum/showthread.php?p=1066718)
but I want only to use the plugin system for this to work and not have to upload an external file to server or/and if possible not add a new template.

Dismounted
07-14-2009, 07:39 AM
Edit the template, and place a variable in the input field for the password. Assign your data to this variable.

Stagehandspace
07-14-2009, 08:12 AM
Edit the template, and place a variable in the input field for the password. Assign your data to this variable.

Hmmm this would mean turning it into a product due to template editting but thats ok...
I just want the string next to the p/w boxes not in it,

Could you post some demo code on how to assign variable please...

Dismounted
07-14-2009, 10:02 AM
Hmmm this would mean turning it into a product due to template editting but thats ok...
No it wouldn't. You don't have to do automatic template edits. Manually edit the template, and place a variable there. Assigning a value to a variable is easy - it is also fundamental. ;)
$foo = 'bar';