[parasy commit] r41 - in trunk/upload: . parasy templates/babel

0 views
Skip to first unread message

codesite...@google.com

unread,
Jan 13, 2008, 6:14:32 AM1/13/08
to project...@googlegroups.com
Author: Saiccc
Date: Sun Jan 13 03:13:33 2008
New Revision: 41

Modified:
trunk/upload/parasy/ParasyCore.php
trunk/upload/parasy_dashboard.php
trunk/upload/parasy_json_tab.php
trunk/upload/templates/babel/dashboard.htm
trunk/upload/templates/babel/viewpro_classic.htm

Log:
home tab avatar size fix
dashboard timeline

Modified: trunk/upload/parasy/ParasyCore.php
==============================================================================
--- trunk/upload/parasy/ParasyCore.php (original)
+++ trunk/upload/parasy/ParasyCore.php Sun Jan 13 03:13:33 2008
@@ -372,6 +372,53 @@
}

/* Thread List */
+
+function timeline_remix () {
+ global $db, $_DCACHE, $timestamp, $tablepre, $discuz_uid, $groupid, $fid;
+ $_timeline = array();
+ @include(DISCUZ_ROOT.'./forumdata/cache/parasy_topic_timeline.php');
+ if((@!include('forumdata/cache/parasy_topic_timeline.php')) ||
$topics_expiration < time()) {
+ $topics = topic_update('timeline','t.dateline DESC','20','m');
+ } else {
+ $topics = $topics;
+ }
+ $i = 0;
+ foreach($topics as $_topic) {
+ $i++;
+ if ($i < 21){
+ $_timeline['timeline'][$_topic['dateline']] = array();
+ $_timeline['timeline'][$_topic['dateline']]['type'] = 'topic';
+ $_timeline['timeline'][$_topic['dateline']]['author'] =
$_topic['author'] ? $_topic['author'] : '�ο�';
+ $_timeline['timeline'][$_topic['dateline']]['clean_title'] = str_replace("'","��",$_topic['subject']);
+ $_timeline['timeline'][$_topic['dateline']]['title'] = $_topic['subject'];
+ $_timeline['timeline'][$_topic['dateline']]['id'] = $_topic['tid'];
+ $_timeline['timeline'][$_topic['dateline']]['uid'] = $_topic['authorid'];
+ $_timeline['timeline'][$_topic['dateline']]['name'] = $_topic['name'];
+ $_timeline['timeline'][$_topic['dateline']]['board_name'] = $_topic['board_name'];
+ $_timeline['timeline'][$_topic['dateline']]['time'] = $_topic['dateline'];
+ $_timeline['timeline'][$_topic['dateline']]['avatar'] = $_topic['avatar'];
+ $_timeline['timeline'][$_topic['dateline']]['size'] = vxGetItemSize($_topic['replies']).'px';
+ }
+ }
+
+ require_once DISCUZ_ROOT.'./forumdata/cache/cache_nowhere.php';
+ foreach($_DCACHE['nowhere'] as $_now) {
+ $_timeline['timeline'][$_now['dateline']] = array();
+ $_timeline['timeline'][$_now['dateline']]['type'] = 'now';
+ $_timeline['timeline'][$_now['dateline']]['author'] =
$_now['author'] ? $_now['author'] : '�ο�';
+ $_timeline['timeline'][$_now['dateline']]['uid'] = $_now['authorid'];
+ $_timeline['timeline'][$_now['dateline']]['id'] = $_now['vid'];
+ $_timeline['timeline'][$_now['dateline']]['title'] = dhtmlspecialchars($_now['content']);
+ $_timeline['timeline'][$_now['dateline']]['avatar'] = avRESIZE($_now['avatar']);
+ $_timeline['timeline'][$_now['dateline']]['time'] = $_now['dateline'];
+ $_timeline['timeline'][$_now['dateline']]['via'] = nwFROM($_now['background']);
+ $_timeline['timeline'][$_now['dateline']]['icons'] = nwtextICONS($_now['icons']);
+ }
+ krsort($_timeline['timeline']);
+
+ return $_timeline['timeline'];
+}
+
function update_timeline($update =0) {
global $db, $_DCACHE, $timestamp, $tablepre, $discuz_uid, $groupid, $fid;
if((!include('forumdata/cache/cache_dashboard_timeline.php')) ||
$update = 1) {
@@ -686,7 +733,7 @@
echo $s;
}

-function topic_update($type='latest',$order='t.dateline
DESC',$limit='100') {
+function topic_update($type='latest',$order='t.dateline
DESC',$limit='100',$avatar='s') {
global $db, $_DCACHE, $timestamp, $tablepre, $discuz_uid;
$data = array();
$query = $db->query("SELECT t.subject, t.authorid,t.author,t.tid,
t.lastpost, t.views, t.replies,t.dateline,t.lastpost, mf.uid,
mf.avatar,f.board_name,f.name FROM {$tablepre}members m,
{$tablepre}threads t LEFT JOIN {$tablepre}forums f ON f.fid=t.fid LEFT
JOIN {$tablepre}memberfields mf ON mf.uid=t.authorid WHERE m.uid =
t.authorid AND m.uid ORDER BY {$order} LIMIT {$limit}");
@@ -702,7 +749,7 @@
$data['topics'][$t['tid']]['board_name'] = $t['board_name'];
$data['topics'][$t['tid']]['author'] = $t['author'] ? $t['author'] : '�ο�';
$data['topics'][$t['tid']]['authorid'] = $t['authorid'];
- $data['topics'][$t['tid']]['avatar'] = avRESIZE($t['avatar'],'s');
+ $data['topics'][$t['tid']]['avatar'] = avRESIZE($t['avatar'],$avatar);

}
$data['topics_expiration'] = 600 + time();

Modified: trunk/upload/parasy_dashboard.php
==============================================================================
--- trunk/upload/parasy_dashboard.php (original)
+++ trunk/upload/parasy_dashboard.php Sun Jan 13 03:13:33 2008
@@ -6,7 +6,6 @@
}
require_once DISCUZ_ROOT.'./include/cache.func.php';
require_once DISCUZ_ROOT.'./forumdata/cache/cache_forums.php';
-@include(DISCUZ_ROOT.'./forumdata/cache/cache_dashboard_timeline.php');
@include(DISCUZ_ROOT.'./forumdata/cache/cache_dashboard_commend.php');

if(!$discuz_uid){
@@ -31,10 +30,8 @@
$dash_commend = $dash_commend;
}
@shuffle($dash_commend);
-/* Timeline
-if((!include('forumdata/cache/cache_dashboard_timeline.php')) ||
$timeline_expiration +300 < time()) {
- update_timeline();
-}*/
+/* Loading Timeline */
+$timeline = timeline_remix();

/* Online Buddies */
$buddyonline = $buddyoffline = array();
@@ -46,17 +43,6 @@
while($buddy = $db->fetch_array($query)) {
$buddyuser = array('uid' => $buddy['uid'], 'username' =>
($buddy['username'] ? $buddy['username'] : 'User was
Deleted'), 'description' => $buddy['description']);
$buddy['onlineuser'] ? $buddyonline[] = $buddyuser : $buddyoffline[]
= $buddyuser;
-}
-
-/* Fav Board */
-$query = $db->query("SELECT f.board_name, f.name,f.todayposts
- FROM {$tablepre}favorites fav, {$tablepre}forums f
- WHERE fav.fid=f.fid AND fav.uid='$discuz_uid' ORDER BY f.lastpost DESC");
-
-while($fav = $db->fetch_array($query)) {
- $fav['lastposterenc'] = rawurlencode($fav['lastposter']);
- $fav['lastpost'] = gmdate("$dateformat $timeformat", $fav['lastpost']
+ $timeoffset * 3600);
- $board_favlist[] = $fav;
}

/* Channel */

Modified: trunk/upload/parasy_json_tab.php
==============================================================================
--- trunk/upload/parasy_json_tab.php (original)
+++ trunk/upload/parasy_json_tab.php Sun Jan 13 03:13:33 2008
@@ -35,7 +35,7 @@
$top[$i]['subject'] = iconv('gbk', 'utf-8', $topic['subject']);
$top[$i]['author'] = iconv('gbk', 'utf-8', $topic['author']);
$top[$i]['author_en'] = rawurlencode($topic['author']);
- $top[$i]['avatar'] = $topic['avatar'];
+ $top[$i]['avatar'] = avRESIZE($topic['avatar'],'s');
$top[$i]['name'] = iconv('gbk', 'utf-8', $topic['name']);
$top[$i]['board_name'] = $topic['board_name'];
$top[$i]['lastpost'] = iconv('gbk', 'utf-8', make_descriptive_time($topic['lastpost']));
@@ -82,6 +82,12 @@
$encoded = Zend_Json::encode($now);
}
echo $encoded;
+ break;
+
+ case 'json_timeline':
+ $timeline = timeline_remix();
+ header('Content-type: text/plain; charset=gbk');
+ include template('dashboard_timeline');
break;
}


Modified: trunk/upload/templates/babel/dashboard.htm
==============================================================================
--- trunk/upload/templates/babel/dashboard.htm (original)
+++ trunk/upload/templates/babel/dashboard.htm Sun Jan 13 03:13:33 2008
@@ -103,8 +103,8 @@
</div>
<div id="right_panel"><h2>�ҹ�ע�İ��</h2>
<ul class="news">
- <!--{if $board_favlist}-->
- <!--{loop $board_favlist $fav}-->
+ <!--{if $fav}-->
+ <!--{loop $fav $fav}-->
<li><a href="$bbsdir/go/$fav[board_name]" target="_blank">$fav[name]</a></li>
<!--{/loop}-->
<!--{else}-->

Modified: trunk/upload/templates/babel/viewpro_classic.htm
==============================================================================
--- trunk/upload/templates/babel/viewpro_classic.htm (original)
+++ trunk/upload/templates/babel/viewpro_classic.htm Sun Jan 13
03:13:33 2008
@@ -123,7 +123,7 @@
<!--{eval $name_color = rand_color();}-->
<tr>
<td align="left" class="section_$thread[bg]">
- [ <a href="forumdisplay.php?fid=$thread[fid]" target="_blank"
style="color: $name_color;">$thread[forumname]</a>
]&nbsp;:&nbsp;<!--{if $thread['displayorder'] >= 0}--><a
href="viewthread.php?tid=$thread[tid]"
target="_blank">$thread[subject]</a><!--{else}-->$thread[subject]<!--{/if}-->
<span class="tip_i">... $thread[lastpost]</span>
+ [ <a href="forumdisplay.php?fid=$thread[fid]" style="color:
$name_color;">$thread[forumname]</a> ]&nbsp;:&nbsp;<!--{if
$thread['displayorder'] >= 0}--><a
href="viewthread.php?tid=$thread[tid]"
target="_blank">$thread[subject]</a><!--{else}-->$thread[subject]<!--{/if}-->
<span class="tip_i">... $thread[lastpost]</span>
</td>
</tr>
<!--{/loop}-->

codesite...@google.com

unread,
Jan 13, 2008, 6:14:32 AM1/13/08
to project...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages