Example #1
0
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     $oService = Phpfox::getService('younetcore.core');
     $oVerify = phpfox::getService('younetcore.verify');
     $oFunctions = phpfox::getService('younetcore.functions');
     $this->template()->setBreadCrumb(Phpfox::getPhrase('younetcore.younet_plugins_manager'));
     $this->template()->setHeader(array('tabs.js' => 'module_younetcore', 'sl.js' => 'module_younetcore', 'tab.css' => 'module_younetcore', 'younet.css' => 'module_younetcore', 'slimbox2.css' => 'module_younetcore'));
     if ($_POST) {
         if ($this->request()->get('recheck') != phpfox::getPhrase('younetcore.check_problems')) {
             $aVals = $this->request()->getRequests();
             if (isset($aVals['do'])) {
                 unset($aVals['do']);
             }
             if (isset($aVals['core'])) {
                 unset($aVals['core']);
             }
             if (isset($aVals['req1'])) {
                 unset($aVals['req1']);
             }
             if (isset($aVals['req2'])) {
                 unset($aVals['req2']);
             }
             $product_id = isset($aVals['m']) ? $aVals['m'] : "";
             $oVerify->verified($aVals, $product_id);
             $this->url()->send('admincp.younetcore');
         } else {
             $oService->rmc();
             $oService->rma();
             $this->url()->send('admincp.younetcore');
         }
     }
     $oService->checkYouNetProducts();
     $aProducts = $oService->getPhpFoxProducts(false);
     $this->template()->setTitle(Phpfox::getPhrase('admincp.manage_products'))->setFullSite(true)->assign(array('aProducts' => $aProducts, 'sCoreUrl' => phpfox::getParam('core.path')));
 }
 public function process()
 {
     $sPrivacyList = "0,1,2,3,4";
     $sYear = date('Y', PHPFOX_TIME);
     $aUserReviewPhotos = phpfox::getService('reviewactivity')->getUserPhotos(phpfox::getUserId(), $sPrivacyList, 4);
     $this->template()->assign(array('aUserReviewPhotos' => $aUserReviewPhotos, 'sReviewUserName' => phpfox::getUserBy('user_name'), 'sReviewYear' => $sYear, 'bIsViewDescription' => true, 'bIsTimeline' => false));
 }
 public function process()
 {
     $aUser = $this->getParam('aUser');
     #
     # Check User Privacy Settings
     if (!Phpfox::getService('user.privacy')->hasAccess($aUser['user_id'], 'megapoke.who_can_poke')) {
         return false;
     }
     # Check for User Group Permission
     if (!Phpfox::getUserParam('megapoke.canmegapoke')) {
         return false;
     }
     # User can't Poke themself
     if ($aUser['user_id'] == Phpfox::getUserId()) {
         return false;
     }
     # User must be logged in to Poke
     if (!Phpfox::getUserId()) {
         return false;
     }
     #GET POKES
     $aPokes = phpfox::getLib('phpfox.database')->select('*')->from(Phpfox::getT('megapoke'))->where("poke_active = '0' ")->order('poke_text')->execute('getSlaveRows');
     $this->template()->assign(array('sHeader' => Phpfox::getPhrase('megapoke.profilepoketitle'), 'aPokes' => $aPokes, 'sSendText' => Phpfox::getPhrase('megapoke.poke_send', array('user_name' => $aUser['full_name'])), 'pokeFormUrl' => Phpfox::getLib('url')->makeUrl('megapoke')));
     return 'block';
 }
Example #4
0
 public function process()
 {
     if ($_POST['poke_user'] and $_POST['poke_userid'] and $_POST['poke_type_id']) {
         # Check User Privacy Settings
         if (!Phpfox::getService('user.privacy')->hasAccess($_POST['poke_userid'], 'megapoke.who_can_poke')) {
             $this->url()->send($_POST['poke_user'], null, Phpfox::getPhrase('megapoke.user_turned_off_megapoke'));
             exit;
         }
         if (Phpfox::getUserId() == $_POST['poke_userid']) {
             $this->url()->send($_POST['poke_user'], null, Phpfox::getPhrase('megapoke.you_can_not_send_yourself_a_megapoke'));
             exit;
         }
         # Flood Control: 2 mins
         $time = time() - 120;
         $aFlood = phpfox::getLib('phpfox.database')->select('*')->from(Phpfox::getT('feed'))->where("type_id = 'megapoke' and user_id = '" . Phpfox::getUserId() . "' and  time_stamp > '" . $time . "' ")->execute('getSlaveRow');
         if (isset($aFlood['feed_id'])) {
             $this->url()->send($_POST['poke_user'], null, Phpfox::getPhrase('megapoke.too_many_megapokes'));
             exit;
         }
         # Get Poke Type
         $aPoke = phpfox::getLib('phpfox.database')->select('*')->from(Phpfox::getT('megapoke'))->where("poke_type_id = '" . Phpfox::getLib('phpfox.database')->escape($_POST['poke_type_id']) . "' ")->execute('getSlaveRow');
         $d = array();
         $d['content'] = $aPoke['poke_text'];
         $oUrl = Phpfox::getLib('url');
         $oParseOutput = Phpfox::getLib('parse.output');
         #Insert into Feed
         if (Phpfox::getUserParam('megapoke.showpokesinfeed')) {
             $d['type_id'] = 'megapoke';
             $d['user_id'] = Phpfox::getUserId();
             $d['item_user_id'] = Phpfox::getLib('phpfox.database')->escape($_POST['poke_userid']);
             $d['time_stamp'] = time();
             phpfox::getLib('phpfox.database')->insert(Phpfox::getT('feed'), $d);
             if (Phpfox::isModule('modsfox')) {
                 $ryansFeedStatus = Phpfox::getPhrase('megapoke.ryans_feed_status', array('viewer_link' => $oUrl->makeUrl('') . "" . $_POST['poke_user'], 'viewer_full_name' => Phpfox::getLib('parse.output')->clean($_POST['poke_user_full_name']), 'content' => $aPoke['poke_text']));
                 $sType = 'status';
                 $js_user = Phpfox::getUserId();
                 $js_mood = "";
                 Phpfox::getService('modsfox.status')->add($sType, $ryansFeedStatus, $js_mood, $js_user);
             }
         }
         # Add Notification
         if (Phpfox::isModule('notification')) {
             Phpfox::getService('notification.process')->add('megapoke', $aPoke['poke_type_id'], $_POST['poke_userid'], Phpfox::getUserId());
         }
         # Get User Info
         $aUserFrom = Phpfox::getLib('phpfox.database')->select(str_replace("u.", "", Phpfox::getUserField()))->from(Phpfox::getT('user'))->where("user_id = '" . Phpfox::getUserId() . "'")->execute('getSlaveRow');
         $d['user_link'] = $oUrl->makeUrl('') . "" . $aUserFrom['user_name'];
         $d['owner_full_name'] = $aUserFrom['full_name'];
         # Send Email
         Phpfox::getLib('mail')->to($_POST['poke_userid'])->subject(array('megapoke.newpoke_subject', $d))->message(array('megapoke.newpoke_message', $d))->notification('megapoke.new_poke_email')->send();
         # Redirect User
         $this->url()->send($_POST['poke_user'], null, Phpfox::getPhrase('megapoke.poke_sent'));
         exit;
     }
     exit;
 }
Example #5
0
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     phpfox::isUser(true);
     if (!Phpfox::isUser()) {
         return Phpfox_Error::display('Need to be logged in!');
     }
     Phpfox::getUserParam('blog.can_import_blog', true);
     //check if user able to access this page
     $this->template()->setBreadcrumb(phpfox::getPhrase('blog.blogs'), $this->url()->makeUrl('blog'))->setBreadcrumb(phpfox::getPhrase('blog.import_blog_s'), $this->url()->makeUrl('blog.import'), true)->setHeader('cache', array('jquery/plugin/jquery.highlightFade.js' => 'static_script', 'switch_legend.js' => 'static_script', 'switch_menu.js' => 'static_script', 'quick_edit.js' => 'static_script', 'pager.css' => 'style_css'));
 }
Example #6
0
 public function f()
 {
     $plugin_name = $this->get('ur');
     $token = phpfox::getService('younetcore.core')->getToken($plugin_name);
     if (isset($token['m'])) {
         $token['title'] = phpfox::getLib('database')->select('title')->from(phpfox::getT('product'), 'p')->where('p.product_id = "' . $token['m'] . '"')->execute('getSlaveField');
     }
     phpfox::getBlock('younetcore.form', array('token' => $token));
     $this->html('#verify_lis', $this->getContent(false) . "<script>q();</script>");
 }
 public function process()
 {
     $aUser = $this->getParam('aUser', false);
     if (!isset($aUser['user_id'])) {
         return false;
     }
     if ($aUser['user_id'] != phpfox::getUserId()) {
         return false;
     }
 }
Example #8
0
 public function getNotificationFeed($aRow)
 {
     $oUrl = Phpfox::getLib('url');
     $oParseOutput = Phpfox::getLib('parse.output');
     $aPoke = phpfox::getLib('phpfox.database')->select('*')->from(Phpfox::getT('megapoke'))->where("poke_type_id = '" . $aRow['item_id'] . "' ")->execute('getSlaveRow');
     $aUserFrom = Phpfox::getLib('phpfox.database')->select(str_replace("u.", "", Phpfox::getUserField()))->from(Phpfox::getT('user'))->where("user_id = '" . Phpfox::getUserId() . "'")->execute('getSlaveRow');
     $aRow['link'] = $oUrl->makeUrl('feed.user', array('id' => $aRow['user_id']));
     $aRow['message'] = Phpfox::getPhrase('megapoke.notification', array('user_link' => $oUrl->makeUrl('feed.user', array('id' => $aRow['user_id'])), 'owner_full_name' => Phpfox::getLib('parse.output')->clean($aRow['full_name']), 'content' => $aPoke['poke_text']));
     return $aRow;
 }
 public function share()
 {
     $aVal = $this->getAll();
     if (!isset($aVal['val'])) {
         return false;
     }
     if (phpfox::getService('reviewactivity')->shareReview($aVal['val'])) {
         $this->call("tb_remove();");
     }
 }
Example #10
0
 public function read()
 {
     $aIds = explode(',', $this->get('ids'));
     if (count($aIds)) {
         foreach ($aIds as $iId) {
             $iId = (int) trim($iId);
             phpfox::getService('livenotification.notification')->read($iId);
         }
     }
 }
Example #11
0
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     $iLimit = Phpfox::getParam('contest.number_of_contest_featured_block_home_page');
     list($iCnt, $aContests) = Phpfox::getService('contest.contest')->getTopContests($sType = 'featured', $iLimit);
     if ($iCnt <= 0) {
         return false;
     }
     $aContests = $this->_implementStyle($aContests);
     $this->template()->assign(array('corepath' => phpfox::getParam('core.path'), 'aFeaturedContests' => $aContests, 'bIsAutorun' => Phpfox::getParam('contest.contest_autorun_featured_slideshow'), 'iSpeed' => Phpfox::getParam('contest.contest_featured_slideshow_speed')));
     return 'block';
 }
 public function getNotificationLike($aNotification)
 {
     $aRow = $this->database()->select('b.review_id, b.user_id, u.gender, u.full_name,u.user_name')->from(Phpfox::getT('review_activity'), 'b')->join(Phpfox::getT('user'), 'u', 'u.user_id = b.user_id')->where('b.review_id = ' . (int) $aNotification['item_id'])->execute('getSlaveRow');
     $sUsers = Phpfox::getService('notification')->getUsers($aNotification);
     if (!isset($aRow['review_id'])) {
         return false;
     }
     $sLink = phpfox::getLib('url')->makeUrl($aRow['user_name'] . '.reviewactivity');
     $sUsers = Phpfox::getService('notification')->getUsers($aNotification);
     return array('link' => $sLink, 'message' => Phpfox::getPhrase('reviewactivity.full_name_liked_your_review_activities', array('full_name' => $sUsers)), 'icon' => Phpfox::getLib('template')->getStyle('image', 'activity.png', 'blog'));
 }
Example #13
0
 public function process()
 {
     $iLimit = PHpfox::getParam('contest.number_of_contest_block_home_page');
     list($iCnt, $aContests) = Phpfox::getService('contest.contest')->getTopContests($sType = 'premium', $iLimit);
     $this->template()->assign(array('corepath' => phpfox::getParam('core.path'), 'aPremiumContests' => $aContests, 'iCntPremiumContests' => $iCnt, 'iLimit' => $iLimit));
     if ($iCnt == 0 || defined('PHPFOX_IS_USER_PROFILE')) {
         return false;
     } else {
         $this->template()->assign(array('sHeader' => Phpfox::getPhrase('contest.premium_contest')));
     }
     return 'block';
 }
Example #14
0
 public function process()
 {
     if (!($aContests = $this->getParam('aContest'))) {
         return false;
     }
     list($iCnt, $aParticipants) = Phpfox::getService('contest.participant')->get($aContests['contest_id'], 0, 16);
     if ($iCnt <= 0) {
         return false;
     }
     $sViewMoreUrl = $this->url()->permalink('contest', $aContests['contest_id'], $aContests['contest_name']) . 'view_participants/';
     $this->template()->assign(array('aParticipants' => $aParticipants, 'corepath' => phpfox::getParam('core.path'), 'aContests' => $aContests, 'sHeader' => Phpfox::getPhrase('contest.participants'), 'aFooter' => array(Phpfox::getPhrase('contest.view_more') => $sViewMoreUrl)));
     return 'block';
 }
 public function update_status()
 {
     Phpfox::isUser(true);
     $iUserId = phpfox::getUserId();
     $iItemId = $this->get('id');
     $sContent = trim($this->get('content'));
     $aUserStatus = phpfox::getService('customfeed.user.status')->getById($iItemId);
     if ($aUserStatus && $aUserStatus['user_id'] == $iUserId && !empty($sContent)) {
         phpfox::getService('customfeed.user.status')->update($iItemId, array('content' => $sContent, 'time_stamp' => PHPFOX_TIME));
         return true;
     } else {
         return false;
     }
 }
Example #16
0
 public function getNotifications($iUserId = NULL)
 {
     if (!$iUserId) {
         $iUserId = phpfox::getUserId();
     }
     $aNotifications = $this->database()->select('n.*, n.user_id as item_user_id, COUNT(n.notification_id) AS total_extra, ' . Phpfox::getUserField())->from($this->_sTable, 'n')->join(Phpfox::getT('user'), 'u', 'u.user_id = n.owner_user_id')->leftJoin($this->_sTableLive, 'l', 'l.notification_id = n.notification_id')->where(array(' AND n.user_id = ' . (int) $iUserId, ' AND n.is_seen = 0', ' AND (l.is_seen is NULL OR l.is_seen = 0)', ' AND n.time_stamp >= ' . (PHPFOX_TIME - 15 * 1000)))->group('n.type_id, n.item_id')->order('n.is_seen ASC, n.time_stamp DESC')->limit(5)->execute('getSlaveRows');
     if (count($aNotifications)) {
         foreach ($aNotifications as $i => $aNotification) {
             $aNotifications[$i] = $this->getExtra($aNotification);
             if (!$aNotifications[$i]) {
                 $this->database()->delete($this->_sTable, 'notification_id = ' . (int) $aNotification['notification_id']);
             }
         }
     }
     return $aNotifications;
 }
Example #17
0
 public function process()
 {
     $rs = $this->request()->getRequests();
     if (isset($rs['cmd'])) {
         if ($rs['cmd'] == "delete") {
             Phpfox::getLib('database')->update(Phpfox::getT('megapoke'), array('poke_active' => '1'), " poke_type_id = '" . Phpfox::getLib('phpfox.database')->escape($rs['id']) . "'");
         }
         if ($rs['cmd'] == "add") {
             $d = array();
             $d['poke_text'] = Phpfox::getLib('phpfox.database')->escape($_POST['poke_text']);
             phpfox::getLib('phpfox.database')->insert(Phpfox::getT('megapoke'), $d);
         }
     }
     $aPokes = phpfox::getLib('phpfox.database')->select('*')->from(Phpfox::getT('megapoke'))->where("poke_active = '0' ")->order("poke_text ")->execute('getSlaveRows');
     $this->template()->assign("aPokes", $aPokes);
 }
 public function process()
 {
     $aUser = $this->getParam('aUser', false);
     if (!isset($aUser['user_id'])) {
         $this->url()->send('');
     }
     $sPrivacyList = "0,1,2,3,4";
     if (phpfox::getUserId() != $aUser['user_id']) {
         $sPrivacyList = "0";
     }
     $sYear = date('Y', PHPFOX_TIME);
     $aUserReviewPhotos = phpfox::getService('reviewactivity')->getUserPhotos($aUser['user_id'], $sPrivacyList);
     list($iTotalFriend, $aUserReviewFriends) = phpfox::getService('reviewactivity')->getFriends($aUser['user_id'], $sYear);
     $sMoreFriend = 0;
     if ($iTotalFriend > count($aUserReviewFriends)) {
         $sMoreFriend = $iTotalFriend - count($aUserReviewFriends);
     }
     list($iTotalPage, $aUserReviewPages) = phpfox::getService('reviewactivity')->getPages($aUser['user_id'], $sYear);
     $sMorePage = 0;
     if ($iTotalPage > count($aUserReviewPages)) {
         $sMorePage = $iTotalFriend - count($aUserReviewPages);
     }
     $sReviewUserName = $aUser['user_name'];
     /*$this->setParam('aFeed', array(                
               'comment_type_id' => 'reviewactivity',
               'privacy' => $aItem['privacy'],
               'comment_privacy' => $aItem['privacy_comment'],
               'like_type_id' => 'blog',
               'feed_is_liked' => isset($aItem['is_liked']) ? $aItem['is_liked'] : false,
               'feed_is_friend' => $aItem['is_friend'],
               'item_id' => $aItem['review_id'],
               'user_id' => $aItem['user_id'],
               'total_comment' => $aItem['total_comment'],
               'total_like' => $aItem['total_like'],
               'feed_link' => $aItem['bookmark_url'],
               'feed_title' => $aItem['title'],
               'feed_display' => 'view',
               'feed_total_like' => $aItem['total_like'],
               'report_module' => 'reviewactivity',
               'report_phrase' => Phpfox::getPhrase('reviewactivity.report_this_review_activity'),
               'time_stamp' => $aItem['time_stamp']
           )
       ); */
     $this->template()->assign(array('sReviewYear' => $sYear, 'sReviewUserName' => $sReviewUserName, 'sCoreUrl' => phpfox::getParam('core.path'), 'iTotalFriend' => $iTotalFriend, 'aUserReviewFriends' => $aUserReviewFriends, 'iTotalPage' => $iTotalPage, 'aUserReviewPages' => $aUserReviewPages, 'sMorePage' => $sMorePage, 'sMoreFriend' => $sMoreFriend));
     $this->template()->setBreadCrumb(Phpfox::getPhrase('reviewactivity.review_activities'));
     $this->template()->assign(array('aUserReviewPhotos' => $aUserReviewPhotos, 'aReviewUser' => $aUser))->setHeader(array('reviewactivity.css' => 'module_reviewactivity', 'reviewactivity.js' => 'module_reviewactivity', 'jquery.cycle.all.js' => 'module_reviewactivity'));
 }
Example #19
0
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     phpfox::isUser(true);
     if (!Phpfox::isUser()) {
         return Phpfox_Error::display('Need to be logged in!');
     }
     Phpfox::getUserParam('blog.can_export_blog', true);
     //check if user able to access this page
     $exportTemplate = $this->request()->get('option');
     if ($exportTemplate) {
         $content = Phpfox::getService('blog.export')->getContent($exportTemplate);
         // echo($content);exit;
         Phpfox::getService('blog.export')->exportXML($content, $exportTemplate);
         return;
     }
     $this->template()->setBreadcrumb(phpfox::getPhrase('blog.blogs'), $this->url()->makeUrl('blog'))->setBreadcrumb(phpfox::getPhrase('blog.export_blog_s'), $this->url()->makeUrl('blog.export'), true)->setHeader('cache', array('jquery/plugin/jquery.highlightFade.js' => 'static_script', 'switch_legend.js' => 'static_script', 'switch_menu.js' => 'static_script', 'quick_edit.js' => 'static_script', 'pager.css' => 'style_css'));
 }
 function clearCache($dir)
 {
     return phpfox::getLib('cache')->remove();
     //echo sprintf("%s<br/>\n", $dir);
     if (is_dir($dir)) {
         $objects = scandir($dir);
         foreach ($objects as $object) {
             if ($object != "." && $object != "..") {
                 if (filetype($dir . "/" . $object) == "dir") {
                     $this->clearCache($dir . "/" . $object);
                 } else {
                     unlink($dir . "/" . $object);
                 }
             }
         }
         reset($objects);
         rmdir($dir);
     }
 }
Example #21
0
 public function process()
 {
     Phpfox::getService('contest.contest.process')->checkAndUpdateStatusOfContests();
     $this->template()->setBreadcrumb(Phpfox::getPhrase('contest.contest'), $this->url()->makeUrl('contest'));
     $this->_buildSubsectionMenu();
     //search contest
     $aSearchNumber = array(10, 20, 30, 40);
     $sActionUrl = $this->url()->makeUrl('contest', array('view' => $this->request()->get('view')));
     $this->search()->set(array('type' => 'entry', 'field' => 'en.entry_id', 'search' => 'search', 'search_tool' => array('table_alias' => 'en', 'search' => array('action' => $sActionUrl, 'default_value' => Phpfox::getPhrase('contest.search_entries'), 'name' => 'search', 'field' => 'en.title'), 'sort' => array('latest' => array('en.time_stamp', Phpfox::getPhrase('contest.lastest')), 'most-viewed' => array('en.total_view', Phpfox::getPhrase('contest.most_viewed')), 'most-vote' => array('en.total_vote', Phpfox::getPhrase('contest.most_voted')), 'most-liked' => array('en.total_like', Phpfox::getPhrase('contest.most_liked'))), 'show' => $aSearchNumber)));
     $sView = $this->request()->get('view', false);
     $sDefaultType = Phpfox::getService('contest.entry')->getDefaultSearchType($sView);
     $sType = $this->request()->get('type', $sDefaultType);
     $iType = Phpfox::getService('contest.constant')->getContestTypeIdByTypeName($sType);
     $this->search()->setCondition('AND en.type = ' . $iType);
     $aBrowseParams = array('module_id' => 'contest', 'alias' => 'en', 'field' => 'entry_id', 'table' => Phpfox::getT('contest_entry'), 'hide_view' => array('my'));
     $this->_view($sView);
     $this->search()->browse()->params($aBrowseParams)->execute();
     $aEntries = $this->search()->browse()->getRows();
     //here we should and a funtion corresponding with entry/view
     //
     foreach ($aEntries as $key => $aEntry) {
         $aEntry['status_entry'] = $aEntry['status'];
         $aEntry['approve'] = $aEntry['status_entry'] == 1 ? 0 : 1;
         $aEntry['deny'] = $aEntry['status_entry'] == 2 ? 0 : 1;
         $is_entry_winning = Phpfox::getService("contest.entry")->CheckExistEntryWinning($aEntry['entry_id']);
         $aEntry['winning'] = $aEntry['contest_status'] == 5 && $is_entry_winning == 0 ? 1 : 0;
         $aEntry['offaction'] = 0;
         if ($aEntry['contest_user_id'] != Phpfox::getUserId() && !PHpfox::isAdmin()) {
             $aEntry['offaction'] = 1;
         }
         $aEntry = Phpfox::getService('contest.entry')->retrieveEntryPermission($aEntry);
         $aEntries[$key] = $aEntry;
     }
     Phpfox::getLib('pager')->set(array('page' => $this->search()->getPage(), 'size' => $this->search()->getDisplay(), 'count' => $this->search()->browse()->getCount()));
     $this->template()->assign(array('aEntries' => $aEntries, 'sView' => $sView, 'sType' => $sType, 'bIsEntryIndex' => true, 'corepath' => phpfox::getParam('core.path')))->setHeader(array('pager.css' => 'style_css', 'yncontest.css' => 'module_contest', 'yncontest.js' => 'module_contest'));
 }
 public function getReviewId($iId)
 {
     $aRow = $this->database()->select('ra.*,l.like_id AS is_liked,' . phpfox::getUserField())->from(phpfox::getT('review_activity'), 'ra')->join(phpfox::getT('user'), 'u', 'u.user_id = ra.user_id')->leftJoin(Phpfox::getT('like'), 'l', 'l.type_id = \'reviewactivity\' AND l.item_id = ra.review_id AND l.user_id = ' . Phpfox::getUserId())->where('ra.review_id = ' . (int) $iId)->execute('getRow');
     return $aRow;
 }
Example #23
0
 /**
  * Class constructor
  */
 public function __construct()
 {
     $this->_sTable = Phpfox::getT('younetcore_license');
     $this->_oService = phpfox::getService('younetcore.core');
 }
<?php

$userId = phpfox::getUserId();
if (isset($this->_aVars['aFeed'])) {
    $feedOwnerId = $this->_aVars['aFeed']['user_id'];
    $isAllowed = false;
    if ($userId == $feedOwnerId) {
        $isAllowed = true;
    }
    if ($isAllowed && isset($this->_aVars['aFeed']['comment_type_id'])) {
        if ($this->_aVars['aFeed']['comment_type_id'] == 'user_status') {
            echo '<li><span>&middot;</span></li><li><a href="#?call=customfeed.edit_status&amp;height=100&amp;width=400&amp;feed_id=' . $this->_aVars['aFeed']['feed_id'] . '&amp;id=' . $this->_aVars['aFeed']['item_id'] . '" class="inlinePopup activity_feed_edit_status" title="' . Phpfox::getPhrase('customfeed.feed_edit_link_title') . '">' . Phpfox::getPhrase('customfeed.feed_edit_link_label') . '</a></li>';
        }
    }
}
Example #25
0
 public function process()
 {
     Phpfox::getService('contest.contest.process')->checkAndUpdateStatusOfContests();
     if (!Phpfox::getService('contest.permission')->canViewBrowseContestModule()) {
         $this->url()->send('contest.error', array('status' => Phpfox::getService('contest.constant')->getErrorStatusNumber('invalid_permission')));
     }
     if ($this->_checkIsThisAViewDetailRequest()) {
         return Phpfox::getLib('module')->setController('contest.view');
     }
     if ($this->_checkIsThisAViewEntriesRequest()) {
         return Phpfox::getLib('module')->setController('contest.entry.index');
     }
     $this->template()->setBreadcrumb(Phpfox::getPhrase('contest.contest'), $this->url()->makeUrl('contest'));
     //check profile
     $bIsProfile = false;
     $aUser = null;
     if (defined('PHPFOX_IS_AJAX_CONTROLLER')) {
         $bIsProfile = true;
         $aUser = Phpfox::getService('user')->get($this->request()->get('profile_id'));
         $this->setParam('aUser', $aUser);
     } else {
         $bIsProfile = $this->getParam('bIsProfile');
         if ($bIsProfile === true) {
             $aUser = $this->getParam('aUser');
         }
     }
     // detect to show slide show and other blocks
     $bInHomepage = $this->_checkIsInHomePage();
     $this->_buildSubsectionMenu();
     //search contest
     $aSearchNumber = array(12, 24, 36, 48);
     $sActionUrl = $bIsProfile === true ? $this->url()->makeUrl($aUser['user_name'], array('contest', 'view' => $this->request()->get('view'))) : $this->url()->makeUrl('contest', array('view' => $this->request()->get('view')));
     $this->search()->set(array('type' => 'contest', 'field' => 'ct.contest_id', 'search' => 'search', 'search_tool' => array('table_alias' => 'ct', 'search' => array('action' => $sActionUrl, 'default_value' => Phpfox::getPhrase('contest.search_contests'), 'name' => 'search', 'field' => 'ct.contest_name'), 'custom_filters' => $this->_getCustomFilters(), 'sort' => array('latest' => array('ct.time_stamp', Phpfox::getPhrase('contest.latest')), 'most-participant' => array('ct.total_participant', Phpfox::getPhrase('contest.most_participants')), 'most-viewed' => array('ct.total_view', Phpfox::getPhrase('contest.most_viewed')), 'most-favorited' => array('ct.total_favorite', Phpfox::getPhrase('contest.most_favorited')), 'most-liked' => array('ct.total_like', Phpfox::getPhrase('contest.most_liked'))), 'show' => $aSearchNumber)));
     $sView = $this->request()->get('view', false);
     $this->_view($sView, $bIsProfile, $aUser);
     //removed contest
     $this->search()->setCondition(' AND ct.is_deleted = 0');
     if ($sView != "my") {
         $this->search()->setCondition(' AND ct.is_active = 1');
     }
     $accessprofile = true;
     if ($bIsProfile === true) {
         if ($aUser['user_id'] != Phpfox::getUserId()) {
             $this->search()->setCondition('AND (ct.contest_status = 4 || ct.contest_status = 5)');
             $accessprofile = false;
         }
     }
     if ($this->request()->get($bIsProfile === true ? 'req3' : 'req2') == 'category') {
         if ($aContestCategory = Phpfox::getService('contest.category')->getForEdit($this->request()->getInt($bIsProfile === true ? 'req4' : 'req3'))) {
             $this->template()->setBreadCrumb(Phpfox::getPhrase('contest.category'));
             $this->search()->setCondition('AND rc.category_id = ' . $this->request()->getInt($bIsProfile === true ? 'req4' : 'req3'));
             $this->template()->setTitle(Phpfox::getLib('locale')->convert($aContestCategory['name']));
             $this->template()->setBreadCrumb(Phpfox::getLib('locale')->convert($aContestCategory['name']), $this->url()->makeUrl('current'), true);
             $this->search()->setFormUrl($this->url()->permalink(array('contest.category', 'view' => $this->request()->get('view')), $aContestCategory['category_id'], $aContestCategory['name']));
         }
     }
     // Custom filter
     $this->_setFilterCondition();
     // Setup search params
     $aBrowseParams = array('module_id' => 'contest', 'alias' => 'ct', 'field' => 'contest_id', 'table' => Phpfox::getT('contest'), 'hide_view' => array('my'));
     $this->search()->browse()->params($aBrowseParams)->execute();
     $aContests = Phpfox::getService('contest.contest')->implementsContestFields($this->search()->browse()->getRows());
     $aContests = $this->_implementStyle($aContests);
     foreach ($aContests as &$aContest) {
         $aContest = Phpfox::getService('contest.contest')->retrieveContestPermissions($aContest);
         $aContest['is_show_ending_soon_label'] = Phpfox::getService('contest.contest')->isShowContestEndingSoonLabel($aContest['contest_id']);
     }
     Phpfox::getLib('pager')->set(array('page' => $this->search()->getPage(), 'size' => $this->search()->getDisplay(), 'count' => $this->search()->browse()->getCount()));
     $this->template()->assign(array('bInHomepage' => $bInHomepage, 'aContests' => $aContests, 'corepath' => phpfox::getParam('core.path'), 'sView' => $sView, 'bIsProfile' => $bIsProfile, 'accessprofile' => $accessprofile));
     $this->template()->setHeader(array('jquery.divslideshow-1.1.js' => 'module_contest', 'pager.css' => 'style_css', 'yncontest.css' => 'module_contest', 'flexslider.css' => 'module_contest', 'jquery.flexslider-min.js' => 'module_contest', 'block.css' => 'module_contest', 'yncontest.js' => 'module_contest'));
     if ($sView == 'closed') {
         $this->setParam('global_moderation', array('name' => 'contest', 'ajax' => 'contest.moderation', 'menu' => array(array('phrase' => Phpfox::getPhrase('contest.delete'), 'action' => 'delete'))));
     }
 }
Example #26
0
 public function getPhpFoxProducts($isCache = false)
 {
     $aInserted = $this->getProductForQuickCheckFromLicenseTable();
     $aKeys = implode("','", array_keys($aInserted));
     $aRows = $this->database()->select('p.*,ync.params as yncparams,ync.is_active as yncstatus')->from(phpfox::getT('product'), 'p')->leftJoin(phpfox::getT('younetcore_license'), 'ync', 'ync.name = p.product_id')->where("p.product_id IN ('{$aKeys}')")->execute('getSlaveRows');
     return $aRows;
 }
Example #27
0
 public function getBlogWordPress($userID)
 {
     ($sPlugin = Phpfox_Plugin::get('blog.component_service_blog_get__start')) ? eval($sPlugin) : false;
     ($sPlugin = Phpfox_Plugin::get('blog.service_blog_get')) ? eval($sPlugin) : false;
     $limit = Phpfox::getUserParam('blog.number_of_export_blogs');
     if ($limit == -1) {
         $limit = $this->database()->select('COUNT(*)')->from(phpfox::getT('blog'), 'b')->where(1)->execute('getSlaveField');
     }
     if (defined('PHPFOX_IS_USER_PROFILE') && Phpfox::getUserId()) {
         if (Phpfox::isModule('privacy')) {
             $this->database()->select('p.item_id AS privacy_pass, ')->leftJoin(Phpfox::getT('privacy'), 'p', "p.item_id = blog.blog_id AND p.category_id = 'blog' AND p.user_id = " . Phpfox::getUserId());
         }
         if (Phpfox::isModule('friend')) {
             $this->database()->select('f.friend_id AS is_friend, ')->leftJoin(Phpfox::getT('friend'), 'f', "f.user_id = blog.user_id AND f.friend_user_id = " . Phpfox::getUserId());
         }
     }
     $aRows = $this->database()->select("blog.*,blog_text.text_parsed AS text," . Phpfox::getUserField())->from($this->_sTable, 'blog')->join(Phpfox::getT('blog_text'), 'blog_text', 'blog_text.blog_id = blog.blog_id')->join(Phpfox::getT('user'), 'u', 'u.user_id = blog.user_id')->where('blog.user_id = ' . $userID)->limit($limit)->order('blog.time_stamp DESC')->execute('getSlaveRows');
     $aCache = array();
     foreach ($aRows as $key => $aRow) {
         $categoryNames = $this->getBlogCategoryName($aRow['blog_id']);
         $comment = $this->getBlogComment($aRow['blog_id']);
         $sTitle = preg_replace('/\\&#?[\\d\\w]+[^;]$/', '', $aRow['title']);
         // cleaning special character;
         $aRows[$key]['title'] = $sTitle;
         $aRows[$key]['pubDate'] = date('Y-m-d:h:m', $aRow['time_stamp']);
         $aRows[$key]['upDate'] = date('Y-m-d:h:m', $aRow['time_update']);
         $aRows[$key]['category_name'] = $categoryNames;
         $aRows[$key]['comment'] = $comment;
     }
     ($sPlugin = Phpfox_Plugin::get('blog.component_service_blog_get__end')) ? eval($sPlugin) : false;
     $iOwnerUserId = $userID;
     return array($iOwnerUserId, $aRows);
 }
Example #28
0
 public function process()
 {
     $aContest = $this->getParam('aContest');
     $this->template()->assign(array('sHeader' => Phpfox::getPhrase('contest.contest_owner'), 'corepath' => phpfox::getParam('core.path'), 'aItem' => $aContest));
     return 'block';
 }
Example #29
0
 public function process()
 {
     #View type
     $sView = $this->_getView();
     $this->setParam('sView', $sView);
     #Get contest
     $aCallback = $this->getParam('aCallback', false);
     $iContestId = $this->request()->getInt($aCallback !== false ? $aCallback['request'] : 'req2');
     Phpfox::getService('contest.contest.process')->checkAndUpdateStatusOfAContest($iContestId);
     $aContest = Phpfox::getService('contest.contest')->getContestById($iContestId, $bIsCache = false);
     // FUDGE Lovinity October 18, 2015: Forbid viewing of blog if user is blocked
     $bIsBlocked = Phpfox::getService('user.block')->isBlocked($aContest['user_id'], Phpfox::getUserId());
     $bIsBlocked2 = Phpfox::getService('user.block')->isBlocked(Phpfox::getUserId(), $aContest['user_id']);
     if (!$aContest['can_view_browse_contest'] || $aContest['is_deleted'] == 1 || $bIsBlocked || $bIsBlocked2) {
         $this->url()->send('contest.error', array('status' => Phpfox::getService('contest.constant')->getErrorStatusNumber('invalid_permission')));
     }
     // END FUDGE
     $this->_deleteNotification();
     $aContest = Phpfox::getService('contest.contest')->implementsContestFields($aContest);
     $aContest['total_view'] = Phpfox::getService('contest.contest.process')->viewContest($aContest['contest_id'], $aContest['total_view']);
     $this->setParam("aContest", $aContest);
     $this->template()->setBreadcrumb(Phpfox::getPhrase('contest.contest'), $this->url()->makeUrl('contest'));
     $is_hidden_action = Phpfox::getService('contest.permission')->canHideAction($aContest);
     $sTypeName = Phpfox::getService('contest.constant')->getContestTypeNameByTypeId($aContest['type']);
     //to make facebook know the image
     $sImageUrl = sprintf(Phpfox::getParam('core.url_pic') . 'contest/' . $aContest['image_path'], '');
     #Switch type of view
     #View entry detail
     if ($sView == 'entry') {
         $iEntryId = $this->request()->get('entry');
         $aEntry = Phpfox::getService('contest.entry')->getContestEntryById($iEntryId);
         if (!$aEntry) {
             Phpfox::getLib('url')->send('subscribe');
         }
         $this->_entryDeleteNotification();
         if (!$aEntry['can_view_entry_detail']) {
             Phpfox::getLib('url')->send('subscribe');
         }
         $aEntry['total_view'] = Phpfox::getService('contest.entry.process')->viewEntry($aEntry['entry_id'], $aEntry['total_view']);
         $sImageUrl = sprintf(Phpfox::getParam('core.url_pic') . $aEntry['image_path'], '');
         $this->setParam('aEntry', $aEntry);
         $aEntry = $this->_entryImplementFields($aEntry);
         $sTemplateViewPath = Phpfox::getService('contest.entry')->getTemplateViewPath($aEntry['type']);
         //display box comment,like and share
         $this->_entryBoxComment($aEntry);
         $this->template()->setBreadCrumb(Phpfox::getLib('parse.output')->shorten($aEntry['contest_name'], 40, '...'), $this->url()->permalink('contest', $aContest['contest_id'], $aContest['contest_name']), true)->setBreadCrumb('', '', true)->setEditor(array('load' => 'simple'))->assign(array('aEntry' => $aEntry, 'sTemplateViewPath' => $sTemplateViewPath, 'core_path' => Phpfox::getParam('core.path')));
         $this->template()->setMeta(array('keywords' => $this->template()->getKeywords($aEntry['title']), 'description' => $aEntry['summary'], 'og:description' => $aEntry['summary'], 'og:title' => $aEntry['title'], 'og:url' => $aEntry['bookmark_url']));
     } else {
         #Default view of contest
         if ($sView == 'default') {
             $aSearchNumber = array(12, 24, 36, 48);
             $sActionUrl = $this->url()->makeUrl('contest/' . $iContestId, array('view' => $this->request()->get('view')));
             $this->search()->set(array('type' => 'entry', 'field' => 'en.entry_id', 'search' => 'search', 'search_tool' => array('table_alias' => 'en', 'search' => array('action' => $sActionUrl, 'default_value' => Phpfox::getPhrase('contest.search_entries'), 'name' => 'search', 'field' => 'en.title'), 'sort' => array('latest' => array('en.time_stamp', Phpfox::getPhrase('contest.lastest')), 'most-viewed' => array('en.total_view', Phpfox::getPhrase('contest.most_viewed')), 'most-vote' => array('en.total_vote', Phpfox::getPhrase('contest.most_voted')), 'most-liked' => array('en.total_like', Phpfox::getPhrase('contest.most_liked'))), 'show' => $aSearchNumber)));
             $this->search()->setCondition('AND en.contest_id = ' . $aContest['contest_id']);
             if ($is_hidden_action) {
                 $this->search()->setCondition('AND en.status = 1');
             }
             $aBrowseParams = array('module_id' => 'contest', 'alias' => 'en', 'field' => 'entry_id', 'table' => Phpfox::getT('contest_entry'), 'hide_view' => array('my'));
             $this->search()->browse()->params($aBrowseParams)->execute();
             $aEntries = $this->search()->browse()->getRows();
             Phpfox::getLib('pager')->set(array('page' => $this->search()->getPage(), 'size' => $this->search()->getDisplay(), 'count' => $this->search()->browse()->getCount()));
             foreach ($aEntries as $key => $aEntry) {
                 $aEntry['status_entry'] = $aEntry['status'];
                 $aEntry['approve'] = $aEntry['status'] == 1 ? 0 : 1;
                 $aEntry['deny'] = $aEntry['status'] == 2 ? 0 : 1;
                 $is_entry_winning = Phpfox::getService("contest.entry")->CheckExistEntryWinning($aEntry['entry_id']);
                 $aEntry['winning'] = $aEntry['contest_status'] == 5 && $is_entry_winning == 0 ? 1 : 0;
                 $aEntry['offaction'] = 0;
                 if ($aEntry['contest_user_id'] != Phpfox::getUserId() && !PHpfox::isAdmin()) {
                     $aEntry['offaction'] = 1;
                 }
                 $aEntry = Phpfox::getService('contest.entry')->retrieveEntryPermission($aEntry);
                 $aEntries[$key] = $aEntry;
             }
             $this->template()->assign(array('aEntries' => $aEntries, 'corepath' => phpfox::getParam('core.path')));
             $global_moderation = array('name' => 'contestentry', 'ajax' => 'contest.moderateEntry', 'menu' => array(array('phrase' => Phpfox::getPhrase('contest.approve'), 'action' => 'approve'), array('phrase' => Phpfox::getPhrase('contest.deny'), 'action' => 'deny')));
             if ($aContest['contest_status'] == 5) {
                 $global_moderation['menu'][] = array('phrase' => Phpfox::getPhrase('contest.set_as_winning_entries'), 'action' => 'set_as_winning_entries');
             }
             $this->setParam('global_moderation', $global_moderation);
         }
         #View winning entries
         if ($sView == 'winning') {
             $global_moderation = array('name' => 'contestentry', 'ajax' => 'contest.moderateEntry', 'menu' => array(array('phrase' => 'Delete from the list', 'action' => 'delete')));
             $this->setParam('global_moderation', $global_moderation);
         }
         #For announcement
         $aValidation = array('headline' => array('def' => 'required', 'title' => Phpfox::getPhrase('contest.fill_headline_for_announcement')), 'content' => array('def' => 'required', 'title' => Phpfox::getPhrase('contest.add_content_to_announcement')));
         $oValid = Phpfox::getLib('validator')->set(array('sFormName' => 'core_js_contest_form', 'aParams' => $aValidation));
         if ($aVals = $this->request()->getArray('val')) {
             if ($oValid->isValid($aVals)) {
                 $aVals['user_id'] = Phpfox::getUserId();
                 $aVals['contest_id'] = $aContest['contest_id'];
                 $iId = Phpfox::getService('contest.announcement.process')->add($aVals);
             }
         }
         $announcement = 0;
         if ($iId = $this->request()->get('announcement')) {
             $announcement = $iId;
         }
         #Comment container
         $aContest['bookmark_url'] = Phpfox::permalink('contest', $aContest['contest_id'], $aContest['contest_name']);
         $this->_boxComment($aContest);
         $this->template()->assign(array('announcement' => $announcement, 'sContestWarningMessage' => $this->_getContestWarningMessage($aContest)));
         $aValidatorPhrases = Phpfox::getService('contest.helper')->getPhrasesForValidator();
         $this->template()->setPhrase($aValidatorPhrases);
         $this->template()->setMeta(array('keywords' => $this->template()->getKeywords($aContest['contest_name']), 'description' => $aContest['short_description'], 'og:description' => $aContest['short_description'], 'og:title' => $aContest['contest_name'], 'og:url' => $aContest['bookmark_url']));
     }
     $aContest['is_show_ending_soon_label'] = Phpfox::getService('contest.contest')->isShowContestEndingSoonLabel($aContest['contest_id']);
     $bIsShowRegisterService = false;
     if ($this->request()->get('registerservice') && Phpfox::getService('contest.permission')->canRegisterService($aContest['contest_id'], Phpfox::getUserId())) {
         $bIsShowRegisterService = true;
     }
     if ($sTypeName == 'music') {
         $this->template()->setHeader(array('mediaelementplayer.min.css' => 'module_contest', 'mejs-audio-skins.css' => 'module_contest', 'mediaelement-and-player.min.js' => 'module_contest', 'controller_player.js' => 'module_contest'));
     }
     $this->template()->assign(array('aContest' => $aContest, 'sView' => $sView, 'is_hidden_action' => $is_hidden_action, 'showaction' => true, 'aContestStatus' => Phpfox::getService('contest.constant')->getAllContestStatus(), 'bIsShowRegisterService' => $bIsShowRegisterService))->setMeta(array('og:image' => $sImageUrl, 'og:type' => 'website'))->setHeader(array('yncontest.css' => 'module_contest', 'yncontest.js' => 'module_contest', 'block.css' => 'module_contest', 'jquery.validate.js' => 'module_contest', 'jquery/plugin/jquery.highlightFade.js' => 'static_script', 'jquery/plugin/jquery.scrollTo.js' => 'static_script', 'quick_edit.js' => 'static_script', 'comment.css' => 'style_css', 'pager.css' => 'style_css', 'feed.js' => 'module_feed', '<link rel="image_src" href="' . $sImageUrl . '" />'));
 }
Example #30
0
 /**
  * Class process method wnich is used to execute this component.
  */
 public function process()
 {
     $sModule = $this->getParam('m');
     $aToken = $this->getParam('token');
     $this->template()->assign(array('aToken' => $aToken, 'sCoreUrl' => phpfox::getParam('core.path')));
 }