Category: SocialEngine

Socialengine video uploading source code


 public function jquerycreateVideo($params, $file, $values)   {     if( $file instanceof Storage_Model_File ) {       $params[‘file_id’] = $file->getIdentity();     } else {        // create video item       $video = Engine_Api::_()->getDbtable(‘videos’, ‘video’)->createRow();       $file_ext = $file[‘extension’];       $video->code = $file_ext;       $video->type

How to change the redirection page after login in socialengine


socialengine is a zendframework based project helps the developers to build their own custom social network website. socialengine following the MVC structure. The login action is in user/controllers/AuthController.php Here we specify the redirection URL return $this->_helper->redirector->gotoRoute(array(“action”  =>  ‘home’) ,  “user_general” ,  true);  change the user router according to your need.

Pass custom error message to zend/socialengine form from controller


$this->view->form = $form = new User_Form_Admin_Universities_Createdomain(); $this->view->university_id = $iId = $this->_getParam(‘id’, null); $form->populate(array(‘university_id’=>$iId)); if($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost()) ) { $iExists = $oUniversitydomains->ifExistsDomain(‘domain’, $aData[‘domain’], $aData[‘university_id’]); if($iExists > 0) { $message = ‘Domain Name Already Registered’;              $form->getElement(‘domain’)->addError($message);              return; } }

select query cannot join with another table zend framework


$select = $table->select() ->setIntegrityCheck(false) ->from($tableName) ->joinRight($subtableName, ‘`’.$subtableName.’`.`user_id` = `’.$tableName.’`.`user_id`’,array(‘resource_approved’,’user_approved’)) ->where(‘`’.$subtableName.’`.`resource_id` = ?’, $resource->getIdentity()); Give the following sql statement for avoid  “select query cannot join with another table zend framework”  mysql error. setIntegrityCheck(false)  

session in socialengine


socialengine basically using zendframework for development. Zendframework methods can see all through the socialengine code. Session is  an important functionality in programming. For achieving the session in socialengine use the following code $session = new Zend_Session_Namespace(‘invite’); $session->invite_code = $this->_getParam(‘code’); $session->invite_email = $this->_getParam(’email’);

Pass custom error messages to form in socialengine / zend framework


if( !$form->isValid($this->getRequest()->getPost()) ) { return; } // Process $values = $form->getValues(); if( ($CouponCode = $form->getElement(‘coupon_code’)) && isset($values[‘coupon_code’])) { $iCouponExist = $table->checkCouponExist($values[‘coupon_code’]); if($iCouponExist == 1) { return $CouponCode->addError(‘This Coupon Code is not available, please use another one.’); } }

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);

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 =

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

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

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

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.

Advertisment ad adsense adlogger