2 #################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename sysmsg.php ##
## Developed by: Dixie ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
4 include_once("GameEngine/Account.php");
6 mysql_connect(SQL_SERVER
, SQL_USER
, SQL_PASS
);
7 mysql_select_db(SQL_DB
);
8 if (mysql_num_rows(mysql_query("SELECT id FROM ".TB_PREFIX
."users WHERE access = 9 AND id = ".$session->uid
)) != '1') die("Hacking attempt!");
10 if(isset($_GET['del'])){
11 $query="SELECT * FROM ".TB_PREFIX
."users ORDER BY id + 0 DESC";
12 $result=mysql_query($query) or die (mysql_error());
13 for ($i=0; $row=mysql_fetch_row($result); $i++
) {
14 $updateattquery = mysql_query("UPDATE ".TB_PREFIX
."users SET ok = '0' WHERE id = '".$row[0]."'")
15 or die(mysql_error());
19 if (@$_POST['submit'] == "Send")
21 unset ($_SESSION['m_message']);
22 $_SESSION['m_message'] = $_POST['message'];
27 if (@isset
($_POST['confirm']))
29 if ($_POST['confirm'] == 'No' ) $Interupt = true;
30 if ($_POST['confirm'] == 'Yes'){
32 if(file_exists("Templates/text.tpl")) {
34 $myFile = "Templates/text.tpl";
35 $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: templates/text.tpl");
36 $text = file_get_contents("Templates/text_format.tpl");
37 $text = preg_replace("'%TEKST%'",$_SESSION['m_message'] ,$text);
40 $query="SELECT * FROM ".TB_PREFIX
."users ORDER BY id + 0 DESC";
41 $result=mysql_query($query) or die (mysql_error());
42 for ($i=0; $row=mysql_fetch_row($result); $i++
) {
43 $updateattquery = mysql_query("UPDATE ".TB_PREFIX
."users SET ok = '1' WHERE id = '".$row[0]."'")
44 or die(mysql_error());
47 } else { die("<br/><br/><br/>wrong"); }
51 <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
54 <title
><?php
echo SERVER_NAME ?
></title
>
55 <link REL
="shortcut icon" HREF
="favicon.ico"/>
56 <meta http
-equiv
="cache-control" content
="max-age=0" />
57 <meta http
-equiv
="pragma" content
="no-cache" />
58 <meta http
-equiv
="expires" content
="0" />
59 <meta http
-equiv
="imagetoolbar" content
="no" />
60 <meta http
-equiv
="content-type" content
="text/html; charset=UTF-8" />
62 <script src
="mt-full.js?0ac36" type
="text/javascript"></script
>
63 <script src
="unx.js?0ac36" type
="text/javascript"></script
>
64 <script src
="new.js?0ac36" type
="text/javascript"></script
>
65 <link href
="<?php echo GP_LOCATE; ?>lang/en/lang.css?f4b7c" rel
="stylesheet" type
="text/css" />
66 <link href
="<?php echo GP_LOCATE; ?>lang/en/compact.css?f4b7c" rel
="stylesheet" type
="text/css" />
68 if($session->gpack
== null || GP_ENABLE
== false) {
70 <link href='".GP_LOCATE
."travian.css?e21d2' rel='stylesheet' type='text/css' />
71 <link href='".GP_LOCATE
."lang/en/lang.css?e21d2' rel='stylesheet' type='text/css' />";
74 <link href='".$session->gpack
."travian.css?e21d2' rel='stylesheet' type='text/css' />
75 <link href='".$session->gpack
."lang/en/lang.css?e21d2' rel='stylesheet' type='text/css' />";
78 <script type
="text/javascript">
80 window
.addEvent('domready', start
);
84 if($session->gpack
== null || GP_ENABLE
== false) {
86 <link href='".GP_LOCATE
."travian.css?e21d2' rel='stylesheet' type='text/css' />
87 <link href='".GP_LOCATE
."lang/en/lang.css?e21d2' rel='stylesheet' type='text/css' />";
90 <link href='".$session->gpack
."travian.css?e21d2' rel='stylesheet' type='text/css' />
91 <link href='".$session->gpack
."lang/en/lang.css?e21d2' rel='stylesheet' type='text/css' />";
94 <script type
="text/javascript">
95 window
.addEvent('domready', start
);
100 <body
class="v35 ie ie8">
101 <div
class="wrapper">
102 <img style
="filter:chroma();" src
="img/x.gif" id
="msfilter" alt
="" />
103 <div id
="dynamic_header">
105 <?php
include("Templates/header.tpl"); ?
>
107 <?php
include("Templates/menu.tpl"); ?
>
109 <div id
="content" class="login">
110 <?php
if (@!$NextStep && @!$NextStep2 && @!$done){?
>
111 <form method
="POST" action
="sysmsg.php" name
="myform" id
="myform">
112 <table cellspacing
="1" cellpadding
="1" class="tbg" style
="background-color:#C0C0C0; border: 0px solid #C0C0C0; font-size: 10pt;">
115 <td
class="rbg" style
="font-size: 10pt; text-align:center;">System Message
</td
>
118 <td style
="font-size: 10pt; text-align:center;">Text BBCode
:<br
><b
>[b
] txt
[/b
]</b
> - <i
>[i
] txt
[/i
]</i
> - <u
>[u
] txt
[/u
]</u
> <br
/>
119 <textarea
class="fm" name
="message" cols
="60" rows
="23"></textarea
></td
>
122 <td style
="text-align:center;">All fields required
</td
>
125 <td style
="text-align:center;">
126 <input type
="submit" value
="Send" name
="submit" /> </td
>
131 <a href
="sysmsg.php?del">Delete old System Message
</a
>
132 <?php
}elseif (@$NextStep){?
>
133 <form method
="POST" action
="sysmsg.php">
134 <table cellspacing
="1" cellpadding
="2" class="tbg">
137 <td
class="rbg" colspan
="2">Confirmation
</td
>
140 <td style
="text-align: left; width: 200px;">Do you really want to send System Message?
</td
>
141 <td style
="text-align: left;">
142 <input type
="submit" style
="width: 240px;" class="fm" name
="confirm" value
="Yes">
143 <input type
="submit" style
="width: 240px;" class="fm" name
="confirm" value
="No"></td
>
148 Example
: (BBCode doesn
't work over here!)
150 $txt=$_SESSION['m_message
'];
151 $txt = preg_replace("/\[b\]/is",'<b
>', $txt);
152 $txt = preg_replace("/\[\/b\]/is",'</b
>', $txt);
153 $txt = preg_replace("/\[i\]/is",'<i
>', $txt);
154 $txt = preg_replace("/\[\/i\]/is",'</i
>', $txt);
155 $txt = preg_replace("/\[u\]/is",'<u
>', $txt);
156 $txt = preg_replace("/\[\/u\]/is",'</u
>', $txt);
159 }elseif (@$Interupt){?>
160 <b><?php echo MASS_ABORT; ?></b>
162 <?php }elseif (@$done){?>
163 System Message was sent
164 <?php }else{die("Something is wrong");}?>
166 <div id="side_info" class="outgame">
169 <div class="clear"></div>
172 <div class="footer-stopper outgame"></div>
173 <div class="clear"></div>
175 <?php include("Templates/footer.tpl"); ?>
179 <?php mysql_close(); ?>