SimplePortal

Support => English Support => Topic started by: Dzonny on July 01, 2015, 07:33:24 AM

Title: How to remove blocks from custom php page?
Post by: Dzonny on July 01, 2015, 07:33:24 AM
I made a custom php page, with a simple code provided below:
Code: [Select]
<?php require("/home1/freelbg9/public_html/SSI.php"); 
$context['page_title_html_safe'] = 'Help Page';
template_header(); 
echo
'


It\'s our intention to provide you with correct answers to all your questions as fast as possible. To do so we\'ve set up a 2 step system. Just go with the flow from step to step to get your answers. We\'ve also included two additional options of getting help with your Freelancers Forum.<br />

<strong>Step 1: Do a forum search</strong>
<p>If you have a question you think is related to any of the topics, try a search of our community forums. The powerful search engine of Freelancers Forum will search for topics that could contain a solution to your problem.</p>

<strong>Step 2: Ask our community</strong>
<p>
If you\'ve gone through steps 1 and haven\'t found any answers to your question. Try asking it at our community. A member of our support team, or another member like yourself may know the answer you\'re looking for.</p>

<strong>Support Helpers of the Month</strong>

<p>Every month we reward a few members with the support helper of the month badge and/or a paid moderator position in recognition of their contributions. Many of these members later go on to join our support team.</p>'
;

template_footer(); ?>


URL: http://freelancersforum.org/helppage.php
I need SP blocks to be hidden from this page. I can't hide it from admin panel, as this is not an "action" page, so I'm not sure where to go from here..
Note that I need to use clean php file for this page as I'll have more customizations that I'm gonna do, so It's easier this way.
Any help would be appreciated.
Title: Re: How to remove blocks from custom php page?
Post by: ♦ Ninja ZX-10RR ♦ on July 01, 2015, 08:53:12 AM
Hi Dzonny!

I'd reply with a counter-question. Why not putting that php code into a SimplePortal page? From the way you worded it it sounds like a completely external page.
If you place the code into a custom SP page then it's very easy to go here "action=admin;area=portalpages;sa=edit;page_id=X" and just deselect all blocks from the "Blocks" menu :)

Regards
Title: Re: How to remove blocks from custom php page?
Post by: [SiNaN] on July 01, 2015, 10:08:43 AM
There are tons of different ways you can do this but for a quick, clean and simple one, the following change in the page code you pasted above should do it:

Code: (Find) [Select]
template_header();
Code: (Replace) [Select]
$context['template_layers'] = array_diff($context['template_layers'], array('portal'));
template_header();
Title: Re: How to remove blocks from custom php page?
Post by: Dzonny on July 01, 2015, 12:20:04 PM
Thanks Sinan, will try that out!
SimplePortal 2.3.8 © 2008-2024, SimplePortal