Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
Jamroom Help:
a function to prevent things from showing in mobile phone
boplive



Joined: 03 May 2006
Posts: 817

Posted: 06/11/13 11:46 
is there a function that can prevent certain things that will show on a computer, tablet but will not show in a mobile phone..since this is a smaller device and it seems that everything that shows is lining up on each other on the mobile phone..maybe its best to not show everything.

Back to top
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 06/11/13 16:54 
The CSS in the skins is supposed change its shape depending on what device its being looked at on.

But in answer to your question, yes. There are 2 functions in the core that check to see what type of device is looking at the page.

They are:
jrCore_is_mobile_device()

and:
jrCore_is_tablet_device()

They don't have any smarty wrappers to be used in the skins though.

You could try:

Code

{if jrCore_is_tablet_device()}
    this is a tablet
    {else}
    this is NOT a tablet
{/if}


Not sure if direct usage like that is permitted or not.....


_________________
Michael Ussher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
boplive



Joined: 03 May 2006
Posts: 817

Posted: 06/11/13 17:57 
i'll give a shot ..and will let you know if it works...thANKS

Back to top
SteveX
Ultrabubble


Joined: 30 Aug 2005
Posts: 8792
Location: Ultrabubble

Posted: 06/12/13 03:31 
You could also look into using CSS media queries:
https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries

In short, they allow you to alter what/how things are displayed.
So this will have a lot of padding on a large screen, a little padding if the screen is less than 800px wide, and will not be shown at all if the screen is less than 600px wide:

Code

.not-needed-on-mobile {
    padding: 30px;
 }

@media (max-width: 800px) {
  .not-needed-on-mobile {
    padding: 10px;
  }
}

@media (max-width: 600px) {
  .not-needed-on-mobile {
    display: none;
  }
}



_________________
Kulshi Mezian!

"Stranger from another planet, welcome to our hole. Just strap on your guitar and we'll play some rock and roll"

Ultrabubble create things.
Back to top
Brian
Jamroom Team


Joined: 09 Jul 2003
Posts: 37583
Location: Seattle, WA

Posted: 06/22/13 12:44 
Both jrCore_is_mobile_device() and jrCore_is_tablet_device() will work in smarty templates just like Michael has posted (it holds true for any PHP built in or user function that returns a Boolean value).

Hope this helps!

- Brian


_________________
Make sure and check out:
* The Jamroom FAQ
* The Jamroom Documentation
Back to top
boplive



Joined: 03 May 2006
Posts: 817

Posted: 08/29/13 17:39 
Thanx guys..I finally got to try this and it worked.... Wink

Much appreciated

Back to top
boplive



Joined: 03 May 2006
Posts: 817

Posted: 10/11/13 17:15 
going back to this function is there a way of making it
have all 3


{if jrCore_is_tablet_device()}
this is a tablet
{else}
this is NOT a tablet
{else}
Arrow this is computer
{/if}

Back to top
Douglas
Jamroom Team


Joined: 08 Oct 2004
Posts: 6639
Location: Tornado Alley!

Posted: 10/12/13 06:46 

boplive:
going back to this function is there a way of making it
have all 3


{if jrCore_is_tablet_device()}
this is a tablet
{else}
this is NOT a tablet
{else}
Arrow this is computer
{/if}




Code
{if jrCore_is_mobile_device()}
this is a mobile device
{elseif jrCore_is_tablet_device()}
this is a tablet
{else}
this is a pc
{/if}


Hope this helps Smile


_________________
Douglas Hackney
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
Jamroom Help

 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.