PDA

View Full Version : Hide welcome guest message on mobile?


pjkcards
09-20-2013, 10:04 AM
I want to hide the welcome guest message to mobile users. It doesn't format properly and needs to be hidden on mobile. What is the best way to do this?

Thanks.

RickyH
09-21-2013, 08:53 AM
Find it in the mobile styles are remove it really.

ozzy47
09-21-2013, 09:43 PM
If you are talking about viewing the full site on a mobile device, versus the mobile style, this would require you to add some code to detect if it is a mobile device, and then wrap the welcome message with a conditional.

Off the top of my head this is not a easy task, but I have not looked into it.

--------------- Added 1379808632 at 1379808632 ---------------

Actually looking around you can use this mod, https://vborg.vbsupport.ru/showthread.php?t=292704

You will have to edit the plugin, Mobile Browser Check found in the group Mobile Browser Detector (BOP5)

In the bottom of that plugin add the following.

At the bottom add lines such as:
if ($vbulletin->detect->isMobile())
$vbulletin->options['isMobile'] = 1;

Then in a template you can go in you header template and find this code.

<li class="welcomelink">{vb:rawphrase welcome_x_link_y, {vb:raw bbuserinfo.username}, {vb:link member, {vb:raw bbuserinfo}}}</li>And change it to this code.

<vb:if condition="$vboptions['isMobile']">
<li class="welcomelink">{vb:rawphrase welcome_x_link_y, {vb:raw bbuserinfo.username}, {vb:link member, {vb:raw bbuserinfo}}}</li>
</vb:if>

This is completely untested but in theory it should work.

pjkcards
09-27-2013, 01:01 AM
If you are talking about viewing the full site on a mobile device, versus the mobile style, this would require you to add some code to detect if it is a mobile device, and then wrap the welcome message with a conditional.

Off the top of my head this is not a easy task, but I have not looked into it.

--------------- Added 1379808632 at 1379808632 ---------------

Actually looking around you can use this mod, https://vborg.vbsupport.ru/showthread.php?t=292704

You will have to edit the plugin, Mobile Browser Check found in the group Mobile Browser Detector (BOP5)

In the bottom of that plugin add the following.

At the bottom add lines such as:
if ($vbulletin->detect->isMobile())
$vbulletin->options['isMobile'] = 1;

Then in a template you can go in you header template and find this code.

<li class="welcomelink">{vb:rawphrase welcome_x_link_y, {vb:raw bbuserinfo.username}, {vb:link member, {vb:raw bbuserinfo}}}</li>And change it to this code.

<vb:if condition="$vboptions['isMobile']">
<li class="welcomelink">{vb:rawphrase welcome_x_link_y, {vb:raw bbuserinfo.username}, {vb:link member, {vb:raw bbuserinfo}}}</li>
</vb:if>

This is completely untested but in theory it should work.
Thanks for your idea. Do I add this:
if ($vbulletin->detect->isMobile())
$vbulletin->options['isMobile'] = 1;

At the very bottom (below the last } ) of bop5_mobile_detect.php?

Edit: Also, I don't see this code in the header or headerinclude default template:
<li class="welcomelink">{vb:rawphrase welcome_x_link_y, {vb:raw bbuserinfo.username}, {vb:link member, {vb:raw bbuserinfo}}}</li>


Thanks.

ozzy47
09-27-2013, 01:11 AM
When viewing your site, on a mobile device, are you viewing it with a regular style or a mobile style?

tbworld
09-27-2013, 01:30 AM
When viewing your site, on a mobile device, are you viewing it with a regular style or a mobile style?

And maybe a link to the site, would help. So we can see what you see.

pjkcards
10-21-2013, 08:54 AM
Ideally, I want mobile devices to default to the mobile style, but they still need to have the option to switch to the full browser. I did use useragent to switch the style, but then user complained that they couldn't view the full site on their phones.

How do most people deal with this?

Basically what I am trying to do atm is hide the guest welcome message (ie. notice) on mobile since it is a massive block that doesn't look well on mobile. Your instructions above seem close to what I need, but still wondering about my questions from post #4 above.

Thanks!

pjkcards
10-29-2013, 02:14 PM
Ideally, I want mobile devices to default to the mobile style, but they still need to have the option to switch to the full browser. I did use useragent to switch the style, but then user complained that they couldn't view the full site on their phones.

How do most people deal with this?

pjkcards
11-11-2013, 08:18 AM
Bump.

I'm considering getting the mobile suite. Does it work with 4.2.1?

Or alternatively, I'd like to have mobile users redirected to the mobile style, but still have the option to view desktop mode. Is this possible?

Thanks.