Fork me on GitHub

I need a custom coded page with postnuke stuff  Bottom

  • Ok I like to check my site statistics from my cell phone... mainly users online (guests and registered), how many votes the poll has, page views, and new registered users. it takes an eternity on my phone and it's hard to read. How could i go about making a page that says all of that? IE it would look like this:

    PV: 8192
    Guests: 4
    Registered: 2
    Poll: 42
    Member: xViDD12

    Like that... how could i do that?
  • You can create a custom .php in the root directory of your PN site, and insert the appropriate HTML & PHP using the pnAPI (or not) to fetch and output the data you need - I'll leave the coding to you, but here's an example of a script that fetches some data from the Web Links directory to form a importable email mailing list:

    Code

    <?php

    if ($_SERVER['QUERY_STRING'] != 'fiddlefaddle') {

       header('Location: index.php');
         exit;
    }

    ?><html><head><title></title>
    <style type="text/css">
    body, table, td, th {font-size: 11px;}
    </style>
    </head>
    <body>
    <?php

    include 'includes/pnAPI.php';
    pnInit();

    // Build email list of listings in Web Links:
    list($dbconn) = pnDBGetConn();    
    $pntable = pnDBGetTables();
    $linkscolumn = &$pntable['links_links_column'];

    $sql = "SELECT $linkscolumn[title], $linkscolumn[name], $linkscolumn[email] FROM $pntable[links_links]";
    $result = $dbconn->Execute($sql);

    echo "<pre>Business Name,Contact Name,Email\n";    
           
    while (list($name, $contact, $email) = $result->fields) {
           
        $result->MoveNext();
                   
        if (empty($email))
            continue;

        echo "$name,$contact,$email\n";
    }

    ?>
    </pre></body></html>


    Note, I put a query string check at the top in case the casual user came across a directory listing, so the script would be accessed @ mysite.com/scriptname?fiddlefaddle - otherwise you get directed to the home page.

    In the future, please post more specific topic subjects so that others may benefit from the exchange.

    --
    Get PhotoGallery, PayPalCart, Dynamenu, Enhanced Blocks & other mods

    Cape Cod Travel Info...

This list is based on users active over the last 60 minutes.