本文整理汇总了PHP中SmartyPaginate::setUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP SmartyPaginate::setUrl方法的具体用法?PHP SmartyPaginate::setUrl怎么用?PHP SmartyPaginate::setUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SmartyPaginate
的用法示例。
在下文中一共展示了SmartyPaginate::setUrl方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSearchResults
<?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);
示例2: getSearchResults
<?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';
示例3: getSearchResults
<?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;
示例4: getSearchResults
#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());
示例5: getSearchResults
#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++;
}
示例6: getSearchResults
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']}";
示例7: getSearchResults
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']}";
示例8:
$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
示例9: getSearchResults
<?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);
示例10: getSearchResults
<?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);
示例11:
$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');
示例12: getSearchResults
}
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);