1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/yunxi59-luohu

В этом репозитории не указан файл с открытой лицензией (LICENSE). При использовании обратитесь к конкретному описанию проекта и его зависимостям в коде.
Клонировать/Скачать
jyapi_local.php 4.6 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
邓云溪 Отправлено 21.05.2018 06:02 82b8225
<?php
require_once ("site_jyconfig.php");
$GL_CONFIG['api_path'] = 'D:/web/250/';
$dirname = dirname(__FILE__);
define('NO_LEGACY_FLEAPHP', true);
require($GL_CONFIG['api_path'].'FLEA/FLEA.php');
$appInf = array(
'internalCacheDir' => $GL_CONFIG['api_path'].'tmp',
'dbDSN' => array(
'driver' => 'mysql',
'host' => 'localhost',
'login' => 'root',
'password' => 'q1w2e3r4',
'database' => 'jiuyi'
),
'tmp_upload_path' => $GL_CONFIG['api_path'].'tmp',
'tmp_upload_url' => 'http://www.91.cn/tmp',
'store_upload_path' => $GL_CONFIG['api_path'].'upload',
'store_upload_url' => 'http://www.91.cn/upload/',
'weed_start' => "Monday",
// "displayErrors"=>true
);
FLEA::loadAppInf($appInf);
FLEA::import($GL_CONFIG['api_path']);
class JYAPI {
var $class;
public function __construct($remoteClass,$setPersistent = false){
if($remoteClass!='file')
$this->class = FLEA::getSingleton($remoteClass);
}
public function __call($fname,$args){
//echo $fname;
return call_user_func_array(array( $this->class, $fname), $args);
}
public function __set($name,$value){
$this->class->$name=$value;
}
public function __get($name){
return $this->class->$name;
}
}
function Api_updload($fileName){
if( !is_readable($fileName) ) return false;
$fBinary = file_get_contents($fileName);
// 新的文件名
$newfile_name = time().mt_rand(1000,9999).".".pathinfo($fileName, PATHINFO_EXTENSION);
// 生成文件到临时目录
if( false != file_put_contents(FLEA::getAppInf("tmp_upload_path").$newfile_name, $fBinary) ){
return $newfile_name;
}
return false;
}
/**
* 输出变量的内容,通常用于调试
*
* @package Core
*
* @param mixed $vars 要输出的变量
* @param string $label
* @param boolean $return
*/
/*function dump($vars, $label = '', $return = false)
{
$content = "<div align=left><pre>\n";
if ($label != '') {
$content .= "<strong>{$label} :</strong>\n";
}
$content .= htmlspecialchars(print_r($vars, true));
$content .= "\n</pre></div>\n";
if ($return) { return $content; }
echo $content;
return null;
}*/
/**
* 分页显示
*
* @package Core
*
* @param mixed $vars 要输出的变量
* @param string $label
* @param boolean $return
*/
function jy_api_pager2( $url, $pager ){
$params = array(
"url" => $url,
"pager" => $pager,
"sep" => "|num|",
"style" => "s_pager"
);
return jy_api_pager($params);
}
function jy_api_pager($params)
{
/****
$url = "kk.php?p=|num|"
$sep = "|num|";
$style = "s_pager";
$pager = Array
(
[pageSize] => 2
[totalCount] => 3
[count] => 3
[pageCount] => 2
[firstPage] => 1
[firstPageNumber] => 1
[lastPage] => 2
[lastPageNumber] => 2
[prevPage] => 1
[prevPageNumber] => 1
[nextPage] => 2
[nextPageNumber] => 2
[currentPage] => 1
[currentPageNumber] => 1
[pagesNumber] => Array
(
[0] => 1
[1] => 2
)
)
****/
extract($params);
$jump_num = 5;
if( isset($pager) && $pager["pageCount"] > 1 ){
// $sep = urlencode($sep);
$out = "<div id='$style'>共有<font color=\"#FF0000\">".$pager["totalCount"]."</font>条记录&nbsp;";
//$out .= "总共<font color=\"#000099\">".$pager["pageCount"]."</font>页&nbsp;";
//$out .= "<font color=\"#FF0000\">".$pager["pageSize"]."</font>条/页&nbsp;&nbsp;&nbsp;&nbsp;";
$out .= "<a href='".str_replace($sep, $pager["firstPageNumber"], $url)."'>首页</a> | ";
$out .= "<a href='".str_replace($sep, $pager["prevPageNumber"], $url)."'>上一页</a> | ";
$out .= "<a href='".str_replace($sep, $pager["nextPageNumber"], $url)."'>下一页</a> | ";
$out .= "<a href='".str_replace($sep, $pager["lastPageNumber"], $url)."'>末页</a> &nbsp;&nbsp;";
foreach( $pager["pagesNumber"] as $value ){
if( $value > ( $pager["currentPageNumber"] + $jump_num ) || $value < ( $pager["currentPageNumber"] - $jump_num ) ){
}else{
if( $value == $pager["currentPageNumber"] ){
$out .= "<font color=\"#FF0000\">$value</font> ";
}else{
$out .= "<a href='".str_replace($sep, $value, $url)."'>$value</a> ";
}
}
}
//$out .= "跳到<input name=\"jump\" type=\"text\" size=\"4\" onkeypress=\"if(event.keyCode==13){Javascript:location.href='".str_replace($sep, "'+this.value+'", $url)."';}\" />页</div>";
$out .="</div>";
return $out;
}
}

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/yunxi59-luohu.git
git@api.gitlife.ru:oschina-mirror/yunxi59-luohu.git
oschina-mirror
yunxi59-luohu
yunxi59-luohu
master