Problem displaying PageRank plugin

Creating and modifying plugins.
Post Reply
3nd3r
Regular
Posts: 71
Joined: Tue Aug 19, 2008 12:58 pm
Location: NeoMadrid, Spain
Contact:

Problem displaying PageRank plugin

Post by 3nd3r »

Hello there!

Well, I've got Google PageRank plugin installed and I've made a little modification on serendipity_plugin_pagerank.php, just turned this:

Code: Select all

    function generate_content(&$title)
    {
        global $serendipity;

        $title = $this->title;

        print '<ul>';

        // PR for the current page
        if ($this->get_config('this_page') == 'yes') {
            $page = $_SERVER['SERVER_NAME'] .  $_SERVER['REQUEST_URI'];
            print '<li>' . PLUGIN_PAGERANK_THIS_PAGE_CAPTION . ': ';
            print '<span class="PageRank">' . $this->getrank($page) . '</span></li>';
        }

        // Warning: loop starts at 1
        for ($i = 1, $n = $this->get_config('page_count'); $i <= $n; ++$i) {
            $caption = $this->get_config('capt' . $i);
            $page = $this->get_config('page' . $i);
            print '<li>' . $caption . ': ';
            print '<span class="PageRank">' . $this->getrank($page) . '</span></li>';
        }
        print '</ul>';
    }
Into this, to remove the 'list' tag:

Code: Select all

    function generate_content(&$title)
    {
        global $serendipity;

        $title = $this->title;

        print '';

        // PR for the current page
        if ($this->get_config('this_page') == 'yes') {
            $page = $_SERVER['SERVER_NAME'] .  $_SERVER['REQUEST_URI'];
            print '' . PLUGIN_PAGERANK_THIS_PAGE_CAPTION . ': ';
            print '<span class="PageRank">' . $this->getrank($page) . '</span>';
        }

        // Warning: loop starts at 1
        for ($i = 1, $n = $this->get_config('page_count'); $i <= $n; ++$i) {
            $caption = $this->get_config('capt' . $i);
            $page = $this->get_config('page' . $i);
            print '<br>' . $caption . ': ';
            print '<span class="PageRank">' . $this->getrank($page) . '</span>';
        }
        print '';
    }
But, even if I use one or another, I get this output (as you can see at the bottom of the right sidebar of my site in http://www.pajareo.com:

Code: Select all

Google PageRank
De esta página: 1ex}div.nav A {font-size
De pajareo.com: 1ex}div.nav A {font-size
I've tried to locate the mistake in styles.css or translucency's transblue.css, but I have no success... I can't find that class="PageRank" piece of code to see what's happening...

Any ideas?

Thanks in advance for your time
Try not. Do, or do not. There is no try.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Problem displaying PageRank plugin

Post by garvinhicking »

Hi!

It seems google has changed their API, and the plugin no longer is able to fetfch your pagerank.

I'm sorry, I believe it might no longer be possible to deduce the pagerank like the plugin currently does. If someone can point me to a way to get a page's pagerank with a HTTP/Webserver API call, I can try to update the plugin.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
3nd3r
Regular
Posts: 71
Joined: Tue Aug 19, 2008 12:58 pm
Location: NeoMadrid, Spain
Contact:

Re: Problem displaying PageRank plugin

Post by 3nd3r »

Ok, I'll disable the plugin meanwhile.

And maybe it would be a good idea to remove it from available plugins in spartacus...

I'll try to look for that API too.

Thank you very much, anyway!
Try not. Do, or do not. There is no try.
Post Reply