Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Definition Application

  • 22-07-2006 6:18pm
    #1
    Registered Users, Registered Users 2 Posts: 3,514 ✭✭✭


    I'm looking for a PHP/MySQL based script that can crawl thru a database and attach IDs to keywords, these IDs then link to a definition of that keyword. When a user then views content that is contained within the database the keyword appears as a link which when clicked pulls the definition from the db and displays it as a pop-up.

    Any ideas on where to find something like this or even if it is available?

    If you're lost and don't have a clue what i'm on about then take a look at http://www.phpit.net/ and notice the double underlined keywords. This is an advertising model of the same system i'm looking for.


Comments

  • Registered Users, Registered Users 2 Posts: 9,579 ✭✭✭Webmonkey


    I take it that this is done after the information is retrieved from the database so the database isn't effected.
    I'm sure you could have an array of keywords and corresponding definitions and use this array in a loop through the content you get from the database and use the eregi_replace functions to replace the words.

    Maybe something like this:
    [php]

    function insertkeywords($text, $keywords)
    {

    foreach ($keywords as $key => $value)
    {
    $text = eregi_replace($value,$key,$text);
    }

    return $text;
    }

    //Keywords array with definitions:
    $keywordset1 = array();
    $keywordset1 = "keyword1"."<html stuff for description hover>";
    $keywordset1 = "keyword2"."<html stuff for description hover>";
    $keywordset1 = "keyword3"."<html stuff for description hover>";
    $keywordset1 = "keyword4"."<html stuff for description hover>";
    $keywordset1 = "keyword5"."<html stuff for description hover>";


    //example of usage:

    $result = "hello thsi is random text from database";
    $result = insertkeywords($result,$keywordset1);
    [/php]

    I do'nt know if this is what you looking for, but something similer like this mightn't be that bad if it is a simple script you running there.

    *havn't tested this (couldn't be arsed!) so might be problems


Advertisement