当前位置: 首页>>代码示例>>PHP>>正文


PHP SmartyPaginate::setUrl方法代码示例

本文整理汇总了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);
开发者ID:jsan4christ,项目名称:idrc-uganda-site,代码行数:31,代码来源:tm0.news.display_news.php

示例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';
开发者ID:jsan4christ,项目名称:idrc-uganda-site,代码行数:31,代码来源:main.show_categories.php

示例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;
开发者ID:jsan4christ,项目名称:idrc-uganda-site,代码行数:31,代码来源:faqs.show_faqs.php

示例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());
开发者ID:jsan4christ,项目名称:idrc-uganda-site,代码行数:31,代码来源:news-and-events.inc.php

示例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++;
    }
开发者ID:jsan4christ,项目名称:idrc-uganda-site,代码行数:31,代码来源:publications.inc.php

示例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']}";
开发者ID:jsan4christ,项目名称:idrc-uganda-site,代码行数:31,代码来源:pubs.show_pubs.php

示例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']}";
开发者ID:jsan4christ,项目名称:idrc-uganda-site,代码行数:31,代码来源:user.show_user.php

示例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
开发者ID:doio,项目名称:Bittytorrent,代码行数:31,代码来源:account.php

示例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);
开发者ID:jsan4christ,项目名称:idrc-uganda-site,代码行数:31,代码来源:faqs.inc.php

示例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);
开发者ID:jsan4christ,项目名称:idrc-uganda-site,代码行数:31,代码来源:tm0.security.show_profile.php

示例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');
开发者ID:doio,项目名称:Bittytorrent,代码行数:31,代码来源:user.php

示例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);
开发者ID:jsan4christ,项目名称:idrc-uganda-site,代码行数:31,代码来源:news.show_subscribers.php


注:本文中的SmartyPaginate::setUrl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。