Hi Jan,
I owe you a feedback, I must have tried many times before to post the content below, but every time forum crashed. Lets hope this time it works this time. Anyway here is the feedback.
Thanks for your module and having patience with me. It seems to work now I can't tell you why. I was testing here http://alturl.com/jezySeven
But I have some improvement to suggest you.
1. There should be a counter field in database to count number of times the same keyword/phrase is searched, instead of writing every search into database.
for example:
Code:
if ($keyword != false) {
//check if the keyword is in DB allready
$objKeyword = $this->Database->prepare("SELECT id,times FROM tl_searchEngineBox WHERE keyword=? AND searchengine=?")
->limit(1)
->execute($keyword, $searchengine);
if (!$objKeyword->numRows)
{
// Save Entries in DB if its not there in keyword
$this->Database->execute('INSERT INTO tl_searchEngineBox (tstamp, searchengine, keyword) VALUES ('.time().',"'.$searchengine.'","'.$keyword.'")');
} else {
$this->Database->prepare('UPDATE tl_searchEngineBox SET times=? WHERE keyword=?')->execute($objKeyword->times + 1, $keyword);
}
where 'times' in above code is a field in DB
Code:
`times` int(10) unsigned NOT NULL default '1',
May be you can improve it.
Regards
Tenzin
Bookmarks