SimplePortal

Customization => Themes and Graphics => Topic started by: 420connect on July 06, 2015, 01:49:31 PM

Title: Is this possible with SP?
Post by: 420connect on July 06, 2015, 01:49:31 PM
I've recently updated my theme to become mobile friendly and whilst viewing the forum on a mobile-device, I have chosen to hide my side column completely.

My issue is, the side column contained a banner I *need* to have on show, so am having a new horizontal banner made up..

My question is could anyone help with some code that would only enable a block (the new horizontal banner) when it is being viewed by a mobile device?

basically a sort of PHP version of:
 IF (side column) = hidden THEN show (horizontal banner) instead..

 :thumbsup:

A million thanks to anyone who's able to help! :)
Title: Re: Is this possible with SP?
Post by: ♦ Ninja ZX-10RR ♦ on July 06, 2015, 02:06:19 PM
This should help: http://simpleportal.net/index.php?topic=13964 :)
Title: Re: Is this possible with SP?
Post by: Burke Knight on July 06, 2015, 08:07:15 PM
More specifically, this post:

http://simpleportal.net/index.php?topic=13964.msg69287#msg69287
Title: Re: Is this possible with SP?
Post by: 420connect on July 07, 2015, 06:29:28 AM
Forgive me if I've missed something, but this is what I've already achieved myself.. (hiding the side column on mobile devices)

I'm looking for a way to detect that the side columns are hidden, then activate a new 'top/header' block..   :P
Title: Re: Is this possible with SP?
Post by: ♦ Ninja ZX-10RR ♦ on July 07, 2015, 07:31:40 PM
And... Do exactly the opposite with that block? That's the same thing reversed.
Title: Re: Is this possible with SP?
Post by: 420connect on July 08, 2015, 01:21:06 PM
I think I "see" what I wasn't before :P  :applause:

although how I'm trying to do it, doesn't seem to be working..

I've got

Code: [Select]
@media only screen and (max-width: 750px), only screen and (min-resolution: 300dpi) {

#sp_right {
display: none;
}
       #sp_header, sp_footer {
display: block;
width: auto !important;
padding: 0;
}

and further up the page where #sp_header, sp_footer is mentioned I had:

Code: [Select]
#sp_header, #sp_footer
{
        display: none;
}

I'm trying to have the header and footer blocks, hidden on big screens but shown on small and the side block, in reverse..  :-[

Appreciated if you can put me right!
Title: Re: Is this possible with SP?
Post by: ♦ Ninja ZX-10RR ♦ on July 08, 2015, 01:55:31 PM
Hmm, odd. URL maybe? :)
Title: Re: Is this possible with SP?
Post by: 420connect on July 08, 2015, 02:09:07 PM
420Connect.co.uk ~ Thanks for having a look! :)

My Portal.css ~ http://pastebin.com/q8aDqtie

just to add, I've just noticed my shoutbox has gone strange looking..

would my edits have caused this? o.O

(http://snag.gy/bfKRQ.jpg)
Title: Re: Is this possible with SP?
Post by: ♦ Ninja ZX-10RR ♦ on July 08, 2015, 02:19:54 PM
Not sure what it's wrong... It works here. Did you flush your forum & browser cache? :P
Title: Re: Is this possible with SP?
Post by: 420connect on July 08, 2015, 02:35:00 PM
Ahh, it was just a delay in the css updating..
My apologies!  :P

.. I'm trying the same idea to change from on a big screen: 2 ads next to each other
and on small screen: one ad shows.

I've got one set in the 'bottom' blocks and one set in the 'footer' blocks but, it looks as if "sp_bottom" doesn't exist? o.O
Title: Re: Is this possible with SP?
Post by: ♦ Ninja ZX-10RR ♦ on July 08, 2015, 02:52:55 PM
Ahh, it was just a delay in the css updating..
My apologies!  :P
I figured, np ;D

.. I'm trying the same idea to change from on a big screen: 2 ads next to each other
and on small screen: one ad shows.

I've got one set in the 'bottom' blocks and one set in the 'footer' blocks but, it looks as if "sp_bottom" doesn't exist? o.O
Yup, they are sp_footer, not sp_bottom. I'd suggest to use the block ID to create the selector, it's the best way that will never cause issues with other elements.
For example, to indicate your ads block (desktop version) I'd use this:
Code: [Select]
td#sp_center div#sp_block_75
{
css properties
}
EDIT: fixed the typo
Title: Re: Is this possible with SP?
Post by: 420connect on July 08, 2015, 03:06:49 PM
Just to be sure I've got this right: (and whilst waiting it to update)

Code: [Select]
@media only screen and (max-width: 750px), only screen and (min-resolution: 300dpi) {

#sp_right {
display: none;
}
#sp_header, #sp_footer {
display: block;
width: auto !important;
padding: 0;
}
div#sp_center div#sp_block_75 {

display: none;
}

}
Title: Re: Is this possible with SP?
Post by: ♦ Ninja ZX-10RR ♦ on July 08, 2015, 03:27:21 PM
Typo on my part, sorry. It's td#sp_center instead of div#sp_center. Too much beer I guess, ahah ;D
Besides, if you want to update and see the changes immediately, usually a ctrl+f5 works ;)
Title: Re: Is this possible with SP?
Post by: 420connect on July 08, 2015, 03:40:57 PM
Woo hoo!  8)

Thanks again for saving the day with your ninja magic! :)  :applause:  :thumbsup:
Title: Re: Is this possible with SP?
Post by: ♦ Ninja ZX-10RR ♦ on July 08, 2015, 05:04:43 PM
^_^ glad to be helpful! You can mark the topic as solved, however, I'd suggest to edit the code a little, at least the one you use for the ads block, since it shows 2 ads as if they were a list, and the bottom one is 1px more on the right. This is probably due to the code you used, I bet you did a   between the 2 ads, which could cause such slightly broken layout in these cases.
SimplePortal 2.3.8 © 2008-2024, SimplePortal