Esempio n. 1
0
/**
 * 分页函数
 *
 * @param $num 信息总数
 * @param $curr_page 当前分页
 * @param $perpage 每页显示数
 * @param $urlrule URL规则
 * @param $array 需要传递的数组,用于增加额外的方法
 * @return 分页
 */
function pages($num, $curr_page, $perpage = 20, $urlrule = '', $array = array(), $setpages = 10)
{
    if (defined('URLRULE') && $urlrule == '') {
        $urlrule = URLRULE;
        $array = $GLOBALS['URL_ARRAY'];
    } elseif ($urlrule == '') {
        $urlrule = url_par('page={$page}');
    }
    $multipage = '';
    if ($num > $perpage) {
        $page = $setpages + 1;
        $offset = ceil($setpages / 2 - 1);
        $pages = ceil($num / $perpage);
        if (defined('IN_ADMIN') && !defined('PAGES')) {
            define('PAGES', $pages);
        }
        $from = $curr_page - $offset;
        $to = $curr_page + $offset;
        $more = 0;
        if ($page >= $pages) {
            $from = 2;
            $to = $pages - 1;
        } else {
            if ($from <= 1) {
                $to = $page - 1;
                $from = 2;
            } elseif ($to >= $pages) {
                $from = $pages - ($page - 2);
                $to = $pages - 1;
            }
            $more = 1;
        }
        $multipage .= '<a class="a1">' . $num . L('page_item') . '</a>';
        if ($curr_page > 0) {
            $multipage .= ' <a href="' . pageurl($urlrule, $curr_page - 1, $array) . '" class="a1">' . L('previous') . '</a>';
            if ($curr_page == 1) {
                $multipage .= ' <a href="javascript:;" class="current">1</a>';
            } elseif ($curr_page > 6 && $more) {
                $multipage .= ' <a href="' . pageurl($urlrule, 1, $array) . '">1</a>..';
            } else {
                $multipage .= ' <a href="' . pageurl($urlrule, 1, $array) . '">1</a>';
            }
        }
        for ($i = $from; $i <= $to; $i++) {
            if ($i != $curr_page) {
                $multipage .= ' <a href="' . pageurl($urlrule, $i, $array) . '">' . $i . '</a>';
            } else {
                $multipage .= ' <a href="javascript:;" class="current">' . $i . '</a>';
            }
        }
        if ($curr_page < $pages) {
            if ($curr_page < $pages - 5 && $more) {
                $multipage .= ' ..<a href="' . pageurl($urlrule, $pages, $array) . '">' . $pages . '</a> <a href="' . pageurl($urlrule, $curr_page + 1, $array) . '" class="a1">' . L('next') . '</a>';
            } else {
                $multipage .= ' <a href="' . pageurl($urlrule, $pages, $array) . '">' . $pages . '</a> <a href="' . pageurl($urlrule, $curr_page + 1, $array) . '" class="a1">' . L('next') . '</a>';
            }
        } elseif ($curr_page == $pages) {
            $multipage .= ' <a href="javascript:;" class="current">' . $pages . '</a> <a href="' . pageurl($urlrule, $curr_page, $array) . '" class="a1">' . L('next') . '</a>';
        } else {
            $multipage .= ' <a href="' . pageurl($urlrule, $pages, $array) . '">' . $pages . '</a> <a href="' . pageurl($urlrule, $curr_page + 1, $array) . '" class="a1">' . L('next') . '</a>';
        }
    }
    return $multipage;
}
Esempio n. 2
0
/**
 * 分页函数
 *
 * @param $num 信息总数
 * @param $curr_page 当前分页
 * @param $perpage 每页显示数
 * @param $urlrule URL规则
 * @param $array 需要传递的数组,用于增加额外的方法
 * @return 分页
 */
function pages($num, $curr_page, $perpage = 20, $urlrule = '', $array = array())
{
    if ($urlrule == '') {
        $urlrule = url_par('page={$page}');
    } else {
        $urlrule = url_par('page={$page}', $urlrule);
    }
    $multipage = '';
    if ($num > $perpage) {
        $page = 11;
        $offset = 4;
        $pages = ceil($num / $perpage);
        $from = $curr_page - $offset;
        $to = $curr_page + $offset;
        $more = 0;
        if ($page >= $pages) {
            $from = 2;
            $to = $pages - 1;
        } else {
            if ($from <= 1) {
                $to = $page - 1;
                $from = 2;
            } elseif ($to >= $pages) {
                $from = $pages - ($page - 2);
                $to = $pages - 1;
            }
            $more = 1;
        }
        $multipage .= '总数<b>' . $num . '</b>&nbsp;&nbsp;';
        if ($curr_page > 0) {
            if ($curr_page == 1) {
                $multipage .= ' <a href="' . pageurl($urlrule, 1, $array) . '" class="a1">上一页</a>';
                $multipage .= ' <span>1</span>';
            } elseif ($curr_page > 6 && $more) {
                $multipage .= ' <a href="' . pageurl($urlrule, $curr_page - 1, $array) . '" class="a1">上一页</a>';
                $multipage .= ' <a href="' . pageurl($urlrule, 1, $array) . '">1</a>..';
            } else {
                $multipage .= ' <a href="' . pageurl($urlrule, $curr_page - 1, $array) . '" class="a1">上一页</a>';
                $multipage .= ' <a href="' . pageurl($urlrule, 1, $array) . '">1</a>';
            }
        }
        for ($i = $from; $i <= $to; $i++) {
            if ($i != $curr_page) {
                $multipage .= ' <a href="' . pageurl($urlrule, $i, $array) . '">' . $i . '</a>';
            } else {
                $multipage .= ' <span>' . $i . '</span>';
            }
        }
        if ($curr_page < $pages) {
            if ($curr_page < $pages - 5 && $more) {
                $multipage .= ' ..<a href="' . pageurl($urlrule, $pages, $array) . '">' . $pages . '</a> <a href="' . pageurl($urlrule, $curr_page + 1, $array) . '" class="a1">下一页</a>';
            } else {
                $multipage .= ' <a href="' . pageurl($urlrule, $pages, $array) . '">' . $pages . '</a> <a href="' . pageurl($urlrule, $curr_page + 1, $array) . '" class="a1">下一页</a>';
            }
        } elseif ($curr_page == $pages) {
            $multipage .= ' <span>' . $pages . '</span> <a href="' . pageurl($urlrule, $curr_page, $array) . '" class="a1">下一页</a>';
        } else {
            $multipage .= ' <a href="' . pageurl($urlrule, $pages, $array) . '">' . $pages . '</a> <a href="' . pageurl($urlrule, $curr_page + 1, $array) . '" class="a1">下一页</a>';
        }
    }
    return $multipage;
}
Esempio n. 3
0
		<th width="20%"><?php 
echo L('filename');
?>
        <div class="tab-use">
        	<div style="position:relative">
        	<div class="arrows cu" onmouseover="hoverUse('use-div');" onmouseout="hoverUse();" onmouseover="this.style.display='block'"></div>
            <ul id="use-div" class="tab-web-panel" onmouseover="this.style.display='block'"  onmouseout="hoverUse('use-div');">
                <li><a href="<?php 
echo url_par('dosubmit=1&status=0');
?>
"><?php 
echo L('not_used');
?>
</a></li>
                <li><a href="<?php 
echo url_par('dosubmit=1&status=1');
?>
"><?php 
echo L('used');
?>
</a></li>
            </ul>
            </div>
        </div></th>
		<th width="10%" ><?php 
echo L('filesize');
?>
</th>
		<th width="20%" ><?php 
echo L('uploadtime');
?>
Esempio n. 4
0
 /**
  * Funtion pages
  * 视频分页
  * @param int $number 总页数 
  * @param int $page 当前页
  * @param int $pagesize 每页数量
  * @param string $js JS属性
  */
 private function pages($num, $curr_page, $perpage = 20, $setpages = 5, $js = '')
 {
     $urlrule = url_par('page={$page}');
     $multipage = '';
     if ($num > $perpage) {
         $page = $setpages + 1;
         $offset = ceil($setpages / 2 - 1);
         $pages = ceil($num / $perpage);
         if (defined('IN_ADMIN') && !defined('PAGES')) {
             define('PAGES', $pages);
         }
         $from = $curr_page - $offset;
         $to = $curr_page + $offset;
         $more = 0;
         if ($page >= $pages) {
             $from = 2;
             $to = $pages - 1;
         } else {
             if ($from <= 1) {
                 $to = $page - 1;
                 $from = 2;
             } elseif ($to >= $pages) {
                 $from = $pages - ($page - 2);
                 $to = $pages - 1;
             }
             $more = 1;
         }
         $multipage .= '<a class="a1">' . $num . L('page_item') . '</a>';
         if ($curr_page > 0) {
             $multipage .= ' <a href="javascript:void(0);" onclick="' . $js . '(' . intval($curr_page - 1) . ')" class="a1">' . L('previous') . '</a>';
             if ($curr_page == 1) {
                 $multipage .= ' <span>1</span>';
             } elseif ($curr_page > 3 && $more) {
                 $multipage .= ' <a href="javascript:void(0);" onclick="' . $js . '(1)">1</a>..';
             } else {
                 $multipage .= ' <a href="javascript:void(0);" onclick="' . $js . '(1)">1</a>';
             }
         }
         for ($i = $from; $i <= $to; $i++) {
             if ($i != $curr_page) {
                 $multipage .= ' <a href="javascript:void(0);" onclick="' . $js . '(' . $i . ')">' . $i . '</a>';
             } else {
                 $multipage .= ' <span>' . $i . '</span>';
             }
         }
         if ($curr_page < $pages) {
             if ($curr_page < $pages - 2 && $more) {
                 $multipage .= ' ..<a href="javascript:void(0);" onclick="' . $js . '(' . $pages . ')">' . $pages . '</a> <a href="javascript:void(0);" onclick="' . $js . '(' . intval($curr_page + 1) . ')" class="a1">' . L('next') . '</a>';
             } else {
                 $multipage .= ' <a href="javascript:void(0);" onclick="' . $js . '(' . $pages . ')">' . $pages . '</a> <a href="javascript:void(0);" onclick="' . $js . '(' . intval($curr_page + 1) . ')" class="a1">' . L('next') . '</a>';
             }
         } elseif ($curr_page == $pages) {
             $multipage .= ' <span>' . $pages . '</span> <a href="javascript:void(0);" onclick="' . $js . '(' . $curr_page . ')" class="a1">' . L('next') . '</a>';
         } else {
             $multipage .= ' <a href="javascript:void(0);" onclick="' . $js . '(' . $pages . ')">' . $pages . '</a> <a href="javascript:void(0);" onclick="' . $js . '(' . intval($curr_page + 1) . ')" class="a1">' . L('next') . '</a>';
         }
     }
     return $multipage;
 }
Esempio n. 5
0
/**
 * 分页函数
 * 
 * @param $num 信息总数
 * @param $curr_page 当前分页
 * @param $perpage 每页显示数
 * @param $urlrule URL规则
 * @param $array 需要传递的数组,用于增加额外的方法
 * @return 分页
 */
function wpa_pages($num, $curr_page, $perpage = 20, $urlrule = '', $array = array(), $setpages = 10)
{
    if (defined('URLRULE')) {
        $urlrule = URLRULE;
        $array = $GLOBALS['URL_ARRAY'];
    } elseif ($urlrule == '') {
        $urlrule = url_par('page={$page}');
    }
    $multipage = '';
    if ($num > $perpage) {
        $page = $setpages + 1;
        $offset = ceil($setpages / 2 - 1);
        $pages = ceil($num / $perpage);
        if (defined('IN_ADMIN') && !defined('PAGES')) {
            define('PAGES', $pages);
        }
        $from = $curr_page - $offset;
        $to = $curr_page + $offset;
        $more = 0;
        if ($page >= $pages) {
            $from = 2;
            $to = $pages - 1;
        } else {
            if ($from <= 1) {
                $to = $page - 1;
                $from = 2;
            } elseif ($to >= $pages) {
                $from = $pages - ($page - 2);
                $to = $pages - 1;
            }
            $more = 1;
        }
        $multipage .= $curr_page . '/' . $pages;
        if ($curr_page > 0) {
            $multipage .= ' <a href="' . pageurl($urlrule, $curr_page - 1, $array) . '">' . L('previous') . '</a>';
        }
        if ($curr_page == $pages) {
            $multipage .= ' <a href="' . pageurl($urlrule, $curr_page, $array) . '">' . L('next') . '</a>';
        } else {
            $multipage .= ' <a href="' . pageurl($urlrule, $curr_page + 1, $array) . '">' . L('next') . '</a>';
        }
    }
    return $multipage;
}
                    <?php foreach ($modules as $module) {
                    	if(in_array($module['module'], array('pay','digg','search','scan','attachment','block','dbsource','template','release','cnzz','comment','mood'))) continue;
                        echo '<li><a href='.url_par('dosubmit=1&module='.$module['module']).'>'.$module['name'].'</a></li>';
                    }?>
                </ul>
            </div>
        </div>		
		</th>
		<th width="8%" ><?php echo L('catname')?></th>
		<th width="20%"><?php echo L('filename')?>
        <div class="tab-use">
        	<div style="position:relative">
        	<div class="arrows cu" onmouseover="hoverUse('use-div');" onmouseout="hoverUse();" onmouseover="this.style.display='block'"></div>
            <ul id="use-div" class="tab-web-panel" onmouseover="this.style.display='block'"  onmouseout="hoverUse('use-div');">
                <li><a href="<?php echo url_par('dosubmit=1&status=0')?>"><?php echo L('not_used')?></a></li>
                <li><a href="<?php echo url_par('dosubmit=1&status=1')?>"><?php echo L('used')?></a></li>
            </ul>
            </div>
        </div></th>
		<th width="10%" ><?php echo L('filesize')?></th>
		<th width="20%" ><?php echo L('uploadtime')?></th>
		<th width="15%" ><?php echo L('operations_manage')?></th>
		</tr>
        </thead>
        
    <tbody>
<?php 
if(is_array($infos)){
	foreach($infos as $info){
		$thumb = glob(dirname($this->upload_path.$info['filepath']).'/thumb_*'.basename($info['filepath']));
?>
Esempio n. 7
0
function video_makeurlrule()
{
    $setting = getcache('video', 'video');
    if ($setting['enable_rewrite'] == 0) {
        return url_par('page={$' . 'page}');
    } else {
        $url = preg_replace('/-[0-9]+.html$/', '-{$page}.html', get_url());
        return $url;
    }
}
Esempio n. 8
0
function makeurlrule()
{
    if (strpos(URLRULE, '.html') === FALSE) {
        return url_par('page={$' . 'page}');
    } else {
        $url = preg_replace('/-[0-9]+.html$/', '-{$page}.html', get_url());
        return $url;
    }
}