public function downloadcsvAction() { $this->_helper->viewRenderer->setNoRender(true); $this->_helper->layout->disableLayout(); $query=Engine_Db_Table::getDefaultAdapter()->select() ->from(‘engine4_users’,array(‘user_id’,’email’,’displayname’,’level_id’,’enabled’,’approved’,’creation_date’)) ->where(‘user_id !=?’,1) ->where(‘user_id not in (?)’, array(‘685′,’870′,’948′,’965′,’1031′,’1249′,’1279′,’1283’)); $aResult= $query->query()->fetchAll(); header(‘Content-Type: application/csv’); header(‘Content-Disposition: attachement; filename=”users.csv”‘); $f = fopen(‘php://output’, ‘w’) or show_error(“Can’t open php://output”); $n = 0;$line = array();$array=array(); $line[]=’Email’; $line[]=’Display Name’; $array[]=$line; $line[]=’info@smarttips.in’;$line[‘sijo’]; $array[] = $line; } foreach ($array as $user) { $n++; if (!fputcsv($f, $user)) { show_error(“Can’t…
Category: SocialEngine
SocialEngine tutorials, SocialEngine tips,SocialEngine plugins,SocialEngine modules
Zend getting user profile picture in SocialEngine
Zend getting user profile picture in SocialEngine <?php $smarttipsuser = Engine_Api::_()->user()->getUser($user_id); echo $this->htmlLink($smarttipsuser->getHref(), $this->itemPhoto($member2, ‘thumb.icon’)) ?>
Get the user id of the profile which is being viewed in socialengine
user id of the profile in socialengine $subject=Engine_Api::_()->core()->getSubject(); The above code returns the currently set subject. In profile the subject is the currently viewing profile. So for get id of this profile, use the following code $profileId=$subject->getIdentity();
how to redirect a page in socialengine
redirect function in socialengine we can use this code controller for redirecting <?php /** * Index Controller */ class Admin_IndexController extends Core_Controller_Action { public function loginAction() { $this->_redirect(‘/index’); } redirect is core helper function in socialengine. It can use in socialengine controller.
Socialengine select Query wih random() function
$customersTable = Engine_Api::_()->getItemTable(‘customer’); $select = $customersTable->select() ->where(‘enabled = ?’, 1) ->order(‘RAND()’) ->limit(3);