Example #1
0
 /**
  * print debug info from global $DEBUG
  * @static
  */
 public static function debugInfoPrint()
 {
     if (SJB_HelperFunctions::debugModeIsTurnedOn()) {
         global $DEBUG;
         $DEBUG['OPERATING_SYSTEM'] = PHP_OS;
         echo '<pre>';
         print_r($DEBUG);
         echo '</pre>';
         echo 'REQUEST<br/><pre>';
         print_r($_REQUEST);
         echo '</pre>';
     }
 }
 public function getProfileInformation()
 {
     if (!$this->takeDataFromServer && ($oCurUser = SJB_UserManager::getCurrentUser())) {
         $curUserSID = $oCurUser->getSID();
         $profileSocialID = self::getProfileSocialID($curUserSID);
         if ($profileSocialID) {
             $aProfExpl = explode($this->getNetwork() . '_', $profileSocialID);
             $linkedinID = SJB_Array::get($aProfExpl, 1);
             $profileSocialInfo = $this->getProfileSocialSavedInfoBySocialID($linkedinID);
             if ($profileSocialInfo) {
                 self::$oProfile = SJB_Array::get($profileSocialInfo, 'profile_info');
                 self::$oSocialPlugin = $this;
                 if (SJB_HelperFunctions::debugModeIsTurnedOn()) {
                     SJB_HelperFunctions::debugInfoPush(self::$oProfile, 'SOCIAL_PLUGIN');
                 }
                 return true;
             }
         }
     }
     if (self::$object) {
         try {
             $this->_getProfileInfoByAccessToken();
             if (self::$oProfile) {
                 if (SJB_HelperFunctions::debugModeIsTurnedOn()) {
                     SJB_HelperFunctions::debugInfoPush(self::$oProfile, 'SOCIAL_PLUGINS');
                 }
                 return true;
             } else {
                 SJB_Session::unsetValue('sn');
             }
         } catch (FacebookApiException $e) {
             SJB_Error::writeToLog($e->getMessage());
         }
     }
     return null;
 }
Example #3
0
 function grab_image($filename, $outfile, $frame_number = "00:00:03", $image_format, $width, $height)
 {
     $size = $width . "x" . $height;
     $cmd = "ffmpeg -i \"{$filename}\" -vframes 1 -ss {$frame_number} -an -vcodec {$image_format} -f rawvideo -s {$size} \"{$outfile}\"  2>&1 ";
     exec($cmd, $ret);
     if (SJB_HelperFunctions::debugModeIsTurnedOn()) {
         SJB_HelperFunctions::debugInfoPush(array('media' => print_r($cmd, 1), 'result' => print_r($ret, 1)), 'UPLOAD_VIDEO_FILE_TYPE-GRAB_IMAGE');
     }
     return $ret;
 }
Example #4
0
 public function display($template = null, $cache_id = null, $compile_id = null, $parent = null)
 {
     if (SJB_FlashMessages::getInstance()->isErrors()) {
         return;
     }
     $compile_id = $this->module_name;
     if (SJB_HelperFunctions::debugModeIsTurnedOn()) {
         SJB_HelperFunctions::debugInfoPush(array($compile_id => $template), 'TEMPLATE_PROCESSOR');
     }
     parent::display($this->templateSupplier->getTplName($template), $cache_id, $compile_id, $parent);
 }
 private function getProfileInformation()
 {
     if (!$this->takeDataFromServer && ($oCurUser = SJB_UserManager::getCurrentUser())) {
         $curUserSID = $oCurUser->getSID();
         $profileSocialID = self::getProfileSocialID($curUserSID);
         if ($profileSocialID) {
             $aProfExpl = explode($this->getNetwork() . '_', $profileSocialID);
             $linkedinID = $aProfExpl[1];
             $profileSocialInfo = $this->getProfileSocialSavedInfoBySocialID($linkedinID);
             if ($profileSocialInfo) {
                 self::$oProfile = $profileSocialInfo['profile_info'];
                 self::$oSocialPlugin = $this;
                 if (SJB_HelperFunctions::debugModeIsTurnedOn()) {
                     SJB_HelperFunctions::debugInfoPush(self::$oProfile, 'SOCIAL_PLUGIN');
                 }
                 return true;
             }
         }
     }
     if (self::$object) {
         try {
             $response = self::$object->getProfileInfo($this->requestedProfileFields);
             if ($response) {
                 self::$oProfile = new SimpleXMLElement($response);
                 self::$oSocialPlugin = $this;
                 if (SJB_HelperFunctions::debugModeIsTurnedOn()) {
                     SJB_HelperFunctions::debugInfoPush(self::$oProfile, 'SOCIAL_PLUGIN');
                 }
                 return true;
             }
         } catch (Exception $ex) {
             // revocation successful, clear session
             unset($_SESSION['oauth'][self::NETWORK_ID]);
             $this->cleanSessionData(self::NETWORK_ID);
             if (SJB_HelperFunctions::debugModeIsTurnedOn()) {
                 $debug = "Error retrieving profile information:\n\nRESPONSE:\n\n<pre>" . print_r($ex->getMessage()) . "</pre>";
                 SJB_HelperFunctions::debugInfoPush($debug, 'SOCIAL_PLUGINS');
             }
         }
     }
     return null;
 }