SimplePortal
Support => English Support => Topic started by: hebron on August 05, 2014, 10:41:19 AM
-
Is there any way I can show a SimplePortal page inside a block? I have an about page that I would like to show as a block for guest users. Can I include the page text in the block somehow? So that I don't have to update two places?
-
hebron,
You can use this as your Custom PHP block code:
$page_ID = 'mysample';
global $smcFunc;
$page = array('', '');
$request = $smcFunc['db_query']('', '
SELECT body, type
FROM {db_prefix}sp_pages
WHERE namespace = {string:page_name}
LIMIT {int:limit}',
array(
'page_name' => $page_ID,
'limit' => 1,
)
);
$page = $smcFunc['db_fetch_row']($request);
$smcFunc['db_free_result']($request);
if (!empty($page))
sportal_parse_page($page[0], $page[1]);
else
echo 'Page load has failed.';
Just change mysample from the top of the code to the page ID that you are attempting to display.
Regards.
-
Perfect, works like a charm. Thanks :D