Home » SocialEngine (page 2)

SocialEngine

zend framework group by select in socialengine

$viewer = Engine_Api::_()->user()->getViewer(); $iCurUser = $viewer->getIdentity(); $oSelect = $this->getAdapter()->select() ->from(‘engine4_job_usersapplied’, array(‘job_id’, ‘COUNT(job_id) as applied_count’)) ->group(‘job_id’) ->where(‘job_user = ?’, $iCurUser); $result = $this->getAdapter()->fetchAll($oSelect);

Read More »

SocialEngine question and answers

 Where is database config file in socialengine ? applications/settings/database.php Where is the general settings file in socialengine? applications/settings/general.php  – maintenance code and site mode (development or production) Where is cache path settings? applications/settings/cache.php    How to get Base url in socialengine?  echo $this->getView()->baseUrl(); or echo $this–>baseUrl(); How to build a mysql query in social engine? $table = Engine_Api::_()->getDbtable(‘model name’, ‘module name’); $select ...

Read More »

Recommendation widget for socialengine

Recommendation widget for socialengine using their own code The basic knowledge of socialengine is required for installing this stuff. first need to inform that, this widget is not developed in a professional manner. steps: 1.Take the user module path: application->modules->user 2.Then reach the widgets folder in user module and create widget files a.controller file b.tpl file then copy the contents ...

Read More »

Send emails in socialengine

Steps for send e-mails in socialengine: 1.Add the mailtemplate to socialengine database Eg: INSERT INTO `engine4_core_mailtemplates` (`mailtemplate_id`, `type`, `module`, `vars`) VALUES (NULL, ‘event_deleted’, ‘event’, ‘[eventname],[host],[email]’); Default socialengine sendsystem to send mails PHP zend socialengine code: $aEmailTo=array(); $db = $event->getTable()->getAdapter(); $db->beginTransaction(); $select = $event->membership()->getMembersObjectSelect(); $aMembers = $db->fetchAll($select); foreach($aMembers as $aMember) { $aEmailTo[] = $aMember[’email’]; } //event delete mail $filteruserEmailTo = array_filter(array_unique($aEmailTo)); ...

Read More »

How to make a csv file in php socialengine

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 write line $n: $user”); } ...

Read More »

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.

Read More »