Exemple #1
0
    $var['title'] = TITRE_SITE;
    $var['club'] = CLUB;
    $var['host'] = SGBD_HOST;
    $var['user_base'] = SGBD_USER;
    $var['pass_base'] = SGBD_PWD;
    $var['name_base'] = SGBD_NAME;
    $var['version'] = VERSION_SITE;
    $var['max_file_size'] = MAX_FILE_SIZE;
    $var['url_rewrite'] = URL_REWRITE;
    $var['email'] = EXPEDITEUR_EMAIL;
    $var['title'] = EXPEDITEUR_NOM;
    $var['nb_player'] = NB_MAX_TITULAIRE;
    #$var['site_open']=SITE_OUVERT;
    $var['lang'] = LANG;
    $contenu_conf = implode("", file($fichier_conf));
    $contenu_conf = text_replace($contenu_conf, $var);
    @chmod("../include/", 0777);
    @chmod($fichier_conf_site, 0777);
    if ($fd = @fopen($fichier_conf_site, "w")) {
        // mise a jour du fichier de connection
        @fwrite($fd, $contenu_conf);
        @fclose($fd);
        @chmod($fichier_conf_site, 0755);
        @chmod("../include/", 0755);
        $page['message'][$nb_message]['message'] = $lang['installation']['update_conf_ok'];
        $nb_message++;
    } else {
        $page['erreur'][$nb_erreur]['message'] = $lang['installation']['E_update_conf'];
        $nb_erreur++;
    }
}
Exemple #2
0
                 if (convert_date_sql($_POST['data'][$i][$id_date]) >= $value['date_start'] and convert_date_sql($_POST['data'][$i][$id_date]) <= $value['date_end']) {
                     $season[$i] = $id_season;
                 }
             }
             if (!isset($season[$i])) {
                 $nb_no_season++;
             }
         }
     }
     if ($nb_match_empty != 0) {
         $page['erreur'][$nb_error]['message'] = $lang['match']['E_empty_matchs_date'];
         $nb_error++;
     }
     if ($nb_invalid != 0) {
         $var['date'] = implode(', ', $date_found);
         $page['erreur'][$nb_error]['message'] = text_replace($lang['match']['E_invalid_date_matchs'], $var);
         $nb_error++;
     }
     if ($nb_no_season != 0) {
         $page['erreur'][$nb_error]['message'] = $lang['match']['E_empty_matchs_no_season'];
         $nb_error++;
     }
 }
 # we check that if the merge option is selected, a match has been chosen
 for ($i = 0; $i < $nb_match; $i++) {
     if ($_POST['action'][$i] == 'merge' and empty($_POST['match'][$i]) and $nb_error == 0) {
         $page['erreur'][$nb_error]['message'] = $lang['match']['E_empty_match_merge'];
         $nb_error++;
     }
 }
 if ($nb_error == 0) {
Exemple #3
0
 public function parseTradeTopic($_G, $post)
 {
     $rows = C::t('forum_thread')->fetch_all_by_tid($_G['tid']);
     $tpids = array();
     if ($rows[$_G['tid']]['special'] == 2) {
         $query = C::t('forum_trade')->fetch_all_thread_goods($_G['tid']);
         foreach ($query as $trade) {
             $tradesaids[] = $trade['aid'];
             $tradespids[] = $trade['pid'];
         }
         $specialadd2 = 1;
         if ($tradespids) {
             foreach (C::t('forum_attachment_n')->fetch_all_by_id('tid:' . $_G['tid'], 'pid', $tradespids) as $attach) {
                 if ($attach['isimage'] && is_array($tradesaids) && in_array($attach['aid'], $tradesaids)) {
                     $trades[$attach['pid']]['attachurl'] = ($attach['remote'] ? $_G['setting']['ftp']['attachurl'] : $_G['setting']['attachurl']) . 'forum/' . $attach['attachment'];
                     $trades[$attach['pid']]['thumb'] = $attach['thumb'] ? getimgthumbname($trades[$attach['pid']]['attachurl']) : $trades[$attach['pid']]['attachurl'];
                     $trades[$attach['pid']]['width'] = $attach['thumb'] && $_G['setting']['thumbwidth'] < $attach['width'] ? $_G['setting']['thumbwidth'] : $attach['width'];
                     $trades[$attach['pid']]['thumb'] = str_replace('forum/', '', $trades[$attach['pid']]['thumb']);
                     $filename = $this->parseTradeTopicImg($trades[$attach['pid']]);
                     $info[] = array('infor' => $filename, 'type' => 1);
                 }
             }
         }
         $tradepostlist = C::t('forum_post')->fetch_all('tid:' . $_G['tid'], $tradespids);
         foreach ($query as $trade) {
             $quality = $trade['quality'] == 1 ? Common::get_unicode_charset('\\u5168\\u65b0\\u5546\\u54c1') : Common::get_unicode_charset('\\u4e8c\\u624b\\u5546\\u54c1');
             $transport = $trade['transport'];
             switch ($trade['transport']) {
                 case 3:
                     $transport = Common::get_unicode_charset('\\u865a\\u62df\\u5546\\u54c1');
                     break;
                 case 2:
                     $transport = '';
                     break;
                 case 0:
                     $transport = Common::get_unicode_charset('\\u7ebf\\u4e0b\\u4ea4\\u6613');
                     break;
             }
             $time = $trade['expiration'] - time();
             $time = explode('.', $time / 3600 / 24);
             $time = intval($time[0]) . Common::get_unicode_charset('\\u5929') . intval(('0.' . $time[1]) * 24) . Common::get_unicode_charset('\\u5c0f\\u65f6');
             $message[] = array('infor' => Common::get_unicode_charset('\\u5546\\u54c1\\u7c7b\\u578b\\u003a') . $quality, 'type' => 0);
             $message[] = array('infor' => Common::get_unicode_charset('\\u8fd0\\u8d39\\u003a') . $transport, 'type' => 0);
             $message[] = array('infor' => Common::get_unicode_charset('\\u5269\\u4f59\\u65f6\\u95f4\\u003a') . $time, 'type' => 0);
             $message[] = array('infor' => Common::get_unicode_charset('\\u5546\\u54c1\\u6570\\u91cf\\u003a') . $trade['amount'], 'type' => 0);
             $message[] = array('infor' => Common::get_unicode_charset('\\u5730\\u70b9\\u003a') . $trade['locus'], 'type' => 0);
             $message[] = array('infor' => Common::get_unicode_charset('\\u7d2f\\u8ba1\\u552e\\u51fa\\u003a') . $trade['totalitems'], 'type' => 0);
         }
         foreach ($tradepostlist as $val) {
             $topicContent = text_replace($val['message']);
             $topicContent = discuzcode($topicContent, $val['smileyoff'], $val['bbcodeoff']);
             $topicContent = str_replace('<img src="static/', '<img src="/static/', $topicContent);
             $val['message'] = text_replace($topicContent);
             $message1 = doContent($val['message'], $tradesaids);
             $message2 = getContentFont($val['message']);
             foreach ($message1 as $k => $v) {
                 if ($v['type'] == 0) {
                     unset($message1[$k]);
                 } else {
                 }
             }
             $message_array2 = explode('|~|', $message2);
             $message2 = str_replace('[', '1', $message2);
             $message2 = str_replace(']', '1', $message2);
             if (is_array($message_array2) && count($message_array2) > 0) {
                 foreach ($message_array2 as $k => $v) {
                     $message[] = array("infor" => $v, "type" => 0);
                     if ($message1[$k]["infor"] && !empty($message1)) {
                         $message[] = $message1[$k];
                     }
                 }
             } else {
                 $message = getContentFont($val['message']);
             }
         }
     }
     return $message;
 }
Exemple #4
0
}
# adding a file
if (isset($_POST['action']) and $_POST['action'] == "upload_file" and isset($_FILES['file']) and $right_user['add_file']) {
    # we format datas
    # we check datas
    if (!isset($_FILES['file']['name']) or empty($_FILES['file']['name'])) {
        $page['erreur'][$nb_erreur]['message'] = $lang['file']['E_empty_file'];
        $nb_erreur++;
    } elseif (!in_array($_FILES['file']['type'], $type_mime_allowed)) {
        $var['type'] = implode(", ", $type_allowed);
        $page['erreur'][$nb_erreur]['message'] = text_replace($lang['file']['E_invalid_file_type'], $var);
        $nb_erreur++;
    }
    if ($_FILES['file']['size'] > MAX_FILE_SIZE) {
        $var['max_file_size'] = filesize_format(MAX_FILE_SIZE);
        $page['erreur'][$nb_erreur]['message'] = text_replace($lang['file']['E_invalid_file_size'], $var);
        $nb_erreur++;
    }
    # if($_FILES['file']['error']!=0) { $page['erreur'][$nb_erreur]['message']=$lang['file']['E_invalid_file']; $nb_erreur++; }
    if (isset($_POST['name']) and !empty($_POST['name']) and !check_file_name($_POST['name'])) {
        $page['erreur'][$nb_erreur]['message'] = $lang['file']['E_invalid_name'];
        $nb_erreur++;
    }
    # we check if the file does not exist
    if ($nb_erreur == 0) {
        # name of the file
        if (isset($_POST['name']) and !empty($_POST['name'])) {
            # we get the extension
            $file_ext = substr($_FILES['file']['name'], strrpos($_FILES['file']['name'], "."));
            $file_name = format_file_name($_POST['name']) . $file_ext;
        } else {
Exemple #5
0
     $sgbd = sql_connect();
     $execution = sql_query($sql_add);
     if ($execution) {
         $page['L_message'] = $lang['member']['form_registration_add_1'];
         $page['value_id'] = sql_insert_id($sgbd);
         # we send an email
         if (MAIL == 1 and REGISTRATION_MAIL == 1) {
             $var['firstname'] = $_POST['login'];
             $var['site_title'] = SITE_TITLE;
             $var['site_url'] = ROOT_URL;
             $var['sender_email'] = SENDER_EMAIL;
             $var['sender_name'] = SENDER_NAME;
             $var['login'] = $_POST['login'];
             $var['pass'] = $_POST['pass_member'];
             $subject = text_replace($lang['member']['mail_registration_subject'], $var);
             $message = text_replace($lang['member']['mail_registration_message'], $var);
             send_mail(SITE_TITLE, SENDER_EMAIL, $_POST['email'], $subject, $message, 'text/plain');
         }
     } else {
         $page['L_message'] = $lang['member']['form_registration_add_0'];
     }
     sql_close($sgbd);
     $page['show_form'] = "";
 } else {
     # there is some errors: we show the datas again
     if (isset($_POST['id'])) {
         $page['value_id'] = $_POST['id'];
     }
     if (isset($_POST['name'])) {
         $page['value_name'] = $_POST['name'];
     }
Exemple #6
0
<?php

# installation : message
$nb_erreur = "0";
$page['L_title'] = $lang['installation']['message'];
$var['root_url'] = "../";
$page['L_message'] = text_replace($lang['installation']['error_folder'], $var);
$page['template'] = "tpl/message.html";
Exemple #7
0
        $page['erreur'][$nb_erreur]['message'] = $lang['installation']['E_creation_conf'];
        $nb_erreur++;
        $page['value_erreur'] = "creation_conf";
    }
    @chmod($fichier_conf_site, 0755);
    @chmod("../include/", 0755);
}
if (isset($_SESSION['creation_conf']) and $_SESSION['creation_conf'] == 1) {
    $page['message'][$nb_message]['message'] = $lang['installation']['creation_conf_ok'];
    $nb_message++;
}
# on insere les donnees pour le sport choisi
if (isset($_SESSION['creation_conf']) and $_SESSION['creation_conf'] == 1 and (!isset($_SESSION['insertion_data']) or $_SESSION['insertion_data'] != 1)) {
    $fichier_donnees = "donnees_" . $_SESSION['sport'] . ".txt";
    $contenu_donnees = implode("", file($fichier_donnees));
    $contenu_donnees = text_replace($contenu_donnees, $lang['installation']);
    $req_insertion_data = explode(";", $contenu_donnees);
    $nb_req_insertion_data = sizeof($req_insertion_data);
    $nb_req_ok = 0;
    $nb_req_pbm = 0;
    for ($i = 0; $i < $nb_req_insertion_data - 1; $i++) {
        if ($_SESSION['prefix'] != '') {
            $var['name_table'] = explode("`", $req_insertion_data[$i]);
            $var['name_table'] = $var['name_table']['1'];
            $req_insertion_data[$i] = eregi_replace("`" . $var['name_table'] . "`", "`" . $_SESSION['prefix'] . $var['name_table'] . "`", $req_insertion_data[$i]);
        }
        if (mysql_query($req_insertion_data[$i], $db)) {
            $nb_req_ok++;
        } else {
            $nb_req_pbm++;
        }
Exemple #8
0
         $page['erreur'][$nb_error]['message'] = text_replace($lang['member']['E_invalid_date_birth_members'], $var);
         $nb_error++;
     }
 }
 if (isset($id_login)) {
     $nb_invalid = 0;
     $member_found = array();
     for ($i = 0; $i < $nb_member; $i++) {
         if (!empty($_POST['data'][$i][$id_login]) and !check_login($_POST['data'][$i][$id_login])) {
             array_push($member_found, $_POST['data'][$i][$id_login]);
             $nb_invalid++;
         }
     }
     if ($nb_invalid != 0) {
         $var['member'] = implode(', ', $member_found);
         $page['erreur'][$nb_error]['message'] = text_replace($lang['member']['E_invalid_login_members'], $var);
         $nb_error++;
     }
 }
 # we check that if the merge option is selected, a member has been chosen
 for ($i = 0; $i < $nb_member; $i++) {
     if ($_POST['action'][$i] == 'merge' and empty($_POST['member'][$i]) and $nb_error == 0) {
         $page['erreur'][$nb_error]['message'] = $lang['member']['E_empty_member_merge'];
         $nb_error++;
     }
 }
 # we check that a season is selected if club are specified
 if (isset($id_club)) {
     if (!isset($_POST['season']) or empty($_POST['season'])) {
         $page['erreur'][$nb_error]['message'] = $lang['member']['E_empty_season'];
         $nb_error++;
Exemple #9
0
     $page['erreur'][$nb_erreur]['message'] = $lang['match']['E_empty_date'];
     $nb_erreur++;
 } elseif (!check_date($_POST['date'])) {
     $page['erreur'][$nb_erreur]['message'] = $lang['match']['E_invalid_date'];
     $nb_erreur++;
 } else {
     # on verifie qu'une season correspond a cette date, et on la recupere
     include_once create_path("competition/sql_competition.php");
     $var['date'] = convert_date_sql($_POST['date']);
     $sql_season = sql_replace($sql['competition']['select_season_date'], $var);
     $sgbd = sql_connect();
     $res_season = sql_query($sql_season);
     $nb_season = sql_num_rows($res_season);
     if ($nb_season == 0) {
         $var['link_season'] = convert_url("index.php?r=" . $lang['general']['idurl_competition'] . "&v1=season_list&fen=pop");
         $page['erreur'][$nb_erreur]['message'] = text_replace($lang['match']['E_empty_season'], $var);
         $nb_erreur++;
     } else {
         $ligne_season = sql_fetch_array($res_season);
         $_POST['season'] = $ligne_season['season_id'];
         // on stocke la season
     }
     sql_free_result($res_season);
 }
 if (isset($_POST['hour']) and !empty($_POST['hour']) and !check_hour($_POST['hour'])) {
     $page['erreur'][$nb_erreur]['message'] = $lang['match']['E_invalid_hour'];
     $nb_erreur++;
 }
 if (isset($_POST['spectators']) and !empty($_POST['spectators']) and !check_integer($_POST['spectators'])) {
     $page['erreur'][$nb_erreur]['message'] = $lang['match']['E_invalid_spectators'];
     $nb_erreur++;
Exemple #10
0
     if (!isset($_POST['ms_season'])) {
         $_POST['ms_season'] = '';
     }
     if (!isset($_POST['ms_competition'])) {
         $_POST['ms_competition'] = '';
     }
     if (!isset($_POST['ms_round'])) {
         $_POST['ms_round'] = '';
     }
     if (!isset($_POST['ms_show_form'])) {
         $_POST['ms_show_form'] = 0;
     }
     $_SESSION['session_mini_standings'] = '';
     # we need a refresh of mini-standings
     $contenu_conf = implode('', file($fichier_conf));
     $contenu_conf = text_replace($contenu_conf, $_POST);
     @chmod($fichier_conf_site, 0777);
     if ($fd = @fopen($fichier_conf_site, "w")) {
         fwrite($fd, $contenu_conf);
         fclose($fd);
         $page['L_message'] = $lang['administration']['configuration_ok'];
         chmod($fichier_conf_site, 0755);
         header("location:" . $page['form_action']);
         exit;
     } else {
         $page['erreur'][$nb_erreur]['message'] = $lang['administration']['E_creation_conf'];
         $nb_erreur++;
     }
 } else {
     if (isset($_POST['title'])) {
         $page['value_title'] = $_POST['title'];
Exemple #11
0
# update
$update_list = array('1.0-1.1', '1.1-1.2', '1.2-1.3', '1.3-1.4');
# available updates
$nb_erreur = 0;
$page['erreur'] = array();
$page['form_action'] = "index.php?lg=" . LANG . "&r=update";
$page['L_message'] = "";
$nb_message = "0";
$page['message'] = array();
# if we have to do an update
if (isset($_POST['update']) and in_array($_POST['update'], $update_list)) {
    include "update_" . $_POST['update'] . ".php";
    if ($nb_erreur == "0") {
        $var['root_url'] = ROOT_URL;
        $page['L_message'] = text_replace($lang['installation']['update_ok'], $var);
    }
}
# list of  avaibable updates
$nb_update = sizeof($update_list);
$page['update_list'] = array();
$j = 0;
for ($i = 0; $i < $nb_update; $i++) {
    $version = explode("-", $update_list[$i]);
    $version = $version['0'];
    # we show only updates not already done
    if (VERSION_SITE > $version && VERSION_SITE > VERSION && VERSION <= $version) {
        $page['update_list'][$j]['value'] = $update_list[$i];
        $page['update_list'][$j]['name'] = eregi_replace("-", " => ", $update_list[$i]);
        $page['update_list'][$j]['L_update'] = $lang['installation']['update'];
        # we active only the oldest update
Exemple #12
0
         $page['erreur'][$nb_erreur]['message'] = text_replace($lang['club']['E_invalid_url_clubs'], $var);
         $nb_erreur++;
     }
 }
 if (isset($id_creation_year)) {
     $nb_invalid = 0;
     $club_found = array();
     for ($i = 0; $i < $nb_club; $i++) {
         if (!empty($_POST['data'][$i][$id_creation_year]) and !check_date("01-01-" . $_POST['data'][$i][$id_creation_year])) {
             array_push($club_found, $_POST['data'][$i][$id_name]);
             $nb_invalid++;
         }
     }
     if ($nb_invalid != 0) {
         $var['club'] = implode(', ', $club_found);
         $page['erreur'][$nb_erreur]['message'] = text_replace($lang['club']['E_invalid_creation_year_clubs'], $var);
         $nb_erreur++;
     }
 }
 # we check that if the merge option is selected, a club has been chosen
 for ($i = 0; $i < $nb_club; $i++) {
     if ($_POST['action'][$i] == 'merge' and empty($_POST['club'][$i]) and $nb_erreur == 0) {
         $page['erreur'][$nb_erreur]['message'] = $lang['club']['E_empty_club_merge'];
         $nb_erreur++;
     }
 }
 if ($nb_erreur == 0) {
     # correspondance des colonnes
     $nb_column = sizeof($_POST['club_field']);
     $nb_line = sizeof($_POST['data']);
     $sgbd = sql_connect();
     $execution = 1;
     if ($execution) {
         $page['L_message'] = $lang['member']['form_registration_validation_merge_1'];
         # we delete the registration
         $sql_delete = sql_replace($sql['member']['sup_member'], $var);
         sql_query($sql_delete);
         # we send the email so that the member could activate his account
         if ($_POST['valid'] == -2 and MAIL == 1 and REGISTRATION_MAIL == 1) {
             //$var['link_activation']; # already define
             $var['firstname'] = $member_firstname;
             $var['site_title'] = SITE_TITLE;
             $var['site_url'] = ROOT_URL;
             $var['sender_email'] = SENDER_EMAIL;
             $var['sender_name'] = SENDER_NAME;
             $subject = $lang['member']['mail_activation_subject'];
             $message = text_replace($lang['member']['mail_activation_message'], $var);
             $to = $member_email;
             if (send_mail(SITE_TITLE, SENDER_EMAIL, $to, $subject, $message, 'text/plain')) {
                 $page['L_message'] .= " " . $lang['member']['mail_activation_sent'];
             } else {
                 $page['erreur'][$nb_erreur]['message'] = $lang['member']['E_mail_activation_sent'];
                 $nb_erreur++;
             }
         }
     } else {
         $page['L_message'] = $lang['member']['form_registration_validation_0'];
     }
     sql_close($sgbd);
 } elseif ($_POST['action'] == 'refuse') {
     # we refuse the registration and block the account
     $_POST['valid'] = 0;
Exemple #14
0
        $_POST['pass'] = create_pass();
        $_POST['pass_md5'] = md5($_POST['pass']);
        $_POST['id'] = $ligne_login['member_id'];
        $page['show_form'] = '';
        $sql_modif = sql_replace($sql['member']['edit_member_pass'], $_POST);
        $sgbd = sql_connect();
        $execution = sql_query($sql_modif);
        if ($execution) {
            $var['firstname'] = $_POST['login'];
            $var['site_title'] = SITE_TITLE;
            $var['site_url'] = ROOT_URL;
            $var['sender_email'] = SENDER_EMAIL;
            $var['sender_name'] = SENDER_NAME;
            $var['login'] = $_POST['login'];
            $var['pass'] = $_POST['pass'];
            $message = text_replace($lang['member']['mail_forgot_pass_message'], $var);
            if (send_mail(SITE_TITLE, SENDER_EMAIL, $_POST['email'], $lang['member']['mail_forgot_pass_subject'], $message, 'text/plain')) {
                $page['L_message'] = $lang['member']['forgot_pass_ok'];
            } else {
                $page['L_message'] = $lang['member']['forgot_pass_pbm'];
            }
        } else {
            $page['L_message'] = $lang['member']['forgot_pass_pbm'];
        }
        sql_close($sgbd);
    } else {
        $page['value_login'] = $_POST['login'];
        $page['value_email'] = $_POST['email'];
    }
}
# link