SimplePortal

Development => Feature Requests => Topic started by: SniffTheGlove on August 03, 2013, 08:25:40 AM

Title: Simple Portal Page - Auto create urls from keywords.
Post 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
Title: Re: Simple Portal Page - Auto create urls from keywords.
Post by: [SiNaN] on August 14, 2013, 11:53:53 AM
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) [Select]
elseif ($type == 'bbc')
echo parse_bbc($body);

Code: (Replace) [Select]
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);
}
SimplePortal 2.3.8 © 2008-2024, SimplePortal