Changeset 14

Show
Ignore:
Timestamp:
08/09/05 21:14:53 (6 years ago)
Author:
alexx
Message:

* fix #16 (add include of country list)
* fux bug in owned communities ("New Topic/event" not displayed)
* fix sample db data
* change strstr to strpos in includes/functions.inc.php (strpos is faster)

Location:
trunk
Files:
9 modified

Legend:

Unmodified
Added
Removed
  • trunk/dotnode-data.sql

    r1 r14  
    8989-- 
    9090 
    91 INSERT INTO `cache_user` VALUES ('354a778bacabffaff3d3fd74f93ac278','alexx','Alexandre','DATH','','A42536','D000','','France','male',25,'committed','friend,business,partners',1084260676,'y',2,'1353c20315c720ad6c88a498ccc1c1ac,00112233445566778899001122334455',0,'',0,0,0,0,0.00,0.00,0.00); 
     91INSERT INTO `cache_user` VALUES ('354a778bacabffaff3d3fd74f93ac278','alexx','Alexandre','DATH','','A42536','D000','','France','male',25,'committed','friend,business,partners',1084260676,'y',2,'1353c20315c720ad6c88a498ccc1c1ac,00112233445566778899001122334455',1,'1',0,0,0,0,0.00,0.00,0.00); 
    9292INSERT INTO `cache_user` VALUES ('00112233445566778899001122334455','moderator','Moderator','Moderator','','','','','France','male',25,'','',1084260676,'y',1,'354a778bacabffaff3d3fd74f93ac278',0,'',0,0,0,0,0.00,0.00,0.00); 
    9393INSERT INTO `cache_user` VALUES ('1353c20315c720ad6c88a498ccc1c1ac','mdoe','John','Doe',NULL,'J500','D000',NULL,'France','male',0,'single','business,partners',1122934961,'y',1,'354a778bacabffaff3d3fd74f93ac278',0,'',1,0,1,5,0.00,0.00,0.00); 
  • trunk/inc/communities/createEvent.inc.php

    r1 r14  
    3232        if(in_array($community['info']['id_comm'], $_SESSION['my_communities_id'])) 
    3333        { 
    34         /************* menu *******************/ 
    35         $leftmenu["/communities/view/".$community['info']['id_comm']] = 'Return to community'; 
    36         $leftmenu["/communities/forum/".$community['info']['id_comm']] = 'View forum'; 
    37         $leftmenu["/communities/events/".$community['info']['id_comm']] = 'View events'; 
     34                /************* menu *******************/ 
     35                $leftmenu["/communities/view/".$community['info']['id_comm']] = 'Return to community'; 
     36                $leftmenu["/communities/forum/".$community['info']['id_comm']] = 'View forum'; 
     37                $leftmenu["/communities/events/".$community['info']['id_comm']] = 'View events'; 
    3838 
    39         $smarty->assign('leftmenu',$leftmenu); 
    40         /************************************/ 
     39                $smarty->assign('leftmenu',$leftmenu); 
     40                /************************************/ 
    4141 
    42         $smarty->assign('Title', 'Communities'); 
    43         $smarty->assign('community', $community); 
     42                $smarty->assign('Title', 'Communities'); 
     43                $smarty->assign('community', $community); 
    4444        } 
    4545        else 
  • trunk/inc/communities/editEvent.inc.php

    r1 r14  
    2222 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 
    2323 ******************** http://opensource.ikse.net/projects/dotnode ***/ 
     24include(INCLUDESPATH.'/countries_list.inc.php'); 
    2425 
    2526if(is_numeric($token[2])) 
  • trunk/inc/communities/events.inc.php

    r1 r14  
    4040        if($_SESSION['my_id'] != $community['info']['id']) 
    4141                if(in_array($community['info']['id_comm'], $_SESSION['my_communities_id']) )  
     42                { 
    4243                        $leftmenu["/communities/unjoin/".$token[2]] = 'Unjoin'; 
     44                        $_SMARTY['is_member'] = 1; 
     45                } 
    4346                else 
     47                { 
    4448                        $leftmenu["/communities/join/".$token[2]] = 'Join'; 
     49                        $_SMARTY['id_member'] = 0; 
     50                } 
    4551        else 
     52        { 
    4653                $leftmenu["/communities/edit/".$token[2]] = 'Edit';      
    47  
     54                $_SMARTY['is_member'] = 1; 
     55        } 
    4856 
    4957        $leftmenu["/communities/forum/".$token[2]] = 'View forum'; 
    5058        $leftmenu["/communities/invite/".$token[2]] = 'Invite friends'; 
    5159 
    52         $smarty->assign('leftmenu',$leftmenu); 
    53  
     60        $_SMARTY['leftmenu'] = $leftmenu; 
    5461 
    5562        /************************************/ 
    5663 
    5764 
     65        $_SMARTY['Title'] = 'Community'; 
    5866 
    59         $smarty->assign('Title', 'Community'); 
     67        if($_SMARTY['is_member']) 
     68                $db->query('UPDATE user_comm SET last_visit=? WHERE id=? AND id_comm=?', array(time(), $_SESSION['my_id'], $community['info']['id_comm'])); 
    6069 
    61         if($_SESSION['my_communities_id']) 
    62         { 
    63                 if( in_array($community['info']['id_comm'], $_SESSION['my_communities_id']) ) 
    64                 { 
    65                         $db->query('UPDATE user_comm SET last_visit=? WHERE id=? AND id_comm=?', array(time(), $_SESSION['my_id'], $community['info']['id_comm'])); 
    66                         $smarty->assign('member', true); 
    67                 } 
    68         } 
    69  
    70  
    71         $smarty->assign('community', $community); 
     70        $_SMARTY['community'] = $community; 
    7271} 
    7372else 
  • trunk/inc/communities/forum.inc.php

    r1 r14  
    3939        if($_SESSION['my_id'] != $community['info']['id']) 
    4040                if(in_array($community['info']['id_comm'], $_SESSION['my_communities_id']) ) 
     41                { 
    4142                        $leftmenu["/communities/unjoin/".$token[2]] = 'Unjoin'; 
     43                        $_SMARTY['is_member'] = 1; 
     44                } 
    4245                else 
     46                { 
    4347                        $leftmenu["/communities/join/".$token[2]] = 'Join'; 
     48                        $_SMARTY['is_member'] = 0; 
     49                } 
    4450        else 
     51        { 
    4552                $leftmenu["/communities/edit/".$token[2]] = 'Edit';      
    46  
     53                $_SMARTY['is_member'] = 1; 
     54        } 
    4755 
    4856        $leftmenu["/communities/events/".$token[2]] = 'View events'; 
    4957        $leftmenu["/communities/invite/".$token[2]] = 'Invite friends'; 
    5058 
    51         $smarty->assign('leftmenu',$leftmenu); 
     59        $_SMARTY['leftmenu'] = $leftmenu; 
    5260 
    5361 
     
    5664 
    5765 
    58         $smarty->assign('Title', 'Community'); 
     66        $_SMARTY['Title'] = 'Community'; 
     67         
    5968 
    60         if($_SESSION['my_communities_id']) 
    61         { 
    62                 if( in_array($community['info']['id_comm'], $_SESSION['my_communities_id']) ) 
    63                 { 
    64                         $db->query('UPDATE user_comm SET last_visit=? WHERE id=? AND id_comm=?', array(time(), $_SESSION['my_id'], $community['info']['id_comm'])); 
    65                         $smarty->assign('member', true); 
    66                 } 
    67         } 
     69        if($_SMARTY['is_member']) 
     70                $db->query('UPDATE user_comm SET last_visit=? WHERE id=? AND id_comm=?', array(time(), $_SESSION['my_id'], $community['info']['id_comm'])); 
    6871 
    69  
    70         $smarty->assign('community', $community); 
     72        $_SMARTY['community'] = $community; 
    7173} 
    7274else 
  • trunk/inc/communities/view.inc.php

    r1 r14  
    121121                } 
    122122        else 
     123        { 
     124                $smarty->assign('is_member', 1); 
    123125                $leftmenu["/communities/edit/".$token[2]] = 'Edit';      
     126        } 
    124127 
    125128 
  • trunk/includes/functions.inc.php

    r8 r14  
    294294                if(array_key_exists('friends_id', $info) && $info['friends_id'] != NULL) 
    295295                { 
    296                         if(strstr($info['friends_id'],',') != false) 
     296                        if(strpos($info['friends_id'],',')) 
    297297                                $info['friends_id'] = explode(',', $info['friends_id']); 
    298298                        else 
     
    310310 
    311311                if(array_key_exists('communities_id', $info) && $info['communities_id'] != NULL) 
    312                         if(strstr($info['communities_id'],',') != false) 
     312                        if(strpos($info['communities_id'],',')) 
    313313                                        $info['communities_id'] = explode(',', $info['communities_id']); 
    314314                                else 
  • trunk/smarty/templates/communities/events.tpl

    r1 r14  
    4747</tr> 
    4848{/foreach} 
    49 {if $member} 
     49{if $is_member} 
    5050<tr class='{cycle name='events' values='odd,even'}'> 
    5151<td colspan='3' align='right'><a class='button' href='/communities/createEvent/{$token[2]}'>{t}New event{/t}</a></td> 
  • trunk/smarty/templates/communities/forum.tpl

    r1 r14  
    5151</tr> 
    5252{/foreach} 
    53 {if $member} 
     53{if $is_member} 
    5454<tr class='{cycle name='forum' values='odd,even'}'> 
    5555<td colspan='4' align='right'><a class='button' href='/communities/createTopic/{$token[2]}'>{t}New topic{/t}</a></td>