Page 1 of 1

Problem displaying PageRank plugin

Posted: Thu Sep 24, 2009 5:28 pm
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

Re: Problem displaying PageRank plugin

Posted: Thu Sep 24, 2009 6:58 pm
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

Re: Problem displaying PageRank plugin

Posted: Thu Sep 24, 2009 8:20 pm
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!