function search_blog() { global $database, $url, $results_per_page, $p, $search_text, $t, $search_objects, $results, $total_results; // CONSTRUCT QUERY $sql = "\r\n SELECT\r\n se_blogentries.blogentry_id,\r\n se_blogentries.blogentry_title,\r\n se_blogentries.blogentry_body,\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 FROM\r\n se_blogentries,\r\n se_users,\r\n se_levels\r\n WHERE\r\n se_blogentries.blogentry_user_id=se_users.user_id &&\r\n se_users.user_level_id=se_levels.level_id &&\r\n (\r\n se_blogentries.blogentry_search='1' ||\r\n se_levels.level_blog_search='0'\r\n ) \r\n "; $sql .= " && MATCH (`blogentry_title`, `blogentry_body`) AGAINST ('{$search_text}' IN BOOLEAN MODE)"; /* $sql .= " && ( blogentry_title LIKE '%$search_text%' || blogentry_body LIKE '%$search_text%' ) "; */ // GET TOTAL ENTRIES $sql2 = $sql . " LIMIT 201"; $resource = $database->database_query($sql2); $total_entries = $database->database_num_rows($resource); // IF NOT TOTAL ONLY if ($t == "blog") { // MAKE BLOG PAGES $start = ($p - 1) * $results_per_page; $limit = $results_per_page + 1; // SEARCH BLOGS $sql3 = $sql . " ORDER BY blogentry_id DESC LIMIT {$start}, {$limit}"; $resource = $database->database_query($sql3); while ($blogentry_info = $database->database_fetch_assoc($resource)) { // CREATE AN OBJECT FOR AUTHOR $profile = new se_user(); $profile->user_info['user_id'] = $blogentry_info['user_id']; $profile->user_info['user_username'] = $blogentry_info['user_username']; $profile->user_info['user_photo'] = $blogentry_info['user_photo']; $profile->user_info['user_fname'] = $blogentry_info['user_fname']; $profile->user_info['user_lname'] = $blogentry_info['user_lname']; $profile->user_displayname(); // IF EMPTY TITLE if (!trim($blogentry_info['blogentry_title'])) { $blogentry_info['blogentry_title'] = SE_Language::get(589); } $blogentry_info['blogentry_body'] = cleanHTML($blogentry_info['blogentry_body'], ''); // IF BODY IS LONG if (strlen($blogentry_info['blogentry_body']) > 150) { $blogentry_info['blogentry_body'] = substr($blogentry_info['blogentry_body'], 0, 147) . "..."; } $result_url = $url->url_create('blog_entry', $blogentry_info['user_username'], $blogentry_info['blogentry_id']); $result_name = 1500118; $result_desc = 1500119; $results[] = array('result_url' => $result_url, 'result_icon' => './images/icons/blog_blog48.gif', 'result_name' => $result_name, 'result_name_1' => $blogentry_info['blogentry_title'], 'result_desc' => $result_desc, 'result_desc_1' => $url->url_create('profile', $blogentry_info['user_username']), 'result_desc_2' => $profile->user_displayname, 'result_desc_3' => $blogentry_info['blogentry_body']); } // SET TOTAL RESULTS $total_results = $total_entries; } // SET ARRAY VALUES SE_Language::_preload_multi(1500118, 1500119, 1500120); if ($total_albums > 200) { $total_albums = "200+"; } $search_objects[] = array('search_type' => 'blog', 'search_lang' => 1500120, 'search_total' => $total_entries); }
function search_forum() { global $database, $url, $results_per_page, $p, $search_text, $t, $search_objects, $results, $total_results; // SET LEVEL ID if ($user->user_exists) { $level_id = $user->level_info[level_id]; } else { $level_id = 0; } // RETRIEVE A LIST OF FORUMS USER IS ALLOWED TO VIEW $forum_ids = array(); $forums = $database->database_query("SELECT se_forums.forum_id FROM se_forums LEFT JOIN se_forumlevels ON se_forums.forum_id=se_forumlevels.forumlevel_forum_id AND se_forumlevels.forumlevel_level_id='{$level_id}' LEFT JOIN se_forummoderators ON se_forums.forum_id=se_forummoderators.forummoderator_forum_id AND se_forummoderators.forummoderator_user_id='{$user->user_info[user_id]}' WHERE se_forumlevels.forumlevel_forum_id IS NOT NULL OR se_forummoderators.forummoderator_forum_id IS NOT NULL"); while ($forum_info = $database->database_fetch_assoc($forums)) { $forum_ids[] = $forum_info[forum_id]; } // CONSTRUCT QUERY $forum_query = "\r\n\t(\r\n\tSELECT\r\n\t '1' AS sub_type,\r\n\t se_forums.forum_id AS forum_id,\r\n\t se_forumtopics.forumtopic_id AS forumtopic_id,\r\n\t '0' AS forumpost_id,\r\n\t se_forums.forum_title AS forum_title,\r\n\t se_forumtopics.forumtopic_subject AS forumtopic_subject,\r\n\t se_forumtopics.forumtopic_excerpt AS excerpt\r\n\tFROM\r\n\t se_forumtopics\r\n\tLEFT JOIN\r\n\t se_forums\r\n\tON\r\n\t se_forumtopics.forumtopic_forum_id=se_forums.forum_id\r\n\tWHERE\r\n\t se_forums.forum_id IN ('" . implode("', '", $forum_ids) . "')\r\n\t AND\r\n\t se_forumtopics.forumtopic_subject LIKE '%{$search_text}%'\r\n\tORDER BY se_forumtopics.forumtopic_id DESC\r\n\t)\r\n\tUNION ALL\r\n\t(\r\n\tSELECT\r\n\t '2' AS sub_type,\r\n\t se_forumtopics.forumtopic_forum_id AS forum_id,\r\n\t se_forumtopics.forumtopic_id AS forumtopic_id,\r\n\t se_forumposts.forumpost_id AS forumpost_id,\r\n\t '' AS forum_title,\r\n\t se_forumtopics.forumtopic_subject AS forumtopic_subject,\r\n\t se_forumposts.forumpost_excerpt AS excerpt\r\n\tFROM\r\n\t se_forumposts\r\n\tLEFT JOIN\r\n\t se_forumtopics\r\n\tON\r\n\t se_forumposts.forumpost_forumtopic_id=se_forumtopics.forumtopic_id\r\n\tWHERE\r\n\t se_forumtopics.forumtopic_forum_id IN ('" . implode("', '", $forum_ids) . "')\r\n\t AND\r\n\t se_forumposts.forumpost_deleted='0'\r\n\t AND\r\n\t se_forumposts.forumpost_body LIKE '%{$search_text}%'\r\n\t AND \r\n\t se_forumtopics.forumtopic_subject NOT LIKE '%{$search_text}%'\r\n\tORDER BY se_forumposts.forumpost_id DESC\r\n\t)"; // GET TOTAL FORUM RESULTS $total_forums = $database->database_num_rows($database->database_query($forum_query . " LIMIT 201")); // IF NOT TOTAL ONLY if ($t == "forum") { // MAKE FORUM PAGES $start = ($p - 1) * $results_per_page; $limit = $results_per_page + 1; // SEARCH FORUMS $posts = $database->database_query($forum_query . " LIMIT {$start}, {$limit}") or die(mysql_query()); while ($post_info = $database->database_fetch_assoc($posts)) { $post_info['excerpt'] = $post_info['excerpt'] . "..."; // RESULT IS A TOPIC if ($post_info[sub_type] == 1) { $result_url = "forum_topic.php?forum_id={$post_info[forum_id]}&topic_id={$post_info[forumtopic_id]}"; $result_name = 6000131; $result_name_1 = $post_info['forumtopic_subject']; $result_desc = 6000132; $result_desc_1 = $post_info['forum_id']; $result_desc_2 = SE_Language::get($post_info['forum_title']); $result_desc_3 = strlen($post_info['excerpt']) > 50 ? substr($post_info['excerpt'], 0, 47) . "..." : $post_info['excerpt']; // RESULT IS A POST } elseif ($post_info['sub_type'] == 2) { $result_url = "forum_topic.php?forum_id={$post_info[forum_id]}&topic_id={$post_info[forumtopic_id]}&post_id={$post_info[forumpost_id]}#post_{$post_info[forumpost_id]}"; $result_name = 6000133; $result_name_1 = $post_info['forumtopic_subject']; $result_desc = 6000134; $result_desc_1 = $post_info['excerpt']; } $results[] = array('result_url' => $result_url, 'result_icon' => 'images/icons/file_big.gif', 'result_name' => $result_name, 'result_name_1' => $result_name_1, 'result_desc' => $result_desc, 'result_desc_1' => $result_desc_1, 'result_desc_2' => $result_desc_2, 'result_desc_3' => $result_desc_3); } // SET TOTAL RESULTS $total_results = $total_forums; } // SET ARRAY VALUES SE_Language::_preload_multi(6000131, 6000132, 6000133, 6000134, 6000135); if ($total_forums > 200) { $total_forums = "200+"; } $search_objects[] = array('search_type' => 'forum', 'search_lang' => 6000135, 'search_total' => $total_forums); }
} else { echo json_encode(array('result' => FALSE, 'error' => SE_Language::get($event->is_error))); } exit; } elseif ($task == "eventmembercancel") { if ($user->user_exists && $event->event_member_cancel($user_id)) { echo json_encode(array('result' => TRUE)); } else { echo json_encode(array('result' => FALSE, 'error' => SE_Language::get($event->is_error))); } exit; } elseif ($task == "eventmemberinvite") { if ($user->user_exists && is_array($invites) && !empty($invites) && ($invites_sent = $event->event_member_invite($invites))) { echo json_encode(array('result' => TRUE, 'invites_sent' => $invites_sent)); } else { echo json_encode(array('result' => FALSE, 'error' => SE_Language::get($event->is_error))); } exit; } elseif ($task == "getfriends") { $results = array(); //$sql = "SELECT user_id, user_username, user_fname, user_lname FROM se_friends LEFT JOIN se_users ON se_friends.friend_user_id2=se_users.user_id LEFT JOIN se_levels ON se_users.user_level_id=se_levels.level_id LEFT JOIN se_eventmembers ON se_users.user_id=se_eventmembers.eventmember_user_id AND se_eventmembers.eventmember_event_id={$event->event_info[event_id]} WHERE se_friends.friend_status=1 AND se_friends.friend_user_id1='{$user->user_info['user_id']}' AND se_eventmembers.eventmember_id IS NULL ORDER BY user_fname, user_lname, user_username"; $sql = "SELECT user_id, user_username, user_fname, user_lname FROM se_friends LEFT JOIN se_users ON se_friends.friend_user_id2=se_users.user_id LEFT JOIN se_levels ON se_users.user_level_id=se_levels.level_id LEFT JOIN se_eventmembers ON se_users.user_id=se_eventmembers.eventmember_user_id AND se_eventmembers.eventmember_event_id={$event->event_info[event_id]} WHERE (se_levels.level_event_allow & 2) AND se_friends.friend_status=1 AND se_friends.friend_user_id1='{$user->user_info['user_id']}' AND se_eventmembers.eventmember_id IS NULL ORDER BY user_fname, user_lname, user_username"; $resource = $database->database_query($sql); while ($friend_info = $database->database_fetch_assoc($resource)) { $friend = new se_user(); $friend->user_info['user_id'] = $friend_info['user_id']; $friend->user_info['user_username'] = $friend_info['user_username']; $friend->user_info['user_fname'] = $friend_info['user_fname']; $friend->user_info['user_lname'] = $friend_info['user_lname']; $friend->user_displayname(); $results[$friend_info['user_id']] = $friend->user_displayname;
function forum_bbcode_parse_view($string) { // DO [quote] $open_quote = preg_match_all('/\\[quote\\=(.*?)\\]/i', $string, $matches); $close_quote = preg_match_all('/\\[\\/quote\\]/i', $string, $matches); $total_tags = $open_quote > $close_quote ? $close_quote : $open_quote; if ($total_tags) { $string = preg_replace('/\\[quote\\=(.*?)\\]/i', "<div class='forum_quote'><div>" . SE_Language::get(6000117, array('$1')) . "</div>", $string, $total_tags); $string = strrev(preg_replace('/\\]etouq\\/\\[/i', ">vid/<", strrev($string), $total_tags)); } return $string; }
<?php /* $Id: help_tos.php 8 2009-01-11 06:02:53Z john $ */ $page = "help_tos"; include "header.php"; $terms_of_service = SE_Language::get(1210); // SET GLOBAL PAGE TITLE/DESCRIPTION $global_page_title[0] = 753; $global_page_description[0] = 1157; $global_page_description[1] = substr($terms_of_service, 0, 150); // ASSIGN VARIABLES AND INCLUDE FOOTER $smarty->assign('terms_of_service', htmlspecialchars_decode($terms_of_service, ENT_QUOTES)); include "footer.php";
function blog_categories_generate($where = NULL) { global $database; $sql = "\r\n SELECT\r\n COUNT(*) AS blogentry_count,\r\n se_blogentries.blogentry_blogentrycat_id,\r\n se_blogentrycats.*\r\n FROM\r\n se_blogentries\r\n LEFT JOIN\r\n se_blogentrycats\r\n ON se_blogentrycats.blogentrycat_id=se_blogentries.blogentry_blogentrycat_id\r\n WHERE\r\n se_blogentries.blogentry_user_id='{$this->user_id}' &&\r\n (se_blogentries.blogentry_blogentrycat_id=0 || se_blogentrycats.blogentrycat_user_id=0 || se_blogentrycats.blogentrycat_user_id='{$this->user_id}')\r\n "; if ($where) { $sql .= " &&\r\n {$where}\r\n "; } $sql .= "\r\n GROUP BY\r\n se_blogentries.blogentry_blogentrycat_id\r\n ORDER BY\r\n se_blogentries.blogentry_blogentrycat_id ASC\r\n "; $resource = $database->database_query($sql); $blog_cats = array(); while ($result = $database->database_fetch_assoc($resource)) { if (empty($result['blogentrycat_id'])) { $result['blogentrycat_id'] = 0; $result['blogentrycat_title'] = SE_Language::get(1500035); } if (!empty($result['blogentrycat_languagevar_id'])) { SE_Language::_preload($result['blogentrycat_languagevar_id']); } $blog_cats[] = $result; } return $blog_cats; }
function smarty_modifier_he_wall_format_text($text, $length = 300) { if (strlen($text) <= 300) { return $text; } $short_text = preg_replace('/\\s+?(\\S+)?$/', '', substr($text, 0, $length + 1)); $short_text = substr($short_text, 0, $length); $hidden_text = '<span class="display_none">' . substr($text, $length) . '</span>'; $show_more_link = '<a href="javascript://" onclick="he_wall_show_more(this);" class="show_more_text">' . SE_Language::get(690706079) . '</a>'; $formatted_text = $short_text . '<span>...</span>' . $show_more_link . $hidden_text; return $formatted_text; }
function he_paging( $params = array() ) { $total = (int)$params['total']; $in_page = (int)$params['on_page']; $pages_count = (int)$params['pages']; $request_uri = $_SERVER['PHP_SELF']; if( !$total || !$in_page || !$pages_count) { return ''; } if( ($total_pages = ceil($total / $in_page)) <= 1 ) { return ''; } $current = @$_GET['page']; $current = intval($current) ? $current : 1; $offset = ceil($pages_count / 2) - 1; $offset_inc = ($total_pages - $offset) - $current; $offset+= ($offset_inc <= 0) ? abs($offset_inc) + ( ($pages_count%2) ? 0 : 1 ) : 0; $page = ($current - $offset) > 1 ? ($current - $offset) : 1; $paging = ''; for ( $counter = 1; $counter <= $pages_count && $page <= $total_pages; $counter++ ) { $active = ($page == $current) ? 'class="active"' : ''; $url = he_make_url($request_uri, array( 'page' => $page )); $paging .= "<a href='{$url}' {$active}>{$page}</a>"; $page++; } switch ( $current ) { case 1: $paging .= "<a href='" . he_make_url($request_uri, array( 'page' => $current+1 )) . "'>" . SE_Language::get(680680001) . "</a>"; $paging .= "<a href='" . he_make_url($request_uri, array( 'page' => $total_pages)) . "'>" . SE_Language::get(680680002) . "</a>"; break; case $total_pages: $paging = "<a href='" . he_make_url($request_uri, array( 'page' => $current-1 )) . "'>" . SE_Language::get(680680003) . "</a>" . $paging; $paging = "<a href='" . he_make_url($request_uri, array( 'page' => 1 )) . "'>" . SE_Language::get(680680004) . "</a>" . $paging; break; default: $paging = "<a href='" . he_make_url($request_uri, array( 'page' => $current-1 )) . "'>" . SE_Language::get(680680003) . "</a>" . $paging; $paging = "<a href='" . he_make_url($request_uri, array( 'page' => 1 )) . "'>" . SE_Language::get(680680004) . "</a>" . $paging; $paging .= "<a href='" . he_make_url($request_uri, array( 'page' => $current+1 )) . "'>" . SE_Language::get(680680001) . "</a>"; $paging .= "<a href='" . he_make_url($request_uri, array( 'page' => $total_pages )). "'>" . SE_Language::get(680680002) . "</a>"; break; } $out = '<div class="paging">'; $out .= '<span>' . SE_Language::get(680680005) . ' </span>'; $out .= $paging . '</div>'; return $out; }
} $text = he_wall_format_text($text); $replace_arr = array($user->user_info['user_username'], $user->user_displayname, $text, $link_url, $link_label, he_wall::get_wall_link($wall_object, $wall_object_id)); $actions->actions_add($user, 'wallpostlink', $replace_arr, array(), 0, false, $action_object_owner, $wall_object_id, $action_privacy_level); he_wall::new_post_notify($wall_object, $wall_object_id, $new_action_id); $result = he_wall_actions_display($wall_object, $wall_object_id, $first_action_id); } elseif ($task == 'post_video') { $first_action_id = isset($_POST['first_action_id']) ? (int) $_POST['first_action_id'] : false; $action_privacy_level = isset($_POST['action_privacy_level']) ? (int) $_POST['action_privacy_level'] : 63; $text = isset($_POST['text']) ? trim($_POST['text']) : ''; $video_provider = isset($_POST['video_provider']) ? trim($_POST['video_provider']) : ''; $video_url = isset($_POST['video_url']) ? trim($_POST['video_url']) : ''; if ($video_provider != 'youtube' && $video_provider != 'vimeo') { $result = array('result' => 0, 'message' => SE_Language::get(690706072)); } elseif ($video_url == '') { $result = array('result' => 0, 'message' => SE_Language::get(690706073)); } else { $new_action_id = he_wall::new_action_id(); $pages_id = $wall_object == 'pages' ? $wall_object_id : 0; if ($pages_id && $video_provider == 'vimeo') { $upload_result = he_wall_vimeo_video_upload($new_action_id, $video_url, $pages_id); } elseif ($video_provider == 'vimeo') { $upload_result = he_wall_vimeo_video_upload($new_action_id, $video_url); } elseif ($video_provider == 'youtube') { if ($pages_id) { $upload_result = he_wall_youtube_video_custom_upload($new_action_id, $video_url, $pages_id); } elseif (isset($global_plugins['video']) && $setting['setting_he_wall_video_sync']) { $upload_result = he_wall_youtube_video_upload($new_action_id, $video_url, $action_privacy_level); } else { $upload_result = he_wall_youtube_video_custom_upload($new_action_id, $video_url); }
$mediasize = @getimagesize($media_dir . $media_info[$type . 'media_id'] . '.' . $media_info[$type . 'media_ext']); $media_info['media_width'] = $mediasize[0]; $media_info['media_height'] = $mediasize[1]; // VALIDATE TAG HEIGHT AND WIDTH BASED ON IMAGE SIZE if ($mediatag_x + $mediatag_height > $media_info['media_height']) { $mediatag_x = $mediatag_x - ($mediatag_x + $mediatag_height - $media_info['media_height']); } if ($mediatag_y + $mediatag_width > $media_info['media_width']) { $mediatag_y = $mediatag_y - ($mediatag_y + $mediatag_width - $media_info['media_width']); } $database->database_query("\r\n INSERT INTO `se_{$type}mediatags` (\r\n `{$type}mediatag_{$type}media_id`,\r\n `{$type}mediatag_user_id`,\r\n `{$type}mediatag_x`,\r\n `{$type}mediatag_y`,\r\n `{$type}mediatag_height`,\r\n `{$type}mediatag_width`,\r\n `{$type}mediatag_text`,\r\n `{$type}mediatag_date`\r\n ) VALUES (\r\n '" . $media_info[$type . 'media_id'] . "',\r\n '{$mediatag_user_id}',\r\n '{$mediatag_x}',\r\n '{$mediatag_y}',\r\n '{$mediatag_height}',\r\n '{$mediatag_width}',\r\n '{$mediatag_text}',\r\n '" . time() . "'\r\n )\r\n "); $mediatag_id = $database->database_insert_id(); // SET OBJECT TITLE $object_title = $media_info[$type . 'media_title']; if ($object_title == "") { $object_title = SE_Language::get(589); } // SEND NOTIFICATION TO OWNER if ($owner_user->user_info['user_id'] != $user->user_info['user_id']) { $notifytype = $notify->notify_add($owner_user->user_info['user_id'], $type . 'mediatag', $media_info[$type . 'media_id'], array($owner_user->user_info['user_username'], $media_info[$type . 'media_id'], $object_owner_id), array($object_title)); $object_url = $url->url_base . vsprintf($notifytype['notifytype_url'], array($owner_iden, $media_info[$type . 'media_id'])); $owner_user->user_settings(); if ($owner_user->usersetting_info['usersetting_notify_' . $type . 'mediatag']) { send_systememail($type . 'mediatag', $owner_user->user_info['user_email'], array($owner_user->user_displayname, $user->user_displayname, "<a href=\"" . $object_url . "\">" . $object_url . "</a>")); } } // INSERT ACTION AND SEND NOTIFICATION TO TAGGED USER if ($taggeduser->user_exists == 1) { // ENSURE USER ISN'T ALREADY TAGGED IN THIS PHOTO if ($database->database_num_rows($database->database_query("SELECT `{$type}mediatag_id` FROM `se_{$type}mediatags` WHERE `{$type}mediatag_{$type}media_id`='" . $media_info[$type . 'media_id'] . "' AND `{$type}mediatag_user_id`='{$taggeduser->user_info['user_id']}'")) == 1) { $media_path = $media_dir . $media_info[$type . 'media_id'] . "_thumb.jpg";
foreach ($_POST['result_id'] as $index => $result_id) { $result_id = (int) $result_id; $title = isset($_POST['title'][$index]) ? trim($_POST['title'][$index]) : false; $desciption = isset($_POST['description'][$index]) ? trim($_POST['description'][$index]) : false; $photo = isset($_POST['photo'][$index]) ? trim($_POST['photo'][$index]) : false; $photo_key = 'photo_' . ($index + 1); $quiz_result = array('id' => $result_id, 'title' => $title, 'description' => $desciption, 'photo' => $photo, 'filename' => $photo_key); $result_ids[] = $result_id; $result_arr[] = $quiz_result; if (strlen($title) == 0) { continue; } $quiz_results[] = $quiz_result; } if (count($quiz_results) >= $min_result_count) { he_quiz::save_results($quiz_id, $quiz_results); $redirect_url = "quiz_questions.php?quiz_id={$quiz_id}"; header("Location: {$redirect_url}"); exit; } $message = array('type' => 'error', 'title' => SE_Language::get(690691108, array($min_result_count)), 'text' => SE_Language::get(690691109)); } $result_arr = $result_arr ? $result_arr : he_quiz::get_results($quiz_id, true); $photo_url = he_quiz::photo_url(); $smarty->assign('quiz_id', $quiz_id); $smarty->assign('result_arr', $result_arr); $smarty->assign('steps', $steps); $smarty->assign('message', $message); $smarty->assign('min_result_count', $min_result_count); $smarty->assign('photo_url', $photo_url); include "footer.php";
function event_media_upload($file_name, $eventalbum_id, &$space_left) { global $class_event, $database, $url; // SET KEY VARIABLES $file_maxsize = $this->eventowner_level_info['level_event_album_maxsize']; $file_exts = explode(",", str_replace(" ", "", strtolower($this->eventowner_level_info['level_event_album_exts']))); $file_types = explode(",", str_replace(" ", "", strtolower($this->eventowner_level_info['level_event_album_mimes']))); $file_maxwidth = $this->eventowner_level_info['level_event_album_width']; $file_maxheight = $this->eventowner_level_info['level_event_album_height']; $time = time(); $new_media = new se_upload(); $new_media->new_upload($file_name, $file_maxsize, $file_exts, $file_types, $file_maxwidth, $file_maxheight); // UPLOAD AND RESIZE PHOTO IF NO ERROR if (!$new_media->is_error) { // INSERT ROW INTO MEDIA TABLE $sql = "\r\n INSERT INTO se_eventmedia\r\n (eventmedia_eventalbum_id, eventmedia_date)\r\n VALUES\r\n ('{$eventalbum_id}', '{$time}')\r\n "; $resource = $database->database_query($sql); $eventmedia_id = $database->database_insert_id(); // CHECK IF IMAGE RESIZING IS AVAILABLE, OTHERWISE MOVE UPLOADED IMAGE $event_dir = $this->event_dir($this->event_info['event_id']); if ($new_media->is_image) { $file_dest = "{$event_dir}{$eventmedia_id}.jpg"; $thumb_dest = "{$event_dir}{$eventmedia_id}_thumb.jpg"; // UPLOAD THUMB $new_media->upload_thumb($thumb_dest, 200); // UPLOAD PHOTO $new_media->upload_photo($file_dest); $file_ext = "jpg"; $file_filesize = filesize($file_dest); } else { $file_dest = "{$event_dir}{$eventmedia_id}.{$new_media->file_ext}"; $thumb_dest = "{$event_dir}{$eventmedia_id}_thumb.jpg"; if ($new_media->file_ext == 'gif') { $new_media->upload_thumb($thumb_dest, 200); } $new_media->upload_file($file_dest); $file_ext = $new_media->file_ext; $file_filesize = filesize($file_dest); } // CHECK SPACE LEFT if ($space_left !== FALSE && $file_filesize > $space_left) { $new_media->is_error = 1; $new_media->error_message = $class_event[1] . $_FILES[$file_name]['name']; // TODO LANG } elseif ($space_left !== FALSE) { $space_left = $space_left - $file_filesize; } // DELETE FROM DATABASE IF ERROR if ($new_media->is_error) { $sql = "DELETE FROM se_eventmedia WHERE eventmedia_id='{$eventmedia_id}' AND eventmedia_eventalbum_id='{$eventalbum_id}'"; $resource = $database->database_query($sql); @unlink($file_dest); } else { $sql = "UPDATE se_eventmedia SET eventmedia_ext='{$file_ext}', eventmedia_filesize='{$file_filesize}' WHERE eventmedia_id='{$eventmedia_id}' AND eventmedia_eventalbum_id='{$eventalbum_id}'"; $resource = $database->database_query($sql); if (!is_numeric($file_filesize)) { $file_filesize = 0; } $sql = "UPDATE se_eventalbums SET eventalbum_totalfiles=eventalbum_totalfiles+1, eventalbum_totalspace=eventalbum_totalspace+'{$file_filesize}' WHERE eventalbum_id='{$eventalbum_id}' LIMIT 1"; $resource = $database->database_query($sql); } } // IF ERROR if ($new_media->is_error) { $new_media->error_message = $_FILES[$file_name]['name'] . " - " . SE_Language::get($new_media->is_error); } // RETURN FILE STATS return array('is_error' => $new_media->is_error, 'error_message' => $new_media->error_message, 'file_name' => $_FILES[$file_name]['name'], 'eventmedia_id' => $eventmedia_id, 'eventmedia_ext' => $file_ext, 'eventmedia_filesize' => $file_filesize); }
} } } // CHECK IF USER IS ALREADY LOGGED IN - IF SO, DO NOTHING if ($login_result == "success") { $chatuser_query = $database->database_query("SELECT chatuser_user_id FROM se_chatusers WHERE chatuser_user_id='" . $user->user_info[user_id] . "' LIMIT 1"); if (!$database->database_num_rows($chatuser_query)) { // GET USER PHOTO, ADD USER TO DATABASE $chatuser_photo_path = $url->url_userdir($user->user_info[user_id]) . $user->user_info[user_photo]; if (!file_exists($chatuser_photo_path) or $user->user_info[user_photo] == "") { $chatuser_photo = ""; } else { $chatuser_photo = $user->user_info[user_photo]; } $database->database_query("\r\n INSERT INTO se_chatusers\r\n (chatuser_user_id, chatuser_user_username, chatuser_user_displayname, chatuser_lastupdate, chatuser_user_photo)\r\n VALUES\r\n ('{$user->user_info['user_id']}', '{$user->user_info['user_username']}', '" . addslashes($user->user_displayname) . "', '{$nowtime}', '{$chatuser_photo}')\r\n "); // INSERT WELCOME MESSAGE $time_welcome = time(); $message_username = ""; $message_welcome = sprintf(SE_Language::get(3500023), $user->user_displayname); $database->database_query("\r\n INSERT INTO se_chatmessages\r\n (chatmessage_time, chatmessage_user_username, chatmessage_content)\r\n VALUES\r\n ('{$time_welcome}', '{$message_username}', '{$message_welcome}')\r\n "); } } // OUTPUT RESULT ob_end_clean(); echo $login_result; exit; } // SET SMARTY VARS AND DISPLAY PAGE $smarty->assign('server_time', $datetime->timezone(time(), $global_timezone) * 1000); ob_end_clean(); include "footer.php";
$code = $_SESSION['code']; if ($code == "") { $code = randomcode(); } if ($_POST['comment_secure'] != $code) { $is_error = 832; } } // MAKE SURE TOPIC BODY IS NOT EMPTY if (!trim($grouppost_body)) { $is_error = 2000298; } // RUN JAVASCRIPT FUNCTION echo "<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'><script type=\"text/javascript\">"; if ($is_error) { $error = SE_Language::get($is_error); echo "window.parent.document.getElementById('post_error').innerHTML = '{$error}';"; echo "window.parent.document.getElementById('post_error').style.display = 'block';"; } else { $database->database_query("UPDATE se_grouptopics SET grouptopic_totalposts=grouptopic_totalposts+1 WHERE grouptopic_id='{$grouptopic_id}' LIMIT 1"); $database->database_query("INSERT INTO se_groupposts (grouppost_grouptopic_id, grouppost_authoruser_id, grouppost_date, grouppost_body) VALUES ('{$grouptopic_id}', '{$user->user_info['user_id']}', '" . time() . "', '{$grouppost_body}')"); $post_id = $database->database_insert_id(); // INSERT ACTION IF USER EXISTS if ($user->user_exists) { $poster = $user->user_displayname; $grouppost_body_encoded = strip_tags($grouppost_body, '<br>'); if (strlen($grouppost_body_encoded) > 250) { $grouppost_body_encoded = substr($grouppost_body_encoded, 0, 247) . "..."; } $actions->actions_add($user, "grouppost", array($user->user_info['user_username'], $user->user_displayname, $group->group_info['group_id'], $grouptopic_info['grouptopic_id'], $grouptopic_info['grouptopic_subject'], $post_id, $grouppost_body_encoded), array(), 0, false, 'group', $group->group_info['group_id'], $group->group_info['group_privacy']); } else {
function search_video() { global $database, $url, $results_per_page, $p, $search_text, $t, $search_objects, $results, $total_results; // CONSTRUCT QUERY $video_query = "SELECT \r\n\t\t\t se_videos.*, \r\n\t\t\t se_users.user_id, \r\n\t\t\t se_users.user_username,\r\n\t\t\t se_users.user_photo,\r\n\t\t\t se_users.user_fname,\r\n\t\t\t se_users.user_lname\r\n\t\t\tFROM\r\n\t\t\t se_videos,\r\n\t\t\t se_users,\r\n\t\t\t se_levels\r\n\t\t\tWHERE\r\n\t\t\t se_videos.video_user_id=se_users.user_id AND\r\n\t\t\t se_users.user_level_id=se_levels.level_id AND\r\n\t\t\t (\r\n\t\t\t se_videos.video_search='1' OR\r\n\t\t\t se_levels.level_video_search='0'\r\n\t\t\t )\r\n\t\t\t AND\r\n\t\t\t (\r\n\t\t\t se_videos.video_title LIKE '%{$search_text}%' OR\r\n\t\t\t se_videos.video_desc LIKE '%{$search_text}%'\r\n\t\t\t )"; // GET TOTAL RESULTS $total_videos = $database->database_num_rows($database->database_query($video_query . " LIMIT 201")); // IF NOT TOTAL ONLY if ($t == "video") { // MAKE VIDEO PAGES $start = ($p - 1) * $results_per_page; $limit = $results_per_page + 1; // SEARCH VIDEOS $video = new se_video(); $videos = $database->database_query($video_query . " ORDER BY video_id DESC LIMIT {$start}, {$limit}"); while ($video_info = $database->database_fetch_assoc($videos)) { // CREATE AN OBJECT FOR USER $profile = new se_user(); $profile->user_info[user_id] = $video_info[user_id]; $profile->user_info[user_username] = $video_info[user_username]; $profile->user_info[user_fname] = $video_info[user_fname]; $profile->user_info[user_lname] = $video_info[user_lname]; $profile->user_info[user_photo] = $video_info[user_photo]; $profile->user_displayname(); // SET RESULT VARS $result_url = $url->url_create("video", $video_info[user_username], $video_info[video_id]); $result_name = 5500141; $result_desc = 5500142; // SET DIRECTORY $video_info[video_dir] = $video->video_dir($video_info[user_id]); // CHECK FOR THUMBNAIL $thumb_path = $video_info[video_dir] . $video_info[video_id] . "_thumb.jpg"; if (!file_exists($thumb_path)) { $video_info[video_thumb] = "./images/video_placeholder.gif"; } // IF NO TITLE if ($video_info[video_title] == "") { $video_info[video_title] = SE_Language::get(589); } // IF DESCRIPTION IS LONG if (strlen($video_info[video_desc]) > 150) { $video_info[video_desc] = substr($video_info[video_desc], 0, 147) . "..."; } $results[] = array('result_url' => $result_url, 'result_icon' => $thumb_path, 'result_name' => $result_name, 'result_name_1' => $video_info[video_title], 'result_desc' => $result_desc, 'result_desc_1' => $url->url_create('profile', $video_info[user_username]), 'result_desc_2' => $profile->user_displayname, 'result_desc_3' => $video_info[video_desc]); } // SET TOTAL RESULTS $total_results = $total_videos; } // SET ARRAY VALUES SE_Language::_preload_multi(5500141, 5500142, 5500143); if ($total_videos > 200) { $total_videos = "200+"; } $search_objects[] = array('search_type' => 'video', 'search_lang' => 5500143, 'search_total' => $total_videos); }
// CHECK IF QUOTING FOR REPLY if ($is_reply && $quote_id != 0) { // VALIDATE POST ID $post = $database->database_query("SELECT se_forumposts.*, se_users.user_id, se_users.user_username, se_users.user_fname, se_users.user_lname FROM se_forumposts LEFT JOIN se_users ON se_forumposts.forumpost_authoruser_id=se_users.user_id WHERE forumpost_id='{$quote_id}' AND forumpost_forumtopic_id='{$topic_info[forumtopic_id]}' AND forumpost_deleted='0'"); if ($database->database_num_rows($post) == 1) { $post_info = $database->database_fetch_assoc($post); // GET POST AUTHOR $author = new se_user(); if ($post_info['forumpost_authoruser_id'] != $post_info['user_id']) { $author->user_exists = false; // AUTHOR DELETED if ($post_info[forumpost_authoruser_id] != 0) { $author->user_displayname = SE_Language::get(6000119); // AUTHOR ANONYMOUS } else { $author->user_displayname = SE_Language::get(835); } } else { $author->user_exists = true; $author->user_info['user_id'] = $post_info['user_id']; $author->user_info['user_username'] = $post_info['user_username']; $author->user_info['user_fname'] = $post_info['user_fname']; $author->user_info['user_lname'] = $post_info['user_lname']; $author->user_displayname(); } $post_body = "[quote={$author->user_displayname}]{$post_info[forumpost_body]}[/quote]"; } } // DECODE POST BODY $post_body = str_replace("\r\n", "", htmlspecialchars_decode($post_body)); // ASSIGN SMARTY VARS AND INCLUDE FOOTER
$album = new se_album($user->user_info['user_id']); if ($task == "doupload") { // CREATE NEW ALBUM IF SELECTED if (!$album_id) { $level_album_privacy = unserialize($user->level_info['level_album_privacy']); $level_album_comments = unserialize($user->level_info['level_album_comments']); $level_album_tag = unserialize($user->level_info['level_album_tag']); $album_title = censor($_POST['album_title']); $album_desc = ''; $album_privacy = $level_album_privacy[0]; $album_comments = $level_album_comments[0]; $album_tag = $level_album_tag[0]; $album_datecreated = time(); // Untitled if (empty($album_title)) { $album_title = SE_Language::get(1500015); } // GET MAX ORDER $max = $database->database_fetch_assoc($database->database_query("SELECT max(album_order) AS max FROM se_albums WHERE album_user_id='{$user->user_info['user_id']}'")); $album_order = $max[max] + 1; // INSERT NEW ALBUM INTO DATABASE $database->database_query("\r\n INSERT INTO se_albums (\r\n\t\t\t\talbum_user_id,\r\n\t\t\t\talbum_datecreated,\r\n\t\t\t\talbum_dateupdated,\r\n\t\t\t\talbum_title, \r\n\t\t\t\talbum_desc, \r\n\t\t\t\talbum_search,\r\n\t\t\t\talbum_privacy,\r\n\t\t\t\talbum_comments,\r\n\t\t\t\talbum_tag,\r\n\t\t\t\talbum_order\r\n ) VALUES (\r\n\t\t\t\t'{$user->user_info['user_id']}',\r\n\t\t\t\t'{$album_datecreated}',\r\n\t\t\t\t'{$album_datecreated}',\r\n\t\t\t\t'{$album_title}',\r\n\t\t\t\t'{$album_desc}',\r\n\t\t\t\t'{$album_search}',\r\n\t\t\t\t'{$album_privacy}',\r\n\t\t\t\t'{$album_comments}',\r\n\t\t\t\t'{$album_tag}',\r\n\t\t\t\t'{$album_order}'\r\n )\r\n ") or die($database->database_error()); $album_id = $database->database_insert_id(); // UPDATE LAST UPDATE DATE (SAY THAT 10 TIMES FAST) $user->user_lastupdate(); // INSERT ACTION if (strlen($album_title) > 100) { $album_title = substr($album_title, 0, 97); $album_title .= "..."; } $actions->actions_add($user, "newalbum", array($user->user_info[user_username], $user->user_displayname, $album_id, $album_title), array(), 0, FALSE, "user", $user->user_info[user_id], $album_privacy);
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)); }
function he_quiz_list($params = array()) { $active_tab = isset($params['active_tab']) && $params['active_tab'] ? $params['active_tab'] : 'popular'; $count = isset($params['count']) && $params['count'] ? (int) $params['count'] : 5; $list_types = array('popular', 'latest', 'commented'); $quiz_list_str = ''; foreach ($list_types as $list_type) { $quiz_list = he_quiz::get_index_list($count, $list_type); $quizzes_str = ''; foreach ($quiz_list as $quiz) { $img_size = $quiz['size'][0] > $quiz['size'][1] ? 'width="60"' : 'height="60"'; $quizzes_str .= '<div class="he_quiz_item"> <div class="he_quiz_photo"> <a href="browse_quiz.php?quiz_id=' . $quiz['quiz_id'] . '"> <img border="0" src="' . ($quiz['photo_url'] ? $quiz['photo_url'] : './images/he_quiz_thumb.jpg') . '" ' . $img_size . '/> </a> </div> <div class="he_quiz_info"> <div class="he_quiz_name"><a href="quiz.php?quiz_id=' . $quiz['quiz_id'] . '">' . $quiz['name'] . '</a></div> <div class="he_quiz_description">' . he_quiz_truncate($quiz['description'], 100) . '</div> </div> <div class="clr"></div> </div>'; } $quizzes_str = strlen($quizzes_str) ? $quizzes_str : '<center>' . SE_Language::get(690691160) . '</center>'; $is_active = $active_tab == $list_type ? 'active_tab' : ''; $quizzes_str = '<div id="tab_' . $list_type . '" class="he_quiz_list ' . $is_active . '">' . $quizzes_str . '</div>'; $quiz_list_str .= $quizzes_str; } $tabs_str = '<div class="he_quiz_tab" onclick="he_quiz.switch_tab(this, \'tab_commented\')"> <label>' . SE_Language::get(690691196) . '</label> </div> <div class="he_quiz_tab" onclick="he_quiz.switch_tab(this, \'tab_latest\')"> <label>' . SE_Language::get(690691158) . '</label> </div> <div class="he_quiz_tab active_tab" onclick="he_quiz.switch_tab(this, \'tab_popular\')"> <label>' . SE_Language::get(690691159) . '</label> </div>'; $lang_var = SE_Language::get(690691161); return <<<OUTPUT <script src="./include/js/he_quiz.js" type="text/javascript"></script> <div class="he_quiz_list_block"> <div class="he_quiz_block_cap"> <div class="he_quiz_label"> <b>{$lang_var}</b> </div> {$tabs_str} <div class="clr"></div> </div> <div class="he_quiz_block_body"> {$quiz_list_str} </div> </div> OUTPUT; }
$quiz_notice = !strlen($answer_label) || !$answer_result_id ? false : $quiz_notice; } $question = array('id' => $question_id, 'text' => $question_text, 'answers' => $answers, 'photo' => $photo, 'filename' => $photo_key); $question_arr[] = $question; if (!strlen($question_text)) { $quiz_error = true; } else { $questions[] = $question; } } if ($min_question_count > count($questions)) { $message = array('type' => 'error', 'title' => SE_Language::get(690691116, array($min_question_count)), 'text' => SE_Language::get(690691117)); } elseif ($quiz_error) { $message = array('type' => 'error', 'title' => SE_Language::get(690691118), 'text' => SE_Language::get(690691119)); } elseif ($quiz_notice) { $message = array('type' => 'error', 'title' => SE_Language::get(690691120), 'text' => SE_Language::get(690691121)); } else { he_quiz::save_questions($quiz_id, $questions); header("Location: quiz_publish.php?quiz_id={$quiz_id}"); exit; } } if (!isset($question_arr)) { $question_arr = he_quiz::get_questions($quiz_id, true); $question_arr = he_quiz::get_answers($quiz_id, $question_arr); } $results = he_quiz::get_results($quiz_id, false, true); $photo_url = he_quiz::photo_url(); $smarty->assign('quiz_id', $quiz_id); $smarty->assign('min_question_count', $min_question_count); $smarty->assign('question_arr', $question_arr);
<?php $page = "quiz_result"; include "header.php"; $task = isset($_POST['task']) && $_POST['task'] ? trim($_POST['task']) : ''; $task = !$task && (isset($_GET['task']) && $_GET['task']) ? $_GET['task'] : $task; $quiz_id = isset($_GET['quiz_id']) && $_GET['quiz_id'] ? (int) $_GET['quiz_id'] : 0; $result_id = he_quiz::user_result($user->user_info['user_id'], $quiz_id); // DISPLAY ERROR PAGE IF USER IS NOT LOGGED IN AND ADMIN SETTING REQUIRES REGISTRATION if (!$user->user_exists || !$quiz_id || !$result_id) { $page = "error"; $smarty->assign('error_header', 639); $smarty->assign('error_message', 656); $smarty->assign('error_submit', 641); include "footer.php"; } $quiz_info = he_quiz::get_quiz_info($quiz_id); $quiz_result = he_quiz::result_info($result_id); $friend_list = $user->user_friend_list(0, 10); $message = array('title' => SE_Language::get(690691154), 'text' => SE_Language::get(690691155), 'type' => 'success'); $photo_url = he_quiz::photo_url(); $smarty->assign('message', $message); $smarty->assign('quiz_info', $quiz_info); $smarty->assign('quiz_result', $quiz_result); $smarty->assign('photo_url', $photo_url); include "footer.php";
function group_post_bbcode_parse_view($string) { // DO [quote] $open_quote = preg_match_all('/\\[quote\\=(.*?)\\]/i', $string, $matches); $close_quote = preg_match_all('/\\[\\/quote\\]/i', $string, $matches); $total_tags = $open_quote > $close_quote ? $close_quote : $open_quote; if ($total_tags) { $string = preg_replace('/\\[quote\\=(.*?)\\]/i', "<div class='group_discussion_quote'><div>" . SE_Language::get(2000323, array('$1')) . "</div>", $string, $total_tags); $string = strrev(preg_replace('/\\]etouq\\/\\[/i', ">vid/<", strrev($string), $total_tags)); } // DO [code] $open_code = preg_match_all('/\\[code\\=?(.*?)\\]/i', $string, $matches); $close_code = preg_match_all('/\\[\\/code\\]/i', $string, $matches); $total_tags = $open_code > $close_code ? $close_code : $open_code; if ($total_tags) { $string = preg_replace('/\\[code\\=?(.*?)\\](.*?)\\[\\/code\\]/ie', "'<div class=\\'group_discussion_code\\'>'.( '\\1'!='' ? '<div class=\\'group_discussion_code_title\\'>'.'\\1'.'</div>' : '').'\\2'.'</div>'", $string, $total_tags); } return $string; }