Development > Feature Requests

Simple Portal Page - Auto create urls from keywords.

(1/1)

SniffTheGlove:
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

[SiNaN]:
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


--- Code: (Find) --- elseif ($type == 'bbc')
echo parse_bbc($body);
--- End code ---


--- Code: (Replace) --- 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);
}
--- End code ---

Navigation

[0] Message Index

Go to full version