:3
git-svn-id: file:///home/shish/svn/shimmie2/trunk@842 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
be5cced8c5
commit
2ab8e256eb
93
themes/futaba/layout.class.php
Normal file
93
themes/futaba/layout.class.php
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class Layout {
|
||||||
|
function display_page($page) {
|
||||||
|
global $config;
|
||||||
|
$theme_name = $config->get_string('theme', 'default');
|
||||||
|
$data_href = get_base_href();
|
||||||
|
$contact_link = $config->get_string('contact_link');
|
||||||
|
$version = "Shimmie-".VERSION;
|
||||||
|
|
||||||
|
$header_html = "";
|
||||||
|
foreach($page->headers as $line) {
|
||||||
|
$header_html .= "\t\t$line\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
$left_block_html = "";
|
||||||
|
$main_block_html = "";
|
||||||
|
|
||||||
|
foreach($page->blocks as $block) {
|
||||||
|
switch($block->section) {
|
||||||
|
case "left":
|
||||||
|
$left_block_html .= $this->block_to_html($block, true, "left");
|
||||||
|
break;
|
||||||
|
case "main":
|
||||||
|
$main_block_html .= $this->block_to_html($block, false, "main");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
print "<p>error: {$block->header} using an unknown section ({$block->section})";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$debug = get_debug_info();
|
||||||
|
|
||||||
|
$contact = empty($contact_link) ? "" : "<br><a href='$contact_link'>Contact</a>";
|
||||||
|
|
||||||
|
if(empty($page->subheading)) {
|
||||||
|
$subheading = "";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$subheading = "<div id='subtitle'>{$page->subheading}</div>";
|
||||||
|
}
|
||||||
|
|
||||||
|
print <<<EOD
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>{$page->title}</title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
||||||
|
<link rel="stylesheet" href="$data_href/themes/$theme_name/style.css" type="text/css">
|
||||||
|
$header_html
|
||||||
|
<script src='$data_href/themes/$theme_name/sidebar.js' type='text/javascript'></script>
|
||||||
|
<script src='$data_href/themes/$theme_name/script.js' type='text/javascript'></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<h1>{$page->heading}</h1>
|
||||||
|
$subheading
|
||||||
|
|
||||||
|
<div id="nav">$left_block_html</div>
|
||||||
|
<div id="body">$main_block_html</div>
|
||||||
|
|
||||||
|
<div id="footer">
|
||||||
|
<hr>
|
||||||
|
Images © their respective owners,
|
||||||
|
<a href="http://trac.shishnet.org/shimmie2/">$version</a> ©
|
||||||
|
<a href="http://www.shishnet.org/">Shish</a> 2007,
|
||||||
|
based on the <a href="http://trac.shishnet.org/shimmie2/wiki/DanbooruRipoff">Danbooru</a> concept.
|
||||||
|
$debug
|
||||||
|
$contact
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
EOD;
|
||||||
|
}
|
||||||
|
|
||||||
|
function block_to_html($block, $hidable=false, $salt="") {
|
||||||
|
$h = $block->header;
|
||||||
|
$b = $block->body;
|
||||||
|
$html = "";
|
||||||
|
$i = str_replace(' ', '_', $h) . $salt;
|
||||||
|
if($hidable) {
|
||||||
|
$toggle = " onclick=\"toggle('$i')\"";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$toggle = "";
|
||||||
|
}
|
||||||
|
if(!is_null($h)) $html .= "\n<h3 id='$i-toggle'$toggle>$h</h3>\n";
|
||||||
|
if(!is_null($b)) $html .= "<div id='$i'>$b</div>\n";
|
||||||
|
return $html;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
6
themes/futaba/page.class.php
Normal file
6
themes/futaba/page.class.php
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class Page extends GenericPage {
|
||||||
|
// no changes from default
|
||||||
|
}
|
||||||
|
?>
|
136
themes/futaba/script.js
Normal file
136
themes/futaba/script.js
Normal file
@ -0,0 +1,136 @@
|
|||||||
|
var defaultTexts = new Array();
|
||||||
|
|
||||||
|
window.onload = function(e) {
|
||||||
|
var sections=get_sections();
|
||||||
|
for(var i=0;i<sections.length;i++) toggle(sections[i]);
|
||||||
|
|
||||||
|
initGray("search_input", "Search");
|
||||||
|
initGray("commentBox", "Comment");
|
||||||
|
initGray("tagBox", "tagme");
|
||||||
|
|
||||||
|
// if we're going to show with JS, hide with JS first
|
||||||
|
pass_confirm = byId("pass_confirm");
|
||||||
|
if(pass_confirm) {
|
||||||
|
pass_confirm.style.display = "none";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function initGray(boxname, text) {
|
||||||
|
var box = byId(boxname);
|
||||||
|
if(!box) return;
|
||||||
|
|
||||||
|
var clr = function () {cleargray(box, text);};
|
||||||
|
var set = function () {setgray(box, text);};
|
||||||
|
|
||||||
|
addEvent(box, "focus", clr, false);
|
||||||
|
addEvent(box, "blur", set, false);
|
||||||
|
|
||||||
|
if(box.value == text) {
|
||||||
|
box.style.color = "#999";
|
||||||
|
box.style.textAlign = "center";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
box.style.color = "#000";
|
||||||
|
box.style.textAlign = "left";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function cleargray(box, text) {
|
||||||
|
if(box.value == text) {
|
||||||
|
box.value = "";
|
||||||
|
box.style.color = "#000";
|
||||||
|
box.style.textAlign = "left";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function setgray(box, text) {
|
||||||
|
if(box.value == "") {
|
||||||
|
box.style.textAlign = "center";
|
||||||
|
box.style.color = "gray";
|
||||||
|
box.value = text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function showUp(elem) {
|
||||||
|
e = document.getElementById(elem)
|
||||||
|
if(!e) return;
|
||||||
|
e.style.display = "";
|
||||||
|
// alert(e.type+": "+e.value);
|
||||||
|
if(e.value.match(/^http|^ftp/)) {
|
||||||
|
e.type = "text";
|
||||||
|
alert("Box is web upload");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
|
||||||
|
* LibShish-JS *
|
||||||
|
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
function addEvent(obj, event, func, capture){
|
||||||
|
if (obj.addEventListener){
|
||||||
|
obj.addEventListener(event, func, capture);
|
||||||
|
} else if (obj.attachEvent){
|
||||||
|
obj.attachEvent("on"+event, func);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function byId(id) {
|
||||||
|
return document.getElementById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getHTTPObject() {
|
||||||
|
if (window.XMLHttpRequest){
|
||||||
|
return new XMLHttpRequest();
|
||||||
|
}
|
||||||
|
else if(window.ActiveXObject){
|
||||||
|
return new ActiveXObject("Microsoft.XMLHTTP");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function ajaxRequest(url, callback) {
|
||||||
|
var http = getHTTPObject();
|
||||||
|
http.open("GET", url, true);
|
||||||
|
http.onreadystatechange = function() {
|
||||||
|
if(http.readyState == 4) callback(http.responseText);
|
||||||
|
}
|
||||||
|
http.send(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* get, set, and delete cookies */
|
||||||
|
function getCookie( name ) {
|
||||||
|
var start = document.cookie.indexOf( name + "=" );
|
||||||
|
var len = start + name.length + 1;
|
||||||
|
if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if ( start == -1 ) return null;
|
||||||
|
var end = document.cookie.indexOf( ";", len );
|
||||||
|
if ( end == -1 ) end = document.cookie.length;
|
||||||
|
return unescape( document.cookie.substring( len, end ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
function setCookie( name, value, expires, path, domain, secure ) {
|
||||||
|
var today = new Date();
|
||||||
|
today.setTime( today.getTime() );
|
||||||
|
if ( expires ) {
|
||||||
|
expires = expires * 1000 * 60 * 60 * 24;
|
||||||
|
}
|
||||||
|
var expires_date = new Date( today.getTime() + (expires) );
|
||||||
|
document.cookie = name+"="+escape( value ) +
|
||||||
|
( ( expires ) ? ";expires="+expires_date.toGMTString() : "" ) + //expires.toGMTString()
|
||||||
|
( ( path ) ? ";path=" + path : "" ) +
|
||||||
|
( ( domain ) ? ";domain=" + domain : "" ) +
|
||||||
|
( ( secure ) ? ";secure" : "" );
|
||||||
|
}
|
||||||
|
|
||||||
|
function deleteCookie( name, path, domain ) {
|
||||||
|
if ( getCookie( name ) ) document.cookie = name + "=" +
|
||||||
|
( ( path ) ? ";path=" + path : "") +
|
||||||
|
( ( domain ) ? ";domain=" + domain : "" ) +
|
||||||
|
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
|
||||||
|
}
|
||||||
|
|
83
themes/futaba/sidebar.js
Normal file
83
themes/futaba/sidebar.js
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
/*
|
||||||
|
* This script shamelessly stolen from wakachan.org d(^_^)b
|
||||||
|
*/
|
||||||
|
|
||||||
|
var cookie_name="shimmie_sidebar";
|
||||||
|
var default_sections=["upload", "edit_tags"];
|
||||||
|
|
||||||
|
function toggle(id)
|
||||||
|
{
|
||||||
|
var e=document.getElementById(id);
|
||||||
|
if(!e) return;
|
||||||
|
if(e.style.display)
|
||||||
|
{
|
||||||
|
remove_section(id);
|
||||||
|
e.style.display="";
|
||||||
|
|
||||||
|
var e2 = document.getElementById(id+"-toggle");
|
||||||
|
if(e2) {
|
||||||
|
e2.style.color = "#000";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
add_section(id);
|
||||||
|
e.style.display="none";
|
||||||
|
|
||||||
|
var e2 = document.getElementById(id+"-toggle");
|
||||||
|
if(e2) {
|
||||||
|
e2.style.color = "#AAA";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function add_section(id)
|
||||||
|
{
|
||||||
|
var sections=get_sections();
|
||||||
|
for(var i=0;i<sections.length;i++) if(sections[i]==id) return;
|
||||||
|
sections.push(id);
|
||||||
|
set_sections(sections);
|
||||||
|
}
|
||||||
|
|
||||||
|
function remove_section(id)
|
||||||
|
{
|
||||||
|
var sections=get_sections();
|
||||||
|
var new_sections=new Array();
|
||||||
|
for(var i=0;i<sections.length;i++) if(sections[i]!=id) new_sections.push(sections[i]);
|
||||||
|
set_sections(new_sections);
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_sections()
|
||||||
|
{
|
||||||
|
var cookie=get_cookie(cookie_name);
|
||||||
|
if(cookie) return cookie.split(/,/);
|
||||||
|
else return default_sections;
|
||||||
|
}
|
||||||
|
|
||||||
|
function set_sections(sections) { set_cookie(cookie_name,sections.join(","),365); }
|
||||||
|
|
||||||
|
function get_cookie(name)
|
||||||
|
{
|
||||||
|
with(document.cookie)
|
||||||
|
{
|
||||||
|
var index=indexOf(name+"=");
|
||||||
|
if(index==-1) return '';
|
||||||
|
index=indexOf("=",index)+1;
|
||||||
|
var endstr=indexOf(";",index);
|
||||||
|
if(endstr==-1) endstr=length;
|
||||||
|
return unescape(substring(index,endstr));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
function set_cookie(name,value,days)
|
||||||
|
{
|
||||||
|
if(days)
|
||||||
|
{
|
||||||
|
var date=new Date();
|
||||||
|
date.setTime(date.getTime()+(days*24*60*60*1000));
|
||||||
|
var expires="; expires="+date.toGMTString();
|
||||||
|
}
|
||||||
|
else expires="";
|
||||||
|
document.cookie=name+"="+value+expires+"; path=/";
|
||||||
|
}
|
||||||
|
|
167
themes/futaba/style.css
Normal file
167
themes/futaba/style.css
Normal file
@ -0,0 +1,167 @@
|
|||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
* things common to all pages *
|
||||||
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
BODY {
|
||||||
|
background: #EEE;
|
||||||
|
font-family: "Arial", sans-serif;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
H1, H3 {
|
||||||
|
border: 1px solid black;
|
||||||
|
background: #DDD;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
H1 {
|
||||||
|
margin-top: 0px;
|
||||||
|
margin-bottom: 0px;
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
H1 A {
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
H3 {
|
||||||
|
margin-top: 32px;
|
||||||
|
padding: 1px;
|
||||||
|
}
|
||||||
|
THEAD {
|
||||||
|
background: #DEDEDE;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
TD {
|
||||||
|
vertical-align: top;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
#subtitle {
|
||||||
|
width: 256px;
|
||||||
|
font-size: 0.75em;
|
||||||
|
margin: auto;
|
||||||
|
text-align: center;
|
||||||
|
border: 1px solid black;
|
||||||
|
border-top: none;
|
||||||
|
background: #DDD;
|
||||||
|
}
|
||||||
|
#body SELECT {width: 150px;}
|
||||||
|
TD>INPUT[type="submit"] {width: 100%;}
|
||||||
|
TD>INPUT[type="text"] {width: 100%;}
|
||||||
|
TD>INPUT[type="password"] {width: 100%;}
|
||||||
|
TD>SELECT {width: 100%;}
|
||||||
|
|
||||||
|
#footer {
|
||||||
|
clear: both;
|
||||||
|
padding-top: 8px;
|
||||||
|
font-size: 0.7em;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
*[onclick] {cursor: pointer;}
|
||||||
|
IMG {border: none;}
|
||||||
|
FORM {margin: 0px;}
|
||||||
|
A {text-decoration: none;}
|
||||||
|
A:hover {text-decoration: underline;}
|
||||||
|
|
||||||
|
BLOCKQUOTE {
|
||||||
|
border: 1px solid black;
|
||||||
|
padding: 8px;
|
||||||
|
background: #DDD;
|
||||||
|
}
|
||||||
|
|
||||||
|
UL {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
* the navigation bar, and all its blocks *
|
||||||
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
#nav {
|
||||||
|
width: 150px;
|
||||||
|
float: left;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 0.9em;
|
||||||
|
}
|
||||||
|
#nav TABLE {
|
||||||
|
width: 150px;
|
||||||
|
}
|
||||||
|
#nav TD {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
#nav INPUT {
|
||||||
|
width: 100%;
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
#nav SELECT {
|
||||||
|
width: 100%;
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#comments P {
|
||||||
|
text-align: left;
|
||||||
|
width: 150px;
|
||||||
|
max-width: 150px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.more:after {
|
||||||
|
content: " >>>";
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag_count:before {
|
||||||
|
content: "(";
|
||||||
|
}
|
||||||
|
.tag_count:after {
|
||||||
|
content: ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
* the main part of each page *
|
||||||
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
#body {
|
||||||
|
margin-left: 160px;
|
||||||
|
text-align: center;
|
||||||
|
height: 1%;
|
||||||
|
}
|
||||||
|
#body TABLE {
|
||||||
|
width: 90%;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
* specific page types *
|
||||||
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
#pagelist {
|
||||||
|
margin-top: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#tagmap A {
|
||||||
|
padding: 8px 4px 8px 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.comment {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.setupblock {
|
||||||
|
border: 1px solid #AAA;
|
||||||
|
padding: 8px;
|
||||||
|
margin: 16px;
|
||||||
|
width: 350px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.helpable {
|
||||||
|
border-bottom: 1px dashed gray;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ok {
|
||||||
|
background: #AFA;
|
||||||
|
}
|
||||||
|
.bad {
|
||||||
|
background: #FAA;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
79
themes/futaba/themelet.class.php
Normal file
79
themes/futaba/themelet.class.php
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class Themelet {
|
||||||
|
/**
|
||||||
|
* Generic error message display
|
||||||
|
*/
|
||||||
|
public function display_error($page, $title, $message) {
|
||||||
|
$page->set_title($title);
|
||||||
|
$page->set_heading($title);
|
||||||
|
$page->add_block(new NavBlock());
|
||||||
|
$page->add_block(new Block("Error", $message));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generic thumbnail code; returns HTML rather than adding
|
||||||
|
* a block since thumbs tend to go inside blocks...
|
||||||
|
*/
|
||||||
|
public function build_thumb_html($image, $query=null) {
|
||||||
|
global $config;
|
||||||
|
$h_view_link = make_link("post/view/{$image->id}", $query);
|
||||||
|
$h_tip = html_escape($image->get_tooltip());
|
||||||
|
$h_thumb_link = $image->get_thumb_link();
|
||||||
|
$tsize = get_thumbnail_size($image->width, $image->height);
|
||||||
|
return "<a href='$h_view_link'><img title='$h_tip' alt='$h_tip' ".
|
||||||
|
"width='{$tsize[0]}' height='{$tsize[1]}' src='$h_thumb_link' /></a>";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a generic paginator
|
||||||
|
*/
|
||||||
|
public function display_paginator($page, $base, $query, $page_number, $total_pages) {
|
||||||
|
if($total_pages == 0) $total_pages = 1;
|
||||||
|
$body = $this->build_paginator($page_number, $total_pages, $base, $query);
|
||||||
|
$page->add_block(new Block(null, $body, "main", 90));
|
||||||
|
}
|
||||||
|
|
||||||
|
private function gen_page_link($base_url, $query, $page, $name) {
|
||||||
|
$link = make_link("$base_url/$page", $query);
|
||||||
|
return "<a href='$link'>$name</a>";
|
||||||
|
}
|
||||||
|
|
||||||
|
private function gen_page_link_block($base_url, $query, $page, $current_page, $name) {
|
||||||
|
$paginator = "";
|
||||||
|
if($page == $current_page) $paginator .= "<b>";
|
||||||
|
$paginator .= $this->gen_page_link($base_url, $query, $page, $name);
|
||||||
|
if($page == $current_page) $paginator .= "</b>";
|
||||||
|
return $paginator;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function build_paginator($current_page, $total_pages, $base_url, $query) {
|
||||||
|
$next = $current_page + 1;
|
||||||
|
$prev = $current_page - 1;
|
||||||
|
$rand = rand(1, $total_pages);
|
||||||
|
|
||||||
|
$at_start = ($current_page <= 1 || $total_pages <= 1);
|
||||||
|
$at_end = ($current_page >= $total_pages);
|
||||||
|
|
||||||
|
$first_html = $at_start ? "First" : $this->gen_page_link($base_url, $query, 1, "First");
|
||||||
|
$prev_html = $at_start ? "Prev" : $this->gen_page_link($base_url, $query, $prev, "Prev");
|
||||||
|
$random_html = $this->gen_page_link($base_url, $query, $rand, "Random");
|
||||||
|
$next_html = $at_end ? "Next" : $this->gen_page_link($base_url, $query, $next, "Next");
|
||||||
|
$last_html = $at_end ? "Last" : $this->gen_page_link($base_url, $query, $total_pages, "Last");
|
||||||
|
|
||||||
|
$start = $current_page-5 > 1 ? $current_page-5 : 1;
|
||||||
|
$end = $start+10 < $total_pages ? $start+10 : $total_pages;
|
||||||
|
|
||||||
|
$pages = array();
|
||||||
|
foreach(range($start, $end) as $i) {
|
||||||
|
$pages[] = $this->gen_page_link_block($base_url, $query, $i, $current_page, $i);
|
||||||
|
}
|
||||||
|
$pages_html = implode(" | ", $pages);
|
||||||
|
|
||||||
|
return "<p class='paginator'>$first_html | $prev_html | $random_html | $next_html | $last_html".
|
||||||
|
"<br><< $pages_html >></p>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
Loading…
x
Reference in New Issue
Block a user