|
@@ -22,9 +22,15 @@ $photo = array();
|
22
|
22
|
$regular = array();
|
23
|
23
|
$video = array();
|
24
|
24
|
|
|
25
|
+$dates = array();
|
25
|
26
|
$rs = $tumble->getPosts($tumble->getPostsNumber());
|
26
|
27
|
if ($db->contarRegistros()>0) {
|
27
|
28
|
while($register = mysql_fetch_assoc($rs)) {
|
|
29
|
+ $date = strtotime($register['date']);
|
|
30
|
+ $year = date('Y',$date);
|
|
31
|
+ $month = date('M',$date);
|
|
32
|
+ $day = date('d',$date);
|
|
33
|
+ $dates[$year][$month][$day] = true;
|
28
|
34
|
$output = handleNode($register);
|
29
|
35
|
|
30
|
36
|
$theType = util::type2Text($register["type"]);
|
|
@@ -57,26 +63,32 @@ function handleNode($node) {
|
57
|
63
|
$dateTmp = null;
|
58
|
64
|
$formatedDate = gmdate("M d", strtotime($node["date"]) + util::transform_offset($conf->offsetTime));
|
59
|
65
|
|
60
|
|
- $output = array();
|
|
66
|
+ $output = array();
|
61
|
67
|
$output['url'] = $tumble->getPermalink($node["id_post"]);
|
62
|
68
|
$output['date'] = $formatedDate;
|
63
|
|
-
|
|
69
|
+
|
|
70
|
+ $date = strtotime($node['date']);
|
|
71
|
+ $year = date('Y',$date);
|
|
72
|
+ $month = date('M',$date);
|
|
73
|
+ $day = date('d',$date);
|
|
74
|
+
|
|
75
|
+ $output['full_date'] = $day.' '.$month.' '.$year;
|
64
|
76
|
$theType = util::type2Text($node["type"]);
|
65
|
77
|
|
66
|
78
|
switch($theType) {
|
67
|
79
|
case 'quote':
|
68
|
80
|
$output['quote'] = $node["description"];
|
69
|
|
- $output['source'] = $node["title"];
|
|
81
|
+ $output['source'] = $node["title"];
|
70
|
82
|
break;
|
71
|
|
- case 'conversation':
|
|
83
|
+ case 'conversation':
|
72
|
84
|
$output['lines'] = $tumble->formatConversation($node["description"]);
|
73
|
85
|
break;
|
74
|
|
- case 'url':
|
75
|
|
- $node["title"] = (empty($node["title"]))? $node["url"] : $node["title"];
|
|
86
|
+ case 'url':
|
|
87
|
+ $node["title"] = (empty($node["title"]))? $node["url"] : $node["title"];
|
76
|
88
|
$output['text'] = $node["title"];
|
77
|
89
|
$output['link'] = $node["url"];
|
78
|
90
|
break;
|
79
|
|
- case 'photo':
|
|
91
|
+ case 'photo':
|
80
|
92
|
$fileName = "uploads/".util::getFileName($node["url"]);
|
81
|
93
|
$x = @getimagesize($fileName);
|
82
|
94
|
if ($x[0] > 500) {
|
|
@@ -110,28 +122,85 @@ function handleNode($node) {
|
110
|
122
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
111
|
123
|
|
112
|
124
|
<head>
|
113
|
|
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
114
|
|
- <meta name="generator" content="gelato <?php echo util::codeName()." (".util::version().")"; ?>" />
|
115
|
|
- <link rel="shortcut icon" href="<?php echo $conf->urlGelato;?>/images/favicon.ico" />
|
116
|
|
- <link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo $conf->urlGelato.($conf->urlFriendly ? "/rss/" : "/rss.php"); ?>"/>
|
|
125
|
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
126
|
+ <meta name="generator" content="gelato <?php echo util::codeName()." (".util::version().")"; ?>" />
|
|
127
|
+ <link rel="shortcut icon" href="<?php echo $conf->urlGelato;?>/images/favicon.ico" />
|
|
128
|
+ <link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo $conf->urlGelato.($conf->urlFriendly ? "/rss/" : "/rss.php"); ?>"/>
|
117
|
129
|
<title><?php echo $conf->title." » ".__(" archive"); ?></title>
|
118
|
130
|
<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/jquery.js"></script>
|
119
|
|
- <link href="<?php echo $conf->urlGelato;?>/admin/css/archive.css" type="text/css" rel="stylesheet">
|
|
131
|
+ <script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/jquery.scrollTo-min.js"></script>
|
|
132
|
+ <link href="<?php echo $conf->urlGelato;?>/admin/css/archive.css" type="text/css" rel="stylesheet">
|
120
|
133
|
<script type='text/javascript'>
|
121
|
134
|
function select(object) {
|
122
|
135
|
var sel_id = object.id;
|
123
|
136
|
$("a.option").removeClass('selected');
|
124
|
137
|
$(object).addClass('selected');
|
125
|
|
- $("#conversation_content, #quote_content, #link_content, #regular_content, #photo_content, #video_content").hide("slow");
|
126
|
|
- $("#"+sel_id+"_content").show("slow");
|
|
138
|
+ $("#conversation_content, #quote_content, #link_content, #regular_content, #photo_content, #video_content").slideUp("fast");
|
|
139
|
+ $(".en, .es, .wn, .ws").remove();
|
|
140
|
+ $("li.selected").removeClass('selected');
|
|
141
|
+ $("#"+sel_id+"_content").show();
|
|
142
|
+ $('#user_hover').hide();
|
|
143
|
+
|
127
|
144
|
};
|
|
145
|
+
|
|
146
|
+ $(function(){
|
|
147
|
+ $("#timeline li").hover(function(){
|
|
148
|
+ $(this).css('cursor','pointer');
|
|
149
|
+ $("#bubble").hide();
|
|
150
|
+ $(this).queue('fx',[]);
|
|
151
|
+ $(this).animate({width:80},300, function(){
|
|
152
|
+ $("#bubble").text($(this).find('span').text()).fadeIn('fast').css({top:this.offsetTop - 2});
|
|
153
|
+ });
|
|
154
|
+ },function(){
|
|
155
|
+ $(this).css('cursor','auto');
|
|
156
|
+ $(this).animate({width:$(this).attr("rel")},300,'linear');
|
|
157
|
+ }).click(function(){
|
|
158
|
+ $(".en, .es, .wn, .ws").remove();
|
|
159
|
+ var date = $(this).text();
|
|
160
|
+ $("#content > div:visible ul").find('li').removeClass('selected');
|
|
161
|
+ $("#content > div:visible ul").find('li div[rel$='+date+']').parent().addClass('selected');
|
|
162
|
+ wrap();
|
|
163
|
+ if($('li.selected').length > 0){
|
|
164
|
+ var elem = $("li.selected").get();
|
|
165
|
+ $(window).scrollTo($("li.selected").eq(0).offset().top-50,900);
|
|
166
|
+ }else{
|
|
167
|
+ $("#bubble").text('Not found');
|
|
168
|
+ }
|
|
169
|
+ });
|
|
170
|
+
|
|
171
|
+ $('#user_hover').hover(function(){},function(){ $(this).hide(); });
|
|
172
|
+
|
|
173
|
+ $('.item').hover(function(e){
|
|
174
|
+ var item = $(this);
|
|
175
|
+ $('#user_hover').css({top:$(this).offset().top,left:$(this).offset().left}).show().unbind('click').click(function(){
|
|
176
|
+ $(item).click();
|
|
177
|
+ });
|
|
178
|
+ $('#user_hover h3').text($(this).attr('rel'));
|
|
179
|
+ },function(e){});
|
|
180
|
+ });
|
|
181
|
+
|
|
182
|
+ function wrap () {
|
|
183
|
+ var elems = $("li.selected");
|
|
184
|
+ var list = $("#content > div:visible ul.item_list > li");
|
|
185
|
+ var cols = 4;
|
|
186
|
+ var l = $(elems).length;
|
|
187
|
+ $(elems).each(function(){
|
|
188
|
+ index = $(list).index(this);
|
|
189
|
+ if( (index+1) % cols == 0){
|
|
190
|
+ $(this).append("<div class='crnr en'> </div>").append("<div class='crnr es'> </div>");
|
|
191
|
+ }else if( (index) % cols == 0){
|
|
192
|
+ $(this).append("<div class='crnr wn'> </div>").append("<div class='crnr ws'> </div>");
|
|
193
|
+ }
|
|
194
|
+ });
|
|
195
|
+ $(elems).eq(0).append("<div class='crnr wn'> </div>").append("<div class='crnr ws'> </div>");
|
|
196
|
+ $(elems).eq(l-1).append("<div class='crnr en'> </div>").append("<div class='crnr es'> </div>");
|
|
197
|
+ }
|
|
198
|
+
|
128
|
199
|
</script>
|
129
|
200
|
</head>
|
130
|
201
|
|
131
|
202
|
<body>
|
132
|
|
-
|
133
|
203
|
<div id='dash'>
|
134
|
|
-
|
135
|
204
|
<div id='options'>
|
136
|
205
|
<ul id='option-list'>
|
137
|
206
|
<li><a href='#' id='conversation' class='option selected' onclick="select(this);">Conversations</a></li>
|
|
@@ -141,111 +210,127 @@ function handleNode($node) {
|
141
|
210
|
<li><a href='#' id='quote' class='option' onclick="select(this);">Quotes</a></li>
|
142
|
211
|
<li><a href='#' id='video' class='option' onclick="select(this);">Videos</a></li>
|
143
|
212
|
</ul>
|
144
|
|
- </div>
|
|
213
|
+ </div>
|
|
214
|
+ <div id="timeline">
|
|
215
|
+ <div id="timewrap">
|
|
216
|
+ <div id="bubble"></div>
|
|
217
|
+ <h4>TIMELINE</h4>
|
|
218
|
+ <ul>
|
|
219
|
+ <?php
|
|
220
|
+
|
|
221
|
+ foreach ($dates as $year => $monthday) {
|
|
222
|
+ echo '<li class="year" rel="60"><span>'.$year.'</span></li>';
|
|
223
|
+ if(is_array($monthday) && count($monthday) > 0){
|
|
224
|
+
|
|
225
|
+ foreach ($monthday as $month => $days) {
|
|
226
|
+ echo '<li class="month" rel="40"><span>'.$month.' '.$year.'</span></li>';
|
|
227
|
+ if(is_array($days) && count($days) > 0){
|
|
228
|
+ foreach ($days as $day => $val) {
|
|
229
|
+ echo '<li class="day" rel="20"><span>'.$day.' '.$month.' '.$year.'</span></li>';
|
|
230
|
+ }
|
|
231
|
+ }
|
|
232
|
+ }
|
|
233
|
+ }
|
|
234
|
+ }
|
|
235
|
+ ?>
|
|
236
|
+ </ul>
|
|
237
|
+ </div>
|
|
238
|
+ </div>
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
145
|
242
|
|
146
|
243
|
<div id='content'>
|
|
244
|
+ <div id='msg' style="display:none;"> </div>
|
|
245
|
+
|
147
|
246
|
<div id='conversation_content'>
|
148
|
|
- <?php foreach($conversation as $item) { ?>
|
149
|
247
|
<ul class='item_list'>
|
|
248
|
+ <?php foreach($conversation as $item) { ?>
|
150
|
249
|
<li>
|
151
|
|
- <div class='item'>
|
152
|
|
- <ul>
|
153
|
|
- <li><?php echo $item['lines']; ?></li>
|
|
250
|
+ <div class='item' rel='<?php echo $item['full_date'] ?>' title="<?php echo strftime("%b %d, %G", strtotime($item['date'])); ?>" onclick="location.href='<?php echo $item['url'] ?>';">
|
|
251
|
+ <ul>
|
|
252
|
+ <li><?php echo $item['lines']; ?></li>
|
154
|
253
|
</ul>
|
155
|
254
|
</div>
|
156
|
|
- <div class='user_hover' onclick="location.href='<?php echo $item['url'] ?>';">
|
157
|
|
- <h3><?php echo strftime("%b %d, %G", strtotime($item['date'])); ?></h3>
|
158
|
|
- </div>
|
159
|
255
|
</li>
|
160
|
|
- </ul>
|
161
|
256
|
<?php } ?>
|
|
257
|
+ </ul>
|
162
|
258
|
</div>
|
163
|
259
|
|
164
|
260
|
<div id='quote_content' style='display:none;'>
|
165
|
|
- <?php foreach($quote as $item) { ?>
|
166
|
261
|
<ul class='item_list'>
|
|
262
|
+ <?php foreach($quote as $item) { ?>
|
167
|
263
|
<li>
|
168
|
|
- <div class='item'>
|
|
264
|
+ <div class='item' rel='<?php echo $item['full_date'] ?>' title="<?php echo strftime("%b %d, %G", strtotime($item['date'])); ?>" onclick="location.href='<?php echo $item['url'] ?>';">
|
169
|
265
|
<ul>
|
170
|
266
|
<li><em>"<?php echo substr($item['quote'], 0, 50), "..."; ?>"</em></li>
|
171
|
267
|
<li>--<?php echo $item['source']; ?></li>
|
172
|
268
|
</ul>
|
173
|
269
|
</div>
|
174
|
|
- <div class='user_hover' onclick="location.href='<?php echo $item['url'] ?>';">
|
175
|
|
- <h3><?php echo strftime("%b %d, %G", strtotime($item['date'])); ?></h3>
|
176
|
|
- </div>
|
177
|
270
|
</li>
|
178
|
|
- </ul>
|
179
|
271
|
<?php } ?>
|
|
272
|
+ </ul>
|
180
|
273
|
</div>
|
181
|
274
|
|
182
|
275
|
<div id='link_content' style='display:none;'>
|
183
|
|
- <?php foreach($link as $item) { ?>
|
184
|
276
|
<ul class='item_list'>
|
|
277
|
+ <?php foreach($link as $item) { ?>
|
185
|
278
|
<li>
|
186
|
|
- <div class='item link'>
|
|
279
|
+ <div class='item link' rel='<?php echo $item['full_date'] ?>' title='<?php echo strftime("%b %d, %G", strtotime($item['date'])); ?>' onclick="location.href='<?php echo $item['url'] ?>';">
|
187
|
280
|
<ul>
|
188
|
|
- <li><a href="<?php echo $item['link']; ?>"><?php echo $item['text']; ?></a></li>
|
|
281
|
+ <li><a href="<?php echo $item['link']; ?>" ><?php echo str_replace('.','.<br/>',$item['text']); ?></a></li>
|
189
|
282
|
</ul>
|
190
|
283
|
</div>
|
191
|
|
- <div class='user_hover' onclick="location.href='<?php echo $item['url'] ?>';">
|
192
|
|
- <h3><?php echo strftime("%b %d, %G", strtotime($item['date'])); ?></h3>
|
193
|
|
- </div>
|
194
|
284
|
</li>
|
195
|
|
- </ul>
|
196
|
285
|
<?php } ?>
|
|
286
|
+ </ul>
|
197
|
287
|
</div>
|
198
|
288
|
|
199
|
289
|
<div id='photo_content' style='display:none;'>
|
200
|
|
- <?php foreach($photo as $item) { ?>
|
201
|
290
|
<ul class='item_list'>
|
|
291
|
+ <?php foreach($photo as $item) { ?>
|
|
292
|
+ <?php echo "<pre>";
|
|
293
|
+ print_r($item);
|
|
294
|
+ echo "</pre>"; ?>
|
202
|
295
|
<li>
|
203
|
|
- <div class='item' style="background-image:url('<?php echo $item['photo']; ?>')"></div>
|
204
|
|
- <div class='user_hover' onclick="location.href='<?php echo $item['url'] ?>';">
|
205
|
|
- <h3><?php echo strftime("%b %d, %G", strtotime($item['date'])); ?></h3>
|
206
|
|
- </div>
|
|
296
|
+ <div class='item' style="background-image:url('<?php echo $item['photo']; ?>')" rel='<?php echo $item['full_date'] ?>' title="<?php echo strftime("%b %d, %G", strtotime($item['date'])); ?>" onclick="location.href='<?php echo $item['url'] ?>';"></div>
|
207
|
297
|
</li>
|
208
|
|
- </ul>
|
209
|
298
|
<?php } ?>
|
|
299
|
+ </ul>
|
210
|
300
|
</div>
|
211
|
301
|
|
212
|
302
|
<div id='regular_content' style='display:none;'>
|
213
|
|
- <?php foreach($regular as $item) { ?>
|
214
|
|
- <ul class='item_list'>
|
|
303
|
+ <ul class='item_list' rel='<?php echo $item['full_date'] ?>'>
|
|
304
|
+ <?php foreach($regular as $item) { ?>
|
215
|
305
|
<li>
|
216
|
|
- <div class='item'>
|
|
306
|
+ <div class="item" title="<?php echo strftime("%b %d, %G", strtotime($item['date'])); ?>" onclick="location.href='<?php echo $item['url'] ?>';">
|
217
|
307
|
<h4><?php echo $item['title']; ?></h4>
|
218
|
308
|
<p><?php echo $item['body']; ?></p>
|
219
|
309
|
</div>
|
220
|
|
- <div class='user_hover' onclick="location.href='<?php echo $item['url'] ?>';">
|
221
|
|
- <h3><?php echo strftime("%b %d, %G", strtotime($item['date'])); ?></h3>
|
222
|
|
- </div>
|
223
|
310
|
</li>
|
224
|
|
- </ul>
|
225
|
311
|
<?php } ?>
|
|
312
|
+ </ul>
|
226
|
313
|
</div>
|
227
|
314
|
|
228
|
315
|
<div id='video_content' style='display:none;'>
|
|
316
|
+ <ul class='item_list' rel='<?php echo $item['full_date'] ?>'>
|
229
|
317
|
<?php foreach($video as $item) { ?>
|
230
|
|
- <ul class='item_list'>
|
231
|
318
|
<li>
|
232
|
|
- <div class='item' style='text-align:center;'>
|
233
|
|
- <?php echo $item['embed']; //$item['caption'] ?>
|
234
|
|
- </div>
|
235
|
|
- <div class='user_hover' onclick="location.href='<?php echo $item['url'] ?>';">
|
236
|
|
- <h3><?php echo strftime("%b %d, %G", strtotime($item['date'])); ?></h3>
|
|
319
|
+ <div class='item' style='text-align:center;' title="<?php echo strftime("%b %d, %G", strtotime($item['date'])); ?>" onclick="location.href='<?php echo $item['url'] ?>';">
|
|
320
|
+ <?php echo $item['embed']; //$item['caption'] ?>
|
237
|
321
|
</div>
|
238
|
322
|
</li>
|
239
|
|
- </ul>
|
240
|
323
|
<?php } ?>
|
|
324
|
+ </ul>
|
241
|
325
|
</div>
|
242
|
|
-
|
|
326
|
+ <p style="clear:both"> </p>
|
243
|
327
|
</div>
|
244
|
328
|
|
245
|
329
|
<br clear='both' />
|
246
|
|
-
|
|
330
|
+ <div id='user_hover'><h3> </h3></div>
|
|
331
|
+
|
247
|
332
|
</div>
|
248
|
333
|
|
249
|
334
|
</body>
|
250
|
335
|
|
251
|
|
-</html>
|
|
336
|
+</html>
|