龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > web编程 > php编程 >

推荐一款PHP+jQuery制作的列表分页的功能模块(7)

时间:2014-10-15 11:09来源:网络整理 作者:网络 点击:
分享到:
style1.css: #page a.pagenum{ margin-left:3px; margin-right:3px; padding:1px 7px; border:1px solid #ccc;}#page a.pagenum:hover{ background-color:#95071b; color:#fff;}.selected{ background-color:#95071b

style1.css:

#page a.pagenum{

  margin-left:3px;
  margin-right:3px;
  padding:1px 7px;
  border:1px solid #ccc;
}

#page a.pagenum:hover{

  background-color:#95071b;
  color:#fff;
}

.selected{

  background-color:#95071b;
  color:#fff;
}

init.inc.php:

<?php
/**
  file:init.inc.php Smarty对象的实例化及初始化文件
*/

/* *********************Smarty设置*********************** */
//根目录路径方式,用于Smarty设置
define("ROOT",str_replace("\\","/",dirname(__FILE__))."/");

require ROOT.'libs/Smarty.class.php';
$smarty = new Smarty();

//Smarty3设置默认路径
$smarty ->setTemplateDir(ROOT.'templates/')
    ->setCompileDir(ROOT.'templates_c/')
    ->setPluginsDir(ROOT.'plugins/')
    ->setCacheDir(ROOT.'cache/')
    ->setConfigDir(ROOT.'configs');

$smarty->caching = false;
$smarty->cache_lifetime = 60*60*24; //模版缓存有效时间为1天
$smarty->left_delimiter = '<{';
$smarty->right_delimiter = '}>';

/***********************************************************/

//根目录url方式
$PHP_SELF=$_SERVER['PHP_SELF'];
$ROOT_URL='http://'.$_SERVER['HTTP_HOST'].substr($PHP_SELF,0,strrpos($PHP_SELF,'/')+1);
define(ROOT_URL,$ROOT_URL);

//模版目录url方式
define("Template_Dir",$ROOT_URL.'templates');

代码下载地址:https://github.com/dee0912/PageClass

精彩图集

赞助商链接