Changeset 21
- Timestamp:
- 08/12/05 20:59:53 (6 years ago)
- Location:
- trunk
- Files:
-
- 7 modified
-
inc/friends/list.inc.php (modified) (4 diffs)
-
inc/messages/inbox.inc.php (modified) (1 diff)
-
inc/messages/saved.inc.php (modified) (1 diff)
-
inc/messages/sent.inc.php (modified) (1 diff)
-
includes/functions.inc.php (modified) (2 diffs)
-
includes/pager.inc.php (modified) (1 diff)
-
smarty/templates/friends/list.tpl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/inc/friends/list.inc.php
r15 r21 23 23 ******************** http://opensource.ikse.net/projects/dotnode ***/ 24 24 25 include_once(INCLUDESPATH.'/pager.inc.php'); 26 25 27 $_SMARTY['Title'] = 'Friends'; 26 28 … … 28 30 $user['photo'] = build_image_url($url_id); 29 31 30 foreach($user['info']['friends_id'] as $friend_id) 32 $pager =& Pager_dotnode::factory(null, array('totalItems' => $user['info']['nb_friends'], 'perPage' => 15)); 33 34 list($first_item, $last_item) = $pager->getOffsetByPageId(); 35 $limit_offset = $first_item-1; 36 $limit_length = $last_item-$limit_start; 37 38 $friends_range = array_slice($user['info']['friends_id'], $limit_offset, $limit_length); 39 foreach($friends_range as $dummy=>$friend_id) 31 40 $friends[$friend_id] = get_cache_user_info($friend_id); 32 41 33 /********** determination du chem ain *****************/42 /********** determination du chemin *****************/ 34 43 $user['path'] = array(); 35 44 … … 55 64 $user['relation_type'] = 'members'; 56 65 57 58 59 66 /************** menu ***************************/ 60 67 $leftmenu["/profile/$url_id"] = 'Profile'; … … 70 77 71 78 $_SMARTY['leftmenu'] = $leftmenu; 79 /************************************************/ 72 80 73 /************************************************/74 81 $_SMARTY['tr_attr'] = array("class='odd' style='vertical-align:top'", "class='even' style='vertical-align:top'"); 75 82 $_SMARTY['user'] = $user; 83 $_SMARTY['pager'] = $pager->getLinks(); 76 84 $_SMARTY['friends'] = $friends; 77 85 ?> -
trunk/inc/messages/inbox.inc.php
r20 r21 32 32 33 33 list($first_item, $last_item) = $pager->getOffsetByPageId(); 34 $limit_ start = $first_item-1;35 $limit_ offset = $last_item-$limit_start;34 $limit_offset = $first_item-1; 35 $limit_length = $last_item-$limit_offset; 36 36 37 $messages_r = $db->query('SELECT id_mess, id_from, from_str, type, dest, subject, message, flag, date FROM message WHERE id=? AND box=? ORDER by date DESC LIMIT !,!', array($_SESSION['my_id'],'inbox', $limit_ start, $limit_offset));37 $messages_r = $db->query('SELECT id_mess, id_from, from_str, type, dest, subject, message, flag, date FROM message WHERE id=? AND box=? ORDER by date DESC LIMIT !,!', array($_SESSION['my_id'],'inbox', $limit_offset, $limit_length )); 38 38 39 39 if(!DB::isError($messages_r) ) -
trunk/inc/messages/saved.inc.php
r20 r21 32 32 33 33 list($first_item, $last_item) = $pager->getOffsetByPageId(); 34 $limit_ start = $first_item-1;35 $limit_ offset = $last_item-$limit_start;34 $limit_offset = $first_item-1; 35 $limit_length = $last_item-$limit_offset; 36 36 37 $messages_r = $db->query('SELECT id_mess, id_from, from_str, type, dest, subject, message, flag, date FROM message WHERE id=? AND box=? ORDER by date DESC LIMIT !,!', array($_SESSION['my_id'],'save', $limit_ start, $limit_offset) );37 $messages_r = $db->query('SELECT id_mess, id_from, from_str, type, dest, subject, message, flag, date FROM message WHERE id=? AND box=? ORDER by date DESC LIMIT !,!', array($_SESSION['my_id'],'save', $limit_offset, $limit_length) ); 38 38 39 39 if(!DB::isError($messages_r) ) -
trunk/inc/messages/sent.inc.php
r20 r21 32 32 33 33 list($first_item, $last_item) = $pager->getOffsetByPageId(); 34 $limit_ start = $first_item-1;35 $limit_ offset = $last_item-$limit_start;34 $limit_offset = $first_item-1; 35 $limit_length = $last_item-$limit_offset; 36 36 37 $messages_r = $db->query('SELECT id, id_mess, id_from, from_str, type, dest, subject, message, flag, date FROM message WHERE id_from=? AND box=? ORDER by date DESC LIMIT !,!', array($_SESSION['my_id'],'send', $limit_ start, $limit_offset) );37 $messages_r = $db->query('SELECT id, id_mess, id_from, from_str, type, dest, subject, message, flag, date FROM message WHERE id_from=? AND box=? ORDER by date DESC LIMIT !,!', array($_SESSION['my_id'],'send', $limit_offset, $limit_length) ); 38 38 39 39 $cache=array(); -
trunk/includes/functions.inc.php
r15 r21 267 267 } 268 268 269 function get_cache_user_info($id, $fields= "", $update_friends_order=false)269 function get_cache_user_info($id, $fields=null, $update_friends_order=false) 270 270 { 271 271 global $db; … … 274 274 global $url_id; 275 275 276 if( !$fields)276 if(is_null($fields)) 277 277 $fields = 'id, login, fname, lname, nick, country, gender, relationship_status, here_for, nb_friends, friends_id, nb_communities, communities_id, nb_fans, nb_bookmarks, nb_blogs, nb_photos, fun, cool, sexy, photo, join_date'; 278 278 -
trunk/includes/pager.inc.php
r20 r21 47 47 if(!is_null($data)) 48 48 $params['itemData'] = $data; 49 return parent::factory( $default_params + $params);49 return parent::factory(array_merge($default_params, $params)); 50 50 } 51 51 } -
trunk/smarty/templates/friends/list.tpl
r1 r21 40 40 41 41 <table> 42 <tr><td class='{cycle values='odd,even'} pagination' colspan='4'>{$pager.all}</td></tr> 42 43 {foreach name=friends from=$friends item=friend key=id_friend} 43 44 {if ($smarty.foreach.friends.iteration-1)%3 == 0} … … 66 67 {/if} 67 68 {/foreach} 69 <tr><td class='{cycle values='odd,even'} pagination' colspan='4'>{$pager.all}</td></tr> 68 70 </table> 69 71
