SimplePortal

Support => English Support => Topic started by: xpress on June 03, 2015, 06:22:46 AM

Title: Need Solution to the Portal Block Showing Database Error.
Post by: xpress on June 03, 2015, 06:22:46 AM
Am trying to disable some html code in showing on mobile. I only want it to display on computer.

So I trying using this code
Code: [Select]
global $browser;
if ($browser == 'mobile')
{} else { include('file.php'); }

But it show me Database error, in my custom .php portal I created.
Title: Re: Need Solution to the Portal Block Showing Database Error.
Post by: ♦ Ninja ZX-10RR ♦ on June 03, 2015, 07:22:14 AM
What is that "html code"? A block maybe? Because if so, I could give you a much easier solution ;)
Title: Re: Need Solution to the Portal Block Showing Database Error.
Post by: xpress on June 03, 2015, 08:25:27 AM
The html code is full of Jquery image slider.
Title: Re: Need Solution to the Portal Block Showing Database Error.
Post by: ♦ Ninja ZX-10RR ♦ on June 03, 2015, 09:21:51 AM
I think we misunderstood there. I didn't mean to ask what is that html code, I meant where did you place it, template or block? Because it would be very easy to hide a block on mobiles, but not so easy to hide a code snippet which is declared in the template files.
Title: Re: Need Solution to the Portal Block Showing Database Error.
Post by: xpress on June 03, 2015, 10:02:29 AM
I create a file.php in my ftp. So I went to create a custom PHP in my block. And I include the File.php into the block custom I created. Like this

global $browser;
if ($browser == 'mobile')
{} else { include('file.php'); }


Title: Re: Need Solution to the Portal Block Showing Database Error.
Post by: ♦ Ninja ZX-10RR ♦ on June 03, 2015, 10:41:37 AM
Please kindly answer the question I asked, that is not what I asked once again...
Title: Re: Need Solution to the Portal Block Showing Database Error.
Post by: xpress on June 03, 2015, 11:05:59 AM
I placed it in block
Title: Re: Need Solution to the Portal Block Showing Database Error.
Post by: ♦ Ninja ZX-10RR ♦ on June 03, 2015, 11:11:03 AM
If your html code is placed in a block, this topic should help you to achieve your goal: http://simpleportal.net/index.php?topic=13954.msg69182#msg69182
Instead of showing for mobiles, do the opposite ;)
Title: Re: Need Solution to the Portal Block Showing Database Error.
Post by: xpress on June 04, 2015, 01:29:09 AM
Ok thankx! In my simple portal. Am using the "Board news" so if I make a post with (http://IMG LINK)

The image will be too large on my screen. Is there anyway I can reduce the image to default 400px width and 200px height! ???
Title: Re: Need Solution to the Portal Block Showing Database Error.
Post by: ♦ Ninja ZX-10RR ♦ on June 04, 2015, 05:20:19 AM
That's another issue entirely but it's an easy fix.
This can help: http://simpleportal.net/index.php?topic=13732.0

Basically, you'd need to add something like:
Code: [Select]
#sp_block_ID img
{
max-width: X;
max-height: Y;
}
at the bottom of your portal.css and it will be done after hard refreshing the page (ctrl+f5), because css changes can be visible only after flushing the cache.
You will also need to replace "ID" with your block ID, there are 2 ways to find out that ID.
1) inspect it with your browser, for example the "Recent posts" here on simpleporta.net on the left is #sp_block_38, with 38 being the ID ;)
2) Just look at the URL in your browser while editing it in administration, it should contain something like id=X
Either way you choose find the block ID and replace the "ID" in my code, then also replace the width and height to the maximum you want it to allow.

This should do what you wanted, regards. :)
SimplePortal 2.3.8 © 2008-2024, SimplePortal