function newCalendar($username, $calname) { $CI = get_instance(); $uid = getUserField($username, 'uid'); $existing = getCalendars($username); foreach ($existing as $c) { if ($calname == $c['name']) { return false; } } $ins = array('name' => $calname, 'uid' => $uid); $CI->db->insert('Calendars', $ins); return true; }
<?php require dirname(__FILE__) . "/../_libs/init.inc.php"; if ($_GET["uid"] != "" or $_GET["uid"] != NULL) { $uid = $_GET["uid"]; } if ($_POST["uid"] != "" or $_POST["uid"] != NULL) { $uid = $_POST["uid"]; } // total rocords $totalRecord = totalHitsRecord($uid); $unickname = getCelebrityField($uid, "name"); $uname = getUserField($uid, "user_name"); $today = date("Y-m-d"); $yesterday = mktime(0, 0, 0, date("m"), date("d") - 1, date("Y")); $StartValue = strftime("%Y-%m-%d", $yesterday); $EndValue = $today; ?> <html> <head> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> <script src="/_js/prototype.js" type="text/javascript"> </script> <style type="text/css">@import url(../_js/jscalendar/calendar-win2k-1.css);</style> <link rel="stylesheet" type="text/css" href="/css/main.css" media="screen" /> <script type="text/javascript" src="../_js/jscalendar/calendar.js"></script> <script type="text/javascript" src="../_js/jscalendar/lang/calendar-en.js"></script> <script type="text/javascript" src="../_js/jscalendar/calendar-setup.js"></script> <title><?php echo $uname; ?> ::PIXNET</title>
function getSaltedPassword($username) { return getUserField($username, 'password'); }
<h2><a href="single.php?videoid=<?php echo $videoId; ?> &contestid=<?php echo $contestId; ?> "><?php echo $videoTitle; ?> </a> </h2> <p class="pull-right" style="margin: 0px;padding: 0px;"><small><em>Post date :<?php echo $new_date; ?> </em></small></p> <p style="margin: 0px;padding: 0px;"><small><em>Posted by: <a href="#" title=""><?php echo getUserField('username', $userId); ?> </em></a></small></p> <p><?php echo limit_text($videoDescription, 12); ?> <a href="single.php?videoid=<?php echo $videoId; ?> &contestid=<?php echo $contestId; ?> ">Readmore</a></p> </div> <div class="ratings">
/** * 获取用户信息 * @Author Wayne[qiaobin@zhiyicx.com] * @DateTime 2016-10-13T00:27:51+0800 * @return [type] [description] */ public function getUserData() { if (!$this->is_ZhiboService()) { return array('status' => 0, '授权错误'); } $usid = $_REQUEST['usid']; $uid = M('live_user_info')->where(array('usid' => $usid))->getField('uid'); if (!$uid) { return array('status' => 0, 'message' => '用户不存在'); } // 用户不存在 if (!($credit = M('credit_user')->where(array('uid' => $uid))->find())) { $data = array('gold' => 0, 'zan_count' => 0, 'zan_remain' => 0, 'uname' => getUserName($uid), 'sex' => getUserField($uid, 'sex')); } else { $data = array('gold' => $credit['score'], 'zan_count' => $credit['zan_count'], 'zan_remain' => $credit['zan_remain'], 'uname' => getUserName($uid), 'sex' => getUserField($uid, 'sex')); } return array('status' => 1, 'data' => $data); }
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> <![endif]--> <!-- Add your site or application content here --> <?php include_once 'nav.php'; ?> <div class="container" style="margin-top:50px;"> <div class="col-lg-3"> <?php if ($user_ok == true) { $userlavel = getUserField('userlevel', $userId); echo '<div class="bs-example">'; echo '<ul class="nav nav-pills nav-stacked" style="max-width: 300px;">'; if ($userlavel == 'c') { echo '<li><a href="dashboard.php">Dashboard</a></li>'; echo '<li class="active"><a href="add-video.php">Add Video</a></li>'; } elseif ($userlavel == 'b') { echo '<li><a href="index.php">Dashboard</a></li>'; echo '<li class="active"><a href="add-video.php">Add Video</a></li>'; echo '<li class="divider"></li>'; echo '<li><a href="add-contest.php">Add Contest</a></li>'; echo '<li><a href="publish-video.php">Publish Video</a></li>'; } echo '</ul>'; echo '</div>'; }
<?php # echo md5('Pass123').'<br>'; require_once 'core.inc.php'; require_once 'connect.inc.php'; if (loggedin()) { $firstname = getUserField('firstname'); $surname = getUserField('surname'); echo 'You\'re logged in <strong>' . $firstname . ' ' . $surname . '</strong> you can <a href="logout.php">Log Out Here</a>' . '<br>'; #echo getUserField('firstname'); } else { include 'loginform.inc.php'; }
<?php require 'core.inc.php'; require 'connect.inc.php'; if (loggedin()) { # code... $usersname = getUserField('username'); echo 'You are logged in. ' . $usersname . '.<a href="logout.php">Logout</a><br>'; } else { include 'loginform.inc.php'; }
foreach ($array as $g) { foreach ($g as $e) { print $e . "\t"; } print "\n"; } } /* End of file index.php */ /* Location: ./index.php */ $CI = get_instance(); $mdb = $CI->load->database('default', TRUE); echo $mdb->conn_id . '<br/>' . "\n"; $today = getdate(); $user = '******'; $tokens[$user] = 'hvjkvrxlrfdcjhywweyvjuk'; if (getUserField($user, 'uid') === null) { //insertUser($user,'password','aaaaa'); insertUser($user, '$2y$10$SwDBQy/RX6AIJ0oMFDwcCuyIIEv82CagSCqGGJCZeBQvGN89x2Lcq', 'aaaaa'); newCalendar($user, 'unsw'); $ds = createDBdate($today['year'], $today['mon'], $today['mday'] + 7, 0, 0, 0); $de = createDBdate($today['year'], $today['mon'], $today['mday'] + 8, 0, 0, 0); print 'e-' . insertEvent($user, 'unsw', 'Long Event', $ds, $de, 1); $ds = createDBdate($today['year'], $today['mon'], $today['mday'] + 1, 19, 0, 0); $de = createDBdate($today['year'], $today['mon'], $today['mday'] + 1, 22, 30, 0); print 'e-' . insertEvent($user, 'unsw', 'Birthday party', $ds, $de, 1); $ds = createDBdate($today['year'], $today['mon'], 28, 0, 0, 0); $de = createDBdate($today['year'], $today['mon'], 29, 0, 30, 0); print 'e-' . insertEvent($user, 'unsw', 'Click for Google', $ds, $de, 1); $ds = createDBdate($today['year'], $today['mon'], $today['mday'], 12, 0, 0); $de = createDBdate($today['year'], $today['mon'], $today['mday'], 14, 30, 0); print 'e-' . insertEvent($user, 'unsw', 'Lunch', $ds, $de, 1);