Archive generator and some minor fixes
parent
c60cdef066
commit
2949a49c30
|
|
@ -0,0 +1,119 @@
|
|||
body {
|
||||
background: white;
|
||||
font-family: "Lucida Sans";
|
||||
font-size: 15px;
|
||||
letter-spacing: 2px;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
#dash {
|
||||
margin: 35px auto 0px auto;
|
||||
padding: 10px;
|
||||
width: 85%;
|
||||
}
|
||||
|
||||
#options {
|
||||
width:100%;
|
||||
text-align: center;
|
||||
border-bottom: thin solid white;
|
||||
}
|
||||
|
||||
li {
|
||||
list-style: none;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
ul {
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
h4 {
|
||||
margin-top: 0px;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
font-variant: small-caps;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#options li {
|
||||
display: inline;
|
||||
padding: 10px;
|
||||
color: #999;
|
||||
font-variant: small-caps;
|
||||
}
|
||||
|
||||
#options li a {
|
||||
text-decoration: none;
|
||||
padding:10px 20px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
#options li a:hover {
|
||||
background-color: #382513;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
#options li a.selected {
|
||||
background-color: #382513;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
#content {
|
||||
padding: 25px;
|
||||
width:auto;
|
||||
}
|
||||
|
||||
.item {
|
||||
height: 110px;
|
||||
width: 110px;
|
||||
padding: 5px;
|
||||
overflow: hidden;
|
||||
border: thin solid #CCC;
|
||||
border-top: 2px solid #444;
|
||||
float:left;
|
||||
margin: 10px;
|
||||
color: #222;
|
||||
text-align: left;
|
||||
background-color: #FEFEFE;
|
||||
font-size: 11px;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
.link {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
div.user_hover {
|
||||
background-color:#000000;
|
||||
color:#FFFFFF;
|
||||
display:none;
|
||||
font-family:Helvetica,sans-serif;
|
||||
font-size:18px;
|
||||
font-size-adjust:none;
|
||||
font-stretch:normal;
|
||||
font-style:normal;
|
||||
font-variant:normal;
|
||||
font-weight:bold;
|
||||
line-height:normal;
|
||||
opacity:0.75;
|
||||
padding:5px;
|
||||
position:absolute;
|
||||
text-align:center;
|
||||
z-index:10;
|
||||
height:113px;
|
||||
width: 112px;
|
||||
margin:10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
li:hover div.user_hover {
|
||||
display:block;
|
||||
}
|
||||
|
||||
ul.item_list {
|
||||
width:112px;
|
||||
float:left;
|
||||
position:relative;
|
||||
margin:10px;
|
||||
}
|
||||
2
api.php
2
api.php
|
|
@ -82,7 +82,7 @@ if(!defined('entry')) define('entry',true);
|
|||
<?php
|
||||
$photoPath = str_replace("../", $conf->urlGelato."/", $register["url"]);
|
||||
?>
|
||||
<photo-caption><?php echo $tit;?></photo-caption>
|
||||
<photo-caption><?php echo stripslashes($tit);?></photo-caption>
|
||||
<photo-url><?php echo $photoPath;?></photo-url>
|
||||
</post>
|
||||
<?php
|
||||
|
|
|
|||
|
|
@ -0,0 +1,251 @@
|
|||
<?php
|
||||
if(!defined('entry'))define('entry', true);
|
||||
/* ===========================
|
||||
|
||||
gelato CMS - A PHP based tumblelog CMS
|
||||
development version
|
||||
http://www.gelatocms.com/
|
||||
|
||||
gelato CMS is a free software licensed under the GPL 2.0
|
||||
Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
|
||||
|
||||
=========================== */
|
||||
?>
|
||||
<?php
|
||||
require('entry.php');
|
||||
global $user, $tumble, $conf;
|
||||
|
||||
$quote = array();
|
||||
$conversation = array();
|
||||
$link = array();
|
||||
$photo = array();
|
||||
$regular = array();
|
||||
$video = array();
|
||||
|
||||
$rs = $tumble->getPosts($tumble->getPostsNumber());
|
||||
if ($tumble->contarRegistros()>0) {
|
||||
while($register = mysql_fetch_assoc($rs)) {
|
||||
$output = handleNode($register);
|
||||
|
||||
$theType = type2Text($register["type"]);
|
||||
|
||||
switch($theType) {
|
||||
case 'quote':
|
||||
$quote[] = $output;
|
||||
continue;
|
||||
case 'conversation':
|
||||
$conversation[] = $output;
|
||||
continue;
|
||||
case 'url':
|
||||
$link[] = $output;
|
||||
continue;
|
||||
case 'photo':
|
||||
$photo[] = $output;
|
||||
continue;
|
||||
case 'post':
|
||||
$regular[] = $output;
|
||||
continue;
|
||||
case 'video':
|
||||
$video[] = $output;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function handleNode($node) {
|
||||
global $user, $tumble, $conf;
|
||||
$dateTmp = null;
|
||||
$formatedDate = gmdate("M d", strtotime($node["date"]) + transform_offset($conf->offsetTime));
|
||||
|
||||
$output = array();
|
||||
$output['url'] = $tumble->getPermalink($node["id_post"]);
|
||||
$output['date'] = $formatedDate;
|
||||
|
||||
$theType = type2Text($node["type"]);
|
||||
|
||||
switch($theType) {
|
||||
case 'quote':
|
||||
$output['quote'] = $node["description"];
|
||||
$output['source'] = $node["title"];
|
||||
break;
|
||||
case 'conversation':
|
||||
$output['lines'] = $tumble->formatConversation($node["description"]);
|
||||
break;
|
||||
case 'url':
|
||||
$node["title"] = (empty($node["title"]))? $node["url"] : $node["title"];
|
||||
$output['text'] = $node["title"];
|
||||
$output['link'] = $node["url"];
|
||||
break;
|
||||
case 'photo':
|
||||
$fileName = "uploads/".getFileName($node["url"]);
|
||||
$x = @getimagesize($fileName);
|
||||
if ($x[0] > 500) {
|
||||
$photoPath = $conf->urlGelato."/classes/imgsize.php?w=500&img=".$node["url"];
|
||||
} else {
|
||||
$photoPath = str_replace("../", $conf->urlGelato."/", $node["url"]);
|
||||
}
|
||||
$output['caption'] = $node["description"];
|
||||
$output['photo'] = $photoPath;
|
||||
break;
|
||||
case 'post':
|
||||
$output['title'] = $node["title"];
|
||||
$output['body'] = $node["description"];
|
||||
break;
|
||||
case 'video':
|
||||
$output['caption'] = $node["description"];
|
||||
$temp = $tumble->getVideoPlayer($node["url"]);
|
||||
$patterns[0] = "/width='[0-9]+'/";
|
||||
$patterns[1] = "/height='[0-9]+'/";
|
||||
$replace[0] = "width='100'";
|
||||
$replace[1] = "height='75'";
|
||||
$embed = preg_replace($patterns, $replace, $temp);
|
||||
$output['embed'] = $embed;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
?>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="gelato <?php echo codeName()." (".version().")"; ?>" />
|
||||
<link rel="shortcut icon" href="<?php echo $conf->urlGelato;?>/images/favicon.ico" />
|
||||
<link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo $conf->urlGelato.($conf->urlFriendly ? "/rss/" : "/rss.php"); ?>"/>
|
||||
<title><?php echo $conf->title." » ".__(" archive"); ?></title>
|
||||
<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/jquery.js"></script>
|
||||
<link href="<?php echo $conf->urlGelato;?>/admin/css/archive.css" type="text/css" rel="stylesheet">
|
||||
<script type='text/javascript'>
|
||||
function select(object) {
|
||||
var sel_id = object.id;
|
||||
$("a.option").removeClass('selected');
|
||||
$(object).addClass('selected');
|
||||
$("#conversation_content, #quote_content, #link_content, #regular_content, #photo_content, #video_content").hide("slow");
|
||||
$("#"+sel_id+"_content").show("slow");
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id='dash'>
|
||||
|
||||
<div id='options'>
|
||||
<ul id='option-list'>
|
||||
<li><a href='#' id='conversation' class='option selected' onclick="select(this);">Conversations</a></li>
|
||||
<li><a href='#' id='photo' class='option' onclick="select(this);">Photos</a></li>
|
||||
<li><a href='#' id='link' class='option' onclick="select(this);">Links</a></li>
|
||||
<li><a href='#' id='regular' class='option' onclick="select(this);">Posts</a></li>
|
||||
<li><a href='#' id='quote' class='option' onclick="select(this);">Quotes</a></li>
|
||||
<li><a href='#' id='video' class='option' onclick="select(this);">Videos</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id='content'>
|
||||
<div id='conversation_content'>
|
||||
<?php foreach($conversation as $item) { ?>
|
||||
<ul class='item_list'>
|
||||
<li>
|
||||
<div class='item'>
|
||||
<ul>
|
||||
<li><?php echo $item['lines']; ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class='user_hover' onclick="location.href='<?php echo $item['url'] ?>';">
|
||||
<h3><?php echo strftime("%b %d, %G", strtotime($item['date'])); ?></h3>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div id='quote_content' style='display:none;'>
|
||||
<?php foreach($quote as $item) { ?>
|
||||
<ul class='item_list'>
|
||||
<li>
|
||||
<div class='item'>
|
||||
<ul>
|
||||
<li><em>"<?php echo substr($item['quote'], 0, 50), "..."; ?>"</em></li>
|
||||
<li>--<?php echo $item['source']; ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class='user_hover' onclick="location.href='<?php echo $item['url'] ?>';">
|
||||
<h3><?php echo strftime("%b %d, %G", strtotime($item['date'])); ?></h3>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div id='link_content' style='display:none;'>
|
||||
<?php foreach($link as $item) { ?>
|
||||
<ul class='item_list'>
|
||||
<li>
|
||||
<div class='item link'>
|
||||
<ul>
|
||||
<li><a href="<?php echo $item['link']; ?>"><?php echo $item['text']; ?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class='user_hover' onclick="location.href='<?php echo $item['url'] ?>';">
|
||||
<h3><?php echo strftime("%b %d, %G", strtotime($item['date'])); ?></h3>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div id='photo_content' style='display:none;'>
|
||||
<?php foreach($photo as $item) { ?>
|
||||
<ul class='item_list'>
|
||||
<li>
|
||||
<div class='item' style="background-image:url('<?php echo $item['photo']; ?>')"></div>
|
||||
<div class='user_hover' onclick="location.href='<?php echo $item['url'] ?>';">
|
||||
<h3><?php echo strftime("%b %d, %G", strtotime($item['date'])); ?></h3>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div id='regular_content' style='display:none;'>
|
||||
<?php foreach($regular as $item) { ?>
|
||||
<ul class='item_list'>
|
||||
<li>
|
||||
<div class='item'>
|
||||
<h4><?php echo $item['title']; ?></h4>
|
||||
<p><?php echo $item['body']; ?></p>
|
||||
</div>
|
||||
<div class='user_hover' onclick="location.href='<?php echo $item['url'] ?>';">
|
||||
<h3><?php echo strftime("%b %d, %G", strtotime($item['date'])); ?></h3>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div id='video_content' style='display:none;'>
|
||||
<?php foreach($video as $item) { ?>
|
||||
<ul class='item_list'>
|
||||
<li>
|
||||
<div class='item' style='text-align:center;'>
|
||||
<?php echo $item['embed']; //$item['caption'] ?>
|
||||
</div>
|
||||
<div class='user_hover' onclick="location.href='<?php echo $item['url'] ?>';">
|
||||
<h3><?php echo strftime("%b %d, %G", strtotime($item['date'])); ?></h3>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<br clear='both' />
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
@ -488,8 +488,9 @@ if(!defined('entry') || !entry) die('Not a valid page');
|
|||
}
|
||||
|
||||
function trimString($string, $len = "") {
|
||||
if($len>strlen($string) or $len<1)
|
||||
return $string;
|
||||
if($len>strlen($string) or $len<1) {
|
||||
return strip_tags($string);
|
||||
}
|
||||
$string = strip_tags($string);
|
||||
$len = (empty($len)) ? "50" : $len ;
|
||||
return ( strpos($string, " ", $len) ) ? substr_replace($string, "...", $len) : $string ;
|
||||
|
|
|
|||
|
|
@ -200,13 +200,5 @@ class gelato extends Conexion_Mysql {
|
|||
$out .= $post_id.$strEnd;
|
||||
return $out;
|
||||
}
|
||||
|
||||
function getPermalink($post_id){
|
||||
$strEnd = ($this->conf->urlFriendly) ? "/" : "";
|
||||
$out = $this->conf->urlGelato;
|
||||
$out .= ($this->conf->urlFriendly) ? "/post/" : "/index.php?post=";
|
||||
$out .= $post_id.$strEnd;
|
||||
return $out;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
10
notice.txt
10
notice.txt
|
|
@ -11,8 +11,12 @@ Juan del Rio [ http://elcaminante.net/ ]
|
|||
= COPYRIGHT NOTICES =
|
||||
This product includes code and libraries developed by third parties, which are governed by different licenses. These components, and their licenses, are listed below.
|
||||
|
||||
= Archive based on code from: simple Tumblr API processor =
|
||||
Copyright (c) Vivek, http://www.stageleftstudios.com
|
||||
simple Tumblr API processor is available under Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.
|
||||
|
||||
= markItUp! Universal MarkUp Engine, JQuery plugin =
|
||||
Copyright (C) 2007-2008 Jay Salvat, http://markitup.jaysalvat.com/
|
||||
Copyright (c) 2007-2008 Jay Salvat, http://markitup.jaysalvat.com/
|
||||
markItUp is available under a dual licensed the MIT and GPL licenses.
|
||||
|
||||
= NicEdit - Micro Inline WYSIWYG =
|
||||
|
|
@ -47,10 +51,6 @@ Clase Conexion_Mysql available under MIT license.
|
|||
Copyright (c) Victor De la Rocha, http://www.mis-algoritmos.com/
|
||||
Digg Style Paginator Class available under MIT license.
|
||||
|
||||
= Clase plantillas =
|
||||
Copyright (c) Pedro Santana, http://www.pecesama.net/weblog/
|
||||
Clase plantillas available under MIT license.
|
||||
|
||||
= Textile class =
|
||||
Copyright (c) 2003-2004, Dean Allen, http://textile.thresholdstate.com/
|
||||
Textile class available under GNU General Public License.
|
||||
|
|
|
|||
Loading…
Reference in New Issue