示例#1
0
function allianz($aid)
{
    global $db, $n;
    $result = $db->query("SELECT name,aid FROM cc" . $n . "_allianz WHERE aid='{$aid}'");
    $row = $db->fetch_array($result);
    return $row['aid'] != $aid ? 0 : c_trim($row['name']);
}
示例#2
0
    $my_ip = "";
    if ($ft_titel_new == "") {
        show_error('ln_error_8', $modul_name);
        header("LOCATION: forum.php?action=new_threadid&ft_id={$ft_id}");
        exit;
    }
    if ($ft_titel_text == "") {
        show_error('ln_error_9', $modul_name);
        header("LOCATION: forum.php?action=new_threadid&ft_id={$ft_id}");
        exit;
    }
    if ($uid <= 0) {
        show_error('ln_error_10', $modul_name);
        exit;
    }
    $ft_titel_text = c_trim($ft_titel_text);
    $db->query("INSERT INTO cc" . $n . "_forum_topics (si_topic_title,si_topic_create_uid ,si_topic_create_uname ,si_topic_create_time,si_forum_id,si_topic_last_post_time,si_topic_last_post_name,si_topic_last_post_uid) VALUES ('" . $ft_titel_new . "','" . $uid . "','" . $uname . "','" . $date . "','" . $ft_id . "','" . $date . "','" . $uname . "','" . $uid . "')");
    $ulast_id = $db->insert_id();
    $db->query("INSERT INTO cc" . $n . "_forum_posts (si_forum_id ,si_topic_id ,si_poster_id,si_poster_name,si_post_text ,si_post_time,si_poster_ip ) VALUES ('" . $f_id . "','" . $ulast_id . "','" . $uid . "','" . $uname . "','." . $ft_titel_text . "','" . $date . "','" . $my_ip . "')");
    $db->unbuffered_query("UPDATE cc" . $n . "_forum SET si_count_topic  =si_count_topic +1 ,si_count_post=si_count_post+1 WHERE si_forum_id ='" . $ft_id . "' ");
    header("LOCATION: forum.php?action=show_forum&f_id={$ft_id}");
    exit;
}
if ($action == "show_post") {
    $ft_id = intval($_GET['ft_id']);
    $f_id = intval($_GET['f_id']);
    if ($ft_id <= 0) {
        header("LOCATION: forum.php");
        exit;
    }
    if ($f_id <= 0) {
示例#3
0
    $result_users = $db->query($sql);
    $como = "<select class=\"combo\" name=\"selkat\">";
    while ($row_g = $db->fetch_array($result_users)) {
        $como .= "<option value=\"" . $row_g['admin_sub_id'] . "\">" . $row_g['admin_sub_name'] . "</option>";
    }
    $como .= "</select>";
    $tpl->assign('menu_name', $menu_name);
    $tpl->assign('var_count', $variablen_count);
    $tpl->assign('combo_cat', $como);
    template_out('gameoptions.html', $modul_name);
    exit;
}
if ($action == "new_save") {
    $new_var_name = c_trim($_POST['varname']);
    $new_var_titel = c_trim($_POST['vartitel']);
    $new_var_type = c_trim($_POST['select_type']);
    $new_var_kat = intval($_POST['selkat']);
    $first_char = substr($new_var_name, 0, 3);
    if ($first_char != "op_") {
        error_msg("Es ist ein Fehler aufgetrten.<br>Bitte darauf achten, das alle Variablen mit 'op_' beginnen !!! ");
        exit;
    }
    if ($new_var_name == "" or $new_var_titel == "" or $new_var_type == "" or $new_var_kat <= 0) {
        error_msg("Es ist ein Fehler aufgetrten.");
        exit;
    }
    $db->unbuffered_query("INSERT INTO cc" . $n . "_menu_admin_opt SET varname='{$new_var_name}' , title='{$new_var_titel}',type='{$new_var_type}', admin_sub_id='{$new_var_kat}',  \tsave='1'");
    template_out('gameoptions.html', $modul_name);
    exit;
}
if ($action == "sel_cat") {
示例#4
0
    $userid_r = $db->insert_id();
    $db->query("INSERT INTO cc" . $n . "_countries (res1,res2,res3,res4,userid,lastressources,picid,x,y,size) VALUES ('{$op_reg_res1}','{$op_reg_res2}','{$op_reg_res3}','{$op_reg_res4}','{$userid_r}','" . time() . "','1','{$x_pos}','{$y_pos}','" . rand($op_min_c_size, $op_max_c_size) . "')");
    $islandid_r = $db->insert_id();
    $db->query("UPDATE cc" . $n . "_crand SET used='1' WHERE x='" . $x_pos . "' AND y='" . $y_pos . "'");
    $db->query("UPDATE cc" . $n . "_users SET activeid='{$islandid_r}' WHERE userid='{$userid_r}'");
    send_register_mail($email, "mail_register.html", $modul_name, $username, $password, $x_pos, $y_pos);
    show_error("REGISTER_SUBMIT_OK", $modul_name);
    exit;
}
if ($action == "forgott") {
    template_out('register_forgott.html', $modul_name);
    exit;
}
if ($action == "submit_forgott") {
    $username = c_trim(strtolower($_POST['username']));
    $email = c_trim(strtolower($_POST['email']));
    if ($username == "") {
        show_error("REGISTER_ERROR_2", $modul_name);
        exit;
    }
    if (!preg_match("/^[0-9a-z_-]{3,15}\$/i", $username)) {
        show_error("REGISTER_ERROR_4", $modul_name);
        exit;
    }
    if ($email == "") {
        show_error("REGISTER_ERROR_2", $modul_name);
        exit;
    }
    $result = $db->query("SELECT username,email,password FROM cc" . $n . "_users WHERE username='******'");
    $row = $db->fetch_array($result);
    if ($row['username'] != $username) {
示例#5
0
function get_rang_name_from_allianz_rang($allianz_rang_id, $alli_id)
{
    global $db, $n, $userdata;
    $name = "";
    $result_s = $db->query("SELECT rangname FROM cc" . $n . "_allianz_rang  WHERE  allianz_rang_id ='{$allianz_rang_id}' and allianz_id ='{$alli_id}'");
    while ($row_s = $db->fetch_array($result_s)) {
        $name = c_trim($row_s['rangname']);
    }
    return $name;
}
示例#6
0
    global $tpl;
    $modul_name = "acp_login";
    $tpl->assign('if_disable_menu', 1);
    $tpl->assign('LITO_ERROR_MSG', $error_msg);
    $tpl->assign('if_login_error', 1);
    template_out('login.html', $modul_name);
}
if ($action == "main") {
    //$tpl ->display("login/login.html");
    $tpl->assign('if_disable_menu', 1);
    template_out('login.html', $modul_name);
    exit;
}
if ($action == "submit") {
    $username = strtolower($_POST['username']);
    $password = c_trim($_POST['password']);
    if (!$username || !$password) {
        login_error($ln_login_e_1);
        exit;
    }
    $result = $db->query("SELECT * FROM cc" . $n . "_users WHERE username='******'");
    $row = $db->fetch_array($result);
    if (strtolower($row['username']) != $username) {
        trace_msg("login ERROR '{$username}' wrong username", 2);
        login_error($ln_login_e_2);
        exit;
    }
    if ($row['password'] != md5($password)) {
        trace_msg("login ERROR '{$username}' wrong password", 2);
        login_error($ln_login_e_2);
        exit;
示例#7
0
    $action = "main";
}
if (!isset($_SESSION['userid'])) {
    show_error('LOGIN_ERROR', 'core');
    exit;
}
if (is_modul_name_aktive($modul_name) == 0) {
    show_error('MODUL_LOAD_ERROR', 'core');
    exit;
}
if ($action == "main") {
    template_out('search.html', $modul_name);
    exit;
}
if ($action == "user") {
    $user = c_trim($_POST['user']);
    if (strlen($user) <= 1) {
        show_error('SEARCH_ERROR_1', $modul_name);
        exit;
    }
    $result = $db->query("SELECT userid FROM cc" . $n . "_users");
    $numOfUsers = $db->num_rows($result);
    $daten = "";
    $result = $db->query("SELECT userid,username,points,allianzid,lastlogin,lastpoints,lastactive,status,umod,userpic FROM cc" . $n . "_users  WHERE username LIKE '%{$user}%' ORDER BY points DESC ");
    $i = 0;
    while ($row = $db->fetch_array($result)) {
        $username = $row['username'];
        $userpoints = $row['points'];
        if ($row['lastactive'] > time() - 3600) {
            $online = "<span class=\"green\">&nbsp;(Online)</span>";
        } else {
示例#8
0
            if ($pmid == true) {
                $xyz = $xyz + 1;
                settype($pmid, integer);
                $db->unbuffered_query("UPDATE cc" . $n . "_messages SET archive='1', inbox='0' WHERE pmid='" . $pmid . "' AND touserid='" . $userdata['userid'] . "'");
                $update = mysql_query($change);
            }
        }
        header("LOCATION: message.php");
        exit;
    } elseif ($todo == "3") {
        $sql = "DELETE FROM cc" . $n . "_messages WHERE touserid='" . $userdata['userid'] . "'";
        $db->unbuffered_query("DELETE FROM cc" . $n . "_messages WHERE touserid='" . $userdata['userid'] . "' AND archive='0'");
        header("LOCATION: message.php");
        exit;
    }
    header("LOCATION: message.php");
    exit;
}
if ($action == "move") {
    $pmid = intval($_GET['pmid']);
    $to = c_trim($_GET['to']);
    if (!$to || !$pmid) {
        show_error('ln_system_error_m', $modul_name);
        exit;
    }
    if ($to == "archive") {
        $db->unbuffered_query("UPDATE cc" . $n . "_messages SET archive='1', inbox='0' WHERE pmid='" . $pmid . "' AND touserid='" . $userdata[userid] . "'");
        header("LOCATION: message.php{$SID_1}");
    }
    exit;
}
示例#9
0
                } else {
                    $modules_game_counter_new++;
                }
            }
        }
    }
    closedir($scandir);
    $tpl->assign('modules', $new_found);
    $tpl->assign('modul_acp_count', $modules_acp_counter);
    $tpl->assign('modul_acp_count_new', $modules_acp_counter_new);
    $tpl->assign('modul_game_count_new', $modules_game_counter_new);
    template_out('modulmgrscan.html', $modul_name);
    exit;
}
if ($action == "install") {
    $m_name = c_trim($_GET['id']);
    $setup_filename = LITO_ROOT_PATH . "acp/tmp/" . $m_name . "/setup.php";
    if (is_file($setup_filename)) {
        include LITO_ROOT_PATH . "acp/includes/ftp_class.php";
        include LITO_ROOT_PATH . "acp/includes/package_class.php";
        if (!isset($ftp) || !is_a($ftp, 'ftp')) {
            $ftp = new ftp($ftphost, $ftpuser, $ftppassword, $ftproot, $ftpport);
        }
        $pm = new package($m_name, $ftp);
        if (!$pm->initialized) {
            die('Schwerer Fehler!');
        }
        $pm->install();
        $tpl->assign('debug', $pm->debug());
        template_out('action.html', $modul_name);
    } else {
示例#10
0
    $tpl->assign('USER_ICQ', $userdata['icq']);
    $tpl->assign('USER_USERMAILS', $userdata['email']);
    $tpl->assign('USER_USERIMAGE', $userpic);
    $tpl->assign('USER_USERNAME', $userdata['username']);
    template_out('members_userdata.html', $modul_name);
    exit;
}
if ($action == "saveuserdata") {
    $umod1 = intval($_POST['urlaub']);
    $email = c_trim($_POST['email']);
    $password_old = c_trim($_POST['password_old']);
    $password_new_first = c_trim($_POST['password_new_first']);
    $password_new_second = c_trim($_POST['password_new_second']);
    $newsletter = intval($_POST['newsletter']);
    $icq = c_trim($_POST['icq']);
    $msn = c_trim($_POST['msn']);
    $description = $_POST['description'];
    $design_id = intval($_POST['coose_design']);
    if ($design_id <= 0) {
        $design_id = 1;
    }
    $db->unbuffered_query("UPDATE cc" . $n . "_users SET design_id = '" . $design_id . "', umod  ='" . $umod1 . "',msn='" . $msn . "',icq='" . $icq . "',description='" . $description . "',email='" . $email . "', newsletter='" . $newsletter . "', grafik='" . $grafik . "' WHERE userid='" . $userdata['userid'] . "'");
    if ($password_old != "" and $password_new_first != "" and $password_new_first != "") {
        $result = $db->query("SELECT password FROM cc" . $n . "_users WHERE userid='{$userdata['userid']}'");
        $row = $db->fetch_array($result);
        if ($row['password'] == md5($password_old)) {
            if ($password_new_first == $password_new_second) {
                $md5_pw = md5($password_new_first);
                $db->query("UPDATE cc" . $n . "_users SET password='******' WHERE userid='" . $userdata['userid'] . "'");
            } else {
                show_error("ln_members_e_2", $modul_name);
示例#11
0
             $name = c_trim($row_s['name']);
             $tabless_name = $row_s['tabless'];
             $out_buildings .= $name . "  [" . $row2[$tabless_name] . "]\n";
         }
         $explore_infos = "";
         $result_s = $db->query("SELECT * FROM cc" . $n . "_explore  WHERE  race='{$target_race}'");
         while ($row_s = $db->fetch_array($result_s)) {
             $name = c_trim($row_s['name']);
             $tabless_name = $row_s['tabless'];
             $explore_infos .= $name . "  [" . $row2[$tabless_name] . "]\n";
         }
         $sol_infos = "";
         $name = "";
         $result_ss = $db->query("SELECT * FROM cc" . $n . "_soldiers  WHERE  race='{$target_race}'");
         while ($row_ss = $db->fetch_array($result_ss)) {
             $name = c_trim($row_ss['name']);
             $tabless_name = $row_ss['tabless'];
             $sol_infos .= $name . "  [" . $row2[$tabless_name] . "]\n";
         }
         $tpl->assign('out_buildings', $out_buildings);
         $tpl->assign('explore_infos', $explore_infos);
         $tpl->assign('sol_infos', $sol_infos);
         $tpl->assign('spioland', $spioland);
         $spion_message = $tpl->fetch(LITO_THEMES_PATH . $modul_name . '/spion_message_ok.html');
     } else {
         $tpl->assign('spioland', $spioland);
         $spion_message = $tpl->fetch(LITO_THEMES_PATH . $modul_name . '/spion_message_nok.html');
     }
     $db->query("DELETE FROM cc" . $n . "_spions WHERE spionid='{$spion_id}'");
     make_ingamemail(0, $userdata['userid'], "Spionage auf " . $spioland, $spion_message);
 }