예제 #1
0
파일: save.php 프로젝트: joomux/jTips
 * @since 2.1 - 01/10/2008
 * @version 2.1
 * @package jTips
 *
 * Description: Save the posted information to the team record
 */
global $mainframe, $database, $mosConfig_absolute_path;
//Make sure this is not a hack job
jTipsSpoofCheck();
require_once 'components/com_jtips/classes/jteam.class.php';
require_once 'components/com_jtips/lib/tnimg.lib.php';
$jTeam = new jTeam($database);
if ($id = jTipsGetParam($_REQUEST, 'id', false)) {
    $jTeam->load($id);
}
$jTeam->bind($_POST);
if (jTipsGetParam($_REQUEST, 'removeImage', false)) {
    $jTeam->logo = null;
} else {
    unset($jTeam->logo);
    //so we dont overwrite the current value
}
if (isset($_FILES['logo']['name']) and !empty($_FILES['logo']['name']) and imageDirCheck()) {
    //Upload image
    $filename = str_replace(' ', '_', $_FILES['logo']['name']);
    $filename_100 = getJtipsImage($filename, 100);
    $filename_25 = getJtipsImage($filename);
    if (!isJoomla15()) {
        if (!is_dir($mosConfig_absolute_path . '/images/jtips') or !file_exists($mosConfig_absolute_path . '/images/jtips')) {
            mkdir($mosConfig_absolute_path . '/images/jtips');
        }