News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

[FREE] Mobile-based code

Started by colby2152, November 23, 2014, 12:45:14 PM

Previous topic - Next topic

colby2152

I need to wrap some HTML so that it displays a different set of code if being viewed on a mobile device.  The main goal here is to not display 728x90 banner ads on mobile and replace those with smaller sizes.
ProFSL.com - Pro Fantasy Sports Leagues - Advanced fantasy sports leagues, contests, free chances at cash/prizes, and sports discussion.

Need a server? I am happy to advocate this hosting solution - hands on customer service and reliability is relieving!!!

margarett

You should be able to use this
http://custom.simplemachines.org/mods/index.php?mod=3349

Then check $context['device'] like stated in the MOD's description:
QuoteOnce instantiated the class is placed in $context['device'], so that other mods and themes can use the it in order to do change their behaviour depending on the device.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

colby2152

That's a bit different than what I am seeking.  That picks a different them whereas I am looking for PHP/HTML code that switches on the fly for a specific SMF page or block in SimplePortal.
ProFSL.com - Pro Fantasy Sports Leagues - Advanced fantasy sports leagues, contests, free chances at cash/prizes, and sports discussion.

Need a server? I am happy to advocate this hosting solution - hands on customer service and reliability is relieving!!!

margarett

I think it doesn't necessarily changes themes, although I never used it...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

colby2152

Quote from: margarett on November 25, 2014, 02:09:56 AM
I think it doesn't necessarily changes themes, although I never used it...

That is all it appears to do.
ProFSL.com - Pro Fantasy Sports Leagues - Advanced fantasy sports leagues, contests, free chances at cash/prizes, and sports discussion.

Need a server? I am happy to advocate this hosting solution - hands on customer service and reliability is relieving!!!

live627

I looked at the code.

CheckIsMobile() returns a bool. Its file will already be pre-loaded with everything else at all times.

colby2152

Quote from: live627 on November 28, 2014, 04:34:03 PM
I looked at the code.

CheckIsMobile() returns a bool. Its file will already be pre-loaded with everything else at all times.

What would a sample PHP/HTML code look like to switch a display of content?
ProFSL.com - Pro Fantasy Sports Leagues - Advanced fantasy sports leagues, contests, free chances at cash/prizes, and sports discussion.

Need a server? I am happy to advocate this hosting solution - hands on customer service and reliability is relieving!!!

Advertisement: