1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

how to replace words and put my <A href tag??

Discussion in 'Blogging' started by nahid5692001, Mar 24, 2010.

  1. nahid5692001

    nahid5692001 Regular Member

    Joined:
    Aug 30, 2009
    Messages:
    357
    Likes Received:
    117
    Hello,

    Is there anyway to do this? search all posts and replace a word with whatever i want?

    anyway to do this automatically?

    Thanks
     
  2. russaus

    russaus Junior Member

    Joined:
    Mar 5, 2010
    Messages:
    164
    Likes Received:
    17
    Occupation:
    software engineer
    Location:
    /dev/null & canada
    link a dink does this

    there is another but im tired... i can up a copy of it, since this site is linking to dax herrera's site which is down.

    xxhttp://www.iamjacksdesign.com/blog/wordpress-plugin-of-the-week-link-a-dink/

    ahh there is also this:

    xxhttp://coffee2code.com/wp-plugins/text-replace - its up to date, check it out, i use it :)

    HTH.
     
  3. BlackMelvyn

    BlackMelvyn Regular Member

    Joined:
    Jul 8, 2008
    Messages:
    202
    Likes Received:
    272
    Home Page:
    If you are using WP, you could try maxblogpress ninja affiliate and use non affiliate links as well.

    If it is a custom script it's still quite easy to do if you have a simple text structure (eg not too many pictures with keywords in the uri or the title).
    PHP:
    <?php
    $list 
    = array(
        
    'keyword' => 'http://www.url-1.tld/',
        
    'other keyword' => 'http://url-2.tld/'
        
    // etc...
    );        

    foreach(
    $list as $key => $value){
        
    $search '/([ |,|;|\.|\'])('.$key.')([ |,|;|\.])/i';
        
    $replace '$1<a href="'.$value.'">$2</a>$3\\1';
        
    $content preg_replace($search$replace$content1);
    }
    ?>
     
  4. nahid5692001

    nahid5692001 Regular Member

    Joined:
    Aug 30, 2009
    Messages:
    357
    Likes Received:
    117
    i used text replace its really good. Thanks to everyone.

    I have another question. Im using SEO WordSpinner to spin my articles., i know it sucks but i have a reason to use it. So i am trying to spin my title posts but the issue is my external scripts sends in the Title with the {{ }} in there and the URL is having issues, ie

    Title is {{hi|hello|sdsds}}

    Url becomes domain.com/hi-hello-sdsds

    I know why this happens but is there any way to stop that?
    Thanks
     
  5. russaus

    russaus Junior Member

    Joined:
    Mar 5, 2010
    Messages:
    164
    Likes Received:
    17
    Occupation:
    software engineer
    Location:
    /dev/null & canada
    You're welcome, it's good. I love it too.

    RNG? Don't know if you can stop it in the plugin, perhaps rewrite it so it checks original string and does a "while != XXX"? Pretty easy.