Exemplo n.º 1
0
 function onProfileDisplay()
 {
     if (!self::kunenaOnline()) {
         return;
     }
     //Load Language file.
     JPlugin::loadLanguage('plg_community_mykunena', JPATH_ADMINISTRATOR);
     $document = JFactory::getDocument();
     $document->addStyleSheet(JURI::base() . 'plugins/community/mykunena/style.css');
     $items = array();
     $user = CFactory::getRequestUser();
     if ($user->id) {
         require_once KPATH_SITE . '/funcs/latestx.php';
         $obj = new CKunenaLatestX('userposts', 0);
         $obj->user = JFactory::getUser($user->id);
         $obj->threads_per_page = $this->params->get('count', 5);
         $obj->embedded = 1;
         $obj->getUserPosts();
         $items = $obj->customreply;
     }
     $caching = $this->params->get('cache', 1);
     if ($caching) {
         $app = JFactory::getApplication();
         $caching = $app->getCfg('caching');
     }
     $cache = JFactory::getCache('plgCommunityMyKunena');
     $cache->setCaching($caching);
     $callback = array('plgCommunityMyKunena', '_getMyKunenaHTML');
     $content = $cache->call($callback, $user, $items);
     return $content;
 }
Exemplo n.º 2
0
 function displayUserPosts()
 {
     require_once KUNENA_PATH_FUNCS . '/latestx.php';
     $obj = new CKunenaLatestX('userposts', 0);
     $obj->user = $this->user;
     $obj->embedded = 1;
     $obj->getUserPosts();
     $obj->displayPosts();
     //echo $obj->getPagination ( $obj->func, $obj->show_list_time, $obj->page, $obj->totalpages, 3 );
 }
Exemplo n.º 3
0
 public function getPosts($userid, $start = 0, $limit = 10, $search = false)
 {
     require_once KUNENA_PATH_FUNCS . '/latestx.php';
     $obj = new CKunenaLatestX('ownposts', 0);
     $obj->user = JUser::getInstance($userid);
     $obj->offset = $start;
     $obj->threads_per_page = $limit;
     $obj->getUserPosts();
     $result = new stdClass();
     $result->total = $obj->total;
     $result->messages = $obj->customreply;
     return $result;
 }