Example #1
0
function do_viewfriends()
{
    global $db, $main_smarty, $user, $the_template;
    $friend = new Friend();
    $friends = $friend->get_friend_list();
    $output = "<h2>Friends</h2>";
    if ($friends) {
        $output .= '<table><th width="250px">Username</th><th width="60px">Message</th><th width="60px">Remove</th>';
        foreach ($friends as $myfriend) {
            $friend_avatar = get_avatar('small', $myfriend->user_avatar_source, $myfriend->user_login, $myfriend->user_email);
            $output .= '<tr>';
            $output .= '<td><img src="' . $friend_avatar . '" align="absmiddle"/> <a href="' . getmyurl('user2', $myfriend->user_login, 'profile') . '">' . $myfriend->user_login . '</a></td>';
            $output .= '<td align="center"><a href="' . my_pligg_base . '/module.php?module=simple_messaging&view=compose&return=' . urlencode($_SERVER['REQUEST_URI']) . '&to=' . $myfriend->user_login . '"><img src="' . my_pligg_base . '/templates/' . $the_template . '/images/user_message.png" border="0"></a></td>';
            $output .= '<td align="center"><a href = "' . getmyurl('user_add_remove', $myfriend->user_login, 'removefriend') . '"><img src=' . my_pligg_base . '/templates/' . $the_template . '/images/user_delete.png border=0></a></td>';
            $output .= '</tr>';
        }
        $output .= '</table>';
    } else {
        $output .= "<br /><br /><center><h2>(0) Friends.</h2></center>";
    }
    $main_smarty->assign('user_page', $output);
}
Example #2
0
function do_viewfriends($user_id)
{
    global $db, $main_smarty, $user, $the_template;
    $friend = new Friend();
    $friends = $friend->get_friend_list($user_id);
    $main_smarty->assign('the_template', $the_template);
    $main_smarty->assign('friends', $friends);
}
Example #3
0
function do_viewfriends()
{
    global $db, $user, $the_template;
    $friend = new Friend();
    $friends = $friend->get_friend_list();
    echo "<h2>Your friends</h2>";
    if ($friends) {
        echo '<table style=width:50% class=listing><th>username</th><th>message</th><th>remove</th>';
        foreach ($friends as $myfriend) {
            echo '<tr><td>';
            echo ' <a href="' . getmyurl('user2', $myfriend->user_login, 'profile') . '">' . $myfriend->user_login . '</a></td>
';
            echo '<td><a href="#view_message" rel="view_message~!~view=small_msg_compose~!~login='******'"	class="lbOn"><img src=' . my_pligg_base . '/templates/' . $the_template . '/images/user_message.png border=0></a></td>';
            echo '<td><a href = "' . getmyurl('user_add_remove', $myfriend->user_login, 'removefriend') . '"><img src=' . my_pligg_base . '/templates/' . $the_template . '/images/user_delete.png border=0></a></td></tr>';
        }
        echo '</table>';
    } else {
        echo "<br /><br /><center><strong>you have no friends</strong></center>";
    }
}