SimplePortal
Development => Feature Requests => Topic started by: SniffTheGlove on August 03, 2013, 08:25:40 AM
-
Let me explain a bit better than what the subject line is..
In Simple Portal you can create PAGES, these can be BBC/HTML/PHP
Create an extra Admin section in SimplePortal. There will be a Keyword(s) entry and a URL entry text boxes where you can add,modify or delete the entries.
EG
Keywords URL
Sandpiper www.domain.com/sandpioer.htm
Profit www.domain.com/profit.htm
Manchester United www.domain.com/
Mickey Mouse www.domain.com/index.php?mickey_mouse
Is it possible say in the BBC mode that when the page is rendered, Simple Portal looks the above table in the Database and where it finds a keyword in the PAGE it creates a clickable URL using the URL and the keyword(s)
Thank you
-
I'm not sure in what kind of a situation this might be useful. So it probably won't make it into SimplePortal. I think it sounds more like a modification to SMF BBC parsing system.
I can't really code a full-fledged management panel for this but a simple solution would be having a static array and using that to replace the keywords while parsing the page. Something like the following:
Sources/Subs-Portal.php
elseif ($type == 'bbc')
echo parse_bbc($body);
elseif ($type == 'bbc')
{
$keywords = array(
'Cool Keyword' => '<a href="http://link.to/cool/keyword">Cool Keyword</a>',
'Another One' => '<a href="http://link.to/another/one">Another One</a>',
'Last Keyword' => '<a href="http://link.to/last/keyword">Last Keyword</a>',
);
echo strtr(parse_bbc($body), $keywords);
}