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

Manage The Blog Roll Links on Multiple Wordpress Sites-Blog Networking

Discussion in 'PHP & Perl' started by SEODEMON, Mar 15, 2014.

  1. SEODEMON

    SEODEMON Regular Member

    Joined:
    Sep 15, 2010
    Messages:
    220
    Likes Received:
    64
    Running Multiple Wordpress blogs can be a pain. I wanted a way to control Blog roll links in the widget area on each blog. If you have a ton of blogs it can be a pain to log into each one and change the links vs getting it from one file. It's also helpful to spin the anchors because of Google penalties.

    Sometimes you have to go into the PHP.ini and change file get contents like I had to do with IPage hosting.


    Example:
    allow_url=off change to allow_url=on


    First put all of your links with spintax anchors in a txt file called Data.txt. Upload it to any domain.

    Example:



    <a href="hXXp://www.yoursite.com">{anchor1|anchor2|anchor3}</a><br/>

    <a href="hXXp://www.yoursite2.com">{anchor1|anchor2|anchor3}</a><br/>


    Next:

    Download this:
    Code:
    [URL="http://wordpress.org/plugins/php-code-widget/ [\code"][COLOR=#f0fff0][FONT=Calibri]http://wordpress.org/plugins/php-code-widget/     [/FONT][/COLOR][/URL]


    Then enable the plugin and place the widget PHPcode in your page.

    Paste this script in the widget:


    <?php

    function spin($s){
    preg_match('#\{(.+?)\}#is',$s,$m);
    if(empty($m)) return $s;

    $t = $m[1];

    if(strpos($t,'{')!==false){
    $t = substr($t, strrpos($t,'{') + 1);
    }

    $parts = explode("|", $t);
    $s = preg_replace("+\{".preg_quote($t)."\}+is", $parts[array_rand($parts)], $s, 1);

    return spin($s);
    }
    $file = "hXXp://www.yourdomain.com/Data.txt";
    $f = fopen($file, "r");
    while ( $line = fgets($f, 1000) ) {
    echo spin($line);
    }
    ?>

    Change yourdomain.com to the location of the Data.txt

    This also works on Drupal. You must change settings.

    Code:
    [URL]https://drupal.org/node/1046700[/URL]
    This only takes a few minutes and now to update or change blogroll links takes only a few seconds. This is very useful if you have 25-100 wordpress blogs.
    Also I'm using a free plugin to manage all the blogs from one interface. You can edit comments, posts, etc...
     
    Last edited: Mar 15, 2014