本文整理汇总了PHP中pathang::getModel方法的典型用法代码示例。如果您正苦于以下问题:PHP pathang::getModel方法的具体用法?PHP pathang::getModel怎么用?PHP pathang::getModel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pathang
的用法示例。
在下文中一共展示了pathang::getModel方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
public function main()
{
$username = pathang::getInstance('node')->get('n1');
$uid = pathang::getModel('userlog')->getUserId($username);
pathang::GetInstance('request')->set('snippet', 1);
$following = pathang::getController('profile')->following();
$count = pathang::getModel('profile')->followingCount($uid);
pathang::GetInstance('packet')->Set('following', $following);
pathang::GetInstance('packet')->Set('count', $count);
pathang::display();
}
示例2: render
public function render()
{
//calling a model class and tiggering a method
$model = pathang::getModel('sample');
$model->renderView();
//changing the parameters of kite to load a different page with a color
$request = pathang::getInstance('request');
$request->page = 'color';
$request->color = 'blue';
pathang::render('sample', 'render');
}
示例3: admin
public function admin()
{
$n2 = strtoupper(pathang::getInstance('node')->get('n2'));
$liveuser_id = null;
$liveuser = pathang::GetInstance('session')->get('liveuser');
if ($liveuser) {
$liveuser_id = $liveuser->id;
}
$isadmin = pathang::getModel('userlog')->isAdmin($liveuser_id);
if (!$isadmin) {
pathang::GetInstance('pathang')->SITE->PAGE = 'login';
$basket = pathang::GetInstance('basket');
$basket->set('heading', 'Restricted Access !');
$basket->set('message', 'You dont have enough privilege to acces this page. Sorry for the inconvenience. ');
pathang::render('general', 'errorpage');
exit;
} else {
if ($n2 == null) {
$n2 = 'main';
}
pathang::getController('admin')->{$n2}();
}
}
示例4: checkToken
public function checkToken($token)
{
$string = str_rot13($token);
$peices = explode('t', $string);
$time_stamp = date('Y-m-d H:i:s', $peices[0]);
$uid = $peices[1];
$status = pathang::getModel('userlog')->validateTimestamp($uid, $time_stamp);
return $status;
}
示例5: emailCheck
public function emailCheck()
{
$email = pathang::getInstance('request')->filterHTMLSQL('email');
$checkEmail = pathang::getModel('userlog')->emailCheck($email);
if ($checkEmail) {
echo 1;
} else {
echo 0;
}
}
示例6: notifications
public function notifications()
{
$basket = pathang::getInstance('basket');
$request = pathang::getInstance('request');
$snippet = $request->get('snippet');
$user = pathang::getInstance('node')->get('n1');
$limit = pathang::GetInstance('pathang')->FEEDSTACK->NOTIFICATION_CENTER_COUNT;
if ($request->get('limit')) {
$limit = $request->get('limit');
}
$liveuser = null;
if (pathang::getInstance('session')->get('liveuser')) {
$liveuser = pathang::getInstance('session')->get('liveuser')->username;
$uid = pathang::getInstance('session')->get('liveuser')->id;
}
if ($user == $liveuser) {
$notify = pathang::getModel('profile')->getUserNotifications($user, $limit);
$notifyObj = new stdclass();
if (isset($notify)) {
foreach ($notify as $a => $b) {
$notifyTemp = new stdClass();
foreach ($b as $c => $d) {
$notifyTemp->{$c} = $d;
}
$notifyTemp->time_stamp = pathang::getHelper('feedprocess')->ago($notifyTemp->time_stamp);
$notifyObj->{$a} = $notifyTemp;
}
}
$notifyTemp2 = new stdclass();
$notifyTemp2->unread = pathang::GetModel('profile')->getUnreadNotificationCount($uid);
$notifyTemp2->messages = $notifyObj;
if ($snippet) {
return $notifyTemp2;
}
$basket->set('notify', $notifyObj);
pathang::getInstance('pathang')->SITE->PAGE = 'members';
pathang::render('profile', 'notifications');
//update notifacations read
pathang::GetModel('profile')->updateReadNotifications($uid);
} else {
pathang::getInstance('pathang')->SITE->PAGE = 'login';
$basket->set('heading', 'Restricted Access');
$basket->set('message', 'You dont have enough permission to access this page.');
pathang::render('general', 'errorpage');
exit;
}
}
示例7: deleteComment
public function deleteComment()
{
$request = pathang::getInstance('request');
$comment_id = $request->get('comment_id');
//check for validity of access token
pathang::getHelper('userlog')->ajaxAuthentication();
pathang::getModel('feed')->deleteFeedComment($comment_id);
return 1;
}
示例8: notify
public function notify()
{
$request = pathang::GetInstance('request');
$target = $request->get('target');
$agent = $request->get('agent');
$action = $request->get('action');
$uid = $request->get('uid');
//check for validity of access token
pathang::getHelper('userlog')->ajaxAuthentication();
pathang::getModel('usermain')->saveNotification($uid, $agent, $target, $action);
}