1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Script to auto link certain words in your content?

Discussion in 'Programming' started by Yukio, Sep 16, 2008.

  1. #1
    Hi guys,

    I've been searching for this script for a while now but I'm having difficulty finding it - I think I might be using the wrong search terms.

    Does anyone know of a script that will let you:

    1. Specify which words you want to be auto linked; and
    2. Specify where you want the word to link to?

    Basically in a page of content, let's say I want every instance of the word "coffee" to link to an in-site page about coffee for example and for this to happen every time the word coffee appears without me needing to make the links manually myself.

    Any help mucho appreciated. :)
     
    Yukio, Sep 16, 2008 IP
  2. Yukio

    Yukio Peon

    Messages:
    137
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Anyone? :confused: :)
     
    Yukio, Sep 17, 2008 IP
  3. txenet

    txenet Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hello,

    it's easy to do this kind of script, but you don't say in which language do you want it...

    I've a fool example in php that maybe should you help.
    Let's suposse we have a web "index.html" that contains some text, and we want to parse the info in index.html to replace the word "coffee" with an hyperlink to "coffee.html".

    
    <HTML>
    <BODY>
    The coffee is a caffeine-based drink. Usually people
    drinks coffee early in morning.
    </BODY>
    </HTML>
    
    HTML:
    Now the php code we can run ...
    
    <?
    $link = '<a href="coffe.html">coffee</a>';
    
    $file = fopen("index.html","r");
    $content = fread($file, filesize("index.html"));
    
    $new_text = str_replace("coffee",$link,$content);
    
    echo $new_text;
    
    ?>
    
    PHP:
    I should apologise because i'm now at work and here i don't have a web server, so i've code it with the interactive interpreter :(.

    If you run it you should see all the text stream form index.html with the word coffee pointing to coffee.html.

    I don't know if this will be helpful to you, because you don't say in which language do you want .. if you want to be run in server with text files or maybe you want to execute against a database ....

    Say me what's your situation i'll could give you more help ..:), but remember that i'm now at work (here in Spain is 10:40 am) and maybe i could not answer you until this night ...

    Greetings

    PD: sorry if something is not quite clear, english is not my mother language ...
     
    txenet, Sep 18, 2008 IP
  4. Yukio

    Yukio Peon

    Messages:
    137
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You speak Spanish?

    Hola weon! Como estas? :)

    I don't mind actually what script I use, but maybe php is best? I'm looking for something with an easy interface so I can access through my browser and set what words and what URL they will link to as there will be many words that I will want auto linked.

    Was hoping there would already be a pre-made script hmmm - surely I can't be the first person who also wanted this?
     
    Yukio, Sep 18, 2008 IP
  5. kisae

    kisae Peon

    Messages:
    66
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I am also looking for something like this, pls let me know if you found something. Thanks.
     
    kisae, Sep 25, 2008 IP
  6. nirajkum

    nirajkum Active Member

    Messages:
    815
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    58
    #6
    I also want same kind of script .... if you have found it please let me know ....
     
    nirajkum, Sep 26, 2008 IP
  7. Yukio

    Yukio Peon

    Messages:
    137
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Hiya guys, just a quick update. I've searched far and wide for a script such as this but no one seems to have found one. =\

    Does anyone else have any updates on this?
     
    Yukio, Oct 25, 2008 IP