Esempio n. 1
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";
Esempio n. 2
0
        $subnet_field1_value = $datetime->MakeTime("0", "0", "0", "{$subnet_field1_month}", "{$subnet_field1_day}", "{$subnet_field1_year}");
    }
    // FIELD 2 IS A DATE
    if ($subnet_field2_value == "" && $subnet_field2_month != "" && $subnet_field2_day != "" && $subnet_field2_year != "") {
        $subnet_field2_value = $datetime->MakeTime("0", "0", "0", "{$subnet_field2_month}", "{$subnet_field2_day}", "{$subnet_field2_year}");
    }
    // FIELD 2 IS NOT FULLY FILLED OUT
    if ($subnet_field2_qual != "" && $subnet_field2_value == "" || $subnet_field2_qual == "" && $subnet_field2_value != "") {
        $subnet_field2_qual = "";
        $subnet_field2_value = "";
    }
    // EDIT SUBNETWORK IF NO ERRORS
    $subnet = $database->database_query("SELECT subnet_name FROM se_subnets WHERE subnet_id='{$subnet_id}'");
    if ($subnet_name != "" && $subnet_field1_qual != "" && $subnet_field1_value != "" && $database->database_num_rows($subnet) == 1) {
        $subnet_info = $database->database_fetch_assoc($subnet);
        SE_Language::edit($subnet_info[subnet_name], $subnet_name);
        $database->database_query("UPDATE se_subnets SET subnet_field1_qual='{$subnet_field1_qual}', subnet_field1_value='{$subnet_field1_value}', subnet_field2_qual='{$subnet_field2_qual}', subnet_field2_value='{$subnet_field2_value}' WHERE subnet_id='{$subnet_id}'");
    }
    // Flush cached stuff
    $cache_object = SECache::getInstance();
    if (is_object($cache_object)) {
        $cache_object->remove('site_subnetworks_' . $subnet_id);
    }
} elseif ($task == "delete") {
    $subnet_id = $_GET['subnet_id'];
    // DELETE SUBNETWORK AND MOVE ALL USERS TO DEFAULT SUBNETWORK
    if ($database->database_num_rows($database->database_query("SELECT subnet_id FROM se_subnets WHERE subnet_id='{$subnet_id}'")) == 1) {
        $database->database_query("DELETE FROM se_subnets, se_languagevars USING se_subnets JOIN se_languagevars ON se_subnets.subnet_name=se_languagevars.languagevar_id WHERE subnet_id='{$subnet_id}'");
        $database->database_query("UPDATE se_users SET user_subnet_id='0' WHERE user_subnet_id='{$subnet_id}'");
        $result = 638;
    }
Esempio n. 3
0
    $setting[setting_signup_invite_numgiven] = $_POST['setting_signup_invite_numgiven'];
    $setting[setting_signup_invitepage] = $_POST['setting_signup_invitepage'];
    $setting[setting_signup_verify] = $_POST['setting_signup_verify'];
    $setting[setting_signup_code] = $_POST['setting_signup_code'];
    $setting[setting_signup_randpass] = $_POST['setting_signup_randpass'];
    $setting[setting_signup_tos] = $_POST['setting_signup_tos'];
    $setting[setting_signup_tostext] = $_POST['setting_signup_tostext'];
    $field_signup = $_POST['field_signup'];
    if (is_array($field_signup)) {
        $database->database_query("UPDATE se_profilefields SET profilefield_signup='1' WHERE profilefield_id IN('" . join("', '", $field_signup) . "')");
        $database->database_query("UPDATE se_profilefields SET profilefield_signup='0' WHERE profilefield_id NOT IN('" . join("', '", $field_signup) . "')");
    }
    $cat_signup = $_POST['cat_signup'];
    if (is_array($cat_signup)) {
        $database->database_query("UPDATE se_profilecats SET profilecat_signup='1' WHERE profilecat_id IN('" . join("', '", $cat_signup) . "')");
        $database->database_query("UPDATE se_profilecats SET profilecat_signup='0' WHERE profilecat_id NOT IN('" . join("', '", $cat_signup) . "')");
    }
    // UPDATE TOS TEXT
    SE_Language::edit(1210, $setting[setting_signup_tostext]);
    // UPDATE SETTINGS
    $database->database_query("UPDATE se_settings SET \r\n\t\t\tsetting_signup_photo='{$setting['setting_signup_photo']}',\r\n\t\t\tsetting_signup_enable='{$setting['setting_signup_enable']}',\r\n\t\t\tsetting_signup_welcome='{$setting['setting_signup_welcome']}',\r\n\t\t\tsetting_signup_invite='{$setting['setting_signup_invite']}',\r\n\t\t\tsetting_signup_invite_checkemail='{$setting['setting_signup_invite_checkemail']}',\r\n\t\t\tsetting_signup_invite_numgiven='{$setting['setting_signup_invite_numgiven']}',\r\n\t\t\tsetting_signup_invitepage='{$setting['setting_signup_invitepage']}',\r\n\t\t\tsetting_signup_verify='{$setting['setting_signup_verify']}',\r\n\t\t\tsetting_signup_code='{$setting['setting_signup_code']}',\r\n\t\t\tsetting_signup_randpass='******'setting_signup_randpass']}',\r\n\t\t\tsetting_signup_tos='{$setting['setting_signup_tos']}'");
    $result = 1;
}
// GET TABS AND FIELDS
$field = new se_field("profile");
$field->cat_list();
$cat_array = $field->cats;
// ASSIGN VARIABLES AND SHOW ADMIN SIGNUP PAGE
$smarty->assign('result', $result);
$smarty->assign('cats', $cat_array);
include "admin_footer.php";
Esempio n. 4
0
    $database->database_query("DELETE FROM se_forumlevels USING se_forumlevels LEFT JOIN se_levels ON se_forumlevels.forumlevel_level_id=se_levels.level_id WHERE se_levels.level_id IS NULL AND se_forumlevels.forumlevel_level_id<>0");
    // EDIT FORUM
} elseif ($task == "editforum") {
    $forum_id = $_POST['forum_id'];
    $forumcat_id = $_POST['forumcat_id'];
    $forum_title = $_POST['forum_title'];
    $forum_desc = $_POST['forum_desc'];
    $view_levels = $_POST['view_levels'];
    $view_levels = !empty($view_levels) ? is_string($view_levels) ? explode(",", $view_levels) : (array) $view_levels : NULL;
    $post_levels = $_POST['post_levels'];
    $post_levels = !empty($post_levels) ? is_string($post_levels) ? explode(",", $post_levels) : (array) $post_levels : NULL;
    $forum = $database->database_query("SELECT * FROM se_forums WHERE forum_id='{$forum_id}'");
    if ($database->database_num_rows($forum) == 1) {
        $forum_info = $database->database_fetch_assoc($forum);
        SE_Language::edit($forum_info[forum_title], $forum_title);
        SE_Language::edit($forum_info[forum_desc], $forum_desc);
        $database->database_query("UPDATE se_forums SET forum_forumcat_id='{$forumcat_id}' WHERE forum_id='{$forum_id}'");
        $database->database_query("DELETE FROM se_forumlevels WHERE forumlevel_forum_id='{$forum_id}'");
        if ($view_levels != NULL) {
            for ($i = 0; $i < count($view_levels); $i++) {
                if (in_array($view_levels[$i], $post_levels)) {
                    $canpost = 1;
                } else {
                    $canpost = 0;
                }
                $database->database_query("INSERT INTO se_forumlevels (forumlevel_forum_id, forumlevel_level_id, forumlevel_post) VALUES ('{$forum_id}', '{$view_levels[$i]}', '{$canpost}')");
            }
        }
    }
    // DELETE UNNECESSARY DATA IN FORUMLEVELS TABLE
    $database->database_query("DELETE FROM se_forumlevels USING se_forumlevels LEFT JOIN se_levels ON se_forumlevels.forumlevel_level_id=se_levels.level_id WHERE se_levels.level_id IS NULL AND se_forumlevels.forumlevel_level_id<>0");
if ($task == "getphrase") {
    $langvar_query = $database->database_query("SELECT * FROM se_languagevars WHERE languagevar_id='{$languagevar_id}'");
    while ($langvar_info = $database->database_fetch_assoc($langvar_query)) {
        if ($json != "") {
            $json .= ", ";
        }
        $json .= "{'{$langvar_info['languagevar_language_id']}':'" . str_replace("\\", "\\\\", htmlspecialchars(str_replace("\n", "<br>", str_replace("\r\n", "<br>", $langvar_info[languagevar_value])), ENT_QUOTES)) . "'}";
    }
    $json = "{'phrases':[" . $json . "]}";
    echo $json;
    exit;
    // ELSE TASK IS TO SAVE LANGUAGE VARIABLES
} elseif ($task == "edit") {
    $languagevar_value = $_POST['languagevar_value'];
    while (list($lang_id, $value) = each($languagevar_value)) {
        SE_Language::edit($languagevar_id, htmlspecialchars_decode($value, ENT_QUOTES), $lang_id);
    }
    // RUN JAVASCRIPT TO UPDATE MAIN PAGE
    echo "<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'><script type='text/javascript'>";
    echo "window.parent.edit_result('{$languagevar_id}', '" . str_replace("'", "\\'", str_replace("\n", "", str_replace("\r\n", "", htmlspecialchars_decode($languagevar_value[$language_id], ENT_QUOTES)))) . "');";
    echo "</script></head><body></body></html>";
    exit;
}
// VALIDATE LANGUAGE
$lang_query = $database->database_query("SELECT * FROM se_languages WHERE language_id='{$language_id}'");
if ($database->database_num_rows($lang_query) != 1) {
    header("Location: admin_language.php");
    exit;
}
$language = $database->database_fetch_assoc($lang_query);
$var_query = "SELECT se_languagevars.*, \r\n\t\tCASE\r\n\t\t  WHEN (languagevar_id <= 500000)\r\n\t\t    THEN 'Normal Variable'\r\n\t\t  WHEN (500000 < languagevar_id AND languagevar_id <= 600000)\r\n\t\t    THEN 'Profile Fields/Tabs'\r\n\t\t  WHEN (600000 < languagevar_id AND languagevar_id <= 633000)\r\n\t\t    THEN 'Friendship Types'\r\n\t\t  WHEN (633000 < languagevar_id AND languagevar_id <= 666000)\r\n\t\t    THEN 'User Levels'\r\n\t\t  WHEN (666000 < languagevar_id AND languagevar_id <= 700000)\r\n\t\t    THEN 'Subnetworks'\r\n\t\t  WHEN (700000 < languagevar_id AND languagevar_id <= 750000)\r\n\t\t    THEN 'Recent Actions'\r\n\t\t  WHEN (750000 < languagevar_id AND languagevar_id <= 800000)\r\n\t\t    THEN 'Notifications'\r\n\t\t  WHEN (800000 < languagevar_id AND languagevar_id <= 850000)\r\n\t\t    THEN 'FAQ Categories/Questions'\r\n\t\t  WHEN (850000 < languagevar_id AND languagevar_id <= 900000)\r\n\t\t    THEN 'System Emails'\r\n\t\t  WHEN (1000000 < languagevar_id AND languagevar_id <= 1500000)\r\n\t\t    THEN 'Album Plugin'\r\n\t\t  WHEN (1500000 < languagevar_id AND languagevar_id <= 2000000)\r\n\t\t    THEN 'Blog Plugin'\r\n\t\t  WHEN (2000000 < languagevar_id AND languagevar_id <= 2500000)\r\n\t\t    THEN 'Group Plugin'\r\n\t\t  WHEN (2500000 < languagevar_id AND languagevar_id <= 3000000)\r\n\t\t    THEN 'Poll Plugin'\r\n\t\t  WHEN (3000000 < languagevar_id AND languagevar_id <= 3500000)\r\n\t\t    THEN 'Event Plugin'\r\n\t\t  WHEN (3500000 < languagevar_id AND languagevar_id <= 4000000)\r\n\t\t    THEN 'Chat Plugin'\r\n\t\t  WHEN (4000000 < languagevar_id AND languagevar_id <= 4500000)\r\n\t\t    THEN 'Music Plugin'\r\n\t\t  WHEN (4500000 < languagevar_id AND languagevar_id <= 5000000)\r\n\t\t    THEN 'Classified Plugin'\r\n\t\t  ELSE\r\n\t\t    'Custom Variable'\r\n\t\tEND\r\n\t\tAS languagevar_category FROM se_languagevars WHERE languagevar_language_id='{$language_id}'";
Esempio n. 6
0
     } else {
         echo '{"result" : "failure"}';
     }
     exit;
 } else {
     if ($task == "editblogentrycat") {
         // Get langvar id
         $sql = "SELECT * FROM se_blogentrycats WHERE blogentrycat_id='{$blogentrycat_id}' LIMIT 1";
         $resource = $database->database_query($sql) or die($database->database_error() . " <b>SQL was: </b>{$sql}");
         if (!$database->database_num_rows($resource)) {
             echo '{"result" : "failure"}';
             exit;
         }
         $result = $database->database_fetch_assoc($resource);
         $lvar_id = $result['blogentrycat_languagevar_id'];
         SE_Language::edit($lvar_id, $blogentrycat_title);
         $sql = "UPDATE se_blogentrycats SET blogentrycat_title='{$blogentrycat_title}' WHERE blogentrycat_id='{$blogentrycat_id}' LIMIT 1";
         $resource = $database->database_query($sql) or die($database->database_error() . " <b>SQL was: </b>{$sql}");
         if ($database->database_affected_rows($resource) || $resource) {
             echo '{"result" : "success"}';
         } else {
             echo '{"result" : "failure"}';
         }
         exit;
     } elseif ($task == "dosave") {
         $setting_permission_blog = $_POST['setting_permission_blog'];
         $sql = "UPDATE se_settings SET setting_permission_blog='{$setting_permission_blog}'";
         $database->database_query($sql) or die($database->database_error() . " <b>SQL was: </b>{$sql}");
         $setting = $database->database_fetch_assoc($database->database_query("SELECT * FROM se_settings LIMIT 1"));
         $result = 1;
     }
Esempio n. 7
0
 function cat_modify($cat_id, $cat_title, $cat_dependency)
 {
     global $database;
     // NEW CATEGORY
     if ($cat_id == "new") {
         $cat_order = $database->database_fetch_assoc($database->database_query("SELECT max(" . $this->type . "cat_order) AS cat_order FROM se_" . $this->type . "cats WHERE " . $this->type . "cat_dependency='{$cat_dependency}'"));
         $cat_order = $cat_order[cat_order] + 1;
         $cat_title = SE_Language::edit(0, $cat_title, NULL, LANGUAGE_INDEX_FIELDS);
         $database->database_query("INSERT INTO se_" . $this->type . "cats (" . $this->type . "cat_dependency, " . $this->type . "cat_title, " . $this->type . "cat_order) VALUES ('{$cat_dependency}', '{$cat_title}', '{$cat_order}')");
         $newcat_id = $database->database_insert_id();
         // EDIT CATEGORY
     } else {
         $cat_info = $database->database_fetch_assoc($database->database_query("SELECT " . $this->type . "cat_title AS cat_title FROM se_" . $this->type . "cats WHERE " . $this->type . "cat_id='{$cat_id}'"));
         SE_Language::edit($cat_info[cat_title], $cat_title);
         $newcat_id = $cat_id;
     }
     return $newcat_id;
 }
Esempio n. 8
0
 function blog_category_create($category_title, $parent_category_id = NULL)
 {
     global $database, $admin, $user;
     if (!trim($category_title)) {
         return FALSE;
     }
     if (!$parent_category_id) {
         $parent_category_id = '0';
     }
     // Truncate and escape
     if (strlen($category_title) > 64) {
         $category_title = substr($category_title, 0, 64);
     }
     $user_id = $user->user_info['user_id'];
     $lvar_id = 0;
     // If admin, create language variable
     if (is_object($admin) && $admin->admin_exists) {
         $lvar_id = SE_Language::edit(0, $category_title, NULL, LANGUAGE_INDEX_SUBNETS);
         $user_id = 0;
     } elseif (!is_object($user) || !$user->user_exists || !$user->level_info['level_blog_category_create']) {
         return FALSE;
     }
     // INSERT
     $category_title = addslashes($category_title);
     $sql = "\r\n      INSERT INTO se_blogentrycats (\r\n        blogentrycat_title,\r\n        blogentrycat_user_id,\r\n        blogentrycat_languagevar_id,\r\n        blogentrycat_parentcat_id\r\n      ) VALUES (\r\n        '{$category_title}',\r\n        '{$user_id}',\r\n        '{$lvar_id}',\r\n        '{$parent_category_id}'\r\n      )\r\n    ";
     $resource = $database->database_query($sql);
     return $database->database_affected_rows($resource) ? $database->database_insert_id() : FALSE;
 }
Esempio n. 9
0
    $setting[setting_actions_actionsinlist] = $_POST['setting_actions_actionsinlist'];
    $setting[setting_actions_privacy] = $_POST['setting_actions_privacy'];
    // GET ACTION TYPES
    $current_language = SE_Language::info("language_id");
    $actiontype_text = $_POST['actiontype_text'];
    $actiontype_enabled = $_POST['actiontype_enabled'];
    $actiontype_setting = $_POST['actiontype_setting'];
    $actiontypes = $database->database_query("SELECT * FROM se_actiontypes ORDER BY actiontype_id ASC");
    while ($actiontype = $database->database_fetch_assoc($actiontypes)) {
        $text = htmlspecialchars_decode($actiontype_text[$actiontype[actiontype_id]], ENT_QUOTES);
        $database->database_query("UPDATE se_actiontypes SET actiontype_enabled='" . $actiontype_enabled[$actiontype[actiontype_id]] . "', actiontype_setting='" . $actiontype_setting[$actiontype[actiontype_id]] . "' WHERE actiontype_id='{$actiontype['actiontype_id']}'");
        $vars = explode(",", $actiontype[actiontype_vars]);
        for ($i = 0; $i < count($vars); $i++) {
            $text = str_replace($vars[$i], "%" . ($i + 1) . "\$s", $text);
        }
        SE_Language::edit($actiontype[actiontype_text], $text);
    }
    // SAVE SETTINGS
    $database->database_query("UPDATE se_settings SET setting_actions_showlength='{$setting['setting_actions_showlength']}', \r\n\t\t\t\t\t\t    setting_actions_actionsperuser='******'setting_actions_actionsperuser']}', \r\n\t\t\t\t\t\t    setting_actions_selfdelete='{$setting['setting_actions_selfdelete']}', \r\n\t\t\t\t\t\t    setting_actions_privacy='{$setting['setting_actions_privacy']}', \r\n\t\t\t\t\t\t    setting_actions_visibility='{$setting['setting_actions_visibility']}', \r\n\t\t\t\t\t\t    setting_actions_preference='{$setting['setting_actions_preference']}', \r\n\t\t\t\t\t\t    setting_actions_actionsonprofile='{$setting['setting_actions_actionsonprofile']}',\r\n\t\t\t\t\t\t    setting_actions_actionsinlist='{$setting['setting_actions_actionsinlist']}'");
    $result = 1;
}
// GET ACTION TYPES
$actiontypes = $database->database_query("SELECT * FROM se_actiontypes ORDER BY actiontype_id ASC");
$actiontype_array = array();
while ($actiontype = $database->database_fetch_assoc($actiontypes)) {
    SE_Language::_preload($actiontype[actiontype_text]);
    $actiontype_array[] = array('actiontype_id' => $actiontype[actiontype_id], 'actiontype_name' => $actiontype[actiontype_name], 'actiontype_text' => $actiontype[actiontype_text], 'actiontype_enabled' => $actiontype[actiontype_enabled], 'actiontype_setting' => $actiontype[actiontype_setting], 'actiontype_media' => $actiontype[actiontype_media], 'actiontype_vars' => implode(",", array_filter(explode(",", $actiontype[actiontype_vars]))), 'actiontype_vars_array' => explode(",", $actiontype[actiontype_vars]));
}
// ASSIGN VARIABLES AND SHOW LOG PAGE
$smarty->assign('result', $result);
$smarty->assign('actiontypes', $actiontype_array);
Esempio n. 10
0
    $faq_order = $max_order[max_order] + 1;
    $faq_subject = SE_Language::edit(0, $faq_subject, NULL, LANGUAGE_INDEX_FAQ);
    $faq_content = SE_Language::edit(0, $faq_content, NULL, LANGUAGE_INDEX_FAQ);
    $faq_datecreated = time();
    $database->database_query("INSERT INTO se_faqs (faq_faqcat_id, faq_order, faq_subject, faq_content, faq_datecreated) VALUES ('{$faqcat_id}', '{$faq_order}', '{$faq_subject}', '{$faq_content}', '{$faq_datecreated}')");
    // EDIT QUESTION
} elseif ($task == "editquestion") {
    $faq_id = $_POST['faq_id'];
    $faqcat_id = $_POST['faqcat_id'];
    $faq_subject = $_POST['faq_subject'];
    $faq_content = htmlspecialchars_decode($_POST['faq_content'], ENT_QUOTES);
    $faq = $database->database_query("SELECT * FROM se_faqs WHERE faq_id='{$faq_id}'");
    if ($database->database_num_rows($faq) == 1) {
        $faq_info = $database->database_fetch_assoc($faq);
        SE_Language::edit($faq_info[faq_subject], $faq_subject);
        SE_Language::edit($faq_info[faq_content], $faq_content);
        $faq_dateupdated = time();
        $database->database_query("UPDATE se_faqs SET faq_faqcat_id='{$faqcat_id}', faq_dateupdated='{$faq_dateupdated}' WHERE faq_id='{$faq_id}'");
    }
    // DELETE QUESTION
} elseif ($task == "deletequestion") {
    $faq_id = $_GET['faq_id'];
    $database->database_query("DELETE FROM se_languagevars, se_faqs USING se_faqs JOIN se_languagevars WHERE faq_id='{$faq_id}' AND (faq_subject=languagevar_id OR faq_content=languagevar_id)");
    // MOVE QUESTION
} elseif ($task == "movequestion") {
    $faq_id = $_GET['faq_id'];
    $faq_info = $database->database_fetch_assoc($database->database_query("SELECT faq_id, faq_order FROM se_faqs WHERE faq_id='{$faq_id}'"));
    $prev_faq = $database->database_query("SELECT faq_id, faq_order FROM se_faqs WHERE faq_order<'{$faq_info['faq_order']}' ORDER BY faq_order DESC LIMIT 1");
    if ($database->database_num_rows($prev_faq) == 1) {
        $prev_faq_info = $database->database_fetch_assoc($prev_faq);
        $database->database_query("UPDATE se_faqs SET faq_order='{$faq_info['faq_order']}' WHERE faq_id='{$prev_faq_info['faq_id']}'");