3 #################################################################################
4 ## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
5 ## --------------------------------------------------------------------------- ##
6 ## Filename massmessage.php ##
7 ## Developed by: Dzoki ##
8 ## License: TravianX Project ##
9 ## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
11 #################################################################################
13 include_once("GameEngine/Account.php");
15 mysql_connect(SQL_SERVER
, SQL_USER
, SQL_PASS
);
16 mysql_select_db(SQL_DB
);
17 if (mysql_num_rows(mysql_query("SELECT id FROM ".TB_PREFIX
."users WHERE access = 9 AND id = ".$session->uid
)) != '1') die("Hacking attemp!");
19 if (@$_POST['submit'] == "Send")
21 unset ($_SESSION['m_message']); unset ($_SESSION['m_subject']); unset ($_SESSION['m_color']);
22 if (!$_POST['message']){die("You have to enter message");}
23 if (!$_POST['subject']){die("You have to enter subject");}
24 if (!$_POST['color']){$_SESSION['m_color'] = "black";}
25 $_SESSION['m_subject'] = $_POST['subject'];
26 if (!$_SESSION['m_color']){$_SESSION['m_color'] = $_POST['color'];}
27 $_SESSION['m_message'] = $_POST['message'];
32 if (@isset
($_POST['confirm']))
34 if ($_POST['confirm'] == 'Yes') $NextStep2 = true;
35 if ($_POST['confirm'] == 'No' ) $Interupt = true;
40 if (isset($_GET['send']) && isset($_GET['from']))
42 $_SESSION['m_message'] = preg_replace("/\[img\]([a-z0-9\_\.\:\/\-]*)\[\/img\]/i","<img src='$1' alt='Corrupted image'/>", $_SESSION['m_message']);
43 $_SESSION['m_message'] = preg_replace("/\[url\]([a-z0-9\_\.\:\/\-]*)\[\/url\]/i", "<a href='$1'>$1</a>", $_SESSION['m_message']);
44 $_SESSION['m_message'] = preg_replace("/\[url\=([a-z0-9\_\.\:\/\-]*)\]([a-z0-9\_\.\:\/\-]*)\[\/url\]/i", "<a href='$1'>$2</a>", $_SESSION['m_message']);
45 $_SESSION['m_message'] = preg_replace("/\*u([0-9]*)(left|right)\*/i", "<img src='img/u2/u$1.gif' style='float:$2;' alt='unit$1' />", $_SESSION['m_message']);
47 $users_count = mysql_fetch_assoc(mysql_query("SELECT count(*) as count FROM ".TB_PREFIX
."users WHERE id != 0"));
48 $users_count = $users_count['count'];
49 if ($_GET['from'] +
$max_per_pass <= $users_count) $plus = $max_per_pass; else $plus = $users_count - $_GET['from'];
50 $sql = "INSERT INTO ".TB_PREFIX
."mdata (`target`, `owner`, `topic`, `message`, `viewed`, `archived`, `send`, `time`) VALUES ";
51 for($i = $_GET['from']; $i < ($_GET['from'] +
$plus) ; $i++
) {
52 if ($_SESSION['m_color'])
54 $sql .= "($i, 0, '<span style=\'color:{$_SESSION['m_color']};\'>{$_SESSION['m_subject']}</span>', \"{$_SESSION['m_message']}\", 0, 0, 0, ".time()."),";
58 $sql .= "($i, 0, '{$_SESSION['m_subject']}', \"{$_SESSION['m_message']}\", 0, 0, 0, ".time()."),";
61 if ($_SESSION['m_color'])
63 $sql .= "($i, 0, '<span style=\'color:{$_SESSION['m_color']};\'>{$_SESSION['m_subject']}</span>', \"{$_SESSION['m_message']}\", 0, 0, 0, ".time().")";
67 $sql .= "($i, 0, '{$_SESSION['m_subject']}', \"{$_SESSION['m_message']}\", 0, 0, 0, ".time()."),";
70 if (($users_count - $_GET['from']) > $max_per_pass) echo header("Location: massmessage.php?send=true&from=",$_GET['from'] +
$max_per_pass); else $done = true;
74 <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
77 <title
><?php
echo SERVER_NAME
; ?
></title
>
78 <link REL
="shortcut icon" HREF
="favicon.ico"/>
81 border
:1px solid
#71D000;
88 background
-color
:#C0C0C0;
95 .uu1
{background
-image
: url(img
/u2
/u1
.gif
);}
96 .uu2
{background
-image
: url(img
/u2
/u2
.gif
);}
97 .uu3
{background
-image
: url(img
/u2
/u3
.gif
);}
98 .uu4
{background
-image
: url(img
/u2
/u4
.gif
);}
99 .uu5
{background
-image
: url(img
/u2
/u5
.gif
);}
100 .uu6
{background
-image
: url(img
/u2
/u6
.gif
);}
101 .uu7
{background
-image
: url(img
/u2
/u7
.gif
);}
102 .uu8
{background
-image
: url(img
/u2
/u8
.gif
);}
103 .uu9
{background
-image
: url(img
/u2
/u9
.gif
);}
104 .uu10
{background
-image
: url(img
/u2
/u10
.gif
);}
105 .uu11
{background
-image
: url(img
/u2
/u11
.gif
);}
106 .uu12
{background
-image
: url(img
/u2
/u12
.gif
);}
107 .uu13
{background
-image
: url(img
/u2
/u13
.gif
);}
108 .uu14
{background
-image
: url(img
/u2
/u14
.gif
);}
109 .uu15
{background
-image
: url(img
/u2
/u15
.gif
);}
110 .uu16
{background
-image
: url(img
/u2
/u16
.gif
);}
111 .uu17
{background
-image
: url(img
/u2
/u17
.gif
);}
112 .uu18
{background
-image
: url(img
/u2
/u18
.gif
);}
113 .uu19
{background
-image
: url(img
/u2
/u19
.gif
);}
114 .uu20
{background
-image
: url(img
/u2
/u20
.gif
);}
115 .uu21
{background
-image
: url(img
/u2
/u21
.gif
);}
116 .uu22
{background
-image
: url(img
/u2
/u22
.gif
);}
117 .uu23
{background
-image
: url(img
/u2
/u23
.gif
);}
118 .uu24
{background
-image
: url(img
/u2
/u24
.gif
);}
119 .uu25
{background
-image
: url(img
/u2
/u25
.gif
);}
120 .uu26
{background
-image
: url(img
/u2
/u26
.gif
);}
121 .uu27
{background
-image
: url(img
/u2
/u27
.gif
);}
122 .uu28
{background
-image
: url(img
/u2
/u28
.gif
);}
123 .uu29
{background
-image
: url(img
/u2
/u29
.gif
);}
124 .uu30
{background
-image
: url(img
/u2
/u30
.gif
);}
125 .uu1
, .uu2
, .uu3
, .uu4
, .uu5
, .uu6
, .uu7
, .uu8
, .uu9
, .uu10
, u11
, .uu12
, .uu13
, .uu14
, .uu15
, .uu16
, .uu17
, .uu18
, .uu19
, .uu20
, .uu21
, .uu22
, .uu23
, .uu24
, .uu25
, .uu26
, .uu27
, .uu28
, .uu29
, .uu30
131 div
.messages div
#message_container div#message_toolbarWindows div, div#text_container div#text_toolbarWindows div {
132 background
:none repeat scroll
0 0 #EFEFEF;
133 border
:1px solid
#71D000;
141 .uu19
{width
: 150px
;}
142 .uu20
{width
: 150px
;}
143 .uu17
{width
: 150px
;}
147 <script language
="javascript" type
="text/javascript">
148 function smilie(text
) {
149 document
.myform
.message
.value +
= text
;
153 <script language
="javascript">
154 function toggleDisplay(e
){
155 element
= document
.getElementById(e
).style
;
156 element
.display
== 'none' ? element
.display
= 'block' :
157 element
.display
='none';
161 <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
164 <title
><?php
echo SERVER_NAME ?
></title
>
165 <link REL
="shortcut icon" HREF
="favicon.ico"/>
166 <meta http
-equiv
="cache-control" content
="max-age=0" />
167 <meta http
-equiv
="pragma" content
="no-cache" />
168 <meta http
-equiv
="expires" content
="0" />
169 <meta http
-equiv
="imagetoolbar" content
="no" />
170 <meta http
-equiv
="content-type" content
="text/html; charset=UTF-8" />
172 <script src
="mt-full.js?0ac36" type
="text/javascript"></script
>
173 <script src
="unx.js?0ac36" type
="text/javascript"></script
>
174 <script src
="new.js?0ac36" type
="text/javascript"></script
>
175 <link href
="<?php echo GP_LOCATE; ?>lang/en/lang.css?f4b7c" rel
="stylesheet" type
="text/css" />
176 <link href
="<?php echo GP_LOCATE; ?>lang/en/compact.css?f4b7c" rel
="stylesheet" type
="text/css" />
178 if($session->gpack
== null || GP_ENABLE
== false) {
180 <link href='".GP_LOCATE
."travian.css?e21d2' rel='stylesheet' type='text/css' />
181 <link href='".GP_LOCATE
."lang/en/lang.css?e21d2' rel='stylesheet' type='text/css' />";
184 <link href='".$session->gpack
."travian.css?e21d2' rel='stylesheet' type='text/css' />
185 <link href='".$session->gpack
."lang/en/lang.css?e21d2' rel='stylesheet' type='text/css' />";
188 <script type
="text/javascript">
190 window
.addEvent('domready', start
);
194 if($session->gpack
== null || GP_ENABLE
== false) {
196 <link href='".GP_LOCATE
."travian.css?e21d2' rel='stylesheet' type='text/css' />
197 <link href='".GP_LOCATE
."lang/en/lang.css?e21d2' rel='stylesheet' type='text/css' />";
200 <link href='".$session->gpack
."travian.css?e21d2' rel='stylesheet' type='text/css' />
201 <link href='".$session->gpack
."lang/en/lang.css?e21d2' rel='stylesheet' type='text/css' />";
204 <script type
="text/javascript">
205 window
.addEvent('domready', start
);
210 <body
class="v35 ie ie8">
211 <div
class="wrapper">
212 <img style
="filter:chroma();" src
="img/x.gif" id
="msfilter" alt
="" />
213 <div id
="dynamic_header">
215 <?php
include("Templates/header.tpl"); ?
>
217 <?php
include("Templates/menu.tpl"); ?
>
219 <div id
="content" class="login">
220 <?php
if (@!$NextStep && @!$NextStep2 && @!$done){?
>
221 <form method
="POST" action
="massmessage.php" name
="myform" id
="myform">
222 <table cellspacing
="1" cellpadding
="2" class="tbg" style
="background-color:#C0C0C0; border: 0px solid #C0C0C0; font-size: 10pt;">
225 <td
class="rbg" style
="font-size: 10pt; text-align:center;" colspan
="2"><?php
echo MASS
; ?
></td
>
228 <td style
="font-size: 10pt; text-align: left; width: 200px;"><?php
echo MASS_SUBJECT
; ?
></td
>
229 <td style
="font-size: 10pt; text-align: left;">
230 <input type
="text" style
="width: 240px;" class="fm" name
="subject" value
="" size
="30"></td
>
233 <td style
="font-size: 10pt; text-align: left;"><?php
echo MASS_COLOR
; ?
></td
>
234 <td style
="font-size: 10pt; text-align: left;">
237 <input type
="text" style
="width: 240px;" class="fm" name
="color" size
="30"></td
>
240 <td colspan
="2" style
="font-size: 10pt; text-align:center;"><?php
echo MASS
; ?
> <br
>
241 <textarea
class="fm" name
="message" cols
="60" rows
="23"></textarea
></td
>
244 <td colspan
="2" style
="text-align:center;"><?php
echo MASS_REQUIRED
; ?
><td
>
247 <td colspan
="2" style
="text-align:center;">
248 <input type
="submit" value
="Send" name
="submit" /> </td
>
253 <?php
if (@!$NextStep && @!$NextStep2 && @!$done){?
>
254 <?php
echo MASS_UNITS
; ?
>
255 <a href
="javascript:toggleDisplay('message_smilies')"><?php
echo MASS_SHOWHIDE
; ?
></a
>
257 <div name
="smilll" id
="message_smilies" style
="background:none repeat scroll 0 0 #EFEFEF;border:1px solid #71D000;left:20px;margin-top:5px;max-width:660px;padding:5px;position:relative;display: none;">
258 <?php
echo MASS_READ
; ?
>
259 <a href
="#" onclick
="smilie('*u1*')"><img src
="img/x.gif" class="uu1" /></a
>
260 <a href
="#" onclick
="smilie('*u2*')"><img src
="img/x.gif" class="uu2" /></a
>
261 <a href
="#" onclick
="smilie('*u3*')"><img src
="img/x.gif" class="uu3" /></a
>
262 <a href
="#" onclick
="smilie('*u4*')"><img src
="img/x.gif" class="uu4" /></a
>
263 <a href
="#" onclick
="smilie('*u5*')"><img src
="img/x.gif" class="uu5" /></a
>
264 <a href
="#" onclick
="smilie('*u6*')"><img src
="img/x.gif" class="uu6" /></a
>
265 <a href
="#" onclick
="smilie('*u7*')"><img src
="img/x.gif" class="uu7" /></a
>
266 <a href
="#" onclick
="smilie('*u8*')"><img src
="img/x.gif" class="uu8" /></a
>
267 <a href
="#" onclick
="smilie('*u9*')"><img src
="img/x.gif" class="uu9" /></a
>
268 <a href
="#" onclick
="smilie('*u10*')"><img src
="img/x.gif" class="uu10" /></a
>
269 <a href
="#" onclick
="smilie('*u11*')"><img src
="img/x.gif" class="uu11" /></a
>
270 <a href
="#" onclick
="smilie('*u12*')"><img src
="img/x.gif" class="uu12" /></a
><br
/>
271 <a href
="#" onclick
="smilie('*u13*')"><img src
="img/x.gif" class="uu13" /></a
>
272 <a href
="#" onclick
="smilie('*u14*')"><img src
="img/x.gif" class="uu14" /></a
>
273 <a href
="#" onclick
="smilie('*u15*')"><img src
="img/x.gif" class="uu15" /></a
>
274 <a href
="#" onclick
="smilie('*u16*')"><img src
="img/x.gif" class="uu16" /></a
>
275 <a href
="#" onclick
="smilie('*u17*')"><img src
="img/x.gif" class="uu17" /></a
>
276 <a href
="#" onclick
="smilie('*u18*')"><img src
="img/x.gif" class="uu18" /></a
>
277 <a href
="#" onclick
="smilie('*u19*')"><img src
="img/x.gif" class="uu19" /></a
>
278 <a href
="#" onclick
="smilie('*u21*')"><img src
="img/x.gif" class="uu21" /></a
>
279 <a href
="#" onclick
="smilie('*u22*')"><img src
="img/x.gif" class="uu22" /></a
>
280 <a href
="#" onclick
="smilie('*u23*')"><img src
="img/x.gif" class="uu23" /></a
>
281 <a href
="#" onclick
="smilie('*u24*')"><img src
="img/x.gif" class="uu24" /></a
><br
/>
282 <a href
="#" onclick
="smilie('*u25*')"><img src
="img/x.gif" class="uu25" /></a
>
283 <a href
="#" onclick
="smilie('*u26*')"><img src
="img/x.gif" class="uu26" /></a
>
284 <a href
="#" onclick
="smilie('*u29*')"><img src
="img/x.gif" class="uu29" /></a
>
288 <?php
}elseif (@$NextStep){?
>
289 <form method
="POST" action
="massmessage.php">
290 <table cellspacing
="1" cellpadding
="2" class="tbg">
293 <td
class="rbg" colspan
="2"><?php
echo MASS_CONFIRM
; ?
></td
>
296 <td style
="text-align: left; width: 200px;"><?php
echo MASS_REALLY
; ?
></td
>
297 <td style
="text-align: left;">
298 <input type
="submit" style
="width: 240px;" class="fm" name
="confirm" value
="Yes">
299 <input type
="submit" style
="width: 240px;" class="fm" name
="confirm" value
="No"></td
>
304 <?php
}elseif (@$NextStep2){?
>
305 <script
>document
.location
.href
='massmessage.php?send=true&from=0'</script
>
307 <?php
}elseif (@$Interupt){?
>
308 <b
><?php
echo MASS_ABORT
; ?
></b
>
310 <?php
}elseif (@$done){?
>
311 <?php
echo MASS_SENT
; ?
>
312 <?php
}else{die("Something is wrong");}?
>
314 <div id
="side_info" class="outgame">
317 <div
class="clear"></div
>
320 <div
class="footer-stopper outgame"></div
>
321 <div
class="clear"></div
>
323 <?php
include("Templates/footer.tpl"); ?
>
327 <?php
mysql_close(); ?
>