brdad
04-17-2011, 08:41 PM
This is my first post and I'm jumping in head first so please bear with me.
I want to format a user name removing unusable characters, and then append that user name to a URL for IRC chat. I'm not 100% sure I can do this in a template for a widget nor am I 100% sure how to code it. Any help would be appreciated. I know the code below is wrong, but it should be clear what I am trying to accomplish.
Thanks
<div class="cms_widget">
<div class="block">
<div class="cms_widget_header widget_header">
<h3>IRC Chat</h3>
</div>
<div class="cms_widget_content widget_content">
Dirty = $bbuserinfo[username]
$Clean = preg_replace('/^[0-9]+([^0-9])/', '\\1', preg_replace('/[^-a-zA-Z0-9_|^{}[\]\\\\]/', '', $Dirty));}
$Output = 'http://www.somesite.com/chat&user='$Clean
</div>
</div>
</div>
I want to format a user name removing unusable characters, and then append that user name to a URL for IRC chat. I'm not 100% sure I can do this in a template for a widget nor am I 100% sure how to code it. Any help would be appreciated. I know the code below is wrong, but it should be clear what I am trying to accomplish.
Thanks
<div class="cms_widget">
<div class="block">
<div class="cms_widget_header widget_header">
<h3>IRC Chat</h3>
</div>
<div class="cms_widget_content widget_content">
Dirty = $bbuserinfo[username]
$Clean = preg_replace('/^[0-9]+([^0-9])/', '\\1', preg_replace('/[^-a-zA-Z0-9_|^{}[\]\\\\]/', '', $Dirty));}
$Output = 'http://www.somesite.com/chat&user='$Clean
</div>
</div>
</div>