Ejemplo n.º 1
0
    }
}
// GET PREVIOUS PRIVACY SETTINGS
for ($c = 0; $c < count($level_album_privacy); $c++) {
    if (user_privacy_levels($level_album_privacy[$c]) != "") {
        SE_Language::_preload(user_privacy_levels($level_album_privacy[$c]));
        $privacy_options[$level_album_privacy[$c]] = user_privacy_levels($level_album_privacy[$c]);
    }
}
for ($c = 0; $c < count($level_album_comments); $c++) {
    if (user_privacy_levels($level_album_comments[$c]) != "") {
        SE_Language::_preload(user_privacy_levels($level_album_comments[$c]));
        $comment_options[$level_album_comments[$c]] = user_privacy_levels($level_album_comments[$c]);
    }
}
for ($c = 0; $c < count($level_album_tag); $c++) {
    if (user_privacy_levels($level_album_tag[$c]) != "") {
        SE_Language::_preload(user_privacy_levels($level_album_tag[$c]));
        $tag_options[$level_album_tag[$c]] = user_privacy_levels($level_album_tag[$c]);
    }
}
// RESTORE LINE BREAKS
$album_info[album_desc] = str_replace("<br>", "\r\n", $album_info[album_desc]);
// ASSIGN VARIABLES AND SHOW EDIT ALBUMS PAGE
$smarty->assign('result', $result);
$smarty->assign('is_error', $is_error);
$smarty->assign('album_info', $album_info);
$smarty->assign('privacy_options', $privacy_options);
$smarty->assign('comment_options', $comment_options);
$smarty->assign('tag_options', $tag_options);
include "footer.php";
Ejemplo n.º 2
0
    // AN ERROR OCCURED SEND THE DATA BACK
    $blogentry_info = array('blogentry_id' => $blogentry_id, 'blogentry_title' => $blogentry_title, 'blogentry_body' => $blogentry_body, 'blogentry_blogentrycat_id' => $blogentry_blogentrycat_id, 'blogentry_search' => $blogentry_search, 'blogentry_privacy' => $blogentry_privacy, 'blogentry_comments' => $blogentry_comments, 'blogentry_trackbacks' => $blogentry_trackbacks);
}
// GET BLOG ENTRY CATEGORIES
$blogentrycats_array = $blog->blog_category_list($user->user_info['user_id']);
// GET PREVIOUS PRIVACY SETTINGS
$level_blog_privacy = unserialize($user->level_info['level_blog_privacy']);
rsort($level_blog_privacy);
for ($c = 0; $c < count($level_blog_privacy); $c++) {
    $lvar = user_privacy_levels($level_blog_privacy[$c]);
    if ($lvar) {
        SE_Language::_preload($privacy_options[$level_blog_privacy[$c]] = $lvar);
    }
}
$level_blog_comments = unserialize($user->level_info['level_blog_comments']);
rsort($level_blog_comments);
for ($c = 0; $c < count($level_blog_comments); $c++) {
    $lvar = user_privacy_levels($level_blog_comments[$c]);
    if ($lvar) {
        SE_Language::_preload($comment_options[$level_blog_comments[$c]] = $lvar);
    }
}
// CONVERT HTML CHARACTERS BACK
$blogentry_info['blogentry_body'] = str_replace("\r\n", "", htmlspecialchars_decode($blogentry_info['blogentry_body']));
// ASSIGN VARIABLES AND SHOW NEW BLOGENTRY PAGE
$smarty->assign('blogentry_info', $blogentry_info);
$smarty->assign('blogentrycats', $blogentrycats_array);
$smarty->assign('privacy_options', $privacy_options);
$smarty->assign('comment_options', $comment_options);
$smarty->assign('comments_total', $comments_total);
include "footer.php";
    if (user_privacy_levels($priv) != "") {
        SE_Language::_preload(user_privacy_levels($priv));
        $privacy_options[$priv] = user_privacy_levels($priv);
    }
}
for ($c = 6; $c >= 0; $c--) {
    $priv = pow(2, $c) - 1;
    if (user_privacy_levels($priv) != "") {
        SE_Language::_preload(user_privacy_levels($priv));
        $comment_options[$priv] = user_privacy_levels($priv);
    }
}
for ($c = 6; $c >= 0; $c--) {
    $priv = pow(2, $c) - 1;
    if (user_privacy_levels($priv) != "") {
        SE_Language::_preload(user_privacy_levels($priv));
        $tag_options[$priv] = user_privacy_levels($priv);
    }
}
// ASSIGN VARIABLES AND SHOW ALBUM SETTINGS PAGE
$smarty->assign('result', $result);
$smarty->assign('is_error', $is_error);
$smarty->assign('level_info', $level_info);
$smarty->assign('level_album_privacy', unserialize($level_info[level_album_privacy]));
$smarty->assign('level_album_comments', unserialize($level_info[level_album_comments]));
$smarty->assign('level_album_tag', unserialize($level_info[level_album_tag]));
$smarty->assign('level_album_profile', explode(",", $level_info[level_album_profile]));
$smarty->assign('album_privacy', $privacy_options);
$smarty->assign('album_comments', $comment_options);
$smarty->assign('album_tag', $tag_options);
include "admin_footer.php";
Ejemplo n.º 4
0
 function album_list($start, $limit, $sort_by = "album_id DESC", $where = "")
 {
     global $database, $user, $owner;
     // BEGIN QUERY
     $sql = "\r\n      SELECT\r\n        se_albums.*,\r\n        se_albums.album_totalfiles AS total_files,\r\n        se_albums.album_totalspace AS total_space\r\n    ";
     // IF NO USER ID SPECIFIED, RETRIEVE USER INFORMATION
     if (!$this->user_id) {
         $sql .= ",\r\n        se_users.user_id,\r\n        se_users.user_username,\r\n        se_users.user_photo,\r\n        se_users.user_fname,\r\n        se_users.user_lname\r\n    ";
     }
     // CONTINUE QUERY
     $sql .= "\r\n      FROM\r\n        se_albums\r\n    ";
     // IF NO USER ID SPECIFIED, JOIN TO USER TABLE
     if (!$this->user_id) {
         $sql .= "\r\n      LEFT JOIN\r\n        se_users\r\n        ON se_albums.album_user_id=se_users.user_id\r\n    ";
     }
     // ADD WHERE IF NECESSARY
     if (!empty($where) || $this->user_id) {
         $sql .= "\r\n      WHERE\r\n    ";
     }
     // ENSURE USER ID IS NOT EMPTY
     if ($this->user_id) {
         $sql .= "\r\n        album_user_id='{$this->user_id}'\r\n    ";
     }
     // INSERT AND IF NECESSARY
     if ($this->user_id && !empty($where)) {
         $sql .= " AND";
     }
     // ADD WHERE CLAUSE, IF NECESSARY
     if (!empty($where)) {
         $sql .= "\r\n        {$where}\r\n    ";
     }
     // ADD ORDER, AND LIMIT CLAUSE
     $sql .= "\r\n      ORDER BY\r\n        {$sort_by}\r\n      LIMIT\r\n        {$start}, {$limit}\r\n    ";
     // RUN QUERY
     $resource = $database->database_query($sql);
     // GET ALBUMS INTO AN ARRAY
     $album_array = array();
     while ($album_info = $database->database_fetch_assoc($resource)) {
         // IF NO USER ID SPECIFIED, CREATE OBJECT FOR AUTHOR
         if (!$this->user_id) {
             $author = new se_user();
             $author->user_exists = TRUE;
             $author->user_info['user_id'] = $album_info['user_id'];
             $author->user_info['user_username'] = $album_info['user_username'];
             $author->user_info['user_fname'] = $album_info['user_fname'];
             $author->user_info['user_lname'] = $album_info['user_lname'];
             $author->user_info['user_photo'] = $album_info['user_photo'];
             $author->user_displayname();
         } elseif ($owner->user_exists && $owner->user_info['user_id'] == $album_info['album_user_id']) {
             $author =& $owner;
         } elseif ($user->user_exists && $user->user_info['user_id'] == $album_info['album_user_id']) {
             $author =& $user;
         }
         // CONVERT SPACE TO MB
         $album_space_mb = $album_info['total_space'] / 1024 / 1024;
         $album_space_mb = round($album_space_mb, 2);
         // GET PATH OF ALBUM COVER
         $album_cover_id = 0;
         $album_cover_ext = "";
         if ($album_info['album_cover']) {
             $album_cover_query = $database->database_query("SELECT media_id, media_ext FROM se_media WHERE media_id='{$album_info['album_cover']}' AND media_album_id='{$album_info['album_id']}' LIMIT 1");
             if ($database->database_num_rows($album_cover_query)) {
                 $album_cover_array = $database->database_fetch_assoc($album_cover_query);
                 $album_cover_id = $album_cover_array['media_id'];
                 $album_cover_ext = $album_cover_array['media_ext'];
             }
         }
         // CREATE ARRAY OF ALBUM DATA
         SE_Language::_preload(user_privacy_levels($album_info['album_privacy']));
         // SET OTHER INFO
         $album_info['album_author'] =& $author;
         $album_info['album_space'] = $album_space_mb;
         $album_info['album_privacy'] = user_privacy_levels($album_info['album_privacy']);
         $album_info['album_cover_id'] = $album_cover_id;
         $album_info['album_cover_ext'] = $album_cover_ext;
         $album_info['album_files'] = $album_info['total_files'];
         $album_array[] = $album_info;
         unset($author, $album_info);
     }
     // RETURN ARRAY
     return $album_array;
 }
            $database->database_query("UPDATE se_users SET user_search='1' WHERE user_level_id='{$level_id}'");
        }
        $database->database_query("UPDATE se_users SET user_privacy='" . $new_privacy_options[0] . "' WHERE user_level_id='{$level_id}' && user_privacy NOT IN('" . join("','", $new_privacy_options) . "')");
        $database->database_query("UPDATE se_users SET user_comments='" . $new_comments_options[0] . "' WHERE user_level_id='{$level_id}' && user_comments NOT IN('" . join("','", $new_comments_options) . "')");
        $result = 1;
    }
}
// GET PREVIOUS PRIVACY SETTINGS
for ($c = 6; $c > 0; $c--) {
    $priv = pow(2, $c) - 1;
    if (user_privacy_levels($priv) != "") {
        SE_Language::_preload(user_privacy_levels($priv));
        $privacy_options[$priv] = user_privacy_levels($priv);
    }
}
for ($c = 6; $c >= 0; $c--) {
    $priv = pow(2, $c) - 1;
    if (user_privacy_levels($priv) != "") {
        SE_Language::_preload(user_privacy_levels($priv));
        $comment_options[$priv] = user_privacy_levels($priv);
    }
}
// ASSIGN VARIABLES AND SHOW GENERAL USER SETTINGS PAGE
$smarty->assign('result', $result);
$smarty->assign('is_error', $is_error);
$smarty->assign('level_info', $level_info);
$smarty->assign('level_profile_privacy', unserialize($level_info[level_profile_privacy]));
$smarty->assign('level_profile_comments', unserialize($level_info[level_profile_comments]));
$smarty->assign('profile_privacy', $privacy_options);
$smarty->assign('profile_comments', $comment_options);
include "admin_footer.php";
Ejemplo n.º 6
0
    // MAKE SURE SUBMITTED PRIVACY OPTIONS ARE ALLOWED, IF NOT, SET TO EVERYONE
    if (!in_array($video_privacy, $level_video_privacy)) {
        $video_privacy = $level_video_privacy[0];
    }
    if (!in_array($video_comments, $level_video_comments)) {
        $video_comments = $level_video_comments[0];
    }
    $database->database_query("UPDATE se_videos SET video_title='{$video_title}', video_desc='{$video_desc}', video_search='{$video_search}', video_privacy='{$video_privacy}', video_comments='{$video_comments}' WHERE video_id='{$video_id}' AND video_user_id='{$user->user_info['user_id']}'");
}
// GET VIDEOS
$total_videos = $video->video_total("(video_is_converted<>'-1')");
$video_array = $video->video_list(0, $video->video_total(), "video_is_converted, video_id DESC", "", 1);
// GET PREVIOUS PRIVACY SETTINGS
for ($c = 0; $c < count($level_video_privacy); $c++) {
    if (user_privacy_levels($level_video_privacy[$c]) != "") {
        SE_Language::_preload(user_privacy_levels($level_video_privacy[$c]));
        $privacy_options[$level_video_privacy[$c]] = user_privacy_levels($level_video_privacy[$c]);
    }
}
for ($c = 0; $c < count($level_video_comments); $c++) {
    if (user_privacy_levels($level_video_comments[$c]) != "") {
        SE_Language::_preload(user_privacy_levels($level_video_comments[$c]));
        $comment_options[$level_video_comments[$c]] = user_privacy_levels($level_video_comments[$c]);
    }
}
// ASSIGN VARIABLES AND SHOW VIEW VIDEOS PAGE
$smarty->assign('videos_total', $total_videos);
$smarty->assign('videos', $video_array);
$smarty->assign('privacy_options', $privacy_options);
$smarty->assign('comment_options', $comment_options);
include "footer.php";
        $block_user = new se_user();
        $block_user->user_info['user_id'] = $block['user_id'];
        $block_user->user_info['user_username'] = $block['user_username'];
        $block_user->user_info['user_photo'] = $block['user_photo'];
        $block_user->user_info['user_fname'] = $block['user_fname'];
        $block_user->user_info['user_lname'] = $block['user_lname'];
        $block_user->user_displayname();
        $block_array[] = $block_user;
    }
}
// GET PREVIOUS PRIVACY SETTINGS
for ($c = 0; $c < count($level_profile_privacy); $c++) {
    if (user_privacy_levels($level_profile_privacy[$c]) != "") {
        SE_Language::_preload(user_privacy_levels($level_profile_privacy[$c]));
        $privacy_options[$level_profile_privacy[$c]] = user_privacy_levels($level_profile_privacy[$c]);
    }
}
for ($c = 0; $c < count($level_profile_comments); $c++) {
    if (user_privacy_levels($level_profile_comments[$c]) != "") {
        SE_Language::_preload(user_privacy_levels($level_profile_comments[$c]));
        $comment_options[$level_profile_comments[$c]] = user_privacy_levels($level_profile_comments[$c]);
    }
}
// ASSIGN VARIABLES AND INCLUDE FOOTER
$smarty->assign('result', $result);
$smarty->assign('is_error', $is_error);
$smarty->assign('blocked_users', $block_array);
$smarty->assign('actiontypes', $actiontypes_array);
$smarty->assign('privacy_options', $privacy_options);
$smarty->assign('comment_options', $comment_options);
include "footer.php";
Ejemplo n.º 8
0
 function poll_list($start, $limit, $sort_by = "poll_id DESC", $where = "", $poll_details = 0)
 {
     global $database, $user;
     // BEGIN QUERY
     $sql = "\r\n      SELECT\r\n        se_polls.*,\r\n        se_polls.poll_totalcomments AS total_comments\r\n    ";
     // SELECT RELEVANT poll DETAILS IF NECESSARY
     if ($poll_details == 1) {
         $sql .= ",\r\n        se_users.user_id,\r\n        se_users.user_username,\r\n        se_users.user_photo,\r\n        se_users.user_fname,\r\n        se_users.user_lname\r\n    ";
     }
     // CONTINUE QUERY
     $sql .= "\r\n      FROM\r\n        se_polls\r\n    ";
     // CONTINUE QUERY IF NECESSARY
     if ($poll_details == 1) {
         $sql .= "\r\n      LEFT JOIN\r\n        se_users\r\n        ON se_polls.poll_user_id=se_users.user_id\r\n    ";
     }
     // ADD WHERE IF NECESSARY
     if ($where != "" | $this->user_id != 0) {
         $sql .= "\r\n      WHERE\r\n    ";
     }
     // ENSURE USER ID IS NOT EMPTY
     if ($this->user_id != 0) {
         $sql .= "\r\n        poll_user_id='{$this->user_id}'\r\n    ";
     }
     // INSERT AND IF NECESSARY
     if ($this->user_id != 0 & $where != "") {
         $sql .= " AND";
     }
     // ADD WHERE CLAUSE, IF NECESSARY
     if ($where != "") {
         $sql .= "\r\n        {$where}\r\n    ";
     }
     // ADD ORDER, AND LIMIT CLAUSE
     $sql .= "\r\n      ORDER BY\r\n        {$sort_by}\r\n      LIMIT\r\n        {$start}, {$limit}\r\n    ";
     // RUN QUERY
     $resource = $database->database_query($sql) or die($database->database_error() . " SQL: " . $sql);
     // GET pollS INTO AN ARRAY
     $poll_array = array();
     while ($poll_info = $database->database_fetch_assoc($resource)) {
         // CREATE OBJECT FOR poll
         $poll = new se_poll($poll_info['user_id']);
         $poll->poll_exists = TRUE;
         // CREATE OBJECT FOR poll CREATOR IF poll DETAILS
         if ($poll_details) {
             $creator = new se_user();
             $creator->user_exists = TRUE;
             $creator->user_info['user_id'] = $poll_info['user_id'];
             $creator->user_info['user_username'] = $poll_info['user_username'];
             $creator->user_info['user_photo'] = $poll_info['user_photo'];
             $creator->user_info['user_fname'] = $poll_info['user_fname'];
             $creator->user_info['user_lname'] = $poll_info['user_lname'];
             $creator->user_displayname();
             $poll->poll_owner =& $creator;
             unset($creator);
         }
         // TURN OPTIONS AND ANSWERS INTO ARRAYS, GET TOTAL VOTES
         $poll_info['poll_options'] = unserialize($poll_info['poll_options']);
         $poll_info['poll_answers'] = unserialize($poll_info['poll_answers']);
         $poll_info['poll_voted'] = unserialize($poll_info['poll_voted']);
         // GET IF THIS POLL HAS BEEN VOTED ON
         if (!$user->user_exists || in_array($user->user_info['user_id'], $poll_info['poll_voted'])) {
             $poll_info['poll_viewonly'] = TRUE;
         } else {
             $poll_info['poll_viewonly'] = FALSE;
         }
         // PRIVACY
         $poll_info['poll_privacy_lang'] = user_privacy_levels($poll_info['poll_privacy']);
         SE_Language::_preload($poll_info['poll_privacy_lang']);
         $poll->poll_info = $poll_info;
         $poll_array[] = $poll;
     }
     // RETURN ARRAY
     return $poll_array;
 }
Ejemplo n.º 9
0
  function get_level_options($levelstring,$name)
  {
	  $options = Array();
		for($p=0;$p<strlen($levelstring);$p++) {
		  $level = substr($levelstring, $p, 1);
		  if(user_privacy_levels($level) != "") {
		    $options[] = Array($name.'_id' => $levelstring.$level,
		             $name.'_value' => $level,
		             $name.'_option' => user_privacy_levels($level));
		  }
		}
		return $options;
  }
Ejemplo n.º 10
0
 function get_privacy_options($object, $object_id)
 {
     global $user;
     if (!$object || !$object_id) {
         return array();
     }
     if ($object == 'group') {
         $group = new se_group($user->user_info['user_id'], $object_id);
         $level_group_privacy = unserialize($group->groupowner_level_info['level_group_privacy']);
         rsort($level_group_privacy);
         // GET PREVIOUS PRIVACY SETTINGS
         for ($c = 0; $c < count($level_group_privacy); $c++) {
             if (group_privacy_levels($level_group_privacy[$c]) != "") {
                 SE_Language::_preload(group_privacy_levels($level_group_privacy[$c]));
                 $privacy_options[$level_group_privacy[$c]] = group_privacy_levels($level_group_privacy[$c]);
             }
         }
     } elseif ($object == 'pages') {
         $level_action_privacy = array(7, 3, 1);
         //TODO
         // GET PREVIOUS PRIVACY SETTINGS
         for ($c = 0; $c < count($level_action_privacy); $c++) {
             if (pages_privacy_levels($level_action_privacy[$c]) != "") {
                 SE_Language::_preload(pages_privacy_levels($level_action_privacy[$c]));
                 $privacy_options[$level_action_privacy[$c]] = pages_privacy_levels($level_action_privacy[$c]);
             }
         }
     } else {
         $level_action_privacy = unserialize($user->level_info['level_wall_action_privacy']);
         rsort($level_action_privacy);
         // GET PREVIOUS PRIVACY SETTINGS
         for ($c = 0; $c < count($level_action_privacy); $c++) {
             if (user_privacy_levels($level_action_privacy[$c]) != "") {
                 SE_Language::_preload(user_privacy_levels($level_action_privacy[$c]));
                 $privacy_options[$level_action_privacy[$c]] = user_privacy_levels($level_action_privacy[$c]);
             }
         }
     }
     return $privacy_options;
 }
        $result = TRUE;
    }
}
// GET PREVIOUS PRIVACY SETTINGS
for ($c = 6; $c > 0; $c--) {
    $priv = pow(2, $c) - 1;
    $upl = user_privacy_levels($priv);
    if (!$upl) {
        continue;
    }
    SE_Language::_preload($upl);
    $privacy_options[$priv] = $upl;
}
for ($c = 6; $c >= 0; $c--) {
    $priv = pow(2, $c) - 1;
    $upl = user_privacy_levels($priv);
    if (!$upl) {
        continue;
    }
    SE_Language::_preload($upl);
    $comment_options[$priv] = $upl;
}
// ASSIGN VARIABLES AND SHOW BLOG SETTINGS PAGE
$smarty->assign('result', $result);
$smarty->assign('is_error', $is_error);
$smarty->assign_by_ref('level_info', $level_info);
$smarty->assign('level_blog_privacy', unserialize($level_info['level_blog_privacy']));
$smarty->assign('level_blog_comments', unserialize($level_info['level_blog_comments']));
$smarty->assign('level_blog_html', str_replace(',', ', ', $level_info['level_blog_html']));
$smarty->assign('blog_privacy', $privacy_options);
$smarty->assign('blog_comments', $comment_options);
Ejemplo n.º 12
0
}
// GET DOCUMENT PREVIOUS PRIVACY SETTINGS
$level_document_privacy = unserialize($user->level_info[level_document_privacy]);
rsort($level_document_privacy);
for ($c = 0; $c < count($level_document_privacy); $c++) {
    if (user_privacy_levels($level_document_privacy[$c]) != "") {
        SE_Language::_preload(user_privacy_levels($level_document_privacy[$c]));
        $privacy_options[$level_document_privacy[$c]] = user_privacy_levels($level_document_privacy[$c]);
    }
}
$level_document_comments = unserialize($user->level_info[level_document_comments]);
rsort($level_document_comments);
for ($c = 0; $c < count($level_document_comments); $c++) {
    if (user_privacy_levels($level_document_comments[$c]) != "") {
        SE_Language::_preload(user_privacy_levels($level_document_comments[$c]));
        $comment_options[$level_document_comments[$c]] = user_privacy_levels($level_document_comments[$c]);
    }
}
// SET SOME DEFAULTS DOCUMENT VALUES
if (!isset($document_search)) {
    $document_search = 1;
}
if (!isset($document_privacy)) {
    $document_privacy = $level_document_privacy[0];
}
if (!isset($document_comments)) {
    $document_comments = $level_document_comments[0];
}
if ($user->level_info['level_document_filesize'] > 0) {
    $file_maxsize = $user->level_info['level_document_filesize'];
} else {