<?php SmartyPaginate::connect(); // set items per page SmartyPaginate::setLimit(5); #set url for links SmartyPaginate::setUrl('./index.php?path=./main/news/tm0.news.display_news.php'); SmartyPaginate::setPrevText('PREV'); SmartyPaginate::setNextText('NEXT'); function getSearchResults(&$dbcon) { $X = SmartyPaginate::getCurrentIndex(); $Y = SmartyPaginate::getLimit(); $searchSQL = "SELECT * FROM sionapros_news WHERE 1 ORDER BY news_no DESC LIMIT {$X},{$Y}"; $result = $dbcon->execute($searchSQL); foreach ($result as $row) { // collect each record into $_data $data[] = $row; } // now we get the total number of records from the table $rowsSQL = "SELECT COUNT(*) FROM sionapros_news WHERE 1"; $dbcon->query($rowsSQL); #$rowNo = $rows[0]; SmartyPaginate::setTotal($dbcon->getValue()); $dbcon->free(); return $data; } $results = getSearchResults($db); if (sizeof($results) == 0) { $searchMsg = 'NO ARTICLES WERE FOUND'; $smarty->assign('searchMsg', $searchMsg);
<?php // required connect SmartyPaginate::connect(); // set items per page SmartyPaginate::setLimit(10); #set url for links SmartyPaginate::setUrl('./index.php?path=./main/cats/main.show_categories.php'); SmartyPaginate::setPrevText('PREV'); SmartyPaginate::setNextText('NEXT'); function getSearchResults(&$dbcon) { $X = SmartyPaginate::getCurrentIndex(); $Y = SmartyPaginate::getLimit(); $searchSQL = "SELECT * FROM sionapros_categories WHERE 1 ORDER BY id ASC LIMIT {$X},{$Y}"; $result = $dbcon->execute($searchSQL); foreach ($result as $row) { // collect each record into $_data $data[] = $row; } // now we get the total number of records from the table $rowsSQL = "SELECT COUNT(*) FROM sionapros_categories WHERE 1 "; $dbcon->query($rowsSQL); #$rowNo = $rows[0]; SmartyPaginate::setTotal($dbcon->getValue()); $dbcon->free(); return $data; } $results = getSearchResults($db); if (sizeof($results) == 0) { $searchMsg = 'NONE HAVE BEEN RECORDED YET';
<?php #reset session data SmartyPaginate::reset(); // required connect SmartyPaginate::connect(); // set items per page SmartyPaginate::setLimit(10); #set url for links SmartyPaginate::setUrl('./index.php?path=./main/faqs/faqs.show_faqs.php'); SmartyPaginate::setPrevText('PREV'); SmartyPaginate::setNextText('NEXT'); function getSearchResults(&$dbcon) { $X = SmartyPaginate::getCurrentIndex(); $Y = SmartyPaginate::getLimit(); $searchSQL = "SELECT fq.*,C.value FROM sionapros_faqs AS fq INNER JOIN sionapros_categories"; $searchSQL .= " AS C ON fq.category = C.id ORDER BY C.id,fq.id LIMIT {$X},{$Y}"; $result = $dbcon->execute($searchSQL); echo $dbcon->error; foreach ($result as $row) { // collect each record into $_data $data[] = $row; } // now we get the total number of records from the table $rowsSQL = "SELECT COUNT(*) FROM sionapros_faqs WHERE 1"; $dbcon->query($rowsSQL); #$rowNo = $rows[0]; SmartyPaginate::setTotal($dbcon->getValue()); $dbcon->free(); return $data;
#store where clause in the session #if($_REQUEST['year']) #$_SESSION['search'] = $searchSpec; #check if its a new search if ($_REQUEST['Search']) { #reset session data SmartyPaginate::reset(); // required connect SmartyPaginate::connect(); // set items per page SmartyPaginate::setLimit(5); } else { SmartyPaginate::connect(); } #set url for links SmartyPaginate::setUrl('./index.php?prgm=news-and-events'); SmartyPaginate::setPrevText('PREV'); SmartyPaginate::setNextText('NEXT'); function getSearchResults(&$dbcon, $searchSpec) { $X = SmartyPaginate::getCurrentIndex(); $Y = SmartyPaginate::getLimit(); $searchSQL = "SELECT * FROM sionapros_news WHERE 1 {$searchSpec} ORDER BY pub_date DESC LIMIT {$X},{$Y}"; $result = $dbcon->execute($searchSQL); foreach ($result as $row) { $data[] = $row; } // now we get the total number of records from the table $rowsSQL = "SELECT COUNT(*) FROM sionapros_news WHERE 1 {$searchSpec}"; $dbcon->query($rowsSQL); SmartyPaginate::setTotal($dbcon->getValue());
#store where clause in the session #if($_REQUEST['year']) #$_SESSION['pubs'] = $searchSpec; #check if its a new search if ($_REQUEST['Search']) { #reset session data SmartyPaginate::reset(); // required connect SmartyPaginate::connect(); // set items per page SmartyPaginate::setLimit(5); } else { SmartyPaginate::connect(); } #set url for links SmartyPaginate::setUrl('./index.php?prgm=sionapros-files'); SmartyPaginate::setPrevText('PREV'); SmartyPaginate::setNextText('NEXT'); function getSearchResults(&$dbcon, $searchSpec) { $X = SmartyPaginate::getCurrentIndex(); $Y = SmartyPaginate::getLimit(); $searchSQL = "SELECT * FROM sionapros_pubs WHERE 1 {$searchSpec} ORDER BY pub_date DESC LIMIT {$X},{$Y}"; $result = $dbcon->execute($searchSQL); $i = 0; foreach ($result as $row) { #$path = './admin'.substr($row['doc'], 1, strlen($row['doc'])); $data[$i] = $row; #$data[$i]['path'] = $path; $i++; }
if ($_REQUEST['Search']) { $_SESSION['search'] = $searchSpec; } #check if its a new search if ($_REQUEST['Search']) { #reset session data SmartyPaginate::reset(); // required connect SmartyPaginate::connect(); // set items per page SmartyPaginate::setLimit($_REQUEST['results']); } else { SmartyPaginate::connect(); } #set url for links SmartyPaginate::setUrl('./index.php?path=./main/pubs/pubs.show_pubs.php'); SmartyPaginate::setPrevText('PREV'); SmartyPaginate::setNextText('NEXT'); function getSearchResults(&$dbcon, $proj_no) { $X = SmartyPaginate::getCurrentIndex(); $Y = SmartyPaginate::getLimit(); $searchSQL = "SELECT p.*,c.value FROM sionapros_pubs AS p INNER JOIN sionapros_categories AS c"; $searchSQL .= " ON p.category = c.id WHERE 1 {$_SESSION['search']} ORDER BY id DESC LIMIT {$X},{$Y}"; $result = $dbcon->execute($searchSQL); foreach ($result as $row) { // collect each record into $_data $data[] = $row; } // now we get the total number of records from the table $rowsSQL = "SELECT COUNT(*) FROM sionapros_pubs AS p WHERE 1 {$_SESSION['search']}";
if ($_POST['Search'] || $_GET['l']) { $_SESSION['search'] = $searchSpec; } #check if its a new search if ($_POST['Search']) { #reset session data SmartyPaginate::reset(); // required connect SmartyPaginate::connect(); // set items per page SmartyPaginate::setLimit($_POST['results']); } else { SmartyPaginate::connect(); } #set url for links SmartyPaginate::setUrl('./index.php?path=./main/user/user.show_user.php'); SmartyPaginate::setPrevText('PREV'); SmartyPaginate::setNextText('NEXT'); function getSearchResults(&$dbcon) { $X = SmartyPaginate::getCurrentIndex(); $Y = SmartyPaginate::getLimit(); $searchSQL = "SELECT firstname,lastname,identifier FROM sionapros_users"; $searchSQL .= " WHERE 1 {$_SESSION['search']} ORDER BY identifier ASC LIMIT {$X},{$Y}"; $result = $dbcon->execute($searchSQL); foreach ($result as $row) { // collect each record into $_data $data[] = $row; } // now we get the total number of records from the table $rowsSQL = "SELECT COUNT(*) FROM sionapros_users WHERE 1 {$_SESSION['search']}";
$hook->execute_hook('account_page'); } $hook->add_side_block('defaultBlock_Account', '', '', 3); $hook->set_title('title_account', 'My account'); $hook->add_block('infoUser', '', '', '450-left', 10); $startUp->isLoggedAcount(); $getUserdata = $startUp->getMydata(); $hook->add_block('getMytorrent', '', '', '270-right', 12); if (!isset($_GET["sortedBy"])) { $_GET["sortedBy"] = ''; } $sortedBy = $_GET["sortedBy"]; if (!isset($_GET["axis"])) { $_GET["axis"] = ''; } $axis = $_GET["axis"]; // required connect SmartyPaginate::connect(); // set items per page SmartyPaginate::setLimit(10); if (!isset($_GET['next'])) { SmartyPaginate::reset(); } // reset/init the session data all time! SmartyPaginate::setUrl('account'); $startUp->paginatePage = 'account'; $smarty->assign("getUserdata", $getUserdata); $smarty->assign("getMyTorrents", $startUp->getMyTorrents($_GET["sortedBy"], $_GET["axis"])); $smarty->assign("getGravatar", $startUp->get_gravatar($getUserdata->mail)); SmartyPaginate::assign($smarty); // paginate
<?php $projSQL = "SELECT * FROM sionapros_proj_info"; $proj = $db->execute($projSQL); $smarty->assign('projs', $proj); SmartyPaginate::connect(); // set items per page SmartyPaginate::setLimit(10); #set url for links SmartyPaginate::setUrl('./index.php?prgm=faqs'); SmartyPaginate::setPrevText('PREV'); SmartyPaginate::setNextText('NEXT'); function getSearchResults(&$dbcon) { $X = SmartyPaginate::getCurrentIndex(); $Y = SmartyPaginate::getLimit(); $searchSQL = "SELECT * FROM sionapros_faqs WHERE 1 ORDER BY id LIMIT {$X},{$Y}"; $result = $dbcon->execute($searchSQL); foreach ($result as $row) { $data[] = $row; } // now we get the total number of records from the table $rowsSQL = "SELECT COUNT(*) FROM sionapros_faqs WHERE 1"; $dbcon->query($rowsSQL); SmartyPaginate::setTotal($dbcon->getValue()); return $data; } $results = getSearchResults($db); if (sizeof($results) == 0) { $searchMsg = 'NO FAQs WERE FOUND'; $smarty->assign('searchMsg', $searchMsg);
<?php SmartyPaginate::connect(); // set items per page SmartyPaginate::setLimit(20); #set url for links SmartyPaginate::setUrl('./index.php?path=./main/security/tm0.security.show_profile.php'); SmartyPaginate::setPrevText('PREV'); SmartyPaginate::setNextText('NEXT'); function getSearchResults(&$dbcon) { $X = SmartyPaginate::getCurrentIndex(); $Y = SmartyPaginate::getLimit(); $searchSQL = "SELECT * FROM sionapros_profiles ORDER BY profile_id ASC LIMIT {$X},{$Y}"; $result = $dbcon->execute($searchSQL); foreach ($result as $row) { // collect each record into $_data $data[] = $row; } // now we get the total number of records from the table $rowsSQL = "SELECT COUNT(*) FROM sionapros_profiles"; $dbcon->query($rowsSQL); #$rowNo = $rows[0]; SmartyPaginate::setTotal($dbcon->getValue()); $dbcon->free(); return $data; } $results = getSearchResults($db); if (sizeof($results) == 0) { $searchMsg = 'NO PROFILES HAVE BEEN CREATED'; $smarty->assign('searchMsg', $searchMsg);
$getUserdata = $startUp->getUserdata($_GET['act']); if ($getUserdata != 'false') { if (!isset($_GET["sortedBy"])) { $_GET["sortedBy"] = ''; } $sortedBy = $_GET["sortedBy"]; if (!isset($_GET["axis"])) { $_GET["axis"] = ''; } $axis = $_GET["axis"]; // required connect SmartyPaginate::connect(); // set items per page SmartyPaginate::setLimit(10); if (!isset($_GET['next'])) { SmartyPaginate::reset(); } // reset/init the session data all time! SmartyPaginate::setUrl('user/' . $getUserdata->name); $startUp->paginatePage = 'user/' . $getUserdata->name; //$hook->set_title('title_user', $getUserdata->name .' detail'); if ($getUserdata->seeMytorrents === 'true') { $hook->add_block('getMytorrents', '', '', '270-right', 12); } $smarty->assign('getUserdata', $getUserdata); $smarty->assign("getMyTorrents", $startUp->getTorrentsByUser($_GET['act'], $_GET["sortedBy"], $_GET["axis"])); $smarty->assign("getGravatar", $startUp->get_gravatar($getUserdata->mail)); } else { // $hook->set_title('title_user','User not found!'); } $hook->set_title('title_user', 'User detail');
} if ($_GET['s']) { $_SESSION['search'] = $searchSpec; } if ($_POST['Search']) { #reset session data SmartyPaginate::reset(); // required connect SmartyPaginate::connect(); // set items per page SmartyPaginate::setLimit(10); } else { SmartyPaginate::connect(); } #set url for links SmartyPaginate::setUrl('./index.php?path=./main/news/news.show_subscribers.php'); SmartyPaginate::setPrevText('PREV'); SmartyPaginate::setNextText('NEXT'); function getSearchResults(&$dbcon) { $X = SmartyPaginate::getCurrentIndex(); $Y = SmartyPaginate::getLimit(); $searchSQL = "SELECT * FROM sionapros_newsletter_receipient WHERE 1 {$_SESSION['search']} ORDER BY id ASC LIMIT {$X},{$Y}"; $result = $dbcon->execute($searchSQL); foreach ($result as $row) { // collect each record into $_data $data[] = $row; } // now we get the total number of records from the table $rowsSQL = "SELECT COUNT(*) FROM sionapros_newsletter_receipient WHERE 1 {$_SESSION['search']}"; $dbcon->query($rowsSQL);