@@ -47,7 +47,7 @@ | |||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td width="260">Model</td> | |||||
<td>Model</td> | |||||
<td><input type="text" name="model" id="model" value="" class="admin-input-lg" placeholder="模型版本名称,例如:deepseek-chat" required><a href="https://www.dedebiz.com/ai?from=dedebiz#models" target="_blank" class="text-success">(获取Model)</a></td> | <td><input type="text" name="model" id="model" value="" class="admin-input-lg" placeholder="模型版本名称,例如:deepseek-chat" required><a href="https://www.dedebiz.com/ai?from=dedebiz#models" target="_blank" class="text-success">(获取Model)</a></td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -34,7 +34,7 @@ | |||||
<td>id:<?php echo $ai['id'];?> <?php echo $ai['title'];?></td> | <td>id:<?php echo $ai['id'];?> <?php echo $ai['title'];?></td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td width="260">Model</td> | |||||
<td>Model</td> | |||||
<td><input type="text" name="model" id="model" value="<?php echo $myModel['model']?>" class="admin-input-lg" required><a href="https://www.dedebiz.com/ai?from=dedebiz#models" target="_blank" class="text-success">(获取Model)</a></td> | <td><input type="text" name="model" id="model" value="<?php echo $myModel['model']?>" class="admin-input-lg" required><a href="https://www.dedebiz.com/ai?from=dedebiz#models" target="_blank" class="text-success">(获取Model)</a></td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -247,7 +247,7 @@ | |||||
<p>{typedir} 栏目保存目录</p> | <p>{typedir} 栏目保存目录</p> | ||||
<p>{cc} 日期加混编id后用转换为适合字母</p> | <p>{cc} 日期加混编id后用转换为适合字母</p> | ||||
<p>伪静态规则(Nginx)</p> | <p>伪静态规则(Nginx)</p> | ||||
<p>rewrite ^/article/([0-9]+).html$ /apps/view.php?arcID=$1;</p> | |||||
<p>rewrite ^/article/([0-9]+).html$ /apps/view.php?aid=$1;</p> | |||||
<p>rewrite ^/article/([0-9]+)-([0-9]+).html$ /apps/view.php?aid=$1&pageno=$2;</p> | <p>rewrite ^/article/([0-9]+)-([0-9]+).html$ /apps/view.php?aid=$1&pageno=$2;</p> | ||||
</div> | </div> | ||||
</td> | </td> | ||||
@@ -105,7 +105,7 @@ | |||||
<p>{typedir} 栏目保存目录</p> | <p>{typedir} 栏目保存目录</p> | ||||
<p>{cc} 日期加混编id后用转换为适合字母</p> | <p>{cc} 日期加混编id后用转换为适合字母</p> | ||||
<p>伪静态规则(Nginx)</p> | <p>伪静态规则(Nginx)</p> | ||||
<p>rewrite ^/article/([0-9]+).html$ /apps/view.php?arcID=$1;</p> | |||||
<p>rewrite ^/article/([0-9]+).html$ /apps/view.php?aid=$1;</p> | |||||
<p>rewrite ^/article/([0-9]+)-([0-9]+).html$ /apps/view.php?aid=$1&pageno=$2;</p> | <p>rewrite ^/article/([0-9]+)-([0-9]+).html$ /apps/view.php?aid=$1&pageno=$2;</p> | ||||
</div> | </div> | ||||
</td> | </td> | ||||
@@ -230,7 +230,7 @@ | |||||
<p>{typedir} 栏目保存目录</p> | <p>{typedir} 栏目保存目录</p> | ||||
<p>{cc} 日期加混编id后用转换为适合字母</p> | <p>{cc} 日期加混编id后用转换为适合字母</p> | ||||
<p>伪静态规则(Nginx)</p> | <p>伪静态规则(Nginx)</p> | ||||
<p>rewrite ^/article/([0-9]+).html$ /apps/view.php?arcID=$1;</p> | |||||
<p>rewrite ^/article/([0-9]+).html$ /apps/view.php?aid=$1;</p> | |||||
<p>rewrite ^/article/([0-9]+)-([0-9]+).html$ /apps/view.php?aid=$1&pageno=$2;</p> | <p>rewrite ^/article/([0-9]+)-([0-9]+).html$ /apps/view.php?aid=$1&pageno=$2;</p> | ||||
</div> | </div> | ||||
</td> | </td> | ||||
@@ -66,7 +66,7 @@ | |||||
var ListArea = $Obj('pagelist'); | var ListArea = $Obj('pagelist'); | ||||
var pagenum = Math.ceil(totalrow / pagesize); | var pagenum = Math.ceil(totalrow / pagesize); | ||||
var listsize = 6; | var listsize = 6; | ||||
var ahtml = "<ul class='pagination justify-content-center'>"; | |||||
var ahtml = "<ul class='pagination justify-content-end'>"; | |||||
var startloop = 1; | var startloop = 1; | ||||
var endnum = 0; | var endnum = 0; | ||||
ahtml += "<li class='page-item disabled'><span class='page-link'>" + pagenum + "页" + totalrow + "条</span></li>"; | ahtml += "<li class='page-item disabled'><span class='page-link'>" + pagenum + "页" + totalrow + "条</span></li>"; | ||||
@@ -96,7 +96,7 @@ | |||||
var ListArea = $Obj('pagelist'); | var ListArea = $Obj('pagelist'); | ||||
var pagenum = Math.ceil(totalrow / pagesize); | var pagenum = Math.ceil(totalrow / pagesize); | ||||
var listsize = 6; | var listsize = 6; | ||||
var ahtml = "<ul class='pagination justify-content-center'>"; | |||||
var ahtml = "<ul class='pagination justify-content-end'>"; | |||||
var startloop = 1; | var startloop = 1; | ||||
var endnum = 0; | var endnum = 0; | ||||
ahtml += "<li class='page-item disabled'><span class='page-link'>" + pagenum + "页" + totalrow + "条</span></li>"; | ahtml += "<li class='page-item disabled'><span class='page-link'>" + pagenum + "页" + totalrow + "条</span></li>"; | ||||
@@ -38,6 +38,14 @@ if ($action == 'post') { | |||||
exit(); | exit(); | ||||
} | } | ||||
$addvar = $addvalue = ''; | $addvar = $addvalue = ''; | ||||
//验证码校验 | |||||
$validate = empty($validate) ? '' : strtolower(trim($validate)); | |||||
$svali = strtolower(GetCkVdValue()); | |||||
if ($validate=='' || $validate != $svali) { | |||||
ResetVdValue(); | |||||
ShowMsg('验证码不正确', '-1'); | |||||
exit(); | |||||
} | |||||
if (!empty($dede_fields)) { | if (!empty($dede_fields)) { | ||||
$link = $_SERVER['HTTP_REFERER']; | $link = $_SERVER['HTTP_REFERER']; | ||||
$date = GetDateTimeMk(time()); | $date = GetDateTimeMk(time()); | ||||
@@ -747,6 +747,14 @@ input,select,textarea,.colordlg,.pubdlg,.quickselitem .topcat,.mysource,.mywrite | |||||
border-top-right-radius:0!important; | border-top-right-radius:0!important; | ||||
border-bottom-right-radius:0!important | border-bottom-right-radius:0!important | ||||
} | } | ||||
.page-item:first-child .page-link { | |||||
border-top-left-radius:var(--b-radius); | |||||
border-bottom-left-radius:var(--b-radius) | |||||
} | |||||
.page-item:last-child .page-link { | |||||
border-top-right-radius:var(--b-radius); | |||||
border-bottom-right-radius:var(--b-radius) | |||||
} | |||||
.nav-pills .nav-link.active,.nav-pills .show>.nav-link { | .nav-pills .nav-link.active,.nav-pills .show>.nav-link { | ||||
background:var(--green) | background:var(--green) | ||||
} | } | ||||
@@ -859,7 +859,7 @@ class Archives | |||||
foreach ($this->SplitTitles as $k => $v) { | foreach ($this->SplitTitles as $k => $v) { | ||||
if ($i == 1) { | if ($i == 1) { | ||||
if ($cfg_rewrite == 'Y') { | if ($cfg_rewrite == 'Y') { | ||||
$revalue .= "<a href='/article-$aid-$i.html'>$v</a>"; | |||||
$revalue .= "<a href='/article/$aid-$i.html'>$v</a>"; | |||||
} else { | } else { | ||||
$revalue .= "<a href='".$this->Fields['phpurl']."/view.php?aid=$aid&pageno=$i'>$v</a>"; | $revalue .= "<a href='".$this->Fields['phpurl']."/view.php?aid=$aid&pageno=$i'>$v</a>"; | ||||
} | } | ||||
@@ -868,7 +868,7 @@ class Archives | |||||
$revalue .= " $v "; | $revalue .= " $v "; | ||||
} else { | } else { | ||||
if ($cfg_rewrite == 'Y') { | if ($cfg_rewrite == 'Y') { | ||||
$revalue .= "<a href='/article-$aid-$i.html'>$v</a>"; | |||||
$revalue .= "<a href='/article/$aid-$i.html'>$v</a>"; | |||||
} else { | } else { | ||||
$revalue .= "<a href='".$this->Fields['phpurl']."/view.php?aid=$aid&pageno=$i'>$v</a>"; | $revalue .= "<a href='".$this->Fields['phpurl']."/view.php?aid=$aid&pageno=$i'>$v</a>"; | ||||
} | } | ||||
@@ -882,20 +882,20 @@ class Archives | |||||
foreach ($this->SplitTitles as $k => $v) { | foreach ($this->SplitTitles as $k => $v) { | ||||
if ($i == 1) { | if ($i == 1) { | ||||
if ($cfg_rewrite == 'Y') { | if ($cfg_rewrite == 'Y') { | ||||
$revalue .= "<option value='/article-$aid-$i.html'>{$i}、{$v}</option>"; | |||||
$revalue .= "<option value='/article/$aid-$i.html'>{$i}、{$v}</option>"; | |||||
} else { | } else { | ||||
$revalue .= "<option value='".$this->Fields['phpurl']."/view.php?aid=$aid&pageno=$i'>{$i}、{$v}</option>"; | $revalue .= "<option value='".$this->Fields['phpurl']."/view.php?aid=$aid&pageno=$i'>{$i}、{$v}</option>"; | ||||
} | } | ||||
} else { | } else { | ||||
if ($pageNo == $i) { | if ($pageNo == $i) { | ||||
if ($cfg_rewrite == 'Y') { | if ($cfg_rewrite == 'Y') { | ||||
$revalue .= "<option value='/article-$aid-$i.html' selected>{$i}、{$v}</option>"; | |||||
$revalue .= "<option value='/article/$aid-$i.html' selected>{$i}、{$v}</option>"; | |||||
} else { | } else { | ||||
$revalue .= "<option value='".$this->Fields['phpurl']."/view.php?aid=$aid&pageno=$i' selected>{$i}、{$v}</option>"; | $revalue .= "<option value='".$this->Fields['phpurl']."/view.php?aid=$aid&pageno=$i' selected>{$i}、{$v}</option>"; | ||||
} | } | ||||
} else { | } else { | ||||
if ($cfg_rewrite == 'Y') { | if ($cfg_rewrite == 'Y') { | ||||
$revalue .= "<option value='/article-$aid-$i.html'>{$i}、{$v}</option>"; | |||||
$revalue .= "<option value='/article/$aid-$i.html'>{$i}、{$v}</option>"; | |||||
} else { | } else { | ||||
$revalue .= "<option value='".$this->Fields['phpurl']."/view.php?aid=$aid&pageno=$i'>{$i}、{$v}</option>"; | $revalue .= "<option value='".$this->Fields['phpurl']."/view.php?aid=$aid&pageno=$i'>{$i}、{$v}</option>"; | ||||
} | } | ||||
@@ -930,13 +930,13 @@ class Archives | |||||
} else { | } else { | ||||
if ($nPage == 1) { | if ($nPage == 1) { | ||||
if ($cfg_rewrite == 'Y') { | if ($cfg_rewrite == 'Y') { | ||||
$PageList .= "<li class='page-item'><a class='page-link' href='".$cfg_cmsurl."/article-$aid.html'>上页</a></li>"; | |||||
$PageList .= "<li class='page-item'><a class='page-link' href='".$cfg_cmsurl."/article/$aid.html'>上页</a></li>"; | |||||
} else { | } else { | ||||
$PageList .= "<li class='page-item'><a class='page-link' href='".$this->Fields['phpurl']."/view.php?aid=$aid'>上页</a></li>"; | $PageList .= "<li class='page-item'><a class='page-link' href='".$this->Fields['phpurl']."/view.php?aid=$aid'>上页</a></li>"; | ||||
} | } | ||||
} else { | } else { | ||||
if ($cfg_rewrite == 'Y') { | if ($cfg_rewrite == 'Y') { | ||||
$PageList .= "<li class='page-item'><a class='page-link' href='".$cfg_cmsurl."/article-$aid-$nPage.html'>上页</a></li>"; | |||||
$PageList .= "<li class='page-item'><a class='page-link' href='".$cfg_cmsurl."/article/$aid-$nPage.html'>上页</a></li>"; | |||||
} else { | } else { | ||||
$PageList .= "<li class='page-item'><a class='page-link' href='".$this->Fields['phpurl']."/view.php?aid=$aid&pageno=$nPage'>上页</a></li>"; | $PageList .= "<li class='page-item'><a class='page-link' href='".$this->Fields['phpurl']."/view.php?aid=$aid&pageno=$nPage'>上页</a></li>"; | ||||
} | } | ||||
@@ -946,7 +946,7 @@ class Archives | |||||
if ($i == 1) { | if ($i == 1) { | ||||
if ($nowPage != 1) { | if ($nowPage != 1) { | ||||
if ($cfg_rewrite == 'Y') { | if ($cfg_rewrite == 'Y') { | ||||
$PageList .= "<li class='page-item'><a class='page-link' href='".$cfg_cmsurl."/article-$aid.html'>1</a></li>"; | |||||
$PageList .= "<li class='page-item'><a class='page-link' href='".$cfg_cmsurl."/article/$aid.html'>1</a></li>"; | |||||
} else { | } else { | ||||
$PageList .= "<li class='page-item'><a class='page-link' href='".$this->Fields['phpurl']."/view.php?aid=$aid'>1</a></li>"; | $PageList .= "<li class='page-item'><a class='page-link' href='".$this->Fields['phpurl']."/view.php?aid=$aid'>1</a></li>"; | ||||
} | } | ||||
@@ -957,7 +957,7 @@ class Archives | |||||
$n = $i; | $n = $i; | ||||
if ($nowPage != $i) { | if ($nowPage != $i) { | ||||
if ($cfg_rewrite == 'Y') { | if ($cfg_rewrite == 'Y') { | ||||
$PageList .= "<li class='page-item'><a class='page-link' href='".$cfg_cmsurl."/article-$aid-$i.html'>{$n}</a></li>"; | |||||
$PageList .= "<li class='page-item'><a class='page-link' href='".$cfg_cmsurl."/article/$aid-$i.html'>{$n}</a></li>"; | |||||
} else { | } else { | ||||
$PageList .= "<li class='page-item'><a class='page-link' href='".$this->Fields['phpurl']."/view.php?aid=$aid&pageno=$i'>{$n}</a></li>"; | $PageList .= "<li class='page-item'><a class='page-link' href='".$this->Fields['phpurl']."/view.php?aid=$aid&pageno=$i'>{$n}</a></li>"; | ||||
} | } | ||||
@@ -968,7 +968,7 @@ class Archives | |||||
} | } | ||||
if ($lPage <= $totalPage) { | if ($lPage <= $totalPage) { | ||||
if ($cfg_rewrite == 'Y') { | if ($cfg_rewrite == 'Y') { | ||||
$PageList .= "<li class='page-item'><a class='page-link' href='".$cfg_cmsurl."/article-$aid-$lPage.html'>下页</a></li>"; | |||||
$PageList .= "<li class='page-item'><a class='page-link' href='".$cfg_cmsurl."/article/$aid-$lPage.html'>下页</a></li>"; | |||||
} else { | } else { | ||||
$PageList .= "<li class='page-item'><a class='page-link' href='".$this->Fields['phpurl']."/view.php?aid=$aid&pageno=$lPage'>下页</a></li>"; | $PageList .= "<li class='page-item'><a class='page-link' href='".$this->Fields['phpurl']."/view.php?aid=$aid&pageno=$lPage'>下页</a></li>"; | ||||
} | } | ||||
@@ -928,27 +928,13 @@ class SgListView | |||||
} | } | ||||
} | } | ||||
$plist = ''; | $plist = ''; | ||||
if (preg_match('/info/i', $listitem)) { | |||||
$plist .= $maininfo.' '; | |||||
} | |||||
if (preg_match('/index/i', $listitem)) { | |||||
$plist .= $indexpage.' '; | |||||
} | |||||
if (preg_match('/pre/i', $listitem)) { | |||||
$plist .= $prepage.' '; | |||||
} | |||||
if (preg_match('/pageno/i', $listitem)) { | |||||
$plist .= $listdd.' '; | |||||
} | |||||
if (preg_match('/next/i', $listitem)) { | |||||
$plist .= $nextpage.' '; | |||||
} | |||||
if (preg_match('/end/i', $listitem)) { | |||||
$plist .= $endpage.' '; | |||||
} | |||||
if (preg_match('/option/i', $listitem)) { | |||||
$plist .= $optionlist; | |||||
} | |||||
if (preg_match('/index/i', $listitem)) $plist .= $indexpage; | |||||
if (preg_match('/pre/i', $listitem)) $plist .= $prepage; | |||||
if (preg_match('/pageno/i', $listitem)) $plist .= $listdd; | |||||
if (preg_match('/next/i', $listitem)) $plist .= $nextpage; | |||||
if (preg_match('/end/i', $listitem)) $plist .= $endpage; | |||||
if (preg_match('/option/i', $listitem)) $plist .= $optionlist; | |||||
if (preg_match('/info/i', $listitem)) $plist .= $maininfo; | |||||
return $plist; | return $plist; | ||||
} | } | ||||
/** | /** | ||||
@@ -1028,7 +1014,14 @@ class SgListView | |||||
$listdd .= "<li class='page-item'><a href='".$purl."PageNo=$j{$geturl}' class='page-link'>$j</a></li>"; | $listdd .= "<li class='page-item'><a href='".$purl."PageNo=$j{$geturl}' class='page-link'>$j</a></li>"; | ||||
} | } | ||||
} | } | ||||
$plist = $indexpage.$prepage.$listdd.$nextpage.$endpage; | |||||
$plist = ''; | |||||
if (preg_match('/index/i', $listitem)) $plist .= $indexpage; | |||||
if (preg_match('/pre/i', $listitem)) $plist .= $prepage; | |||||
if (preg_match('/pageno/i', $listitem)) $plist .= $listdd; | |||||
if (preg_match('/next/i', $listitem)) $plist .= $nextpage; | |||||
if (preg_match('/end/i', $listitem)) $plist .= $endpage; | |||||
if (preg_match('/option/i', $listitem)) $plist .= $optionlist; | |||||
if (preg_match('/info/i', $listitem)) $plist .= $maininfo; | |||||
//伪静态栏目分页 | //伪静态栏目分页 | ||||
if ($cfg_rewrite == 'Y') { | if ($cfg_rewrite == 'Y') { | ||||
$plist = str_replace("?tid=", "", $plist); | $plist = str_replace("?tid=", "", $plist); | ||||
@@ -391,89 +391,6 @@ class TagList | |||||
$this->dsql->FreeResult('al'); | $this->dsql->FreeResult('al'); | ||||
return $artlist; | return $artlist; | ||||
} | } | ||||
/** | |||||
* 获取动态的分页列表 | |||||
* | |||||
* @access public | |||||
* @param int $list_len 列表宽度 | |||||
* @param string $listitem 列表样式 | |||||
* @return string | |||||
*/ | |||||
function GetPageListDM($list_len, $listitem = "info,index,end,pre,next,pageno") | |||||
{ | |||||
$prepage = ''; | |||||
$nextpage = ''; | |||||
$prepagenum = $this->PageNo - 1; | |||||
$nextpagenum = $this->PageNo + 1; | |||||
if ($list_len == "" || preg_match("/[^0-9]/", $list_len)) { | |||||
$list_len = 3; | |||||
} | |||||
$totalpage = $this->TotalPage; | |||||
if ($totalpage <= 1 && $this->TotalResult > 0) { | |||||
return "<li class='page-item disabled'><span class='page-link'>1页".$this->TotalResult."条</span></li>"; | |||||
} | |||||
if ($this->TotalResult == 0) { | |||||
return "<li class='page-item disabled'><span class='page-link'>0页".$this->TotalResult."条</span></li>"; | |||||
} | |||||
$maininfo = "<li class='page-item disabled'><span class='page-link'>{$totalpage}页".$this->TotalResult."条</span></li>"; | |||||
$purl = $this->GetCurUrl(); | |||||
$purl .= "?/".urlencode($this->Tag); | |||||
//获得上页和下页的链接 | |||||
if ($this->PageNo != 1) { | |||||
$prepage .= "<li class='page-item'><a href='".$purl."/$prepagenum' class='page-link'>上页</a></li>"; | |||||
$indexpage = "<li class='page-item'><a href='".$purl."/1' class='page-link'>首页</a></li>"; | |||||
} else { | |||||
$indexpage = "<li class='page-item'><span class='page-link'>首页</span></li>"; | |||||
} | |||||
if ($this->PageNo != $totalpage && $totalpage > 1) { | |||||
$nextpage .= "<li class='page-item'><a href='".$purl."/$nextpagenum' class='page-link'>下页</a></li>"; | |||||
$endpage = "<li class='page-item'><a href='".$purl."/$totalpage' class='page-link'>末页</a></li>"; | |||||
} else { | |||||
$endpage = "<li class='page-item'><span class='page-link'>末页</span></li>"; | |||||
} | |||||
//获得数字链接 | |||||
$listdd = ''; | |||||
$total_list = $list_len * 2 + 1; | |||||
if ($this->PageNo >= $total_list) { | |||||
$j = $this->PageNo - $list_len; | |||||
$total_list = $this->PageNo + $list_len; | |||||
if ($total_list > $totalpage) { | |||||
$total_list = $totalpage; | |||||
} | |||||
} else { | |||||
$j = 1; | |||||
if ($total_list > $totalpage) { | |||||
$total_list = $totalpage; | |||||
} | |||||
} | |||||
for ($j; $j <= $total_list; $j++) { | |||||
if ($j == $this->PageNo) { | |||||
$listdd .= "<li class='page-item active'><span class='page-link'>$j</span></li>"; | |||||
} else { | |||||
$listdd .= "<li class='page-item'><a href='".$purl."/$j' class='page-link'>$j</a></li>"; | |||||
} | |||||
} | |||||
$plist = ''; | |||||
if (preg_match('/info/i', $listitem)) { | |||||
$plist .= $maininfo.' '; | |||||
} | |||||
if (preg_match('/index/i', $listitem)) { | |||||
$plist .= $indexpage.' '; | |||||
} | |||||
if (preg_match('/pre/i', $listitem)) { | |||||
$plist .= $prepage.' '; | |||||
} | |||||
if (preg_match('/pageno/i', $listitem)) { | |||||
$plist .= $listdd.' '; | |||||
} | |||||
if (preg_match('/next/i', $listitem)) { | |||||
$plist .= $nextpage.' '; | |||||
} | |||||
if (preg_match('/end/i', $listitem)) { | |||||
$plist .= $endpage.' '; | |||||
} | |||||
return $plist; | |||||
} | |||||
/** | /** | ||||
* 获取静态的分页列表 | * 获取静态的分页列表 | ||||
* | * | ||||
@@ -536,24 +453,12 @@ class TagList | |||||
} | } | ||||
} | } | ||||
$plist = ''; | $plist = ''; | ||||
if (preg_match('/info/i', $listitem)) { | |||||
$plist .= $maininfo.' '; | |||||
} | |||||
if (preg_match('/index/i', $listitem)) { | |||||
$plist .= $indexpage.' '; | |||||
} | |||||
if (preg_match('/pre/i', $listitem)) { | |||||
$plist .= $prepage.' '; | |||||
} | |||||
if (preg_match('/pageno/i', $listitem)) { | |||||
$plist .= $listdd.' '; | |||||
} | |||||
if (preg_match('/next/i', $listitem)) { | |||||
$plist .= $nextpage.' '; | |||||
} | |||||
if (preg_match('/end/i', $listitem)) { | |||||
$plist .= $endpage.' '; | |||||
} | |||||
if (preg_match('/index/i', $listitem)) $plist .= $indexpage; | |||||
if (preg_match('/pre/i', $listitem)) $plist .= $prepage; | |||||
if (preg_match('/pageno/i', $listitem)) $plist .= $listdd; | |||||
if (preg_match('/next/i', $listitem)) $plist .= $nextpage; | |||||
if (preg_match('/end/i', $listitem)) $plist .= $endpage; | |||||
if (preg_match('/info/i', $listitem)) $plist .= $maininfo; | |||||
return $plist; | return $plist; | ||||
} | } | ||||
function GetTruePath() | function GetTruePath() | ||||
@@ -614,6 +519,77 @@ class TagList | |||||
} | } | ||||
} | } | ||||
} | } | ||||
/** | |||||
* 获取动态的分页列表 | |||||
* | |||||
* @access public | |||||
* @param int $list_len 列表宽度 | |||||
* @param string $listitem 列表样式 | |||||
* @return string | |||||
*/ | |||||
function GetPageListDM($list_len, $listitem = "info,index,end,pre,next,pageno") | |||||
{ | |||||
$prepage = ''; | |||||
$nextpage = ''; | |||||
$prepagenum = $this->PageNo - 1; | |||||
$nextpagenum = $this->PageNo + 1; | |||||
if ($list_len == "" || preg_match("/[^0-9]/", $list_len)) { | |||||
$list_len = 3; | |||||
} | |||||
$totalpage = $this->TotalPage; | |||||
if ($totalpage <= 1 && $this->TotalResult > 0) { | |||||
return "<li class='page-item disabled'><span class='page-link'>1页".$this->TotalResult."条</span></li>"; | |||||
} | |||||
if ($this->TotalResult == 0) { | |||||
return "<li class='page-item disabled'><span class='page-link'>0页".$this->TotalResult."条</span></li>"; | |||||
} | |||||
$maininfo = "<li class='page-item disabled'><span class='page-link'>{$totalpage}页".$this->TotalResult."条</span></li>"; | |||||
$purl = $this->GetCurUrl(); | |||||
$purl .= "?/".urlencode($this->Tag); | |||||
//获得上页和下页的链接 | |||||
if ($this->PageNo != 1) { | |||||
$prepage .= "<li class='page-item'><a href='".$purl."/$prepagenum' class='page-link'>上页</a></li>"; | |||||
$indexpage = "<li class='page-item'><a href='".$purl."/1' class='page-link'>首页</a></li>"; | |||||
} else { | |||||
$indexpage = "<li class='page-item'><span class='page-link'>首页</span></li>"; | |||||
} | |||||
if ($this->PageNo != $totalpage && $totalpage > 1) { | |||||
$nextpage .= "<li class='page-item'><a href='".$purl."/$nextpagenum' class='page-link'>下页</a></li>"; | |||||
$endpage = "<li class='page-item'><a href='".$purl."/$totalpage' class='page-link'>末页</a></li>"; | |||||
} else { | |||||
$endpage = "<li class='page-item'><span class='page-link'>末页</span></li>"; | |||||
} | |||||
//获得数字链接 | |||||
$listdd = ''; | |||||
$total_list = $list_len * 2 + 1; | |||||
if ($this->PageNo >= $total_list) { | |||||
$j = $this->PageNo - $list_len; | |||||
$total_list = $this->PageNo + $list_len; | |||||
if ($total_list > $totalpage) { | |||||
$total_list = $totalpage; | |||||
} | |||||
} else { | |||||
$j = 1; | |||||
if ($total_list > $totalpage) { | |||||
$total_list = $totalpage; | |||||
} | |||||
} | |||||
for ($j; $j <= $total_list; $j++) { | |||||
if ($j == $this->PageNo) { | |||||
$listdd .= "<li class='page-item active'><span class='page-link'>$j</span></li>"; | |||||
} else { | |||||
$listdd .= "<li class='page-item'><a href='".$purl."/$j' class='page-link'>$j</a></li>"; | |||||
} | |||||
} | |||||
$plist = ''; | |||||
if (preg_match('/index/i', $listitem)) $plist .= $indexpage; | |||||
if (preg_match('/pre/i', $listitem)) $plist .= $prepage; | |||||
if (preg_match('/pageno/i', $listitem)) $plist .= $listdd; | |||||
if (preg_match('/next/i', $listitem)) $plist .= $nextpage; | |||||
if (preg_match('/end/i', $listitem)) $plist .= $endpage; | |||||
if (preg_match('/info/i', $listitem)) $plist .= $maininfo; | |||||
return $plist; | |||||
} | |||||
/** | /** | ||||
* 获得一个指定的栏目的链接 | * 获得一个指定的栏目的链接 | ||||
* | * | ||||
@@ -240,7 +240,7 @@ class DataListCP | |||||
$listdd .= $j == $this->pageNO ? "<li class='page-item'><span class='page-link'>$j</span></li>\r\n" : "<li class='page-item'><a class='page-link' href='".$purl."pageno=$j'>".$j."</a></li>\r\n"; | $listdd .= $j == $this->pageNO ? "<li class='page-item'><span class='page-link'>$j</span></li>\r\n" : "<li class='page-item'><a class='page-link' href='".$purl."pageno=$j'>".$j."</a></li>\r\n"; | ||||
} | } | ||||
$plist = "<div class='d-flex justify-content-end'>\r\n"; | $plist = "<div class='d-flex justify-content-end'>\r\n"; | ||||
$sizesel = "<select name='pagesize' id='dedepagesize' class='form-control mr-2' style='width:100px'>\r\n"; | |||||
$sizesel = "<select name='pagesize' id='dedepagesize' class='form-control mr-2' style='width:120px'>\r\n"; | |||||
$sizesel .= "<option value='30' ".($this->pagesize == 30 ? "selected='selected'" : "").">30条/页</option>\r\n"; | $sizesel .= "<option value='30' ".($this->pagesize == 30 ? "selected='selected'" : "").">30条/页</option>\r\n"; | ||||
$sizesel .= "<option value='50' ".($this->pagesize == 50 ? "selected='selected'" : "").">50条/页</option>\r\n"; | $sizesel .= "<option value='50' ".($this->pagesize == 50 ? "selected='selected'" : "").">50条/页</option>\r\n"; | ||||
$sizesel .= "<option value='100' ".($this->pagesize == 100 ? "selected='selected'" : "").">100条/页</option>\r\n"; | $sizesel .= "<option value='100' ".($this->pagesize == 100 ? "selected='selected'" : "").">100条/页</option>\r\n"; | ||||
@@ -27,7 +27,14 @@ | |||||
<table class="table mb-0"> | <table class="table mb-0"> | ||||
<?php echo $postform;?> | <?php echo $postform;?> | ||||
<tr> | <tr> | ||||
<td align="center"> | |||||
<td>验证码</td> | |||||
<td> | |||||
<input type="text" name="validate" class="form-control admin-input-lg"> | |||||
<img src="/apps/vdimgck.php" onclick="this.src='/apps/vdimgck.php?tag='+Math.random();" style="cursor:pointer"> | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td colspan="2" align="center"> | |||||
<button type="submit" name="submit" class="btn btn-success btn-sm">提交</button> | <button type="submit" name="submit" class="btn btn-success btn-sm">提交</button> | ||||
<button type="reset" name="reset" class="btn btn-outline-success btn-sm">重置</button> | <button type="reset" name="reset" class="btn btn-outline-success btn-sm">重置</button> | ||||
</td> | </td> | ||||