<?php if (!defined('IN_ROSTER')) { exit('Detected invalid access to this file!'); } include_once $addon['inc_dir'] . 'functions.lib.php'; $func = new mainFunctions(); if (isset($_POST['op']) && $_POST['op'] == 'upload') { $filename = basename($_FILES['b_image']['name']); $target_path = $addon['dir'] . 'images' . DIR_SEP . basename($_FILES['b_image']['name']); $path = $addon['dir'] . 'images' . DIR_SEP; $slider = $path . 'slider-' . $filename; $thumb = $path . 'thumb-' . $filename; if (move_uploaded_file($_FILES['b_image']['tmp_name'], $target_path)) { $func->image_resize($target_path, $thumb, 100, 47); $func->image_resize($target_path, $slider, 600, 300); $query = "INSERT INTO `" . $roster->db->table('slider', $addon['basename']) . "` SET " . "`b_title` = '" . $_POST['b_title'] . "', " . "`b_desc` = '" . $_POST['b_desc'] . "', " . "`b_url` = '" . $_POST['b_url'] . "', " . "`b_video` = '" . $_POST['b_video'] . "', " . "`b_image` = '" . $_FILES['b_image']['name'] . "';"; if ($roster->db->query($query)) { $roster->set_message(sprintf($roster->locale->act['slider_add_success'], $_FILES['b_image']['name'])); } else { unlink($target_path); unlink($slider); unlink($thumb); $roster->set_message($roster->locale->act['slider_error_db'], '', 'error'); $roster->set_message('<pre>' . $roster->db->error() . '</pre>', 'MySQL Said', 'error'); } } else { $roster->set_message(sprintf($roster->locale->act['slider_file_error'], $target_path), $roster->locale->act['b_add'], 'error'); } //*/ }
<?php roster_add_js($addon['url'] . 'js/jquery.easing.1.3.js'); roster_add_js($addon['url'] . 'js/camera.min.js'); roster_add_css($addon['tpl_url'] . 'camera.css'); include_once $addon['inc_dir'] . 'functions.lib.php'; $func = new mainFunctions(); // Add news if any was POSTed if (isset($_POST['process']) && $_POST['process'] == 'process') { if (isset($_POST['author']) && !empty($_POST['author']) && isset($_POST['title']) && !empty($_POST['title']) && isset($_POST['news']) && !empty($_POST['news'])) { if (isset($_POST['html']) && $_POST['html'] == 1 && $addon['config']['news_html'] >= 0) { $html = 1; } else { $html = 0; } if (isset($_POST['id'])) { $func->newsUPDATE($_POST, $html); } else { $func->newsADD($_POST, $html); } } else { $roster->set_message($roster->locale->act['news_error_process'], '', 'error'); } } $roster->tpl->assign_vars(array('FACTION' => isset($roster->data['factionEn']) ? strtolower($roster->data['factionEn']) : false, 'JSDIE' => $addon['dir'] . 'js')); $r = $func->makeUSERmenu($roster->output['show_menu']); $usrmenu = '<ul style="line-height: 24px;">'; foreach ($r['user'] as $i => $usr) { $usrmenu .= '<li><div class="icon"> <img src="' . $usr['ICON'] . '" alt="" /> <div class="mask"></div>