TVProjects top



TVProjects bottom
You are not registered.
Registration allows you to subscribe to projects, open projects, and more. Click here to register.

Website Source Code
<< Back

profile.php

<?php
    
function get_profile()
    {
        global 
$page_title$categories;
        
        
$id intval($_GET['id']);
        
        
$result mysql_query('SELECT `name`, `username`, `email`, `avatar`, `contact`, `about`, `hide_email`, `member_of` FROM `users` WHERE `id` = ' $id ' LIMIT 1;');
        
        if (
mysql_num_rows($result) == 0)
            return 
'<div style="font-style: italic">Sorry, no user found with this ID.</div>';
            
        
$row mysql_fetch_row($result);
        
$vars['PICTURE'] = ($row[3] == '') ? 'images/no_picture.png' escape_html($row[3]);
        
$vars['USERNAME'] = escape_html($row[1]);
        
$vars['NAME'] = escape_html($row[0]);
        
$vars['ABOUT'] = xss_safe($row[5]);
        
$vars['CONTACT'] = ($row[4] == '') ? '<div style="font-style: italic">No contact information.</div>' xss_safe($row[4]);
        
$vars['EMAIL'] = ($row[6] != 1) ? ('<script type="text/javascript">
                                    <!--
                                        var email = \'' 
str_replace('@''||'escape_html($row[2])) . '\';
                                        email = email.replace(\'||\', \'@\');
                                        document.write(\'<a href="mailto:\'+email+\'" style="color: #666666">\'+email+\'</a>\');
                                    //-->
                                    </script>'
) : '<span style="font-style: italic; color: #888888">E-Mail address is hidden</span>';
        
        if (
$row[7] == '')
        {
            
$vars['MEMBER_STYLE'] = '; font-style: italic';
            
$vars['MEMBER'] = escape_html($row[1]) . ' is not a member of any project.';
        }
        else
        {
            
$ex explode(chr(1), $row[7]);
            
$vars['MEMBER'] = '';
            foreach (
$ex as $of)
            {
                
$each explode(chr(2), $of);
                
                
$link create_link($each[0], $each[1], $each[2]);
                
$vars['MEMBER'] .= '<img src="images/arrow.png" alt="arrow" style="text-align: center" /> <span style="font-style: italic; color: black">' escape_html($each[3]) . '</span> in <a href="' $link '" style="color: black">' $each[2] . '</a><br />';
            }
        }
        
        
$page_title 'User Profile - ' $row[1];
        
        return 
get_template('profile'$vars);
    }
?>