<?php $db_password = ‘root’; $db_user = ‘root’; $db_host = “-h localhost”; // Probably localhost $db_name = ‘test’; $prefix =’smarttips_’; $remove = ‘removeprefix’;//set a a condition name if(strtolower($remove) == ‘removeprefix’ || strtolower($remove) == ‘remove’){ $removeprefix = (bool) TRUE; } else { $removeprefix = (bool) FALSE; } $renmeQuery = “mysql -u$db_user -B -p$db_password -s -r $db_host $port…
Category: PHP
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…
Signup or login through facebook
<div><a href=’javascript:void(null);’ onclick=”login();”>Signup/ login through facebook</a></div> <div id=”fb-root”></div> <script src=”http://connect.facebook.net/en_US/all.js”></script> 1. Include the above facebook all.js first. <script> 2. Initialize the facebook app settings. jQuery(function() { FB.init({ appId : ” <12356666>”, status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true //…
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.
Decode binary image data to image file
<?php $output = json_decode($result); foreach($output as $value) { echo $value->id.’–‘.$value->count.‘–‘; echo ‘<img src=”data:image/jpg;base64,’.$value->photo.’” width=”50″ height=”50″ alt=”embedded folder icon”><br />’; } ?>