Support » Fixing WordPress » Pageviews Plugin

  • jmschot

    (@jmschot)


    Hi, i’m writing my own pageviews plugin, but i’ve got a problem. It all works, except one part, the part where it displays on the index page how many views there have been. I’m posting the code which is going wrong:

    <?php
    /*
    Plugin Name: PPP (Pageviews Per Post)
    Plugin URI: http://schot.xs4all.nl/index.php?p=4
    Description: Pageview counter for posts, automatic. My site is online, when i'm online ;)
    Version: .01b
    Author: jmschot
    Author URI: http://schot.xs4all.nl
    */
    function views() {
    $count_id = $_GET['p'];
    if ($count_id == NULL) {
    global $id;
    $result = mysql_query("
    select *
    from wp_count
    where count_id='".$id."'");
    $r=mysql_fetch_array($result);
    echo $r[count];
    return;
    }
    ... here follows the code where it displays the views at the post itself, like index.php?p=3, which does work ...

    Does anybody see what i’m doing wrong?

Viewing 9 replies - 1 through 9 (of 9 total)
  • jmschot

    (@jmschot)

    found the problem, i used the wrong row name … argh

    MaxT

    (@maxt)

    Pageview counter for posts… O.O
    I’m sorry, but what’s the reason to make your own plugin? Isn’t official feature provided by WP is good enough? Just wondering.

    Ozh

    (@ozh)

    only in alpha if I’m correct, that’s probably why

    MaxT

    (@maxt)

    Ah, I see…

    Sushubh

    (@sushubh)

    WP dont have a page view counter :O)
    there is a hack… by laughing lizard

    jmschot

    (@jmschot)

    Well, that just sucks. 😉
    It ready anyway and can be found here: http://wordpress.org/support/10/4937

    MaxT

    (@maxt)

    Now I understood why I didn’t understood meaning of this one from the first time… I have it allready on my site 😮

    jmschot

    (@jmschot)

    I reallt don’t understand what you’re saying there… you now understood why you understood the meaning of this one … which one?

    MaxT

    (@maxt)

    of this thread…

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.