Location: PHPKode > scripts > BOOKS module for PostNuke > books-module-for-postnuke/modules/Books/visit.php
<?php // $Id: visit.php,v 1.3 2002/01/28 16:38:26 micha Exp $
// ----------------------------------------------------------------------
// BOOKS module
// Copyright (C) 2001, 2002 by IB Rahn, http://www.ib-rahn.de
// Written by Michael Schatz, hide@address.com
// get the newest version at http://www.bauphysik.com
// ----------------------------------------------------------------------
// POST-NUKE Content Management System
// Copyright (C) 2001 by the Post-Nuke Development Team.
// http://www.postnuke.com/
// ----------------------------------------------------------------------

if (!eregi("modules.php", $PHP_SELF)) { die ("You can't access this file directly..."); }
if (!isset($mainfile)) { include("mainfile.php"); }

$ModName = basename( dirname( __FILE__ ) );
$modset = modules_settings_enh($ModName);
 
include("$modset[basepath]/config.php");
include("$modset[basepath]/functions.php");

/*--------------------------------------------------------------------------
 * function  visit
 *--------------------------------------------------------------------------
 * purpose   go to given url of $abkid
 * input     $bkid    :  a book id
 *           $orderid : a order id, 1 if none is given
 * output    -
 * changes   2001-09-21 [MS] user order1, ..2, ..3
 *--------------------------------------------------------------------------*/
function visit($abkid, $orderid = 1) {
    global $pntable, $modset;
    mysql_query("update $pntable[books_books] set hits=hits+1 where bkid=$abkid");
    $result = mysql_query("select order$orderid from $pntable[books_books] where bkid=$abkid");
    list($url) = mysql_fetch_row($result);
    Header("Location: $url");
}

/************************************************************************/
/*  Main initialization                                                 */
/************************************************************************/
visit($bkid, $orderid);
?>
Return current item: BOOKS module for PostNuke