In simple messaging module in compose view i want to add list of users that are my friends.
In simple_messaging_main.php i added :
andCode:function get_friend_list() { global $db, $the_template, $current_user, $main_smarty; $sql = "SELECT " . table_users . ".user_login FROM " . table_friends . " INNER JOIN " . table_users . " ON " . table_friends . ".friend_to = " . table_users . ".user_id WHERE (((" . table_friends . ".friend_from)= " . $current_user->user_id . "))"; $friends = $db->get_results($sql); $friends = object_2_array($friends); return $friends; }
in compose.tpl:Code:$main_smarty->assign('m_get_friend_list', get_friend_list($current_user->user_id));
If you have for example 3 friends, on the compose page it shows word Array 3 times ("Array Array Array") not names of the friends.Code:{foreach from=$m_get_friend_list item=foo} {$foo} {/foreach}
If i use return $voters[0]; in function it shows the name of first friend normally (Marko), doesent list "Array".
If i use same function and foreach loop on any other page like for example user.php it works normally and shows for example "Marko, Luigi, Francis", not "Array Array Array".
Why is this the case in this module ? I am not a programmer, just need this simple addon.
Do anybody know how to fix this?
Thanks!



Reply With Quote




