![]() |
php calling for use in pages
I am wanting to take the username, and if it has a space in it replace it with an _
I am not up with programming, so am trying to figure it out. I got this far. <$irc_user = str_replace(' ', '_', $bbuserinfo[username]);> Am i heading totally down the wrong track? Can i use this straight in the template? I don't know what to search for to help me, i am a complete noob at this. Thank you for any help in advance. |
You cant use php in the templates. You will need to make a plugin for the global_start hook that contains the following code (the plugin could change if you only need it in a specific area, this would make it available globally).
PHP Code:
|
Is it a problem to have it available globally? Ie does it slow anything down or affect anything?
I need it available for forumhome template and also a custom template page. --------------- Added [DATE]1215854750[/DATE] at [TIME]1215854750[/TIME] --------------- Quote:
--------------- Added [DATE]1215855674[/DATE] at [TIME]1215855674[/TIME] --------------- Ok i added a hook sorry i have read up about it) but that doesn't doesn't work, either for people with spaces or without. |
Don't add the opening and closing PHP tags.
AdminCP > Plugins & Products > Add New Plugin Hook Location: global_start PHP Code: PHP Code:
|
Thank you so much :) I hadn't realised that! It works perfectly.
Again, thank you very much :) |
All times are GMT. The time now is 11:46 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|