public function field($id = null)
 {
     $details = !empty($this->entity->info) ? perfectUnserialize($this->entity->info) : [];
     if (empty($id)) {
         return $details;
     }
     if (isset($details[$id])) {
         return $details[$id];
     }
     return 'Nill';
 }
 public function get($userid)
 {
     if (empty($this->type)) {
         return [];
     }
     $userFilePath = $this->path . '/' . $this->type . '/' . $userid . '.php';
     if (!$this->file->exists($userFilePath)) {
         return [];
     }
     $fileContent = $this->file->get($userFilePath);
     return perfectUnserialize($fileContent);
 }
 public function render()
 {
     $data = ['path' => 'notification.display', 'notification' => $this->entity];
     if ($this->entity->user) {
         try {
             $data = array_merge($data, empty($this->entity->data) ? [] : perfectUnserialize($this->entity->data));
             /**
              * @var $path
              */
             extract($data);
             /**user have seen it**/
             $this->entity->markSeen();
             return \Theme::section($path, $data);
         } catch (\Exception $e) {
             $this->entity->delete();
         }
     } else {
         $this->entity->delete();
     }
 }
Exemple #4
0
 /**
  * save user privacy info
  *
  * @param array $val
  * @param \App\Models\User $user
  * @return boolean
  */
 public function savePrivacy($val, $user = null)
 {
     $user = empty($user) ? \Auth::user() : $user;
     $privacy = empty($user->privacy_info) ? [] : perfectUnserialize($user->privacy_info);
     $privacy = array_merge($privacy, $val);
     $user->privacy_info = perfectSerialize(sanitizeUserInfo($privacy));
     $user->save();
     $this->event->fire('user.save.privacy', [$user]);
     return true;
 }
Exemple #5
0
 public function getAutoPost()
 {
     return $content = perfectUnserialize($this->entity->type_content);
 }
Exemple #6
0
        $repository->savePrivacy(['self-online' => 0]);
        //$user->updateStatus(0);
        $user->save();
    }
    \Auth::logout();
    \Session::flush();
    sleep(1);
    \Auth::logout();
    \Session::flush();
    return \Redirect::to('/');
}]);
require 'routes/user.php';
require 'routes/post.php';
require 'routes/pages.php';
Route::any('load/pagelets', ['uses' => function () {
    $pagelets = perfectUnserialize(\Input::get('pagelets'));
    $content = "";
    foreach ($pagelets as $pagelet) {
        $content .= \Theme::section($pagelet['view'], $pagelet['data']);
    }
    echo $content;
}]);
if (!Config::get('disable-game', 0)) {
}
require 'routes/games.php';
require 'routes/message.php';
require 'routes/connection.php';
require 'routes/search.php';
require 'routes/discover.php';
require 'routes/help.php';
require 'routes/report.php';
Exemple #7
0
 public function readDesign($type = 'profile')
 {
     $design = ['enable' => false];
     $userDesign = !empty($this->entity->design_info) ? perfectUnserialize($this->entity->design_info) : [];
     $userDesign = !$userDesign ? [] : $userDesign;
     $design = array_merge($design, $userDesign);
     if (isset($design[$type])) {
         $design = $design[$type];
     }
     /**
      * @var $enable
      * @var $theme
      */
     extract($design);
     if ($enable) {
         $design['bg_image'] = \Image::url($design['bg_image']);
     }
     if (!$enable) {
         $themeDesign = \Theme::option()->get('design-themes');
         $themeDesign = (empty($theme) or !isset($themeDesign[$theme])) ? $themeDesign['default'] : $themeDesign[$theme];
         /**
          * Reset the design to this selected one
          */
         $design['bg_image'] = $themeDesign['background-image'];
         $design['bg_color'] = $themeDesign['background-color'];
         $design['bg_attachment'] = $themeDesign['background-attachment'];
         $design['bg_position'] = $themeDesign['background-position'];
         $design['bg_repeat'] = $themeDesign['background-repeat'];
         $design['link_color'] = $themeDesign['link-color'];
         $design['content_bg_color'] = $themeDesign['page-content-bg-color'];
     }
     return $design;
 }
Exemple #8
0
 public function getModerators()
 {
     $moderators = empty($this->moderators) ? [] : perfectUnserialize($this->moderators);
     return empty($moderators) ? [] : $moderators;
 }