|
Revision 15, 1.8 KB
(checked in by alexx, 7 years ago)
|
- fix last bug in communities (see [14])
- execute a "conversion smarty style" script ;) : for i in find . -type f | grep "\.php$" | grep -v "\.svn"; do perl -pi -e "s/\\\$smarty->assign\((.*),(.*)\);/\\\$_SMARTY\[\$1\] = \$2;/" $i; done
|
| Line | |
|---|
| 1 | <?php |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | |
|---|
| 22 | |
|---|
| 23 | |
|---|
| 24 | |
|---|
| 25 | $_SMARTY['Title'] = 'My communities'; |
|---|
| 26 | |
|---|
| 27 | $my_communities_r = $db->query('SELECT name, community.id_comm as id_comm, description, nb_members, last_post_date, community.id as id FROM community LEFT JOIN user_comm USING (id_comm) WHERE user_comm.id=? AND user_comm.status=? ORDER BY last_post_date DESC', array($_SESSION['my_id'], 'ok') ); |
|---|
| 28 | |
|---|
| 29 | if(DB::isError($my_communities_r)) |
|---|
| 30 | error_log($my_communities_r->getUserInfo()); |
|---|
| 31 | |
|---|
| 32 | while($my_community = $my_communities_r->fetchRow()) |
|---|
| 33 | { |
|---|
| 34 | $day = date('Ymd', $my_community['last_post_date']); |
|---|
| 35 | $key = $my_community['id_comm']; |
|---|
| 36 | if($day != $last_day) |
|---|
| 37 | { |
|---|
| 38 | $my_community['day'] = $day; |
|---|
| 39 | $last_day = $day; |
|---|
| 40 | if($last_comm_day_key) $my_communities[$last_comm_day_key]['next_day'] = $day; |
|---|
| 41 | $last_comm_day_key = $key; |
|---|
| 42 | } |
|---|
| 43 | |
|---|
| 44 | $my_communities[$key] = $my_community; |
|---|
| 45 | } |
|---|
| 46 | |
|---|
| 47 | $_SMARTY['my_communities'] = $my_communities; |
|---|
| 48 | |
|---|
| 49 | ?> |
|---|