Пример #1
0
 public function main()
 {
     //$username = pathang::getInstance('node')->get('n1');
     //$uid = pathang::getModel('userlog')->getUserId($username);
     pathang::GetInstance('request')->set('snippet', 1);
     $popular = pathang::getController('profile')->popular();
     $count = 0;
     pathang::GetInstance('packet')->Set('popular', $popular);
     pathang::GetInstance('packet')->Set('count', $count);
     pathang::display();
 }
Пример #2
0
 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();
 }
Пример #3
0
 public function about()
 {
     //calling request object and setting the page and color to be used in the template page
     $request = pathang::getInstance('request');
     $request->page = 'color';
     $request->color = 'orange';
     //identifying the user from the nodes
     $node = pathang::getInstance('node');
     $user = $node->get('n2');
     //based on the node switching between controllers
     if ($user != null) {
         pathang::getController('sample', $user);
     } else {
         pathang::render('sample', 'about');
     }
 }
Пример #4
0
 public function main()
 {
     // get request object
     $request = pathang::GetInstance('request');
     // set the snippet,limit and unread varaibles
     $request->Set('snippet', 'one');
     $request->set('limit', 3);
     $request->set('unread', true);
     // if user exists then only display
     if (isset(pathang::GetInstance('session')->get('liveuser')->username)) {
         $liveuser = pathang::GetInstance('session')->get('liveuser')->username;
         $user = pathang::GetInstance('node')->get('n1');
         //if the user is liveuser then display
         if ($user == $liveuser) {
             //get notification and counter
             $notify = pathang::getController('profile')->notifications()->messages;
             $count = pathang::getController('profile')->notifications()->unread;
             pathang::GetInstance('packet')->set('notify', $notify);
             pathang::GetInstance('packet')->set('count', $count);
             pathang::display();
         }
     }
 }
Пример #5
0
 public function user()
 {
     $n2 = strtoupper(pathang::getInstance('node')->get('n2'));
     switch ($n2) {
         case 'LOGIN':
         case 'LOGOUT':
         case 'REGISTER':
         case 'FORGOT':
         case 'USERNAMECHECK':
         case 'EMAILCHECK':
             pathang::getController('userlog')->{$n2}();
             break;
         case 'SEARCH':
         case 'FOLLOW':
         case 'UNFOLLOW':
         case 'NOTIFY':
             pathang::getController('usermain')->{$n2}();
             break;
         default:
             $this->main();
     }
 }