cmmguy
09-25-2008, 08:08 PM
I am trying to get a piece of code to work that would usually sit in a php file. I want it in a section of a template. This function (is supposed to) return the string that is appended to the url for the chatbox. This string will autolog the user on with their user name from the forum.
For some reason unknown to my limited experience, the function does not work - I had it located in the index.php file. Here is the Function part.:
// ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTTA HERE... ###
($hook = vBulletinHook::fetch_hook('forumhome_complete')) ? eval($hook) : false;
// ### CHAT integration: start ###
function shoutmix($name = '') {
return htmlspecialchars(
'&name='.rawurlencode($name)
.'&code='.md5($name.'XXXXXXXXX'));
}
$shoutmix = $vbulletin->userinfo['userid'] ? shoutmix($vbulletin->userinfo['username']) : '';
// ### CHAT integration: end ###
[Note: the XXXXXXXXX is the key for my chatbox
I think the function is in the wrong location to work or the scope is not right or ??
Can I move or recode this into only the template so that I dont have to worry about those details? Could someone suggest a recode of the template part to include what is function.
If I get this working, I would like to post the outcome as a new ChatBox solution.
Thank you and please "drill" me with any questions.
J
This is the actual code for the footer
<!-- Begin CHAT - http://www.shoutmix.com -->
<iframe title="chatname" src="http://www2.shoutmix.com/?chatname$shoutmix" width="160" height="400" frameborder="0" scrolling="auto">
<a href="http://www2.shoutmix.com/?chatname$shoutmix">View shoutbox</a>
</iframe>
<!-- End CHAT -->
NOTE: This is for a chatbox that will be in the side column of forum with the modification in the footer template(using the side column mod).
For some reason unknown to my limited experience, the function does not work - I had it located in the index.php file. Here is the Function part.:
// ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTTA HERE... ###
($hook = vBulletinHook::fetch_hook('forumhome_complete')) ? eval($hook) : false;
// ### CHAT integration: start ###
function shoutmix($name = '') {
return htmlspecialchars(
'&name='.rawurlencode($name)
.'&code='.md5($name.'XXXXXXXXX'));
}
$shoutmix = $vbulletin->userinfo['userid'] ? shoutmix($vbulletin->userinfo['username']) : '';
// ### CHAT integration: end ###
[Note: the XXXXXXXXX is the key for my chatbox
I think the function is in the wrong location to work or the scope is not right or ??
Can I move or recode this into only the template so that I dont have to worry about those details? Could someone suggest a recode of the template part to include what is function.
If I get this working, I would like to post the outcome as a new ChatBox solution.
Thank you and please "drill" me with any questions.
J
This is the actual code for the footer
<!-- Begin CHAT - http://www.shoutmix.com -->
<iframe title="chatname" src="http://www2.shoutmix.com/?chatname$shoutmix" width="160" height="400" frameborder="0" scrolling="auto">
<a href="http://www2.shoutmix.com/?chatname$shoutmix">View shoutbox</a>
</iframe>
<!-- End CHAT -->
NOTE: This is for a chatbox that will be in the side column of forum with the modification in the footer template(using the side column mod).