当前位置: 首页>>代码示例>>PHP>>正文


PHP pathang::GetModel方法代码示例

本文整理汇总了PHP中pathang::GetModel方法的典型用法代码示例。如果您正苦于以下问题:PHP pathang::GetModel方法的具体用法?PHP pathang::GetModel怎么用?PHP pathang::GetModel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pathang的用法示例。


在下文中一共展示了pathang::GetModel方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: showMembers

 public function showMembers()
 {
     $count = pathang::getInstance('pathang')->FEEDSTACK->MEMBER_COUNT;
     $from = pathang::getInstance('request')->get('from');
     if ($from) {
         $members = pathang::GetModel('usermain')->listMembers($count, $from);
     } else {
         $members = pathang::GetModel('usermain')->listMembers($count);
     }
     $users = new stdClass();
     foreach ($members as $a => $b) {
         $temp = new stdClass();
         foreach ($b as $x => $y) {
             $temp->{$x} = $y;
         }
         $temp->image = '';
         $temp->profile_link = ROOT . $temp->username;
         $users->{$a} = $temp;
     }
     $result = pathang::GetHelper('userlog')->getUsersImage($users);
     $basket = pathang::GetInstance('basket');
     $basket->set('members', $result);
     $basket->set('count', $count);
     $basket->set('heading', 'Members');
     if ($from) {
         pathang::render('members', 'members_loadmore');
     } else {
         pathang::render('members');
     }
 }
开发者ID:adrixnac,项目名称:RedSocial,代码行数:30,代码来源:usermain.php

示例2: installation

 public function installation()
 {
     $request = pathang::getInstance('request');
     if ($request->get('username')) {
         pathang::GetModel('install')->main($request);
         pathang::getInstance('node')->set('terminal_ext', 'html');
         pathang::Render('install', 'success');
     } else {
         pathang::getInstance('node')->set('terminal_ext', 'html');
         pathang::Render('install', 'main');
     }
 }
开发者ID:gibranda,项目名称:Feedstack,代码行数:12,代码来源:root.php

示例3: main

 public function main()
 {
     //display menu as user/guest or admin
     $n1 = pathang::getInstance('node')->get('n1');
     $session = pathang::getInstance('session');
     $liveuser = $session->get('liveuser');
     if ($liveuser) {
         $uid = $liveuser->id;
         $unread = pathang::GetModel('profile')->getUnreadNotificationCount($uid);
         pathang::getInstance('packet')->set('unread', $unread);
         if ($liveuser->type == 1) {
             pathang::display();
         } else {
             pathang::display('admin');
         }
     } else {
         pathang::display('guest');
     }
 }
开发者ID:adrixnac,项目名称:RedSocial,代码行数:19,代码来源:menu.php

示例4: post

 public function post()
 {
     $feed = pathang::GetInstance('request')->filterHTMLSQL('feed');
     $username = pathang::GetInstance('request')->filterHTMLSQL('username');
     $uid = pathang::GetInstance('request')->filterHTMLSQL('uid');
     $name = pathang::GetInstance('request')->filterHTMLSQL('name');
     $image = pathang::GetInstance('request')->filterHTMLSQL('image');
     $basket = pathang::GetInstance('basket');
     //check for validity of access token
     pathang::getHelper('userlog')->ajaxAuthentication();
     //feed process
     $feedObj = pathang::getHelper('feedprocess')->process($feed);
     //storing feed in database
     $status = pathang::GetModel('feed')->addFeed($uid, $feedObj->feed, $feed, $feedObj->feed_url, $feedObj->feed_container, $feedObj->feed_type);
     //$feed = pathang::getHelper('feedprocess')->markUp($feedObj);
     $basket->set('feed', $feedObj->feed);
     $basket->set('feed_container', $feedObj->feed_container);
     $basket->set('feed_id', $status);
     $basket->set('name', $name);
     $basket->Set('profile_link', ROOT . $username);
     $basket->set('image', $image);
     pathang::Render('feed', 'feed_entry');
 }
开发者ID:adrixnac,项目名称:RedSocial,代码行数:23,代码来源:feed.php

示例5: sendForgotPasswordMail

 public function sendForgotPasswordMail($code, $email)
 {
     $to = $email;
     $url = ROOT . 'user/forgot/' . $code;
     $subject = 'Forgot Password Instruction';
     $from = pathang::getInstance('pathang')->MAILGUN->ADMIN_EMAIL;
     $title = pathang::getInstance('pathang')->META->SITE_NAME;
     $desc = pathang::getInstance('pathang')->META->DESC;
     $name = pathang::GetModel('userlog')->getUserFullName(null, $to);
     $headers = "From: " . strip_tags($from) . "\r\n";
     $headers .= "Reply-To: " . strip_tags($from) . "\r\n";
     $headers .= "MIME-Version: 1.0\r\n";
     $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
     $message = '<html><body>';
     $message .= '<p>hi ' . $name . ' !</p>';
     $message .= '<p>please click on the below link to create a new password </p>';
     $message .= '<p><a href="' . $url . '">' . $url . '</a></p><br>';
     $message .= "<p><b>{$title}</b><br>{$desc}<br>";
     $message .= "<small><a href='" . ROOT . "'>" . ROOT . "</a></small></p>";
     $message .= '</body></html>';
     $this->email($to, $subject, $message);
 }
开发者ID:gibranda,项目名称:Feedstack,代码行数:22,代码来源:userlog.php

示例6: getUserNotifications

 public function getUserNotifications($user, $limit)
 {
     //pdo object and table
     $pdo = pathang::getInstance('pdo');
     $request = pathang::getInstance('request');
     $table = 'notifications';
     $uid = pathang::GetModel('userlog')->getUserId($user);
     if ($request->Get('unread')) {
         $sql = "SELECT u.name,u.username,n.uid,n.action,n.agent,n.target,n.time_stamp,n.status  \r\n\t\t\t\tFROM {$table} n,users u\r\n\t\t\t\tWHERE n.uid= {$uid} and n.agent = u.id and n.status = 1\r\n\t\t\t\tORDER BY n.id desc \r\n\t\t\t\tLIMIT {$limit}";
     } else {
         $sql = "SELECT u.name,u.username,n.uid,n.action,n.agent,n.target,n.time_stamp,n.status  \r\n\t\t\t\tFROM {$table} n,users u\r\n\t\t\t\tWHERE n.uid= {$uid} and n.agent = u.id\r\n\t\t\t\tORDER BY n.id desc \r\n\t\t\t\tLIMIT {$limit}";
     }
     //query and fetch the result
     $res = $pdo->query($sql);
     $result = $res->fetchAll(PDO::FETCH_ASSOC);
     //if record found return activation else false
     if ($result) {
         return $result;
     } else {
         return null;
     }
 }
开发者ID:adrixnac,项目名称:RedSocial,代码行数:22,代码来源:profile.php

示例7: 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;
     }
 }
开发者ID:adrixnac,项目名称:RedSocial,代码行数:47,代码来源:profile.php

示例8: deleteUser

 public function deleteUser()
 {
     $request = pathang::GetInstance('request');
     $uid = $request->get('uid');
     //check for validity of access token
     pathang::getHelper('userlog')->ajaxAuthentication();
     $status = pathang::GetModel('userlog')->deleteUser($uid);
     if ($status) {
         echo '1';
     } else {
         echo '0';
     }
 }
开发者ID:adrixnac,项目名称:RedSocial,代码行数:13,代码来源:admin.php


注:本文中的pathang::GetModel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。