• 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: https://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: https://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)
Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Pageviews Plugin’ is closed to new replies.