/**
  * Deletes message from queue
  * @param $id
  * @return boolean
  */
 function delete_message_from_queue($id)
 {
     he_database::query(he_database::placeholder("DELETE FROM se_he_mass_mailing_queue WHERE id=?", intval($id)));
     return ( he_database::affected_rows() );
 }
Пример #2
0
$result = 0;
if ($task == 'dosave') {
    $result = 1;
    $setting['setting_he_wall_comments_per_page'] = (int) $_POST['setting_he_wall_comments_per_page'];
    $setting['setting_he_wall_actions_per_page'] = (int) $_POST['setting_he_wall_actions_per_page'];
    $setting['setting_he_wall_guest_view'] = (int) $_POST['setting_he_wall_guest_view'];
    $setting['setting_he_wall_music_sync'] = (int) $_POST['setting_he_wall_music_sync'];
    $setting['setting_he_wall_video_sync'] = (int) $_POST['setting_he_wall_video_sync'];
    $setting['setting_he_wall_photo_sync'] = (int) $_POST['setting_he_wall_photo_sync'];
    $setting['setting_he_wall_video_player_width'] = (int) $_POST['setting_he_wall_video_player_width'];
    $setting['setting_he_wall_video_player_height'] = (int) $_POST['setting_he_wall_video_player_height'];
    $setting['setting_he_wall_video_thumb_width'] = (int) $_POST['setting_he_wall_video_thumb_width'];
    $setting['setting_he_wall_video_thumb_height'] = (int) $_POST['setting_he_wall_video_thumb_height'];
    $setting['setting_he_wall_photo_width'] = (int) $_POST['setting_he_wall_photo_width'];
    $setting['setting_he_wall_photo_height'] = (int) $_POST['setting_he_wall_photo_height'];
    $setting['setting_he_wall_photo_thumb_width'] = (int) $_POST['setting_he_wall_photo_thumb_width'];
    $setting['setting_he_wall_photo_thumb_height'] = (int) $_POST['setting_he_wall_photo_thumb_height'];
    $setting['setting_he_wall_photo_filesize'] = (int) $_POST['setting_he_wall_photo_filesize'];
    $setting['setting_he_wall_photo_exts'] = trim($_POST['setting_he_wall_photo_exts']);
    $setting['setting_he_wall_photo_mimes'] = trim($_POST['setting_he_wall_photo_mimes']);
    $setting['setting_he_wall_music_filesize'] = (int) $_POST['setting_he_wall_music_filesize'];
    $setting['setting_he_wall_music_exts'] = trim($_POST['setting_he_wall_music_exts']);
    $setting['setting_he_wall_music_mimes'] = trim($_POST['setting_he_wall_music_mimes']);
    $sql = he_database::placeholder("UPDATE `se_settings` SET \r\n        `setting_he_wall_comments_per_page`=?, \r\n        `setting_he_wall_actions_per_page`=?, \r\n        `setting_he_wall_music_sync`=?,\r\n        `setting_he_wall_video_sync`=?,\r\n        `setting_he_wall_photo_sync`=?,\r\n        `setting_he_wall_guest_view`=?,\r\n        \r\n        `setting_he_wall_video_player_width`=?,\r\n        `setting_he_wall_video_player_height`=?,\r\n        `setting_he_wall_video_thumb_width`=?,\r\n        `setting_he_wall_video_thumb_height`=?,\r\n        \r\n        `setting_he_wall_photo_width`=?,\r\n        `setting_he_wall_photo_height`=?,\r\n        `setting_he_wall_photo_thumb_width`=?,\r\n        `setting_he_wall_photo_thumb_height`=?,\r\n        `setting_he_wall_photo_filesize`=?,\r\n        `setting_he_wall_photo_exts`='?',\r\n        `setting_he_wall_photo_mimes`='?',\r\n        \r\n        `setting_he_wall_music_filesize`=?,\r\n        `setting_he_wall_music_exts`='?',\r\n        `setting_he_wall_music_mimes`='?'", $setting['setting_he_wall_comments_per_page'], $setting['setting_he_wall_actions_per_page'], $setting['setting_he_wall_music_sync'], $setting['setting_he_wall_video_sync'], $setting['setting_he_wall_photo_sync'], $setting['setting_he_wall_guest_view'], $setting['setting_he_wall_video_player_width'], $setting['setting_he_wall_video_player_height'], $setting['setting_he_wall_video_thumb_width'], $setting['setting_he_wall_video_thumb_height'], $setting['setting_he_wall_photo_width'], $setting['setting_he_wall_photo_height'], $setting['setting_he_wall_photo_thumb_width'], $setting['setting_he_wall_photo_thumb_height'], $setting['setting_he_wall_photo_filesize'], $setting['setting_he_wall_photo_exts'], $setting['setting_he_wall_photo_mimes'], $setting['setting_he_wall_music_filesize'], $setting['setting_he_wall_music_exts'], $setting['setting_he_wall_music_mimes']);
    he_database::query($sql);
}
$smarty->assign('music_plugin_installed', $music_plugin_installed);
$smarty->assign('album_plugin_installed', $album_plugin_installed);
$smarty->assign('video_plugin_installed', $video_plugin_installed);
$smarty->assign('result', $result);
include "admin_footer.php";
Пример #3
0
 function recent_taked_quizzes($count = 10)
 {
     $query = he_database::placeholder("SELECT `play`.`user_id` AS `play_user_id`, `play`.`play_stamp`, `quiz`.*\r\n\t\t\tFROM `se_he_quiz_play` AS `play`\r\n\t\t\tINNER JOIN ( \r\n\t\t\t    SELECT MAX(`play_stamp`) AS `play_stamp` FROM `se_he_quiz_play`\r\n\t\t\t    WHERE `play_stamp`!=0\r\n\t\t\t    GROUP BY `quiz_id`\r\n\t\t\t) AS `last` ON (`play`.`play_stamp`=`last`.`play_stamp`)\r\n\t\t\tINNER JOIN `se_he_quiz` AS `quiz` ON (`play`.`quiz_id`=`quiz`.`quiz_id`)\r\n\t\t\tWHERE `quiz`.approved = 1 AND `quiz`.`status`=1\r\n\t\t\tLIMIT ?", $count);
     $takes = array();
     $res = he_database::query($query);
     $quiz_arr = array();
     while ($quiz = he_database::fetch_row_from_resource($res)) {
         $quiz['user'] = new se_user(array($quiz['play_user_id']));
         $quiz['photo_url'] = $quiz['photo'] ? he_quiz::photo_url() . $quiz['photo'] : '';
         $quiz_arr[$quiz['quiz_id']] = $quiz;
     }
     return $quiz_arr;
 }
Пример #4
0
 function get_wall_link($object, $object_id)
 {
     global $user, $url;
     if (!$object || !$object_id) {
         return '';
     }
     if ($object == 'userhome' || !$user->user_exists) {
         return '';
     }
     if ($object == 'user' && $user->user_info['user_id'] == $object_id) {
         return '';
     }
     if ($object == 'user') {
         $sql = he_database::placeholder("SELECT `user_id`, `user_username`, `user_fname`, `user_lname` FROM `se_users` " . "WHERE `user_id`=?", $object_id);
         $row = he_database::fetch_row($sql);
         $wall_owner = new se_user();
         $wall_owner->user_exists = 1;
         $wall_owner->user_info['user_id'] = $row['user_id'];
         $wall_owner->user_info['user_username'] = $row['user_username'];
         $wall_owner->user_info['user_fname'] = $row['user_fname'];
         $wall_owner->user_info['user_lname'] = $row['user_lname'];
         $wall_owner->user_displayname();
         $wall_url = $url->url_create('profile', $wall_owner->user_info['user_username']);
         $wall_label = $wall_owner->user_displayname;
     } elseif ($object == 'group') {
         $sql = he_database::placeholder("SELECT `group_title` FROM `se_groups` " . "WHERE `group_id`=?", $object_id);
         $wall_url = $url->url_create('group', null, $object_id);
         $wall_label = he_database::fetch_field($sql);
     } elseif ($object == 'pages') {
         $sql = he_database::placeholder("SELECT `pages_title` FROM `se_pages` " . "WHERE `pages_id`=?", $object_id);
         $wall_url = $url->url_create('pages', null, $object_id);
         $wall_label = he_database::fetch_field($sql);
     } else {
         return '';
     }
     return SE_Language::get(690706106, array($wall_url, $wall_label));
 }
Пример #5
0
<?php

$page = "wall_action";
include "header.php";
if (isset($_POST['id'])) {
    $action_id = $_POST['id'];
} elseif (isset($_GET['id'])) {
    $action_id = $_GET['id'];
}
$where_clause = he_database::placeholder("se_actions.action_id=?", $action_id);
$wall_action = he_wall::actions_display(0, $setting['setting_actions_actionsonprofile'], $where_clause);
$wall_action = $wall_action[0];
if (!$setting['setting_he_wall_guest_view'] && $user->level_info['level_wall_allowed'] == 0) {
    $page = "error";
    $smarty->assign('error_header', 639);
    $smarty->assign('error_message', 690706102);
    $smarty->assign('error_submit', 641);
    include "footer.php";
}
$action_info = he_wall::get_action_info($action_id);
if (!$action_info) {
    he_wall::delete_action_notify($action_id);
}
if (!$wall_action) {
    $page = "error";
    $smarty->assign('error_header', 639);
    $smarty->assign('error_message', 690706081);
    $smarty->assign('error_submit', 641);
    include "footer.php";
}
$action_wall_owner = he_wall::get_wall_owner($action_info['action_object_owner'], $action_info['action_object_owner_id']);
Пример #6
0
 function get_user_uploads()
 {
     $query = he_database::placeholder("SELECT * FROM `se_he_uploads`\r\n           WHERE `uploads_user_id`=? AND `uploads_instance_type`='?'", $this->user_id, $this->instance_type);
     return he_database::fetch_array($query);
 }
    header("Location: admin_levels.php");
    exit;
}
// SET RESULT VARIABLE
$result = 0;
if ($task == "dosave") {
    $level_info['level_wall_allowed'] = $_POST['level_wall_allowed'];
    $level_info['level_wall_action_privacy'] = is_array($_POST['level_wall_action_privacy']) ? $_POST['level_wall_action_privacy'] : array();
    //GET PRIVACY AND PRIVACY DIFFERENCES
    if (empty($level_info['level_wall_action_privacy']) || !is_array($level_info['level_wall_action_privacy'])) {
        $level_info['level_wall_action_privacy'] = array(63);
    }
    rsort($level_info['level_wall_action_privacy']);
    $new_privacy_options = $level_info['level_wall_action_privacy'];
    $level_info['level_wall_action_privacy'] = serialize($level_info['level_wall_action_privacy']);
    $query = he_database::placeholder("UPDATE `se_levels` SET `level_wall_allowed`=?, `level_wall_action_privacy`='?'\r\n        WHERE `level_id`=?", $level_info['level_wall_allowed'], $level_info['level_wall_action_privacy'], $level_id);
    he_database::query($query);
    $result = 1;
}
// GET PREVIOUS PRIVACY SETTINGS
$privacy_options = array();
for ($c = 6; $c > 0; $c--) {
    $priv = pow(2, $c) - 1;
    if (user_privacy_levels($priv) != "" && $priv != 1) {
        SE_Language::_preload(user_privacy_levels($priv));
        $privacy_options[$priv] = user_privacy_levels($priv);
    }
}
// ASSIGN VARIABLES AND SHOW ADMIN ADD USER LEVEL PAGE
$smarty->assign('result', $result);
$smarty->assign('level_wall_action_privacy', unserialize($level_info['level_wall_action_privacy']));
Пример #8
0
function he_wall_delete_user($user_id)
{
    if ($user_id == false) {
        return false;
    }
    $sql = he_database::placeholder('DELETE FROM `se_he_wall_comment` WHERE `author_id`=?', $user_id);
    he_database::query($sql);
    $sql = he_database::placeholder('DELETE FROM `se_he_hidden_action` WHERE `user_id`=?', $user_id);
    he_database::query($sql);
    $sql = he_database::placeholder('DELETE FROM `se_he_wall_like` WHERE `user_id`=?', $user_id);
    he_database::query($sql);
    he_wall::delete_user_uploads($user_id);
}
Пример #9
0
<?php

$page = "browse_quiz";
include "header.php";
$current_page = isset($_GET['page']) && $_GET['page'] ? (int) $_GET['page'] : 1;
$mode = isset($_GET['mode']) && $_GET['mode'] ? trim($_GET['mode']) : 'popular';
$cat_id = isset($_GET['cat_id']) && $_GET['cat_id'] ? (int) $_GET['cat_id'] : 0;
//TODO get from configs
$on_page = 10;
$pages = 5;
$first = ($current_page - 1) * $on_page;
$where_cond = $cat_id != 0 ? he_database::placeholder("AND `quiz`.`cat_id`=?", $cat_id) : '';
if ($mode != 'commented') {
    $quiz_arr = he_quiz::quiz_list($first, $on_page, $mode, $where_cond);
    $quiz_total = he_quiz::quiz_total($where_cond);
} else {
    $quiz_arr = he_quiz::recent_commented_list($first, $on_page, $where_cond);
    $quiz_total = he_quiz::recent_commented_total($where_cond);
}
$quiz_cats = he_quiz::find_cats($where_cond);
$taked_quiz_list = he_quiz::recent_taked_quizzes();
$smarty->assign('mode', $mode);
$smarty->assign('current_page', $current_page);
$smarty->assign('quiz_arr', $quiz_arr);
$smarty->assign('message', $message);
$smarty->assign('paging', array('total' => $quiz_total, 'on_page' => $on_page, 'pages' => $pages));
$smarty->assign('quiz_cats', $quiz_cats);
$smarty->assign('taked_quiz_list', $taked_quiz_list);
$smarty->assign('cat_id', $cat_id);
include "footer.php";