Browse Source

bug fix for pagination in default page

master
filesite 5 months ago
parent
commit
12aa479854
  1. 23
      themes/beauty/views/site/index.php

23
themes/beauty/views/site/index.php

@ -1,4 +1,12 @@
<!-- 顶部导航栏模块 --> <?php
$selectedId = !empty($viewData['cateId']) ? $viewData['cateId'] : '';
$total = 0; //翻页支持
$imgExts = !empty(FSC::$app['config']['supportedImageExts']) ? FSC::$app['config']['supportedImageExts'] : array('jpg', 'jpeg', 'png', 'webp', 'gif');
$videoExts = !empty(FSC::$app['config']['supportedVideoExts']) ? FSC::$app['config']['supportedVideoExts'] : array('mp4', 'mov', 'm3u8');
$supportedExts = array_merge($imgExts, $videoExts);
?><!-- 顶部导航栏模块 -->
<nav class="navbar navbar-default navbar-fixed-top navbarJS"> <nav class="navbar navbar-default navbar-fixed-top navbarJS">
<div class="container-fluid"> <div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display navbar-inverse--> <!-- Brand and toggle get grouped for better mobile display navbar-inverse-->
@ -37,7 +45,6 @@
<ul class="nav navbar-fixed-left"> <ul class="nav navbar-fixed-left">
<?php <?php
$selectedId = !empty($viewData['cateId']) ? $viewData['cateId'] : '';
$breadcrumbs = !empty($viewData['breadcrumbs']) ? $viewData['breadcrumbs'] : []; $breadcrumbs = !empty($viewData['breadcrumbs']) ? $viewData['breadcrumbs'] : [];
if (!empty($viewData['menus'])) { //只显示第一级目录 if (!empty($viewData['menus'])) { //只显示第一级目录
foreach ($viewData['menus'] as $index => $item) { foreach ($viewData['menus'] as $index => $item) {
@ -57,11 +64,15 @@ eof;
<div class="img_main"> <div class="img_main">
<?php <?php
$imgExts = !empty(FSC::$app['config']['supportedImageExts']) ? FSC::$app['config']['supportedImageExts'] : array('jpg', 'jpeg', 'png', 'webp', 'gif');
$videoExts = !empty(FSC::$app['config']['supportedVideoExts']) ? FSC::$app['config']['supportedVideoExts'] : array('mp4', 'mov', 'm3u8');
$supportedExts = array_merge($imgExts, $videoExts);
$category = !empty($viewData['scanResults'][$selectedId]) ? $viewData['scanResults'][$selectedId] : []; $category = !empty($viewData['scanResults'][$selectedId]) ? $viewData['scanResults'][$selectedId] : [];
$total = 0; //翻页支持
//如果是首页
if (empty($selectedId) && !empty($viewData['menus'])) {
$category = array(
'directories' => $viewData['menus'],
'files' => $viewData['scanResults'],
);
}
if (!empty($category['files'])) { if (!empty($category['files'])) {
$total = Html::getDataTotal($category['files'], $supportedExts); //翻页支持 $total = Html::getDataTotal($category['files'], $supportedExts); //翻页支持

Loading…
Cancel
Save