コード例 #1
0
function send_systememail($systememail, $recipient_email, $replace = array(), $bcc = FALSE)
{
    global $setting, $database;
    // RETRIEVE EMAIL INFO
    $email = $database->database_fetch_assoc($database->database_query("SELECT * FROM se_systememails WHERE systememail_name='{$systememail}' LIMIT 1"));
    SE_Language::_preload_multi($email['systememail_subject'], $email['systememail_body']);
    SE_Language::load();
    // GET/DECODE SUBJECT AND MESSAGE
    $subject = htmlspecialchars_decode(SE_Language::_get($email['systememail_subject']), ENT_QUOTES);
    $message = htmlspecialchars_decode(SE_Language::_get($email['systememail_body']), ENT_QUOTES);
    // REPLACE VARIABLES IN SUBJECT AND MESSAGE
    $subject = vsprintf($subject, $replace);
    $message = vsprintf($message, $replace);
    // ENCODE SUBJECT FOR UTF8
    $subject = "=?UTF-8?B?" . base64_encode($subject) . "?=";
    // REPLACE CARRIAGE RETURNS WITH BREAKS
    $message = str_replace("\n", "<br>", $message);
    // SET HEADERS
    $sender = "{$setting['setting_email_fromname']} <{$setting['setting_email_fromemail']}>";
    $headers = "MIME-Version: 1.0" . "\n";
    $headers .= "Content-type: text/html; charset=utf-8" . "\n";
    $headers .= "Content-Transfer-Encoding: 8bit" . "\n";
    $headers .= "From: {$sender}" . "\n";
    $headers .= "Return-Path: {$sender}" . "\n";
    $headers .= "Reply-To: {$sender}\n";
    // IF BCC, SET TO AND BCC
    if ($bcc) {
        $headers .= "Bcc: {$recipient_email}\n";
        $recipient_email = "*****@*****.**";
    }
    // SEND MAIL
    mail($recipient_email, $subject, $message, $headers);
    return true;
}
コード例 #2
0
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);
}
コード例 #3
0
function send_systememail($systememail, $recipient_email, $replace = array(), $bcc = FALSE)
{
    global $setting, $database, $setting_smtp_email;
    $setting_email_query = $database->database_query("SELECT * FROM se_settings_email LIMIT 1");
    $setting_smtp_email = $database->database_fetch_assoc($setting_email_query);
    // RETRIEVE EMAIL INFO
    $email = $database->database_fetch_assoc($database->database_query("SELECT * FROM se_systememails WHERE systememail_name='{$systememail}' LIMIT 1"));
    SE_Language::_preload_multi($email['systememail_subject'], $email['systememail_body']);
    SE_Language::load();
    // GET/DECODE SUBJECT AND MESSAGE
    $subject = htmlspecialchars_decode(SE_Language::_get($email['systememail_subject']), ENT_QUOTES);
    $message = htmlspecialchars_decode(SE_Language::_get($email['systememail_body']), ENT_QUOTES);
    // REPLACE VARIABLES IN SUBJECT AND MESSAGE
    $subject = vsprintf($subject, $replace);
    $message = vsprintf($message, $replace);
    // ENCODE SUBJECT FOR UTF8
    $subject = "=?UTF-8?B?" . base64_encode($subject) . "?=";
    // REPLACE CARRIAGE RETURNS WITH BREAKS
    $message = str_replace("\n", "<br>", $message);
    // SET HEADERS
    $sender = "{$setting['setting_email_fromname']} <{$setting['setting_email_fromemail']}>";
    $headers = "MIME-Version: 1.0" . "\n";
    $headers .= "Content-type: text/html; charset=utf-8" . "\n";
    $headers .= "Content-Transfer-Encoding: 8bit" . "\n";
    $headers .= "From: {$sender}" . "\n";
    $headers .= "Return-Path: {$sender}" . "\n";
    $headers .= "Reply-To: {$sender}\n";
    // IF BCC, SET TO AND BCC
    if ($bcc) {
        $headers .= "Bcc: {$recipient_email}\n";
        $recipient_email = "*****@*****.**";
    }
    // SEND MAIL
    if ($setting_smtp_email['email_method'] == "mail") {
        mail($recipient_email, $subject, $message, $headers);
    } elseif ($setting_smtp_email['email_method'] == "smtp") {
        $mailer = new PHPMailer();
        $mailer->IsSMTP();
        $mailer->Subject = $subject;
        $mailer->From = $setting['setting_email_fromemail'];
        $mailer->FromName = $setting['setting_email_fromname'];
        $mailer->MsgHTML($message);
        $mailer->AddAddress($recipient_email);
        $mailer->Host = $setting_smtp_email['smtp_host'];
        $mailer->Username = $setting_smtp_email['smtp_user'];
        $mailer->Password = $setting_smtp_email['smtp_pass'];
        $mailer->Port = $setting_smtp_email['smtp_port'];
        if ($setting_smtp_email['smtp_port'] == 465) {
            $mailer->SMTPSecure = "ssl";
        } else {
            $mailer->SMTPSecure = "";
        }
        $mailer->Send();
    }
    return true;
}
コード例 #4
0
function search_poll()
{
    global $database, $url, $results_per_page, $p, $search_text, $t, $search_objects, $results, $total_results;
    // CONSTRUCT QUERY
    $sql = "\r\n    SELECT\r\n      se_polls.poll_id,\r\n      se_polls.poll_title,\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_polls,\r\n      se_users,\r\n      se_levels\r\n    WHERE\r\n      se_polls.poll_user_id=se_users.user_id &&\r\n      se_users.user_level_id=se_levels.level_id &&\r\n      (\r\n        se_polls.poll_search='1' ||\r\n        se_levels.level_poll_search='0'\r\n      ) &&\r\n      (\r\n        poll_title LIKE '%{$search_text}%' ||\r\n        poll_desc LIKE '%{$search_text}%' ||\r\n        poll_options LIKE '%{$search_text}%'\r\n      )\r\n  ";
    // GET TOTAL ENTRIES
    $total_polls = $database->database_num_rows($database->database_query($sql . " LIMIT 201"));
    // IF NOT TOTAL ONLY
    if ($t == "poll") {
        // MAKE POLL PAGES
        $start = ($p - 1) * $results_per_page;
        $limit = $results_per_page + 1;
        // SEARCH POLLS
        $sql .= " ORDER BY se_polls.poll_id DESC LIMIT {$start}, {$limit}";
        $resource = $database->database_query($sql) or die($database->database_error());
        while ($poll_info = $database->database_fetch_assoc($resource)) {
            // CREATE AN OBJECT FOR AUTHOR
            $profile = new se_user();
            $profile->user_info['user_id'] = $poll_info['user_id'];
            $profile->user_info['user_username'] = $poll_info['user_username'];
            $profile->user_info['user_fname'] = $poll_info['user_fname'];
            $profile->user_info['user_lname'] = $poll_info['user_lname'];
            $profile->user_info['user_photo'] = $poll_info['user_photo'];
            $profile->user_displayname();
            $result_url = $url->url_create('poll', $poll_info['user_username'], $poll_info['poll_id']);
            $result_name = 2500112;
            $result_desc = 2500113;
            // IF EMPTY TITLE
            if (!trim($poll_info['poll_title'])) {
                SE_Language::_preload(589);
                SE_Language::load();
                $poll_info['poll_title'] = SE_Language::_get(589);
            }
            $results[] = array('result_url' => $result_url, 'result_icon' => './images/icons/poll_poll48.gif', 'result_name' => $result_name, 'result_name_1' => $poll_info['poll_title'], 'result_desc' => $result_desc, 'result_desc_1' => $url->url_create('profile', $profile->user_info['user_username']), 'result_desc_2' => $profile->user_displayname, 'result_desc_3' => $poll_info['poll_desc']);
        }
        // SET TOTAL RESULTS
        $total_results = $total_polls;
    }
    // SET ARRAY VALUES
    SE_Language::_preload_multi(2500111, 2500112, 2500113);
    if ($total_polls > 200) {
        $total_polls = "200+";
    }
    $search_objects[] = array('search_type' => 'poll', 'search_lang' => 2500111, 'search_total' => $total_polls);
}
コード例 #5
0
function search_documents()
{
    global $database, $url, $results_per_page, $p, $search_text, $t, $search_objects, $results, $total_results;
    // START TO QUERY BUILD
    $sql = "\r\n    SELECT\r\n      se_documents.document_id,\r\n      se_documents.document_title,\r\n      se_documents.document_slug,\r\n      se_documents.document_description,\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_documents \r\n      INNER JOIN \r\n       se_users \r\n       ON se_documents.document_user_id=se_users.user_id\r\n      INNER JOIN\r\n       se_levels\r\n      ON se_users.user_level_id=se_levels.level_id \r\n      LEFT JOIN\r\n\t       se_document_tags\r\n\t       ON se_documents.document_id = se_document_tags.document_id\r\n\t    LEFT JOIN se_documenttags\r\n\t       ON se_document_tags.tag_id = se_documenttags.id  \r\n    WHERE\r\n\r\n      (\r\n        se_documents.document_search='1' ||\r\n        se_levels.level_document_search='0'\r\n      ) &&\r\n      (\r\n        document_title LIKE '%{$search_text}%' ||\r\n        document_description LIKE '%{$search_text}%' ||\r\n        document_fulltext LIKE '%{$search_text}%' ||\r\n        tag_name LIKE '%{$search_text}%'\r\n      )\r\n      &&\r\n      (\r\n        se_documents.document_approved='1'\r\n      )\r\n      &&\r\n      (\r\n        se_documents.document_publish='1'\r\n      )\r\n      &&\r\n      (\r\n        se_documents.document_status='1'\r\n      )\r\n     GROUP BY se_documents.document_id \r\n  ";
    // GET TOTAL DOCUMNETS
    $total_documents = $database->database_num_rows($database->database_query($sql . " LIMIT 201"));
    // IF NOT TOTAL ONLY
    if ($t == "document") {
        //  DOCUMENTS PAGES
        $start = ($p - 1) * $results_per_page;
        $limit = $results_per_page + 1;
        // SEARCH DOCUMENTS
        $sql .= " ORDER BY se_documents.document_id DESC LIMIT {$start}, {$limit}";
        $resource = $database->database_query($sql) or die($database->database_error());
        while ($document_info = $database->database_fetch_assoc($resource)) {
            // CREATE AN OBJECT FOR AUTHOR
            $profile = new se_user();
            $profile->user_info['user_id'] = $document_info['user_id'];
            $profile->user_info['user_username'] = $document_info['user_username'];
            $profile->user_info['user_fname'] = $document_info['user_fname'];
            $profile->user_info['user_lname'] = $document_info['user_lname'];
            $profile->user_info['user_photo'] = $document_info['user_photo'];
            $profile->user_displayname();
            $result_url = $url->url_create("document", $document_info['user_username'], $document_info['document_id'], $document_info['document_slug']);
            $result_name = 650003007;
            $result_desc = 650003008;
            $results[] = array('result_url' => $result_url, 'result_icon' => './images/icons/document60.gif', 'result_name' => $result_name, 'result_name_1' => $document_info['document_title'], 'result_desc' => $result_desc, 'result_desc_1' => $url->url_create('profile', $profile->user_info['user_username']), 'result_desc_2' => $profile->user_displayname, 'result_desc_3' => $document_info['document_description']);
        }
        // SET TOTAL RESULTS
        $total_results = $total_documents;
    }
    // SET ARRAY VALUES
    SE_Language::_preload_multi(650003009, 650003007, 650003008);
    if ($total_documents > 200) {
        $total_documents = "200+";
    }
    $search_objects[] = array('search_type' => 'document', 'search_lang' => 650003009, 'search_total' => $total_documents);
}
コード例 #6
0
 function forum_list($cat_id = 0)
 {
     global $database, $user;
     // SET LEVEL ID
     if ($user->user_exists) {
         $level_id = $user->level_info[level_id];
     } else {
         $level_id = 0;
     }
     // GET FORUM CATEGORIES
     if ($cat_id == 0) {
         $sql = "SELECT * FROM se_forumcats ORDER BY forumcat_order";
     } else {
         $sql = "SELECT * FROM se_forumcats WHERE cat_id='{$cat_id}'";
     }
     $forumcats = $database->database_query($sql);
     while ($forumcat_info = $database->database_fetch_assoc($forumcats)) {
         // GET FORUMS
         $forum_array = array();
         $forums = $database->database_query("SELECT * FROM se_forums WHERE forum_forumcat_id='{$forumcat_info['forumcat_id']}' ORDER BY forum_order");
         while ($forum_info = $database->database_fetch_assoc($forums)) {
             $show_forum = false;
             if ($database->database_num_rows($database->database_query("SELECT NULL FROM se_forumlevels WHERE forumlevel_forum_id='{$forum_info['forum_id']}' AND forumlevel_level_id='{$level_id}'")) == 1) {
                 $show_forum = true;
             } elseif ($user->user_exists && $this->forum_is_moderator($user->user_info[user_id], $forum_info[forum_id])) {
                 $show_forum = true;
             }
             if ($show_forum) {
                 SE_Language::_preload_multi($forum_info[forum_title], $forum_info[forum_desc]);
                 // GET MODERATORS
                 $mod_array = array();
                 $mod_array_id = array();
                 $mods = $database->database_query("SELECT se_users.user_id, se_users.user_username, se_users.user_fname, se_users.user_lname FROM se_forummoderators LEFT JOIN se_users ON se_forummoderators.forummoderator_user_id=se_users.user_id WHERE se_forummoderators.forummoderator_forum_id='{$forum_info['forum_id']}' AND se_users.user_id IS NOT NULL");
                 while ($user_info = $database->database_fetch_assoc($mods)) {
                     $mod_user = new se_user();
                     $mod_user->user_info[user_id] = $user_info[user_id];
                     $mod_user->user_info[user_username] = $user_info[user_username];
                     $mod_user->user_info[user_fname] = $user_info[user_fname];
                     $mod_user->user_info[user_lname] = $user_info[user_lname];
                     $mod_user->user_displayname();
                     $mod_array[] = $mod_user;
                 }
                 $forum_info[forum_mods] = $mod_array;
                 // GET LAST POST
                 $lastpost = $database->database_query("SELECT se_forumposts.forumpost_id, se_forumposts.forumpost_date, se_forumposts.forumpost_authoruser_id, se_forumtopics.forumtopic_id, se_forumtopics.forumtopic_subject, se_users.user_id, se_users.user_username, se_users.user_fname, se_users.user_lname, se_users.user_photo FROM se_forumposts LEFT JOIN se_forumtopics ON se_forumposts.forumpost_forumtopic_id=se_forumtopics.forumtopic_id LEFT JOIN se_users ON se_forumposts.forumpost_authoruser_id=se_users.user_id WHERE se_forumtopics.forumtopic_forum_id='{$forum_info[forum_id]}' AND se_forumposts.forumpost_deleted='0' ORDER BY se_forumposts.forumpost_id DESC LIMIT 1");
                 if ($database->database_num_rows($lastpost) == 1) {
                     $lastpost_info = $database->database_fetch_assoc($lastpost);
                     $forum_info[lastpost] = true;
                     // GET POST AUTHOR
                     $author = new se_user();
                     if ($lastpost_info['forumpost_authoruser_id'] != $lastpost_info['user_id']) {
                         $author->user_exists = false;
                     } else {
                         $author->user_exists = true;
                         $author->user_info['user_id'] = $lastpost_info['user_id'];
                         $author->user_info['user_username'] = $lastpost_info['user_username'];
                         $author->user_info['user_fname'] = $lastpost_info['user_fname'];
                         $author->user_info['user_lname'] = $lastpost_info['user_lname'];
                         $author->user_info['user_photo'] = $lastpost_info['user_photo'];
                         $author->user_displayname();
                     }
                     $lastpost_info[author] = $author;
                     $forum_info[lastpost_info] = $lastpost_info;
                 } else {
                     $forum_info[lastpost] = false;
                 }
                 if ($forum_info[lastpost]) {
                     $forum_info[is_read] = false;
                     if (isset($_COOKIE["forum_{$user->user_info[user_id]}_{$forum_info['forum_id']}"])) {
                         if ($_COOKIE["forum_{$user->user_info[user_id]}_{$forum_info['forum_id']}"] >= $forum_info[lastpost_info][forumpost_date]) {
                             $forum_info[is_read] = true;
                         }
                     }
                 } else {
                     $forum_info[is_read] = true;
                 }
                 $forum_array[] = $forum_info;
             }
         }
         SE_Language::_preload($forumcat_info[forumcat_title]);
         $forumcat_info[forums] = $forum_array;
         $forumcat_array[] = $forumcat_info;
     }
     return $forumcat_array;
 }
コード例 #7
0
 if ($setting[setting_subnet_field2_id] != -2 && $subnet_info[subnet_field2_qual] != "" && $subnet_info[subnet_field2_value] != "") {
     $subnet_field2_qual = $subnet_info[subnet_field2_qual];
     switch ($secondary[field_type]) {
         case "1":
         case "2":
             $subnet_field2_value = $subnet_info[subnet_field2_value];
             $subnet_field2_value_date = 0;
             break;
         case "3":
         case "4":
             $subnet_field2_value_date = 0;
             // LOOP OVER FIELD OPTIONS
             $options = $secondary[field_options];
             for ($i = 0, $max = count($options); $i < $max; $i++) {
                 if ($subnet_info[subnet_field2_value] == $options[$i][value]) {
                     SE_Language::_preload_multi($options[$i][label]);
                     SE_Language::load();
                     $subnet_field2_value = SE_Language::_get($options[$i][label]);
                     break;
                 }
             }
             break;
         case "5":
             $subnet_field2_value_date = $subnet_info[subnet_field2_value];
             $subnet_field2_value = $datetime->cdate($setting[setting_dateformat], $subnet_info[subnet_field2_value]);
             break;
     }
 }
 // SET SUBNET ARRAY AND INCREMENT SUBNET COUNT
 SE_Language::_preload($subnet_info[subnet_name]);
 $subnet_array[] = array('subnet_id' => $subnet_info[subnet_id], 'subnet_name' => $subnet_info[subnet_name], 'subnet_field1_qual' => $subnet_info[subnet_field1_qual], 'subnet_field1_value_formatted' => $subnet_field1_value, 'subnet_field1_value' => $subnet_info[subnet_field1_value], 'subnet_field1_month' => $datetime->cdate("n", $subnet_field1_value_date), 'subnet_field1_day' => $datetime->cdate("j", $subnet_field1_value_date), 'subnet_field1_year' => $datetime->cdate("Y", $subnet_field1_value_date), 'subnet_field2_qual' => $subnet_field2_qual, 'subnet_field2_value_formatted' => $subnet_field2_value, 'subnet_field2_value' => $subnet_info[subnet_field2_value], 'subnet_field2_month' => $datetime->cdate("n", $subnet_field2_value_date), 'subnet_field2_day' => $datetime->cdate("j", $subnet_field2_value_date), 'subnet_field2_year' => $datetime->cdate("Y", $subnet_field2_value_date), 'subnet_users' => $subnet_info[users]);
コード例 #8
0
ファイル: admin_lostpass.php プロジェクト: rahulsiwal/younity
<?php

/* $Id: admin_lostpass.php 8 2009-01-11 06:02:53Z nico-izo $ */
$page = "admin_lostpass";
include "admin_header.php";
$task = isset($_POST['task']) ? $_POST['task'] : "main";
// SET ERROR VARS
$is_error = 0;
$submitted = 0;
if ($task == "send_email") {
    $admin_email = $_POST['admin_email'];
    $admin_query = $database->database_query("SELECT admin_id FROM se_admins WHERE admin_email='{$admin_email}' LIMIT 1");
    $submitted = 1;
    if ($database->database_num_rows($admin_query) != 1) {
        $is_error = 1;
    } else {
        $lostpassword_code = randomcode(15);
        $lostpassword_time = time();
        $admin_lost = $database->database_fetch_assoc($admin_query);
        $database->database_query("UPDATE se_admins SET admin_lostpassword_code='{$lostpassword_code}', admin_lostpassword_time='{$lostpassword_time}' WHERE admin_id='{$admin_lost['admin_id']}' LIMIT 1");
        $prefix = $url->url_base;
        $link = "<a href=\"{$prefix}" . "admin/admin_lostpass_reset.php?admin_id={$admin_lost['admin_id']}&r={$lostpassword_code}\">{$prefix}" . "admin/admin_lostpass_reset.php?admin_id={$admin_lost['admin_id']}&r={$lostpassword_code}</a>";
        SE_Language::_preload_multi(40, 41);
        SE_Language::load();
        send_generic($admin_email, $admin_email, SE_Language::_get(40), SE_Language::_get(41), array("[link]"), array($link));
    }
}
// ASSIGN VARIABLES AND INCLUDE FOOTER
$smarty->assign('is_error', $is_error);
$smarty->assign('submitted', $submitted);
include "admin_footer.php";
コード例 #9
0
function search_event()
{
    global $database, $url, $results_per_page, $p, $search_text, $t, $search_objects, $results, $total_results;
    // GET EVENT FIELDS
    $fields = $database->database_query("SELECT eventfield_id AS field_id, eventfield_type AS field_type, eventfield_options AS field_options FROM se_eventfields WHERE eventfield_type<>'5' AND (eventfield_dependency<>'0' OR (eventfield_dependency='0' AND eventfield_display<>'0'))");
    $event_query = "se_events.event_title LIKE '%{$search_text}%' OR se_events.event_desc LIKE '%{$search_text}%'";
    // LOOP OVER FIELDS
    while ($field_info = $database->database_fetch_assoc($fields)) {
        // TEXT FIELD OR TEXTAREA
        if ($field_info['field_type'] == 1 || $field_info['field_type'] == 2) {
            if ($event_query != "") {
                $event_query .= " OR ";
            }
            $event_query .= "se_eventvalues.eventvalue_{$field_info['field_id']} LIKE '%{$search_text}%'";
        } elseif ($field_info['field_type'] == 3 || $field_info['field_type'] == 4) {
            $options = unserialize($field_info['field_options']);
            $langids = array();
            $cases = array();
            for ($i = 0, $max = count($options); $i < $max; $i++) {
                $cases[] = "WHEN languagevar_id='{$options[$i]['label']}' THEN {$options[$i][value]}";
                $langids[] = $options[$i]['label'];
            }
            if (count($cases) != 0) {
                if ($event_query != "") {
                    $event_query .= " OR ";
                }
                $event_query .= "se_eventvalues.eventvalue_{$field_info['field_id']} IN (SELECT CASE " . implode(" ", $cases) . " END AS value FROM se_languagevars WHERE languagevar_id IN (" . implode(", ", $langids) . ") AND languagevar_value LIKE '%{$search_text}%')";
            }
        } elseif ($field_info['field_type'] == 6) {
            $options = unserialize($field_info['field_options']);
            $langids = array();
            $cases = array();
            for ($i = 0, $max = count($options); $i < $max; $i++) {
                $cases[] = "WHEN languagevar_id='{$options[$i]['label']}' THEN " . pow(2, $i);
                $langids[] = $options[$i]['label'];
            }
            if (count($cases) != 0) {
                if ($event_query != "") {
                    $event_query .= " OR ";
                }
                $event_query .= "se_eventvalues.eventvalue_{$field_info['field_id']} & (SELECT sum(CASE " . implode(" ", $cases) . " END) AS value FROM se_languagevars WHERE languagevar_id IN (" . implode(", ", $langids) . ") AND languagevar_value LIKE '%{$search_text}%')";
            }
        }
    }
    // CONSTRUCT QUERY
    $event_query = "\r\n    (\r\n      SELECT \r\n        '1' AS sub_type,\r\n        se_events.event_id AS event_id, \r\n        se_events.event_title AS event_title, \r\n        se_events.event_photo AS event_photo,\r\n        '' AS title,\r\n        se_events.event_desc AS description,\r\n        '' AS id,\r\n        '' AS extra\r\n      FROM \r\n        se_eventvalues \r\n      LEFT JOIN \r\n        se_events \r\n      ON \r\n        se_eventvalues.eventvalue_event_id=se_events.event_id \r\n      WHERE \r\n        se_events.event_search='1' \r\n        AND \r\n        ({$event_query})\r\n      ORDER BY event_id DESC\r\n    )\r\n    UNION ALL\r\n    (\r\n      SELECT\r\n        '2' AS sub_type,\r\n        se_events.event_id AS event_id, \r\n        se_events.event_title AS event_title, \r\n        se_events.event_photo AS event_photo,\r\n        se_eventmedia.eventmedia_title AS title,\r\n        se_eventmedia.eventmedia_desc AS description,\r\n        se_eventmedia.eventmedia_id AS id,\r\n        se_eventmedia.eventmedia_ext AS extra\r\n      FROM\r\n        se_eventmedia,\r\n        se_eventalbums,\r\n        se_events\r\n      WHERE\r\n        se_eventmedia.eventmedia_eventalbum_id=se_eventalbums.eventalbum_id AND\r\n        se_eventalbums.eventalbum_event_id=se_events.event_id AND\r\n        se_events.event_search='1'\r\n        AND\r\n        (\r\n          se_eventmedia.eventmedia_title LIKE '%{$search_text}%' OR\r\n          se_eventmedia.eventmedia_desc LIKE '%{$search_text}%'\r\n        )\r\n      ORDER BY eventmedia_id DESC\r\n    )\r\n  ";
    // GET TOTAL EVENT RESULTS
    $total_events = $database->database_num_rows($database->database_query($event_query . " LIMIT 201"));
    // IF NOT TOTAL ONLY
    if ($t == "event") {
        // MAKE EVENT PAGES
        $start = ($p - 1) * $results_per_page;
        $limit = $results_per_page + 1;
        // SEARCH EVENTS
        $resource = $database->database_query($event_query . " LIMIT {$start}, {$limit}");
        while ($event_info = $database->database_fetch_assoc($resource)) {
            // SET UP EVENT
            $event = new se_event();
            $event->event_info['event_id'] = $event_info['event_id'];
            $event->event_info['event_photo'] = $event_info['event_photo'];
            $thumb_path = $event->event_photo('./images/nophoto.gif', TRUE);
            // IF DESCRIPTION IS LONG
            if (strlen($event_info['description']) > 150) {
                $event_info['description'] = substr($event_info['description'], 0, 147) . "...";
            }
            if (strlen($event_info['event_desc']) > 150) {
                $event_info['event_desc'] = substr($event_info['event_desc'], 0, 147) . "...";
            }
            // RESULT IS A EVENT
            if ($event_info[sub_type] == 1) {
                $result_url = $url->url_create('event', NULL, $event_info['event_id']);
                $result_name = 3000282;
                $result_name_1 = $event_info['event_title'];
                $result_desc = 3000284;
                $result_desc_1 = $event_info['description'];
            } elseif ($event_info[sub_type] == 2) {
                $result_url = $url->url_create('event_media', NULL, $event_info['event_id'], $event_info['id']);
                $result_name = 3000283;
                $result_name_1 = $event_info['title'];
                $result_desc = 3000285;
                $result_desc_1 = "event.php?event_id=" . $event_info[event_id];
                $result_desc_2 = $event_info['event_title'];
                $result_desc_3 = $event_info['description'];
                // SET THUMBNAIL, IF AVAILABLE
                switch ($event_info['extra']) {
                    case "jpeg":
                    case "jpg":
                    case "gif":
                    case "png":
                    case "bmp":
                        $thumb_path = $event->event_dir($event->event_info['event_id']) . $event_info['id'] . "_thumb.jpg";
                        break;
                    case "mp3":
                    case "mp4":
                    case "wav":
                        $thumb_path = "./images/icons/audio_big.gif";
                        break;
                    case "mpeg":
                    case "mpg":
                    case "mpa":
                    case "avi":
                    case "swf":
                    case "mov":
                    case "ram":
                    case "rm":
                        $thumb_path = "./images/icons/video_big.gif";
                        break;
                    default:
                        $thumb_path = "./images/icons/file_big.gif";
                }
                if (!file_exists($thumb_path)) {
                    $thumb_path = "./images/icons/file_big.gif";
                }
            }
            $results[] = array('result_url' => $result_url, 'result_icon' => $thumb_path, '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_events;
    }
    // SET ARRAY VALUES
    SE_Language::_preload_multi(3000281, 3000282, 3000283, 3000284, 3000285);
    if ($total_events > 200) {
        $total_events = "200+";
    }
    $search_objects[] = array('search_type' => 'event', 'search_lang' => 3000281, 'search_total' => $total_events);
}
コード例 #10
0
ファイル: help.php プロジェクト: amitjoy/nitd-network
    $task = $_POST['task'];
} elseif (isset($_GET['task'])) {
    $task = $_GET['task'];
} else {
    $task = "";
}
// INCREMENT VIEW
if ($task == "view") {
    $faq_id = $_GET['faq_id'];
    $database->database_query("UPDATE se_faqs SET faq_views=faq_views+1 WHERE faq_id='{$faq_id}'");
    exit;
}
$faqcats = $database->database_query("SELECT * FROM se_faqcats ORDER BY faqcat_order");
while ($faqcat_info = $database->database_fetch_assoc($faqcats)) {
    $faq_array = array();
    $faqs = $database->database_query("SELECT * FROM se_faqs WHERE faq_faqcat_id='{$faqcat_info['faqcat_id']}' ORDER BY faq_order");
    while ($faq_info = $database->database_fetch_assoc($faqs)) {
        SE_Language::_preload_multi($faq_info[faq_subject], $faq_info['faq_content']);
        $faq_info['faq_content'] = htmlspecialchars_decode($faq_info['faq_content'], ENT_QUOTES);
        $faq_array[] = $faq_info;
    }
    SE_Language::_preload($faqcat_info['faqcat_title']);
    $faqcat_info[faqs] = $faq_array;
    $faqcat_array[] = $faqcat_info;
}
// SET GLOBAL PAGE TITLE/DESCRIPTION
$global_page_title[0] = 957;
$global_page_description[0] = 958;
// ASSIGN SMARTY VARIABLES AND INCLUDE FOOTER
$smarty->assign('faqcats', $faqcat_array);
include "footer.php";
コード例 #11
0
<?php

// ENSURE THIS IS BEING INCLUDED IN AN SE SCRIPT
if (!defined('SE_PAGE')) {
    exit;
}
//include_once "./lang/lang_".$global_lang."_education.php";
include_once "./include/class_radcodes.php";
include_once "./include/class_education.php";
include_once "./include/functions_education.php";
SE_Language::_preload_multi(11040101, 11040102, 11040103);
SE_Language::load();
// SET MAIN MENU VARS
//$plugin_vars[menu_main] = Array('file' => 'search_education.php', 'title' => 11020106);
// SET USER MENU VARS
if ($user->level_info[level_education_allow] == 1) {
    $plugin_vars[menu_user] = array('file' => 'user_education.php', 'icon' => 'education16.gif', 'title' => 11040102);
}
// SET PROFILE MENU VARS
if ($owner->level_info[level_education_allow] == 1 && $page == "profile") {
    $rc_education = new rc_education($owner->user_info[user_id]);
    $educations = $rc_education->get_educations();
    $educations = $rc_education->build_searchable_fields($educations);
    $total_educations = count($educations);
    $smarty->assign('educations', $educations);
    $smarty->assign('total_educations', $total_educations);
    // SET PROFILE MENU VARS
    if ($total_educations > 0) {
        // DETERMINE WHERE TO SHOW ALBUMS
        $level_education_profile = explode(",", $owner->level_info[level_education_profile]);
        if (!in_array($owner->user_info[user_profile_education], $level_education_profile)) {
コード例 #12
0
function search_profile()
{
    global $database, $url, $results_per_page, $p, $search_text, $t, $search_objects, $results, $total_results;
    // GET FIELDS
    $fields = $database->database_query("\r\n    SELECT\r\n      profilefield_id AS field_id,\r\n      profilefield_type AS field_type,\r\n      profilefield_options AS field_options\r\n    FROM\r\n      se_profilefields\r\n    WHERE\r\n      profilefield_type<>'5' &&\r\n      (profilefield_dependency<>'0' OR (profilefield_dependency='0' AND profilefield_display<>'0'))\r\n  ");
    $profile_query = "se_users.user_username LIKE '%{$search_text}%' OR CONCAT(se_users.user_fname, ' ', se_users.user_lname) LIKE '%{$search_text}%'";
    // LOOP OVER FIELDS
    while ($field_info = $database->database_fetch_assoc($fields)) {
        // TEXT FIELD OR TEXTAREA
        if ($field_info['field_type'] == 1 || $field_info['field_type'] == 2) {
            if ($profile_query) {
                $profile_query .= " OR ";
            }
            $profile_query .= "`se_profilevalues`.`profilevalue_{$field_info['field_id']}` LIKE '%{$search_text}%'";
        } elseif ($field_info[field_type] == 3 || $field_info[field_type] == 4) {
            $options = unserialize($field_info['field_options']);
            $langids = array();
            $cases = array();
            for ($i = 0, $max = count($options); $i < $max; $i++) {
                $cases[] = "WHEN languagevar_id='{$options[$i]['label']}' THEN {$options[$i]['value']}";
                $langids[] = $options[$i][label];
            }
            if (count($cases) != 0) {
                if ($profile_query) {
                    $profile_query .= " OR ";
                }
                $profile_query .= "`se_profilevalues`.`profilevalue_{$field_info['field_id']}` IN (SELECT CASE " . implode(" ", $cases) . " END AS value FROM se_languagevars WHERE languagevar_id IN (" . implode(", ", $langids) . ") AND languagevar_value LIKE '%{$search_text}%')";
            }
        } elseif ($field_info[field_type] == 6) {
            $options = unserialize($field_info['field_options']);
            $langids = array();
            $cases = array();
            for ($i = 0, $max = count($options); $i < $max; $i++) {
                $cases[] = "WHEN languagevar_id='{$options[$i]['label']}' THEN " . pow(2, $i);
                $langids[] = $options[$i][label];
            }
            if (count($cases) != 0) {
                if ($profile_query) {
                    $profile_query .= " OR ";
                }
                $profile_query .= "`se_profilevalues`.`profilevalue_{$field_info['field_id']}` & (SELECT sum(CASE " . implode(" ", $cases) . " END) AS value FROM se_languagevars WHERE languagevar_id IN (" . implode(", ", $langids) . ") AND languagevar_value LIKE '%{$search_text}%')";
            }
        }
    }
    // CONSTRUCT QUERY
    $profile_query = "\r\n    SELECT\r\n      se_users.user_id,\r\n      se_users.user_username,\r\n      se_users.user_fname,\r\n      se_users.user_lname,\r\n      se_users.user_photo\r\n    FROM\r\n      se_profilevalues\r\n    LEFT JOIN\r\n      se_users\r\n      ON se_profilevalues.profilevalue_user_id=se_users.user_id\r\n    LEFT JOIN\r\n      se_levels\r\n      ON se_levels.level_id=se_users.user_level_id\r\n    WHERE\r\n      se_users.user_verified='1' AND\r\n      se_users.user_enabled='1' AND\r\n      (se_users.user_search='1' OR se_levels.level_profile_search='0') AND\r\n      ({$profile_query})\r\n  ";
    // GET TOTAL PROFILES
    $total_profiles = $database->database_num_rows($database->database_query($profile_query . " LIMIT 201"));
    // IF NOT TOTAL ONLY
    if ($t == "0") {
        // MAKE PROFILE PAGES
        $start = ($p - 1) * $results_per_page;
        $limit = $results_per_page + 1;
        // SEARCH PROFILES
        $online_users_array = online_users();
        $profiles = $database->database_query($profile_query . " ORDER BY se_users.user_id DESC LIMIT {$start}, {$limit}");
        while ($profile_info = $database->database_fetch_assoc($profiles)) {
            // CREATE AN OBJECT FOR USER
            $profile = new se_user();
            $profile->user_info['user_id'] = $profile_info['user_id'];
            $profile->user_info['user_username'] = $profile_info['user_username'];
            $profile->user_info['user_fname'] = $profile_info['user_fname'];
            $profile->user_info['user_lname'] = $profile_info['user_lname'];
            $profile->user_info['user_photo'] = $profile_info['user_photo'];
            $profile->user_displayname();
            // DETERMINE IF USER IS ONLINE
            $is_online = (bool) in_array($profile_info['user_username'], $online_users_array[0]);
            $results[] = array('result_url' => $url->url_create('profile', $profile_info['user_username']), 'result_icon' => $profile->user_photo('./images/nophoto.gif', TRUE), 'result_name' => 509, 'result_name_1' => $profile->user_displayname, 'result_desc' => '', 'result_online' => $is_online);
        }
        // SET TOTAL RESULTS
        $total_results = $total_profiles;
    }
    // SET ARRAY VALUES
    SE_Language::_preload_multi(509, 1072);
    if ($total_profiles > 200) {
        $total_profiles = "200+";
    }
    $search_objects[] = array('search_type' => '0', 'search_lang' => 1072, 'search_total' => $total_profiles);
}
コード例 #13
0
function search_music()
{
    global $database, $url, $results_per_page, $p, $search_text, $t, $search_objects, $results, $total_results, $user;
    // CONSTRUCT QUERY
    $sql = "\r\n    SELECT\r\n      se_music.*,\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_music\r\n    LEFT JOIN\r\n      se_users\r\n      ON se_users.user_id=se_music.music_user_id\r\n    WHERE\r\n      se_music.music_title LIKE '%{$search_text}%'\r\n  ";
    // GET TOTAL RESULTS
    $total_music = $database->database_num_rows($database->database_query($sql . " LIMIT 201"));
    // IF NOT TOTAL ONLY
    if ($t == "music") {
        // MAKE MUSIC PAGES
        $start = ($p - 1) * $results_per_page;
        $limit = $results_per_page + 1;
        // Lang for download song
        SE_Language::_preload(4000095);
        SE_Language::load();
        // SEARCH MUSIC
        $sql .= " ORDER BY se_music.music_id DESC LIMIT {$start}, {$limit}";
        $resource = $database->database_query($sql) or die($database->database_error());
        while ($music_info = $database->database_fetch_assoc($resource)) {
            // CREATE AN OBJECT FOR USER
            $profile = new se_user();
            $profile->user_info['user_id'] = $music_info['user_id'];
            $profile->user_info['user_username'] = $music_info['user_username'];
            $profile->user_info['user_fname'] = $music_info['user_fname'];
            $profile->user_info['user_lname'] = $music_info['user_lname'];
            $profile->user_info['user_photo'] = $music_info['user_photo'];
            $profile->user_displayname();
            $result_url = $url->url_create('profile', $music_info['user_username']);
            $result_name = 4000105;
            $result_desc = 4000106;
            $userdir = $url->url_userdir($music_info['user_id']);
            $music_path = "{$userdir}{$music_info['music_id']}.{$music_info['music_ext']}";
            // IF NO TITLE
            if (!trim($music_info['music_title'])) {
                SE_Language::_preload(589);
                SE_Language::load();
                $music_info['music_title'] = SE_Language::_get(589);
            }
            $dl_lv = SE_Language::_get(4000095);
            $desc3 = <<<EOF
<br />
<table><tr><td>
  <object width="17" height="17" data="images/music_button.swf?song_url={$music_path}" type="application/x-shockwave-flash">
    <param value="images/music_button.swf?song_url={$music_path}" name="movie" />
    <img width="17" height="17" alt="" src="noflash.gif" />
  </object>
</td>
EOF;
            if ($user->user_exists && $user->level_info['level_music_allow_downloads']) {
                $desc3 .= <<<EOF
<td style="padding-left:10px;vertical-align:middle;">
  <a type="application/force-download" href="{$music_path}">{$dl_lv}</a>
</td>
EOF;
            }
            $desc3 .= "</tr></table>";
            $results[] = array('result_url' => $result_url, 'result_icon' => './images/icons/music_music48.gif', 'result_name' => $result_name, 'result_name_1' => $music_info['music_title'], 'result_desc' => $result_desc, 'result_desc_1' => $url->url_create('profile', $profile->user_info['user_username']), 'result_desc_2' => $profile->user_displayname, 'result_desc_3' => $desc3);
        }
        // SET TOTAL RESULTS
        $total_results = $total_music;
    }
    // SET ARRAY VALUES
    SE_Language::_preload_multi(4000104, 4000105, 4000106);
    if ($total_music > 200) {
        $total_music = "200+";
    }
    $search_objects[] = array('search_type' => 'music', 'search_lang' => 4000104, 'search_total' => $total_music);
}
コード例 #14
0
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);
}
コード例 #15
0
function search_album()
{
    global $database, $url, $results_per_page, $p, $search_text, $t, $search_objects, $results, $total_results;
    // CONSTRUCT QUERY
    $album_query = "\r\n\t(\r\n\tSELECT\r\n          '1' AS sub_type,\r\n\t  se_media.media_album_id AS album_id,\r\n\t  se_media.media_title AS title,\r\n\t  se_media.media_desc AS description,\r\n\t  se_media.media_id AS media_id,\r\n\t  se_media.media_ext AS media_ext,\r\n\t  se_users.user_id,\r\n\t  se_users.user_username,\r\n\t  se_users.user_photo,\r\n\t  se_users.user_fname,\r\n\t  se_users.user_lname\r\n\tFROM\r\n\t  se_media,\r\n\t  se_albums,\r\n\t  se_users,\r\n\t  se_levels\r\n\tWHERE\r\n\t  se_media.media_album_id=se_albums.album_id AND\r\n\t  se_albums.album_user_id=se_users.user_id AND\r\n\t  se_users.user_level_id=se_levels.level_id AND\r\n\t  (\r\n\t    se_albums.album_search='1' OR\r\n\t    se_levels.level_album_search='0'\r\n\t  )\r\n\t  AND\r\n\t  (\r\n\t    se_media.media_title LIKE '%{$search_text}%' OR\r\n\t    se_media.media_desc LIKE '%{$search_text}%'\r\n\t  )\r\n\tORDER BY media_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_albums.album_id AS album_id,\r\n\t  se_albums.album_title AS title,\r\n\t  se_albums.album_desc AS description,\r\n\t  se_albums.album_cover AS media_id,\r\n\t  se_media.media_ext AS media_ext,\r\n\t  se_users.user_id,\r\n\t  se_users.user_username,\r\n\t  se_users.user_photo,\r\n\t  se_users.user_fname,\r\n\t  se_users.user_lname\r\n\tFROM\r\n\t  se_albums,\r\n\t  se_users,\r\n\t  se_levels,\r\n\t  se_media\r\n\tWHERE\r\n\t  se_albums.album_user_id=se_users.user_id AND\r\n\t  se_users.user_level_id=se_levels.level_id AND\r\n\t  se_albums.album_cover=se_media.media_id AND \r\n\t  (\r\n\t    se_albums.album_search='1' OR\r\n\t    se_levels.level_album_search='0'\r\n\t  )\r\n\t  AND\r\n\t  (\r\n\t    se_albums.album_title LIKE '%{$search_text}%' OR\r\n\t    se_albums.album_desc LIKE '%{$search_text}%'\r\n\t  )\r\n\tORDER BY album_id DESC\r\n\t)";
    // GET TOTAL RESULTS
    $total_albums = $database->database_num_rows($database->database_query($album_query . " LIMIT 201"));
    // IF NOT TOTAL ONLY
    if ($t == "album") {
        // MAKE ALBUM PAGES
        $start = ($p - 1) * $results_per_page;
        $limit = $results_per_page + 1;
        // SEARCH ALBUMS
        $albums = $database->database_query($album_query . " ORDER BY album_id DESC LIMIT {$start}, {$limit}");
        while ($album_info = $database->database_fetch_assoc($albums)) {
            // CREATE AN OBJECT FOR USER
            $profile = new se_user();
            $profile->user_info['user_id'] = $album_info['user_id'];
            $profile->user_info['user_username'] = $album_info['user_username'];
            $profile->user_info['user_fname'] = $album_info['user_fname'];
            $profile->user_info['user_lname'] = $album_info['user_lname'];
            $profile->user_info['user_photo'] = $album_info['user_photo'];
            $profile->user_displayname();
            // RESULT IS A MEDIA
            if ($album_info[sub_type] == 1) {
                $result_url = $url->url_create('album_file', $album_info['user_username'], $album_info['album_id'], $album_info['media_id']);
                $result_name = 1000119;
                $result_desc = 1000121;
                // RESULT IS AN ALBUM
            } else {
                $result_url = $url->url_create('album', $album_info['user_username'], $album_info['album_id']);
                $result_name = 1000120;
                $result_desc = 1000122;
            }
            // SET THUMBNAIL, IF AVAILABLE
            switch ($album_info['media_ext']) {
                case "jpeg":
                case "jpg":
                case "gif":
                case "png":
                case "bmp":
                    $thumb_path = $url->url_userdir($album_info['user_id']) . $album_info['media_id'] . "_thumb.jpg";
                    break;
                case "mp3":
                case "mp4":
                case "wav":
                    $thumb_path = "./images/icons/audio_big.gif";
                    break;
                case "mpeg":
                case "mpg":
                case "mpa":
                case "avi":
                case "swf":
                case "mov":
                case "ram":
                case "rm":
                    $thumb_path = "./images/icons/video_big.gif";
                    break;
                default:
                    $thumb_path = "./images/icons/file_big.gif";
            }
            if (!file_exists($thumb_path)) {
                $thumb_path = "./images/icons/file_big.gif";
            }
            // IF NO TITLE
            if ($album_info['title'] == "") {
                SE_Language::_preload(589);
                SE_Language::load();
                $album_info['title'] = SE_Language::_get(589);
            }
            // IF DESCRIPTION IS LONG
            if (strlen($album_info['description']) > 150) {
                $album_info['description'] = substr($album_info['description'], 0, 147) . "...";
            }
            $results[] = array('result_url' => $result_url, 'result_icon' => $thumb_path, 'result_name' => $result_name, 'result_name_1' => $album_info['title'], 'result_desc' => $result_desc, 'result_desc_1' => $url->url_create('profile', $album_info['user_username']), 'result_desc_2' => $profile->user_displayname, 'result_desc_3' => $album_info['description']);
        }
        // SET TOTAL RESULTS
        $total_results = $total_albums;
    }
    // SET ARRAY VALUES
    SE_Language::_preload_multi(1000118, 1000119, 1000120, 1000121, 1000122);
    if ($total_albums > 200) {
        $total_albums = "200+";
    }
    $search_objects[] = array('search_type' => 'album', 'search_lang' => 1000118, 'search_total' => $total_albums);
}
コード例 #16
0
ファイル: class_field.php プロジェクト: amitjoy/nitd-network
 function field_get($field_id)
 {
     global $database;
     $field_info = $database->database_fetch_assoc($database->database_query("SELECT " . $this->type . "field_id AS field_id, " . $this->type . "field_" . $this->type . "cat_id AS field_cat_id, " . $this->type . "field_order AS field_order, " . $this->type . "field_dependency AS field_dependency, " . $this->type . "field_title AS field_title, " . $this->type . "field_desc AS field_desc, " . $this->type . "field_error AS field_error, " . $this->type . "field_type AS field_type, " . $this->type . "field_style AS field_style, " . $this->type . "field_maxlength AS field_maxlength, " . $this->type . "field_link AS field_link, " . $this->type . "field_options AS field_options, " . $this->type . "field_required AS field_required, " . $this->type . "field_regex AS field_regex, " . $this->type . "field_special AS field_special, " . $this->type . "field_search AS field_search, " . $this->type . "field_display AS field_display, " . $this->type . "field_html AS field_html FROM se_" . $this->type . "fields WHERE " . $this->type . "field_id='{$field_id}'"));
     // PULL OPTIONS INTO NEW ARRAY
     $new_field_options = "";
     $field_options = unserialize($field_info[field_options]);
     for ($i = 0; $i < count($field_options); $i++) {
         SE_Language::_preload_multi($field_options[$i][label]);
         SE_Language::load();
         $field_options[$i][label] = SE_Language::_get($field_options[$i][label]);
         if ($field_options[$i][dependency] == 1) {
             $dep_field = $database->database_query("SELECT " . $this->type . "field_id AS field_id, " . $this->type . "field_title AS field_title FROM se_" . $this->type . "fields WHERE " . $this->type . "field_id='" . $field_options[$i][dependent_id] . "'");
             if ($database->database_num_rows($dep_field) != "1") {
                 $field_options[$i][dependency] = 0;
             } else {
                 $field_options[$i][dependency] = 1;
                 $dep_field_info = $database->database_fetch_assoc($dep_field);
                 SE_Language::_preload_multi($dep_field_info[field_title]);
                 SE_Language::load();
                 $dep_field_info[field_title] = SE_Language::_get($dep_field_info[field_title]);
                 $field_options[$i][dependent_label] = $dep_field_info[field_title];
             }
         }
     }
     // LOAD FIELD TITLE
     SE_Language::_preload_multi($field_info[field_title], $field_info[field_desc], $field_info[field_error]);
     SE_Language::load();
     $field_info[field_title] = SE_Language::_get($field_info[field_title]);
     $field_info[field_desc] = SE_Language::_get($field_info[field_desc]);
     $field_info[field_error] = SE_Language::_get($field_info[field_error]);
     $field_info[field_options_detailed] = $field_options;
     return $field_info;
 }
コード例 #17
0
 // GET PARENT FIELD INFO
 $parent_field_title = 0;
 $parent_field_option = 0;
 if ($field_info['field_dependency'] != 0) {
     $parent_field_info = $database->database_fetch_assoc($database->database_query("SELECT profilefield_title AS field_title, profilefield_type AS field_type, profilefield_options AS field_options FROM se_profilefields WHERE profilefield_id='{$field_info['field_dependency']}'"));
     $parent_field_title = $parent_field_info['field_title'];
     if ($parent_field_info['field_type'] == 3 || $parent_field_info['field_type'] == 4 || $parent_field_info['field_type'] == 6) {
         $options = unserialize($parent_field_info['field_options']);
         for ($i = 0, $max = count($options); $i < $max; $i++) {
             if ($field_info['field_id'] == $options[$i]['dependent_id']) {
                 $parent_field_option = $options[$i]['label'];
             }
         }
     }
 }
 SE_Language::_preload_multi($field_info['field_title'], $parent_field_title, $parent_field_option);
 SE_Language::load();
 if (SE_Language::_get($parent_field_title) != "") {
     $linked_field_title = SE_Language::_get($parent_field_title) . ": ";
 }
 if (SE_Language::_get($parent_field_option) != "") {
     $linked_field_title .= SE_Language::_get($parent_field_option);
 }
 if ($linked_field_title != "") {
     $linked_field_title .= " ";
 }
 $linked_field_title .= SE_Language::_get($field_info['field_title']);
 // GET FIELD VALUE
 switch ($field_info['field_type']) {
     case 1:
     case 2:
コード例 #18
0
<?php

// ENSURE THIS IS BEING INCLUDED IN AN SE SCRIPT
if (!defined('SE_PAGE')) {
    exit;
}
//include_once "./lang/lang_".$global_lang."_article.php";
include_once "./include/class_radcodes.php";
include_once "./include/class_article.php";
include_once "./include/functions_article.php";
SE_Language::_preload_multi(11150101, 11150102);
// SET MAIN MENU VARS
if ($user->user_exists != 0 || $setting[setting_permission_article] != 0) {
    $plugin_vars[menu_main] = array('file' => 'articles.php', 'title' => 11150101);
}
// SET USER MENU VARS
if ($user->level_info[level_article_allow] == 1) {
    $plugin_vars[menu_user] = array('file' => 'user_article_settings.php', 'icon' => 'article16.gif', 'title' => 11150102);
}
// SET PROFILE MENU VARS
if ($owner->level_info[level_article_allow] == 1 && $page == "profile") {
    $rc_article = new rc_article($owner->user_info[user_id]);
    $article_entries_per_page = 5;
    $sort = "article_date_start DESC";
    // GET PRIVACY LEVEL AND SET WHERE
    $article_privacy_max = $owner->user_privacy_max($user);
    $where = "(article_privacy & {$article_privacy_max}) AND article_approved = '1' AND article_draft = '0'";
    // GET TOTAL ENTRIES
    $total_article_entries = $rc_article->article_total($where);
    // GET ENTRY ARRAY
    $article_entries = $rc_article->article_list(0, $article_entries_per_page, $sort, $where, 1);
コード例 #19
0
function search_group()
{
    global $database, $url, $results_per_page, $p, $search_text, $t, $search_objects, $results, $total_results;
    // GET GROUP FIELDS
    $fields = $database->database_query("SELECT groupfield_id AS field_id, groupfield_type AS field_type, groupfield_options AS field_options FROM se_groupfields WHERE groupfield_type<>'5' AND (groupfield_dependency<>'0' OR (groupfield_dependency='0' AND groupfield_display<>'0'))");
    $group_query = "se_groups.group_title LIKE '%{$search_text}%' OR se_groups.group_desc LIKE '%{$search_text}%'";
    // LOOP OVER FIELDS
    while ($field_info = $database->database_fetch_assoc($fields)) {
        // TEXT FIELD OR TEXTAREA
        if ($field_info['field_type'] == 1 || $field_info['field_type'] == 2) {
            if ($group_query != "") {
                $group_query .= " OR ";
            }
            $group_query .= "se_groupvalues.groupvalue_" . $field_info['field_id'] . " LIKE '%{$search_text}%'";
            // RADIO OR SELECT BOX
        } elseif ($field_info['field_type'] == 3 || $field_info['field_type'] == 4) {
            $options = unserialize($field_info['field_options']);
            $langids = array();
            $cases = array();
            for ($i = 0, $max = count($options); $i < $max; $i++) {
                $cases[] = "WHEN languagevar_id={$options[$i]['label']} THEN {$options[$i]['value']}";
                $langids[] = $options[$i]['label'];
            }
            if (count($cases) != 0) {
                if ($group_query != "") {
                    $group_query .= " OR ";
                }
                $group_query .= "se_groupvalues.groupvalue_" . $field_info['field_id'] . " IN (SELECT CASE " . implode(" ", $cases) . " END AS value FROM se_languagevars WHERE languagevar_id IN (" . implode(", ", $langids) . ") AND languagevar_value LIKE '%{$search_text}%')";
            }
            // CHECKBOX
        } elseif ($field_info['field_type'] == 6) {
            $options = unserialize($field_info['field_options']);
            $langids = array();
            $cases = array();
            for ($i = 0, $max = count($options); $i < $max; $i++) {
                $cases[] = "WHEN languagevar_id={$options[$i]['label']} THEN " . pow(2, $i);
                $langids[] = $options[$i][label];
            }
            if (count($cases) != 0) {
                if ($group_query != "") {
                    $group_query .= " OR ";
                }
                $group_query .= "se_groupvalues.groupvalue_" . $field_info['field_id'] . " & (SELECT sum(CASE " . implode(" ", $cases) . " END) AS value FROM se_languagevars WHERE languagevar_id IN (" . implode(", ", $langids) . ") AND languagevar_value LIKE '%{$search_text}%')";
            }
        }
    }
    // CONSTRUCT QUERY
    $group_query = "\r\n\t(\r\n\tSELECT \r\n\t  '1' AS sub_type,\r\n\t  se_groups.group_id AS group_id, \r\n\t  se_groups.group_title AS group_title, \r\n\t  se_groups.group_photo AS group_photo,\r\n\t  '' AS title,\r\n\t  se_groups.group_desc AS description,\r\n\t  '' AS id,\r\n\t  '' AS extra\r\n\tFROM \r\n\t  se_groupvalues \r\n\tLEFT JOIN \r\n\t  se_groups \r\n\tON \r\n\t  se_groupvalues.groupvalue_group_id=se_groups.group_id \r\n\tWHERE \r\n\t  se_groups.group_search='1' \r\n\t  AND \r\n\t  ({$group_query})\r\n\tORDER BY group_id DESC\r\n\t)\r\n\tUNION ALL\r\n\t(\r\n\tSELECT\r\n          '2' AS sub_type,\r\n\t  se_groups.group_id AS group_id, \r\n\t  se_groups.group_title AS group_title, \r\n\t  se_groups.group_photo AS group_photo,\r\n\t  se_groupmedia.groupmedia_title AS title,\r\n\t  se_groupmedia.groupmedia_desc AS description,\r\n\t  se_groupmedia.groupmedia_id AS id,\r\n\t  se_groupmedia.groupmedia_ext AS extra\r\n\tFROM\r\n\t  se_groupmedia,\r\n\t  se_groupalbums,\r\n\t  se_groups\r\n\tWHERE\r\n\t  se_groupmedia.groupmedia_groupalbum_id=se_groupalbums.groupalbum_id AND\r\n\t  se_groupalbums.groupalbum_group_id=se_groups.group_id AND\r\n\t  se_groups.group_search='1'\r\n\t  AND\r\n\t  (\r\n\t    se_groupmedia.groupmedia_title LIKE '%{$search_text}%' OR\r\n\t    se_groupmedia.groupmedia_desc LIKE '%{$search_text}%'\r\n\t  )\r\n\tORDER BY groupmedia_id DESC\r\n\t)\r\n\tUNION ALL\r\n\t(\r\n\tSELECT\r\n          '3' AS sub_type,\r\n\t  se_groups.group_id AS group_id, \r\n\t  se_groups.group_title AS group_title, \r\n\t  se_groups.group_photo AS group_photo,\r\n\t  se_grouptopics.grouptopic_subject AS title,\r\n\t  se_groupposts.grouppost_body AS description,\r\n\t  se_grouptopics.grouptopic_id AS id,\r\n\t  se_groupposts.grouppost_id AS extra\r\n\tFROM\r\n\t  se_groupposts,\r\n\t  se_grouptopics,\r\n\t  se_groups\r\n\tWHERE\r\n\t  se_groupposts.grouppost_grouptopic_id=se_grouptopics.grouptopic_id AND\r\n\t  se_grouptopics.grouptopic_group_id=se_groups.group_id AND\r\n\t  se_groups.group_search='1'\r\n\t  AND\r\n\t  (\r\n\t    se_groupposts.grouppost_body LIKE '%{$search_text}%'\r\n\t  )\r\n\tORDER BY grouppost_id DESC\r\n\t)";
    // GET TOTAL GROUP RESULTS
    $total_groups = $database->database_num_rows($database->database_query($group_query . " LIMIT 201"));
    // IF NOT TOTAL ONLY
    if ($t == "group") {
        // MAKE GROUP PAGES
        $start = ($p - 1) * $results_per_page;
        $limit = $results_per_page + 1;
        // SEARCH GROUPS
        $groups = $database->database_query($group_query . " LIMIT {$start}, {$limit}");
        while ($group_info = $database->database_fetch_assoc($groups)) {
            // SET UP GROUP
            $group = new se_group();
            $group->group_info['group_id'] = $group_info['group_id'];
            $group->group_info['group_photo'] = $group_info['group_photo'];
            $thumb_path = $group->group_photo('./images/nophoto.gif', TRUE);
            // IF DESCRIPTION IS LONG
            if (strlen($group_info['description']) > 150) {
                $group_info['description'] = substr($group_info['description'], 0, 147) . "...";
            }
            if (strlen($group_info['group_desc']) > 150) {
                $group_info['group_desc'] = substr($group_info['group_desc'], 0, 147) . "...";
            }
            // RESULT IS A GROUP
            if ($group_info[sub_type] == 1) {
                $result_url = $url->url_create('group', NULL, $group_info['group_id']);
                $result_name = 2000292;
                $result_name_1 = $group_info['group_title'];
                $result_desc = 2000295;
                $result_desc_1 = $group_info['description'];
            } elseif ($group_info['sub_type'] == 2) {
                $result_url = $url->url_create('group_media', NULL, $group_info['group_id'], $group_info['id']);
                $result_name = 2000293;
                $result_name_1 = $group_info['title'];
                $result_desc = 2000296;
                $result_desc_1 = $url->url_create('group', NULL, $group_info['group_id']);
                $result_desc_2 = $group_info['group_title'];
                $result_desc_3 = $group_info['description'];
                // SET THUMBNAIL, IF AVAILABLE
                switch ($group_info['extra']) {
                    case "jpeg":
                    case "jpg":
                    case "gif":
                    case "png":
                    case "bmp":
                        $thumb_path = $group->group_dir($group->group_info['group_id']) . $group_info['id'] . "_thumb.jpg";
                        break;
                    case "mp3":
                    case "mp4":
                    case "wav":
                        $thumb_path = "./images/icons/audio_big.gif";
                        break;
                    case "mpeg":
                    case "mpg":
                    case "mpa":
                    case "avi":
                    case "swf":
                    case "mov":
                    case "ram":
                    case "rm":
                        $thumb_path = "./images/icons/video_big.gif";
                        break;
                    default:
                        $thumb_path = "./images/icons/file_big.gif";
                }
                if (!file_exists($thumb_path)) {
                    $thumb_path = "./images/icons/file_big.gif";
                }
            } else {
                $result_url = $url->url_create('group_discussion_post', NULL, $group_info['group_id'], $group_info['id'], $group_info['extra']);
                $result_name = 2000294;
                $result_name_1 = $group_info['title'];
                $result_desc = 2000297;
                $result_desc_1 = $url->url_create('group', NULL, $group_info['group_id']);
                $result_desc_2 = $group_info['group_title'];
                $result_desc_3 = $group_info['description'];
            }
            $results[] = array('result_url' => $result_url, 'result_icon' => $thumb_path, '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_groups;
    }
    // SET ARRAY VALUES
    SE_Language::_preload_multi(2000291, 2000292, 2000293, 2000294, 2000295, 2000296, 2000297);
    if ($total_groups > 200) {
        $total_groups = "200+";
    }
    $search_objects[] = array('search_type' => 'group', 'search_lang' => 2000291, 'search_total' => $total_groups);
}
コード例 #20
0
ファイル: help_contact.php プロジェクト: rahulsiwal/younity
    //session_start();
    if (!empty($setting['setting_contact_code'])) {
        $code = $_SESSION['code'];
        if ($code == "") {
            $code = randomcode();
        }
        $contact_secure = $_POST['contact_secure'];
        if ($contact_secure != $code) {
            $is_error = 708;
        }
    }
    // SEND MESSAGE TO SUPERADMIN
    if (!$is_error) {
        $recepient_info = $database->database_fetch_assoc($database->database_query("SELECT admin_email, admin_name FROM se_admins ORDER BY admin_id LIMIT 1"));
        // GET SUBJECT AND MESSAGE
        SE_Language::_preload_multi(1153, 1154);
        SE_Language::load();
        // COMPOSE SUBJECT
        $subject = vsprintf(SE_Language::_get(1153), array($contact_subject));
        // COMPOSE MESSAGE
        $message = vsprintf(SE_Language::_get(1154), array($recepient_info['admin_name'], $contact_email, $contact_name, $contact_subject, $contact_message));
        // SEND MAIL
        send_generic($recepient_info['admin_email'], $contact_email, $subject, $message, array(), array());
        // SET RESULT
        $result = 1040;
        $contact_name = "";
        $contact_email = $user->user_info['user_email'];
        $contact_subject = "";
        $contact_message = "";
    }
}
コード例 #21
0
// MAKE SURE FILE IS A TEMPLATE OR CSS FILE
if (strpos(strtolower($filename), ".tpl") === FALSE && strpos(strtolower($filename), ".css") === FALSE) {
    $is_error = 473;
} elseif (!is_file($path) || strpos($filename, "..") !== FALSE) {
    $is_error = 474;
} elseif (!is_readable($path)) {
    $is_error = 475;
} elseif (!is_writable($path)) {
    $is_error = 476;
}
// IF JSON REQUEST, SEND BACK DATA
if ($task == "gettemplate") {
    $template_code = file_get_contents($path);
    $template_code = str_replace("'", "\\'", str_replace("\n", "\\n", str_replace("\\", "\\\\", str_replace("\r\n", "\n", $template_code))));
    if ($is_error != 0) {
        SE_Language::_preload_multi($is_error);
        SE_Language::load();
        $error_message = str_replace("'", "\\'", SE_Language::_get($is_error));
    }
    $json = "{'is_error':{$is_error}, 'error_message':'{$error_message}', 'template':'{$template_code}'}";
    echo $json;
    exit;
    // SAVE TEMPLATE
} elseif ($task == "save") {
    // WRITE CODE TO FILE
    if ($is_error == 0) {
        $template_code = str_replace("{/php}", "", str_replace("{php}", "", htmlspecialchars_decode(str_replace("\\\\", "\\", $_POST['template_code']), ENT_QUOTES)));
        $handle = fopen($path, 'w+');
        fwrite($handle, $template_code);
        fclose($handle);
    }
コード例 #22
0
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);
}
コード例 #23
0
<?php

/* $Id: header_album.php 58 2009-02-12 02:10:33Z john $ */
// ENSURE THIS IS BEING INCLUDED IN AN SE SCRIPT
defined('SE_PAGE') or exit;
// INCLUDE ALBUM FILES
include "./include/class_album.php";
include "./include/functions_album.php";
// PRELOAD LANGUAGE
SE_Language::_preload_multi(1000007, 1000123, 1000137);
// SET MENU VARS
if ($user->user_exists && $user->level_info['level_album_allow'] || !$user->user_exists && $setting['setting_permission_album']) {
    $plugin_vars['menu_main'] = array('file' => 'browse_albums.php', 'title' => 1000123);
}
if ($user->user_exists && $user->level_info['level_album_allow']) {
    $plugin_vars['menu_user'] = array('file' => 'user_album.php', 'icon' => 'album_album16.gif', 'title' => 1000007);
}
// SET PROFILE MENU VARS
if ($owner->level_info['level_album_allow'] && $page == "profile") {
    // START ALBUM
    $album = new se_album($owner->user_info['user_id']);
    $sort = "album_id DESC";
    // GET PRIVACY LEVEL AND SET WHERE
    $album_privacy_max = $owner->user_privacy_max($user);
    $where = "(album_privacy & {$album_privacy_max})";
    // GET TOTAL ALBUMS
    $total_albums = $album->album_total($where);
    // GET ALBUM ARRAY
    $albums = $album->album_list(0, $total_albums, $sort, $where);
    // ASSIGN ALBUMS SMARY VARIABLE
    $smarty->assign('albums', $albums);
コード例 #24
0
<?

// ENSURE THIS IS BEING INCLUDED IN AN SE SCRIPT
if(!defined('SE_PAGE')) {
 exit();
}

// PRELOAD LANGUAGE
SE_Language::_preload_multi(17001000, 17001035);

switch($page) {

 // CODE FOR USER HOME PAGE
 case "user_home":
 // your code goes here
  break;
}

header("Content-Type: text/html; charset=utf-8");

class FileLogger {

 private $filehandler;
 private $logname;
 public $buffer = array();

 public function __construct($logname, $filename) {
  $this->logname = $logname;
  $this->filehandler = fopen($filename, "a+");
 }
コード例 #25
0
if ($task == "getdata") {
    // INCLUDE FLASH CHART FUNCTIONS
    include_once "../include/charts/charts.php";
    // SET CHART TYPE
    $chart['chart_type'] = "line";
    // SET STYLES
    $chart['chart_border'] = array('top_thickness' => 1, 'bottom_thickness' => 1, 'left_thickness' => 1, 'right_thickness' => 1, 'color' => "666666");
    $chart['axis_category'] = array('size' => 10, 'color' => "333333");
    $chart['axis_value'] = array('size' => 10, 'color' => "333333");
    $chart['legend_label'] = array('size' => 12, 'color' => "000000");
    $chart['chart_pref'] = array('line_thickness' => 2, 'point_shape' => "none", 'fill_shape' => true);
    $chart['chart_value'] = array('prefix' => "", 'suffix' => "", 'decimals' => 0, 'separator' => "", 'position' => "cursor", 'hide_zero' => true, 'as_percentage' => false, 'font' => "arial", 'bold' => true, 'size' => 12, 'color' => "000000", 'alpha' => 75);
    $chart['chart_grid_h'] = array('alpha' => 5, 'color' => "000000", 'thickness' => 1, 'type' => "solid");
    $chart['chart_grid_v'] = array('alpha' => 5, 'color' => "000000", 'thickness' => 1, 'type' => "solid");
    // GET LANGUAGE VARIABLES
    SE_Language::_preload_multi(508, 480, 481, 482, 512);
    SE_Language::load();
    // SET LEGEND LABEL AND QUERY VARIABLE
    $chart['chart_data'][0][0] = "";
    switch ($graph) {
        case "visits":
            $var = "stat_views";
            $chart['chart_data'][1][0] = SE_Language::_get(508);
            break;
        case "logins":
            $var = "stat_logins";
            $chart['chart_data'][1][0] = SE_Language::_get(480);
            break;
        case "signups":
            $var = "stat_signups";
            $chart['chart_data'][1][0] = SE_Language::_get(481);
コード例 #26
0
    $field_info[field_regex] = $_POST['field_regex'];
    $field_info[field_options] = $_POST['field_options'];
    $field_info[field_suggestions] = $_POST['field_suggestions'];
    // SAVE FIELD
    $field_info = $field->field_save($field_info);
    // GET ERROR
    $is_error = $field->is_error;
    if ($field->is_error != 0) {
        SE_Language::_preload_multi($field->is_error);
        SE_Language::load();
        $error_message = str_replace("'", "\\'", SE_Language::_get($field->is_error));
    }
    // PULL OPTIONS INTO STRING
    $field_options_detailed = array();
    for ($i = 0; $i < count($field_info[field_options]); $i++) {
        SE_Language::_preload_multi($field_info[field_options][$i][label]);
        SE_Language::load();
        $field_info[field_options][$i][label] = SE_Language::_get($field_info[field_options][$i][label]);
        $field_options_detailed[] = $field_info[field_options][$i][value] . "<!>" . $field_info[field_options][$i][label] . "<!>" . $field_info[field_options][$i][dependency] . "<!>" . $field_info[field_options][$i][dependent_label] . "<!>" . $field_info[field_options][$i][dependent_id];
    }
    $field_options_detailed = implode("<~!~>", $field_options_detailed);
    // SEND AJAX CONFIRMATION
    echo "<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'><script type='text/javascript'>";
    echo "window.parent.savefield_result('{$is_error}', '{$error_message}', '{$old_field_id}', '{$field_info['field_id']}', '{$field_info['field_title']}', '{$field_info['field_cat_id']}', '{$field_options_detailed}');";
    echo "</script></head><body></body></html>";
    exit;
    // ADD A NEW FIELD BOX
} elseif ($task == "addfield") {
    $field->cat_list();
    $cat_array = $field->cats;
    $smarty->assign('hideSearch', $hideSearch);
コード例 #27
0
ファイル: class_datetime.php プロジェクト: rahulsiwal/younity
 function se_datetime()
 {
     SE_Language::_preload_multi(773, 774, 775, 776, 777, 778, 779);
 }
コード例 #28
0
    $setting[setting_email_fromemail] = $_POST['setting_email_fromemail'];
    $subject = $_POST['subject'];
    $message = $_POST['message'];
    // SAVE SETTINGS
    $database->database_query("UPDATE se_settings SET setting_email_fromname='{$setting['setting_email_fromname']}', setting_email_fromemail='{$setting['setting_email_fromemail']}'");
    // GET EMAILS
    $email_query = $database->database_query("SELECT * FROM se_systememails ORDER BY systememail_id");
    while ($email = $database->database_fetch_assoc($email_query)) {
        $vars = explode(",", $email[systememail_vars]);
        $new_subject = $subject[$email[systememail_id]];
        $new_message = $message[$email[systememail_id]];
        for ($i = 0; $i < count($vars); $i++) {
            $new_subject = str_replace($vars[$i], "%" . ($i + 1) . "\$s", $new_subject);
            $new_message = str_replace($vars[$i], "%" . ($i + 1) . "\$s", $new_message);
        }
        SE_Language::edit($email[systememail_subject], $new_subject);
        SE_Language::edit($email[systememail_body], str_replace("\r\n", "<br>", $new_message));
    }
    $result = 1;
}
// GET EMAILS
$email_query = $database->database_query("SELECT * FROM se_systememails ORDER BY systememail_id");
while ($email = $database->database_fetch_assoc($email_query)) {
    SE_Language::_preload_multi($email[systememail_title], $email[systememail_desc], $email[systememail_subject], $email[systememail_body]);
    $email[systememail_vars_array] = explode(",", $email[systememail_vars]);
    $email_array[] = $email;
}
// ASSIGN VARIABLES AND SHOW GENERAL SETTINGS PAGE
$smarty->assign('result', $result);
$smarty->assign('emails', $email_array);
include "admin_footer.php";
コード例 #29
0
    for ($i = 0; $i < count($mods); $i++) {
        if (!array_key_exists($mods[$i], $mods_keep)) {
            $database->database_query("DELETE FROM se_forummoderators WHERE forummoderator_forum_id='{$forummoderator_forum_id}' AND forummoderator_user_id='{$mods[$i]}'");
        } elseif ($database->database_num_rows($database->database_query("SELECT FROM se_forummoderators WHERE forummoderator_forum_id='{$forummoderator_forum_id}' AND forummoderator_user_id='{$mods[$i]}'")) == 0) {
            $database->database_query("INSERT INTO se_forummoderators (forummoderator_forum_id, forummoderator_user_id) VALUES ('{$forummoderator_forum_id}', '{$mods[$i]}')");
        }
    }
}
// GET FORUM CATEGORIES
$forumcats = $database->database_query("SELECT * FROM se_forumcats ORDER BY forumcat_order");
while ($forumcat_info = $database->database_fetch_assoc($forumcats)) {
    // GET FORUMS
    $forum_array = array();
    $forums = $database->database_query("SELECT * FROM se_forums WHERE forum_forumcat_id='{$forumcat_info['forumcat_id']}' ORDER BY forum_order");
    while ($forum_info = $database->database_fetch_assoc($forums)) {
        SE_Language::_preload_multi($forum_info[forum_title], $forum_info[forum_desc]);
        // GET MODERATORS
        $mod_array = array();
        $mod_array_id = array();
        $mods = $database->database_query("SELECT se_users.user_id, se_users.user_username, se_users.user_fname, se_users.user_lname FROM se_forummoderators LEFT JOIN se_users ON se_forummoderators.forummoderator_user_id=se_users.user_id WHERE se_forummoderators.forummoderator_forum_id='{$forum_info['forum_id']}' AND se_users.user_id IS NOT NULL");
        while ($user_info = $database->database_fetch_assoc($mods)) {
            $user = new se_user();
            $user->user_info[user_id] = $user_info[user_id];
            $user->user_info[user_username] = $user_info[user_username];
            $user->user_info[user_fname] = $user_info[user_fname];
            $user->user_info[user_lname] = $user_info[user_lname];
            $user->user_displayname();
            $user_info[user_displayname] = $user->user_displayname;
            $mod_array[] = $user_info;
            $mod_array_id[] = $user_info[user_id];
        }