Ejemplo n.º 1
0
 public static function router($uid, $type, $size = 0)
 {
     switch ($type) {
         case 'avatar':
             return iCMS_FS_URL . get_user_pic($uid, $size);
             break;
         case 'url':
             return iPHP::router(array('/{uid}/', $uid), iPHP_ROUTER_REWRITE);
             break;
         case 'coverpic':
             $dir = get_user_dir($uid, 'coverpic');
             return array('pc' => iFS::fp($dir . '/' . $uid . ".jpg", '+http'), 'mo' => iFS::fp($dir . '/m_' . $uid . ".jpg", '+http'));
             break;
         case 'urls':
             return array('inbox' => iPHP::router(array('/user/inbox/{uid}', $uid), iPHP_ROUTER_REWRITE), 'home' => iPHP::router(array('/{uid}/', $uid), iPHP_ROUTER_REWRITE), 'comment' => iPHP::router(array('/{uid}/comment/', $uid), iPHP_ROUTER_REWRITE), 'favorite' => iPHP::router(array('/{uid}/favorite/', $uid), iPHP_ROUTER_REWRITE), 'fans' => iPHP::router(array('/{uid}/fans/', $uid), iPHP_ROUTER_REWRITE), 'follower' => iPHP::router(array('/{uid}/follower/', $uid), iPHP_ROUTER_REWRITE));
             break;
     }
 }
Ejemplo n.º 2
0
</button>
                               
                      </div>
                       </form>
                      </li>
<?php 
foreach ($project->project_has_activities as $value) {
    ?>
                      <?php 
    $writer = FALSE;
    if ($value->user_id != 0) {
        $writer = $value->user->firstname . " " . $value->user->lastname;
        $image = get_user_pic($value->user->userpic, $value->user->email);
    } else {
        $writer = $value->client->firstname . " " . $value->client->lastname;
        $image = get_user_pic($value->client->userpic, $value->client->email);
    }
    ?>
                      <li class="comment-item">
                      <div class="comment-pic">
                        <?php 
    if ($writer != FALSE) {
        ?>
                        <img class="img-circle tt" title="<?php 
        echo $writer;
        ?>
"  src="<?php 
        echo $image;
        ?>
">
                        <?php 
?>
                    </div>
				</div><!-- /"sidepanel" -->

				<div id="main">
                <div>
    					<h1 style="text-align: center;"><?php 
echo get_the_flag(24, 'blue') . ' Current No Clan members ' . get_the_flag(24, 'blue');
?>
</h1>
    					
    					<?php 
foreach ($arrMembers as $member) {
    extract($member, EXTR_PREFIX_ALL, 'm');
    $m_joined = how_long_since($m_date_created);
    $m_img_url = get_user_pic($m_idUser, 64);
    $m_info_url = rurl() . '/user/' . $m_username . '/';
    $m_frame_url = rurl() . '/user/show_userinfo.php?id=' . $m_idUser;
    if ($m_username[strlen($m_username) - 1] == 's') {
        $m_usernames = $m_username . "'";
    } else {
        $m_usernames = $m_username . "'s";
    }
    if (!empty($m_picasaUser)) {
        $m_gallery = rurl() . '/gallery/' . $m_idUser . '/' . $m_username;
    }
    ?>
						
						<div class="member_li">
							<a href="<?php 
    echo $m_info_url;
Ejemplo n.º 4
0
            echo '</a>';
            echo '<h3 style="padding: 0; margin: 0;">';
            echo '<a class="fancy" href="' . rurl() . '/user/show_userinfo.php?id=' . $u_idUser . '">' . $u_username . '</a>';
            echo '</h3>';
            echo '<span class="location">' . $u_location . ' (' . $u_country . ')</span><br />';
            echo '<span class="label">' . $u_type . ' since ' . $u_date_created . '</span>';
            echo '<br /><span><a class="more" href="' . rurl() . '/user/' . $u_username . '/" title="Visit ' . friendly_str($u_username) . '\'s profile">-more info-</a></span>';
            echo '</div>';
        }
    }
    if (!empty($arr_search_comments)) {
        echo '<h2 style="clear: both;">Comments</h2>';
    }
    foreach ($arr_search_comments as $c) {
        extract(strip_slashes_arr($c), EXTR_PREFIX_ALL, 'c');
        $c_pic = get_user_pic($c_userId, 32);
        $c_title = '<a href="' . rurl() . '/post/' . $c_postId . '/' . friendly_str($c_title) . '">' . $c_title . '</a>';
        $c_content = cut_string($c_content, 60);
        $c_content = '<a class="acomm" href="' . rurl() . '/post/' . $c_postId . '/' . friendly_str($c_title) . '#comm_' . $c_idComment . '">' . $c_content . '</a>';
        $c_date = date("M j/Y", strtotime($c_date));
        echo '<div class="comment_found">';
        echo '<p><img src="' . $c_pic . '" alt="' . $c_username . '" title="' . $c_username . '"/>';
        echo '<a class="fancy" href="' . rurl() . '/user/show_userinfo.php?id=' . $c_userId . '">' . $c_username . '</a>, on ' . $c_title . ': ';
        echo '<em>' . $c_content . '</em>';
        echo '<span style="color: #505050; font-size: 0.8em;">&nbsp;&nbsp;(' . $c_date . ')</span>';
        echo '</p></div>';
    }
}
// end USERS and COMMENTS FOUND!
?>
					
<?php

if (!empty($arrUser)) {
    $up = get_user_pic($arrUser['idUser'], 64);
    ?>
<div id="sideUserInfo" style="overflow: hidden; margin-bottom: 1em;">
	<div style="overflow: hidden;">
	    <a href="<?php 
    echo rurl() . '/user/' . $arrUser['username'] . '/';
    ?>
" title="<?php 
    echo $arrUser['username'];
    ?>
's zone"><img src="<?php 
    echo $up;
    ?>
" alt="your photo"/></a>
	    <h1><?php 
    echo $arrUser['username'];
    ?>
<span class="label">(<?php 
    echo $arrUser['type'];
    ?>
)</span></h1>					
	    <p><?php 
    echo $arrUser['country'];
    ?>
</p>
		<p><?php 
    if ($arrUser['type'] == 'member' || $arrUser['type'] == 'admin') {
        echo "<strong>&bull;NC&bull;&nbsp;</strong>";
Ejemplo n.º 6
0
<ul id="comments-ul" class="comments">
                      <li class="comment-item add-comment">
                      <?php 
$attributes = array('class' => 'ajaxform', 'id' => 'replyform', 'data-reload' => 'comments-ul');
echo form_open($form_action, $attributes);
?>
                     <!--  <div class="comment-pic">
                        <img class="img-circle tt" title="<?php 
echo $this->client->firstname;
?>
 <?php 
echo $this->client->lastname;
?>
"  src="<?php 
echo get_user_pic($this->client->userpic, $this->client->email);
?>
">
                      
                      </div> -->
                      <div class="comment-content">

                            <p><small class="text-muted"><span class="comment-writer"><?php 
echo $this->client->firstname;
?>
 <?php 
echo $this->client->lastname;
?>
</span> <span class="datetime"><?php 
echo date($core_settings->date_format . ' ' . $core_settings->date_time_format, time());
?>
Ejemplo n.º 7
0
 public function ACTION_register()
 {
     iCMS::$config['user']['register']['enable'] or exit(iPHP::lang('user:register:forbidden'));
     $regip = iS::escapeStr(iPHP::getIp());
     $regdate = time();
     if (iCMS::$config['user']['register']['interval']) {
         $ip_regdate = iDB::value("\n                SELECT `regdate`\n                FROM `#iCMS@__user`\n                WHERE `regip`='{$regip}'\n                ORDER BY uid DESC");
         $ip_regdate - $regdate > iCMS::$config['user']['register']['interval'] && iPHP::code(0, 'user:register:interval', 'username', 'json');
     }
     $username = iS::escapeStr($_POST['username']);
     $nickname = iS::escapeStr($_POST['nickname']);
     $gender = $_POST['gender'] == 'girl' ? 0 : 1;
     $password = md5(trim($_POST['password']));
     $rstpassword = md5(trim($_POST['rstpassword']));
     $refer = iS::escapeStr($_POST['refer']);
     $openid = iS::escapeStr($_POST['openid']);
     $type = iS::escapeStr($_POST['platform']);
     $avatar = iS::escapeStr($_POST['avatar']);
     $province = iS::escapeStr($_POST['province']);
     $city = iS::escapeStr($_POST['city']);
     $agreement = $_POST['agreement'];
     $username or iPHP::code(0, 'user:register:username:empty', 'username', 'json');
     preg_match("/^[\\w\\-\\.]+@[\\w\\-]+(\\.\\w+)+\$/i", $username) or iPHP::code(0, 'user:register:username:error', 'username', 'json');
     user::check($username, 'username') && iPHP::code(0, 'user:register:username:exist', 'username', 'json');
     $nickname or iPHP::code(0, 'user:register:nickname:empty', 'nickname', 'json');
     (cstrlen($nickname) > 20 || cstrlen($nickname) < 4) && iPHP::code(0, 'user:register:nickname:error', 'nickname', 'json');
     user::check($nickname, 'nickname') && iPHP::code(0, 'user:register:nickname:exist', 'nickname', 'json');
     trim($_POST['password']) or iPHP::code(0, 'user:password:empty', 'password', 'json');
     trim($_POST['rstpassword']) or iPHP::code(0, 'user:password:rst_empty', 'rstpassword', 'json');
     $password == $rstpassword or iPHP::code(0, 'user:password:unequal', 'password', 'json');
     if (iCMS::$config['user']['register']['seccode']) {
         $seccode = iS::escapeStr($_POST['seccode']);
         iPHP::seccode($seccode, true) or iPHP::code(0, 'iCMS:seccode:error', 'seccode', 'json');
     }
     $gid = 0;
     $pid = 0;
     $fans = $follow = $article = $comments = $share = $credit = 0;
     $hits = $hits_today = $hits_yday = $hits_week = $hits_month = 0;
     $lastloginip = $lastlogintime = '';
     $status = 1;
     $fields = array('gid', 'pid', 'username', 'nickname', 'password', 'gender', 'fans', 'follow', 'article', 'comments', 'share', 'credit', 'regip', 'regdate', 'lastloginip', 'lastlogintime', 'hits', 'hits_today', 'hits_yday', 'hits_week', 'hits_month', 'type', 'status');
     $data = compact($fields);
     $uid = iDB::insert('user', $data);
     user::set_cookie($username, $password, array('uid' => $uid, 'username' => $username, 'nickname' => $nickname, 'status' => $status));
     if ($openid) {
         $platform = $type;
         iDB::query("\n                INSERT INTO `#iCMS@__user_openid`\n                       (`uid`, `openid`, `platform`)\n                VALUES ('{$uid}', '{$openid}', '{$platform}');\n            ");
     }
     if ($avatar) {
         $avatarData = iFS::remote($avatar);
         if ($avatarData) {
             $avatarpath = iFS::fp(get_user_pic($uid), '+iPATH');
             iFS::mkdir(dirname($avatarpath));
             iFS::write($avatarpath, $avatarData);
             iFS::yun_write($avatarpath);
         }
     }
     //user::set_cache($uid);
     iPHP::set_cookie('forward', '', -31536000);
     iPHP::json(array('code' => 1, 'forward' => $this->forward));
 }
Ejemplo n.º 8
0
       </tr>';
 $i = 0;
 while ($row = mysql_fetch_array($r)) {
     $idMessage = $row['idMessage'];
     $from = $row['from'];
     $time = date("Mj - H:i", strtotime($row['time']));
     $subject = $row['subject'];
     $message = $row['message'];
     $is_read = $row['is_read'];
     if ($i % 2 == 0) {
         $class = 'class="i"';
     } else {
         $class = '';
     }
     // get link to user's photo
     $img = get_user_pic($from, 24);
     // show message # within query (not idMessage)
     echo '<tr ' . $class . '><td style="text-align: center;">' . $pointer++ . '</td><td>';
     // show sender's photo & name
     // if username isn't found, they are obviously ex-members.
     if (!isset($usernames["{$from}"])) {
         $usernames["{$from}"] = 'ex-member';
     }
     echo '<img class="userpic" src="' . $img . '" alt="' . $usernames["{$from}"] . '" title="' . $usernames["{$from}"] . '"/>&nbsp;' . $usernames["{$from}"] . '</td>';
     // show time sent
     echo '<td class="date"><a href="messages/read.php?msg=' . $idMessage . '">' . $time . '</a></td>';
     // show message subject
     if ($is_read == '0') {
         echo '<td class="subject"><a style="font-weight: bold;" href="messages/read.php?msg=' . $idMessage . '">' . $subject . '</a></td>';
     } else {
         echo '<td class="subject"><a href="messages/read.php?msg=' . $idMessage . '">' . $subject . '</a></td>';
Ejemplo n.º 9
0
            <div class="input-prepend"> <span class="add-on">属 性</span>
              <select name="pid[]" id="pid" class="chosen-select span6" multiple="multiple">
                <option value="0">普通用户[pid='0']</option>
                <?php 
echo iACP::getProp("pid");
?>
              </select>
            </div>
            <?php 
if ($this->uid) {
    ?>
            <div class="clearfloat mb10"></div>
            <div class="input-prepend">
              <span class="add-on"> 头像</span>
              <img src="<?php 
    echo iCMS_FS_URL . get_user_pic($this->uid);
    ?>
" class="img-polaroid">
            </div>
            <?php 
}
?>
            <div class="clearfix mb10"></div>
            <div class="input-prepend"> <span class="add-on"> 账号</span>
              <input type="text" name="user[username]" class="span3" id="username" value="<?php 
echo $rs->username;
?>
"/>
            </div>
            <div class="clearfix mb10"></div>
            <div class="input-prepend input-append"> <span class="add-on"> 密码</span>
Ejemplo n.º 10
0
					<?php 
}
?>
					<!-- /errors -->
                    <?php 
include $_SERVER['DOCUMENT_ROOT'] . '/includes/sidepanel.inc.php';
?>
				</div><!-- /"sidepanel" -->

				<div id="main">

<div id="message">
<?php 
//Show the message
if (empty($error)) {
    $img = get_user_pic($from, 64);
    //since we actually found it, load sender's username
    // no error checking, but do we really have to?
    $username_query = "SELECT username, idUser FROM users WHERE\n\t                 idUser='******' LIMIT 1";
    $r3 = mysql_query($username_query, $dbConn);
    $usernameArr = mysql_fetch_array($r3);
    $username = $usernameArr['username'];
    // show sender's photo
    echo '<div class ="header">';
    echo '<img class="userpic" src="' . $img . '" alt="' . $username . '" title="' . $username . '"/>';
    echo "<p>from</p>";
    echo "<h2>{$username}</h2>";
    echo "<p>On {$time}</p>";
    echo '</div>';
    echo '<div class ="body">';
    echo "<p><strong>Subject:</strong> {$subject}</p>";
Ejemplo n.º 11
0
<ul id="comments-ul" class="comments">
                      <li class="comment-item add-comment">
                      <?php 
$attributes = array('class' => 'ajaxform', 'id' => 'replyform', 'data-reload' => 'comments-ul');
echo form_open($form_action, $attributes);
?>
                     <!--  <div class="comment-pic">
                        <img class="img-circle tt" title="<?php 
echo $this->user->firstname;
?>
 <?php 
echo $this->user->lastname;
?>
"  src="<?php 
echo get_user_pic($this->user->userpic, $this->user->email);
?>
">
                      
                      </div> -->
                      <div class="comment-content">

                            <p><small class="text-muted"><span class="comment-writer"><?php 
echo $this->user->firstname;
?>
 <?php 
echo $this->user->lastname;
?>
</span> <span class="datetime"><?php 
echo date($core_settings->date_format . ' ' . $core_settings->date_time_format, time());
?>
    					<?php 
if (!empty($_GET['uploaded']) && empty($error)) {
    ?>
    					<div id="previewArea"></div>
    					<?php 
} else {
    $userPage = rurl() . '/user/' . $username . '/';
    ?>
    					<a href="<?php 
    echo $userPage;
    ?>
" title="<?php 
    echo $username;
    ?>
's info page"><img src="<?php 
    echo get_user_pic($idUser, 128);
    ?>
"/></a>
    					<?php 
}
?>
					</div>
					
					<div>
						<?php 
if (empty($_GET['uploaded'])) {
    ?>
    					<form action="" method="post" enctype="multipart/form-data" style="margin-top: 1em;">
					    <label for="file">Chage your picture</label><br/>
    					    <label for="submitUpload" style="font-weight: normal; font-size: 0.8em;">Must be JPG or PNG and &lt; 5Mb.</label>
    					    <input type="file" name="file" size="18" style="width: 250px;" style="float: right;"/><br/>
				
						<p class="pre_label">FULL POST</p>
                    <!-- ARTICLE -->
                    <div class="article">
                        <h1 class="title"><a href="<?php 
echo rurl() . '/post/' . $p_idPost . '/' . friendly_str($p_title);
?>
" title="<?php 
echo $p_title;
?>
"><?php 
echo $p_title;
?>
</a></h1>
                        <img style="float: left; margin-right: 0.5em; margin-top: 12px;" src="<?php 
echo get_user_pic($p_userId, 32);
?>
"/><p class="info">by <a class="fancy" href="<?php 
echo rurl();
?>
/user/show_userinfo.php?id=<?php 
echo $p_userId;
?>
"><?php 
echo $p_username;
?>
</a><br/>on <?php 
echo date("M j, Y", strtotime($p_date_pub));
?>

                        </p>                       
Ejemplo n.º 14
0
        ?>
</span></td>
                    <td class="hidden-xs"><span class="hidden-xs label label-important"><?php 
        echo $core_settings->currency . $value->project_budget;
        ?>
</span></td>

                  <td class="hidden-xs">
                    <?php 
        $workerImages = array();
        foreach ($value->project_has_workers as $workers) {
            if (!empty($workers->user_id)) {
                if (array_key_exists($workers->user->email, $workerImages)) {
                    $image = $workerImages[$workers->user->email];
                } else {
                    $image = get_user_pic($workers->user->userpic, $workers->user->email);
                    $workerImages[$workers->user->email] = $image;
                }
                ?>
                      <img class="img-circle tt" src="<?php 
                echo $image;
                ?>
" title="<?php 
                echo $workers->user->firstname . ' ' . $workers->user->lastname;
                ?>
" height="19px"><span class="hidden"><?php 
                echo $workers->user->firstname . ' ' . $workers->user->lastname;
                ?>
</span>
                    
                    <?php 
    ?>
                        <div>
							<form action="" class="commentarea" method="post" id="comment_form">
								<?php 
    if (!empty($error['comm'])) {
        ?>
									<div class="error" id="error"><p><?php 
        echo $error['comm'];
        ?>
</p></div>
								<?php 
    }
    ?>
								<label for="comment_body">Leave a comment</label>
								<textarea name="comment_body" rows="3" style="background: url('<?php 
    echo get_user_pic($arrUser['idUser'], 48);
    ?>
') no-repeat scroll 5px 5px; background-color: #e0e0e0;" onkeydown="if(this.value.length >= 1452){this.value = this.value.substring(0,1450); alert('Ups! Too much text for a comment.'); return false; }"><?php 
    if (!empty($comm_content)) {
        canput($comm_content);
    }
    ?>
</textarea>
								<input type="submit" name="submitComm" value="SEND!"/>
							</form>
						</div>                        
                        <?php 
} elseif (!$edition) {
    ?>
                        <p style="text-align: center;"><br/>Only registered users and NC members can comment.<br/>
                        <a href="<?php 
require_once '../admin/functions.php';
require_once rdir() . '/admin/connect.php';
require_once rdir() . '/admin/isUser.php';
// db connection
$dbConn = connect_db();
if (!empty($_SESSION['NC_user']) && !empty($_SESSION['NC_password'])) {
    $arrUser = isUser($_SESSION['NC_user'], $_SESSION['NC_password'], $dbConn);
}
// Number of comments to show
$n = 10;
if (empty($arrUser) || !empty($arrUser) && $arrUser['type'] == 'user') {
    // Get the Last Comments of public posts posts.
    $q = "SELECT idComment, comments.userId, postId, content, comments.date, username, title FROM comments INNER JOIN posts ON postId = idPost INNER JOIN users ON comments.userId = users.idUser WHERE posts.postFor = 'all' ORDER BY comments.date DESC LIMIT 0,{$n}";
} else {
    // Members, friends and admins can see all...
    $q = "SELECT idComment, comments.userId, postId, content, comments.date, username, title FROM comments INNER JOIN posts ON postId = idPost INNER JOIN users ON comments.userId = users.idUser ORDER BY comments.date DESC LIMIT 0,{$n}";
}
if ($r = mysql_query($q, $dbConn)) {
    while ($commentrow = mysql_fetch_array($r)) {
        extract(strip_slashes_arr($commentrow), EXTR_PREFIX_ALL, "lastc");
        $lastc_pic = get_user_pic($lastc_userId, 24);
        $lastc_title = '<a href="' . rurl() . '/post/' . $lastc_postId . '/' . friendly_str($lastc_title) . '">' . $lastc_title . '</a>';
        $lastc_content = cut_string($lastc_content, 60);
        $lastc_content = '<a class="acomm" href="' . rurl() . '/post/' . $lastc_postId . '/' . friendly_str($lastc_title) . '#comm_' . $lastc_idComment . '">' . $lastc_content . '</a>';
        echo '<div class="comment">';
        echo '<p><img class="userpic" src="' . $lastc_pic . '" alt="' . $lastc_username . '" title="' . $lastc_username . '"/>';
        echo '<strong>' . ' ' . $lastc_username . '</strong>, on ' . $lastc_title . ' says: ';
        echo '<em>' . $lastc_content . '</em></p>';
        echo '</div>';
    }
}
// Get the selected user data
if (!empty($_GET['id'])) {
    $id = mysql_real_escape_string($_GET['id']);
    $query = "SELECT idUser, username, type, first_name, last_name, country, DATE_FORMAT (date_created, '%b %D, %Y') AS date_created, date_modified, homepage, about, location FROM users WHERE idUser='******'";
    $result = mysql_query($query, $dbConn);
    if (empty($result)) {
        $error['noUser'] = "******";
    } else {
        $user = mysql_fetch_array($result);
        unset($query, $result);
        // array $user to single vars
        $user = strip_slashes_arr($user);
        extract($user);
        unset($user, $arr, $u);
        // and userpic
        $userpic = get_user_pic($idUser, 128);
    }
} else {
    $error['noUser'] = "******";
}
// page info
$page_title = "NoClan: Home";
// used at 'includes/head.inc'
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
    <title><?php 
echo $page_title;
?>
    $users = mysql_num_rows($result);
    if ($users > 0) {
        $now = time();
        while ($logins = mysql_fetch_array($result)) {
            $u = $logins['username'];
            $t = $logins['date_modified'];
            $i = $logins['idUser'];
            $hl = how_long_since($t);
            $userInfoPage = rurl() . '/user/show_userinfo.php?id=' . $i;
            if ($u[strlen($u) - 1] == 's') {
                $atitle = $u . "'";
            } else {
                $atitle = $u . "'s";
            }
            // set the user pic (idUser and pixels w/h)
            $img = get_user_pic($i, 24);
            //show as online members users who requested pages within the last 90 seconds (panda is a pain in the ass)
            $unix_time = strtotime($t);
            ?>
			<div <?php 
            if ($now - 90 < $unix_time) {
                echo "class=\"online\"";
            }
            ?>
>
			
				<a class="fancy" href="<?php 
            echo $userInfoPage;
            ?>
" title="<?php 
            echo "{$atitle}";