/* * gCards - a web-based eCard application * Copyright (C) 2003 Greg Neustaetter * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ session_start(); include_once('inc/adodb/adodb.inc.php'); include_once('config.php'); include_once('inc/UIfunctions.php'); include_once('inc/pager.php'); $row = (isset($_GET['row'])) ? (int)$_GET['row'] : 0; $catSearch = (isset($_GET['catSearch'])) ? (int)$_GET['catSearch'] : false; deleteFromSession('to_email, cardtext, music'); if (isset($_GET['reply'])) $_SESSION['reply'] = $_GET['reply']; $page = new pagebuilder; include_once('inc/setLang.php'); $page->langargs = "&row=$row&catSearch=$catSearch"; $page->showHeader(); $limit = $rowsPerPage * $cardsPerRow; $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC; $conn = &ADONewConnection('mysql'); if (!$conn->Connect($dbhost,$dbuser,$dbpass,$dbdatabase)) { echo "Error: Could not connect to database"; $page->showFooter(); exit; } if ($deleteDays != 0) { $deletePriorTime = time() - ($deleteDays * 24 * 60 * 60); $deleteCardsSQL = 'DELETE FROM '.$tablePrefix.'sentcards WHERE cardid<'.$deletePriorTime; $conn->Execute($deleteCardsSQL); } if ($stats_unique_index_hits_enabled == true) { if (!isset($_SESSION['stat_userhits'])) { $sql = "UPDATE ".$tablePrefix."statistics set statval=(statval +1) WHERE stat='userhits'"; $conn->Execute($sql); unset($sql); $_SESSION['stat_userhits'] = true; } } $rowsInTableSQL = "SELECT COUNT(*) from ".$tablePrefix."cardinfo"; if ($catSearch) $rowsInTableSQL .= " where catid = '$catSearch'"; if ($orderPop == 'yes') $orderArg = "senttimes DESC,"; else $orderArg = " "; $sqlstmt = 'select * from '.$tablePrefix.'cardinfo'; $sqlstmt .= ($catSearch) ? " where catid = '$catSearch' order by $orderArg imageid $order" : " order by $orderArg imageid $order"; $pager = new pager($conn, $row, $limit, $rowsInTableSQL); $recordSet = $pager->getrecords($conn, $sqlstmt); if (!$recordSet) print $conn->ErrorMsg(); ?>