VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: oneyozfest182 on June 01, 2017, 18:28:43 PM

Title: [Off Topic] General Joomla! Question
Post by: oneyozfest182 on June 01, 2017, 18:28:43 PM
I'm so sorry for posting here, but the Joomla! forums keep giving me 403 errors for some reason, and everyone here is always super helpful, so I thought I'd try posting my question here and seeing if anyone can help me. Sorry if this is against the rules; feel free to remove and I'll totally understand.

Hey all; I use Smooch for a web support chat on my site, and all used to work fine, but after updating to PHP 7.0.15 and Joomla! 3.7.2, suddenly the PHP I use to pull their username into Smooch.

This is the code I used:
<script src="https://cdn.smooch.io/smooch.min.js"></script>
<script>
Smooch.init({appToken: 'INTENTIONALLY OMITTED', givenName: '<? echo $user->name ?>', email: '<? echo $user->email ?>', emailCaptureEnabled: 'Yes', customText: {
    headerText: 'Chat with Customer Support', settingsText: 'You can also leave us your e-mail address so that we can get back to you later.', messageIndicatorTitleSingular: '({count}) New Message', messageIndicatorTitlePlural: '({count}) New messages', introText: 'To help us better serve you, please provide us with your account number if you have it available. Feel free to ask us anything\; we\'re here to help!',
}, properties: {
        'Account Number': '<? echo $user->username ?>'
    }
});
</script>


I used to have to place that inside of the <head> content in index.php and everything worked fine, but now after updating, it seems PHP is just completely ignoring that script and the output is literally <? echo $user->name ?>, etc. instead of the PHP displaying the proper values. Is there something I'm doing wrong?

Side-note: Someone also said I should be able to put them inside a custom module so they survive updates, (since index.php is overwritten each update), using $user =& JFactory:;getUser(); as well, somehow, (I'm clueless on PHP, though), so if we sort this out and someone could help me out with this as well, that would be fantastic!

Thanks again, so much, in advanced, for any help. :)
Title: Re: [Off Topic] General Joomla! Question
Post by: jenkinhill on June 01, 2017, 18:40:18 PM
You should direct this to Smooch support at https://smooch.io/help/
Title: Re: [Off Topic] General Joomla! Question
Post by: GJC Web Design on June 01, 2017, 22:21:32 PM
try

<?php echo $user->name ?>

assuming $user is available
Title: Re: [Off Topic] General Joomla! Question
Post by: Ghost on June 02, 2017, 07:46:35 AM
You can't post on Joomla forum because your post contains <script> tags. You can break them (e.g. change to <s cript>) and it will allow you to post.
Title: Re: [Off Topic] General Joomla! Question
Post by: oneyozfest182 on June 02, 2017, 17:42:15 PM
Quote from: GJC Web Design on June 01, 2017, 22:21:32 PM
try

<?php echo $user->name ?>

assuming $user is available

This was indeed the issue! I was using short code.  :-X

Quote from: Ghost on June 02, 2017, 07:46:35 AM
You can't post on Joomla forum because your post contains <script> tags. You can break them (e.g. change to <s cript>) and it will allow you to post.

Is there any chance that by trying too many times, I got banned? I can't access forum.joomla.org at all from my office anymore, (though I can on my cell, and my USER isn't banned).