Author Topic: Hiding the Name field  (Read 10420 times)

0 Members and 1 Guest are viewing this topic.

jarradyuhas

  • Sr. Member
  • ****
  • Posts: 36
    • SusQ-Cyber Charter School
Hiding the Name field
« on: September 08, 2010, 06:18:35 PM »
I have Mibew integrated with Joomla currently and I pull the User's Name from the Joomla Database. I was wondering if there is a way to simply hide the "name" form field in the Chat initiation page. I have it set so they can give a summary, so it wont just be a blank page.

avm

  • Jr. Member
  • **
  • Posts: 2
    • XHTMLFactory
Re: Hiding the Name field
« Reply #1 on: September 09, 2010, 02:38:39 AM »
Sometime ago I did this in the following way:

1. Add this snippet into your template code:
<?php
$user =& JFactory::getUser();
$user_name = urlencode($user->name);
$user_email = urlencode($user->email);
?>

2. And then inject name and email values into button invocation code (pay attention to bolded code):
<!-- webim button --><a href="/support/chat/client.php?locale=en" target="_blank" onclick="if(navigator.userAgent.toLowerCase().indexOf('opera') != -1 &amp;&amp; window.event.preventDefault) window.event.preventDefault();this.newWindow = window.open('/support/chat/client.php?locale=en&amp;url='+escape(document.location.href)+'&amp;referrer='+escape(document.referrer)+'&amp;name=<?php echo $user_name; ?>&amp;email=<?php echo $user_email; ?>', 'webim', 'toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width=640,height=480,resizable=1');this.newWindow.focus();this.newWindow.opener=window;return false;"><img src="/support/chat/button.php?image=webim&amp;lang=en" border="0" width="163" height="61" alt=""/></a><!-- / webim button -->

Hope this will help :)
« Last Edit: September 09, 2010, 02:40:31 AM by avm »

jarradyuhas

  • Sr. Member
  • ****
  • Posts: 36
    • SusQ-Cyber Charter School
Re: Hiding the Name field
« Reply #2 on: September 09, 2010, 08:11:22 AM »
I have already done that (as stated in my first post). I want to hide the Name field so that the user cant change it. If I set it to not change the name field, the user shows up in the Admin interface as Visitor. I changed it in localize to " ", but then it shows nothing as the name. Also, if multiple users use the same computer, it will keep the first users name in the field if I have it set so they cant change it. I just want to change the field to hidden.

jarradyuhas

  • Sr. Member
  • ****
  • Posts: 36
    • SusQ-Cyber Charter School
Re: Hiding the Name field
« Reply #3 on: September 11, 2010, 01:58:22 AM »
Found it. Just had to comment out some of the coding in the style tpl files and change the field type to hidden. Works great!