33 $GLOBALS[
"xoTheme"]->addStylesheet(null, null,
'
37 background-color: #f8f8f8;
39 border: 1px solid #000;
44 background: url( images/password.png) no-repeat center top;
47 .login_form .credentials {
50 background-color: #ccc;
53 .login_form .credentials label {
54 display: inline-block;
58 .login_form .credentials input {
62 border: 1px solid #000;
64 .login_form .credentials input:focus {
65 border: 1px solid #2266cc;
67 .login_form .actions {
68 padding: 1.5em .5em .5em;
79 echo
"<div id='login_window'>
81 <form method='post' action='banners.php' class='login_form'>
82 <div class='credentials'>
84 <input type='text' name='login' id='login_form-login' value='' /><br />
86 <input type='password' name='pass' id='login_form-password' value='' /><br />
88 <div class='actions'><input type='hidden' name='op' value='Ok' /><button type='submit'>" .
_BANNERS_LOGIN_OK .
"</button></div>
91 include
$GLOBALS[
'xoops']->path(
'footer.php');
105 $result = $xoopsDB->query(sprintf(
"SELECT cid, name, passwd FROM %s WHERE login=%s", $xoopsDB->prefix(
"bannerclient"), $xoopsDB->quoteString(
$_SESSION[
'banner_login'])));
106 list ($cid, $name, $passwd) = $xoopsDB->fetchRow(
$result);
107 if (
$_SESSION[
'banner_pass'] == $passwd) {
108 include
$GLOBALS[
'xoops']->path(
'header.php');
109 $GLOBALS[
"xoTheme"]->addStylesheet(null, null,
'
116 echo
"<div id='bannerstats'>
117 <h4 class='content_title'>" . sprintf(
_BANNERS_TITLE, $name) .
"</h4><hr />
128 <tfoot><tr><td colspan='7'></td></tr></tfoot>";
130 $result = $xoopsDB->query(
"SELECT bid, imptotal, impmade, clicks, date FROM " . $xoopsDB->prefix(
"banner") .
" WHERE cid={$cid}");
132 while (list ($bid, $imptotal, $impmade, $clicks,
$date) = $xoopsDB->fetchRow(
$result)) {
136 $percent = substr(100 * $clicks / $impmade, 0, 5);
138 if ($imptotal == 0) {
141 $left = $imptotal - $impmade;
143 $class = (
$i % 2 == 0) ?
'even' :
'odd';
144 echo
"<tbody><tr class='{$class}'>
151 <td><a href='banners.php?op=EmailStats&cid={$cid}&bid={$bid}' title='" .
_BANNERS_STATS .
"'>" .
_BANNERS_STATS .
"</a></td></tr></tbody>";
156 <h4 class='content_title'>" .
_BANNERS_FOW_IN . htmlspecialchars($xoopsConfig[
'sitename']) .
"</h4><hr />";
158 $result = $xoopsDB->query(
"SELECT bid, imageurl, clickurl, htmlbanner, htmlcode FROM " . $xoopsDB->prefix(
"banner") .
" WHERE cid={$cid}");
159 while (list ($bid, $imageurl, $clickurl, $htmlbanner, $htmlcode) = $xoopsDB->fetchRow(
$result)) {
160 $numrows = $xoopsDB->getRowsNum(
$result);
164 if (!empty($htmlbanner) && !empty($htmlcode)) {
165 echo $myts->displayTarea($htmlcode);
167 if (strtolower(substr($imageurl, strrpos($imageurl,
"."))) ==
".swf") {
168 echo
"<object type='application/x-shockwave-flash' width='468' height='60' data='{$imageurl}'>";
169 echo
"<param name='movie' value='{$imageurl}' />";
170 echo
"<param name='quality' value='high' />";
173 echo
"<img src='{$imageurl}' alt='' />";
176 echo
"<br /><strong>" .
_BANNERS_ID . $bid .
"</strong><br />" . sprintf(
_BANNERS_SEND_STATS,
'banners.php?op=EmailStats&cid=' . $cid .
'&bid=' . $bid) .
"<br />";
178 $clickurl = htmlspecialchars($clickurl, ENT_QUOTES);
180 <form action='banners.php' method='post'>" .
_BANNERS_URL .
"
181 <input type='text' name='url' size='50' maxlength='200' value='{$clickurl}' />
182 <input type='hidden' name='bid' value='{$bid}' />
183 <input type='hidden' name='cid' value='{$cid}' />
184 <input type='submit' name='op' value='" .
_BANNERS_CHANGE .
"' />" .
$GLOBALS[
'xoopsSecurity']->getTokenHTML(
"BANNER_EDIT") .
"</form>";
190 if (
$result = $xoopsDB->query(
"SELECT bid, impressions, clicks, datestart, dateend FROM " . $xoopsDB->prefix(
"bannerfinish") .
" WHERE cid={$cid}")) {
191 echo
"<h4 class='content_title'>" . sprintf(
_BANNERS_FINISHED, $name) .
"</h4><hr />
201 <tfoot><tr><td colspan='6'></td></tr></tfoot>";
204 while (list ($bid, $impressions, $clicks, $datestart, $dateend) = $xoopsDB->fetchRow(
$result)) {
205 if ($impressions == 0) {
208 $percent = substr(100 * $clicks / $impressions, 0, 5);
210 $class = (
$i % 2 == 0) ?
'even' :
'odd';
211 echo
"<tbody><tr class='{$class}'>
213 <td>{$impressions}</td>
219 echo
"</table></div>";
221 include
$GLOBALS[
'xoops']->path(
'footer.php');
238 if ($result2 = $xoopsDB->query(sprintf(
"SELECT name, email, passwd FROM %s WHERE cid=%u AND login=%s", $xoopsDB->prefix(
"bannerclient"), $cid, $xoopsDB->quoteString(
$_SESSION[
'banner_login'])))) {
239 list ($name,
$email, $passwd) = $xoopsDB->fetchRow($result2);
240 if (
$_SESSION[
'banner_pass'] == $passwd) {
245 if (
$result = $xoopsDB->query(
"SELECT bid, imptotal, impmade, clicks, imageurl, clickurl, date FROM " . $xoopsDB->prefix(
"banner") .
" WHERE bid={$bid} AND cid={$cid}")) {
246 list ($bid, $imptotal, $impmade, $clicks, $imageurl, $clickurl,
$date) = $xoopsDB->fetchRow(
$result);
250 $percent = substr(100 * $clicks / $impmade, 0, 5);
252 if ($imptotal == 0) {
256 $left = $imptotal - $impmade;
258 $fecha = date(
"F jS Y, h:iA.");
260 $message = sprintf(
_BANNERS_MAIL_MESSAGE, $xoopsConfig[
'sitename'], $name, $bid, $imageurl, $clickurl, $imptotal, $impmade, $left, $clicks, $percent, $fecha);
262 $xoopsMailer->useMail();
263 $xoopsMailer->setToEmails(
$email);
264 $xoopsMailer->setFromEmail($xoopsConfig[
'adminmail']);
265 $xoopsMailer->setFromName($xoopsConfig[
'sitename']);
266 $xoopsMailer->setSubject($subject);
267 $xoopsMailer->setBody($message);
268 $xoopsMailer->send();
290 $sql = sprintf(
"SELECT passwd FROM %s WHERE cid=%u AND login=%s", $xoopsDB->prefix(
"bannerclient"), $cid, $xoopsDB->quoteString(
$_SESSION[
'banner_login']));
292 list ($passwd) = $xoopsDB->fetchRow(
$result);
293 if (
$_SESSION[
'banner_pass'] == $passwd) {
294 $sql = sprintf(
"UPDATE %s SET clickurl=%s WHERE bid=%u AND cid=%u", $xoopsDB->prefix(
"banner"), $xoopsDB->quoteString(
$url), $bid, $cid);
295 if ($xoopsDB->query(
$sql)) {
311 $bresult = $xoopsDB->query(
"SELECT clickurl FROM " . $xoopsDB->prefix(
"banner") .
" WHERE bid={$bid}");
312 list ($clickurl) = $xoopsDB->fetchRow($bresult);
314 if (
$GLOBALS[
'xoopsSecurity']->checkReferer()) {
315 $xoopsDB->queryF(
"UPDATE " . $xoopsDB->prefix(
"banner") .
" SET clicks=clicks+1 WHERE bid=$bid");
316 header(
'Location: ' . $clickurl);
329 if (!empty(
$_POST[
'op'])) {
331 }
else if (!empty(
$_GET[
'op'])) {
339 if (!empty(
$_GET[
'bid'])) {
340 $bid = intval(
$_GET[
'bid']);
345 if (
$_SERVER[
'REQUEST_METHOD'] ==
'POST') {
346 if (!
$GLOBALS[
'xoopsSecurity']->check(
true,
false,
"BANNER_LOGIN")) {
357 if (!
$GLOBALS[
'xoopsSecurity']->check(
true,
false,
"BANNER_EDIT")) {
362 if (!empty(
$_POST[
'url'])) {
365 if (!empty(
$_POST[
'bid'])) {
366 $bid = intval(
$_POST[
'bid']);
368 if (!empty(
$_POST[
'cid'])) {
369 $cid = intval(
$_POST[
'cid']);
375 if (!empty(
$_GET[
'bid'])) {
376 $bid = intval(
$_GET[
'bid']);
378 if (!empty(
$_GET[
'cid'])) {
379 $cid = intval(
$_GET[
'cid']);