Example #1
0
$site = ad_getsite($p);
ad_connect_db("db");
$qh = ad_query("select * from ads where adid = '{$ad}'");
$nr = ad_queryrows($qh);
if ($nr > 0) {
    $r = ad_fetch($qh);
} else {
    return;
}
// Add entry to mysql log
$qh = ad_query("insert into adlog SET " . "adid = '{$r['adid']}'," . "type = 'click'," . "remotehost = '{$REMOTE_HOST}'," . "remoteaddr = '{$REMOTE_ADDR}'," . "site = '{$site['name']}'," . "entrydate = '{$dt}'");
// Update Information (unless localhost)
if (!ad_is_localhost()) {
    // Update click count
    $r[clicks] = $r[clicks] + 1;
    $qh = ad_query("update ads SET clicks = '{$r['clicks']}' WHERE adid = '{$ad}'");
    // If logfile is not empty, make an entry
    // Format: YYYY-MM-DD HH:MM:SS CLICK|HIT domain clientaddress
    if (!empty($r[logfile])) {
        if ($fp = fopen($ad_logpath_default . "/" . $r[logfile], "a+")) {
            $ca = getenv("REMOTE_HOST");
            if (empty($ca)) {
                $ca = getenv("REMOTE_ADDR");
            }
            fputs($fp, "{$dt} CLICK {$site['name']} {$ca}\n");
            fclose($fp);
        }
    }
}
// Redirect to URL
header("Location: {$r['url']}");
						<th>Hits</th>
						<th>Clicks</th>

						<th>Current State</th>

						<th>View Log</th>
						<th>Edit</th>
						<th class="last">Delete</th>
					</tr>
					<?php 
    $now = strftime("%Y-%m-%d %H:%M:%S", time());
    ad_connect_db("ads");
    if (empty($sort)) {
        $sort = "title";
    }
    $qh = ad_query("select * from ads order by {$sort},title");
    if (!$qh) {
        die("Database Error");
    }
    $nr = ad_queryrows($qh);
    $ct = 0;
    $i = 0;
    if ($nr > 0) {
        $array_hits_value = array();
        $array_clicks_value = array();
        while ($nr > $ct) {
            $ad = ad_fetch($qh);
            if ($ad['expiredate'] > $now) {
                ?>
					<tr>
						<td class="first style1">
Example #3
0
     if (!empty($edit)) {
         include "edit.domain.php";
     } else {
         show_domains();
     }
     break;
 case "log":
     viewlog($id, $size);
     break;
 case "resetstats":
     $dt = strftime("%Y-%m-%d %H:%M:%S", time());
     ad_connect_db();
     if (!empty($id)) {
         ad_query("update ads set hits=0,clicks=0,statsreset='{$dt}' where adid = '{$id}'");
     } else {
         ad_query("update ads set hits=0,clicks=0,statsreset='{$dt}'");
     }
     if (!empty($rp)) {
         include "{$rp}";
     } else {
         include "admin.editad.php";
     }
     break;
 case "optdb":
     optdb();
     break;
 case "buildhc":
     buildhc();
     break;
 case "imgsize":
     getimgsize($img);
Example #4
0
    } else {
        return;
    }
} else {
    qpe(&$title, &$banner, &$url, &$trackingurl, &$logfile, &$textad, &$textadurl, &$notes);
    $domains = implode("|", $domains);
    if ($logtype != NULL) {
        $logtype = join(",", $logtype);
    } else {
        $logtype = "";
    }
    if (strtoupper($updmodifydate) == 'ON') {
        $modifydate = strftime("%Y-%m-%d %H:%M:%S", time());
    }
    $iq = "update ads set " . "domains='{$domains}'," . "title='{$title}'," . "banner='{$banner}'," . "width='{$width}'," . "height='{$height}'," . "url='{$url}'," . "logfile='{$logfile}'," . "trackingurl='{$trackingurl}'," . "textad='{$textad}'," . "textadurl='{$textadurl}'," . "hits='{$hits}'," . "clicks='{$clicks}'," . "adclass='{$adclass}'," . "logtype='{$logtype}'," . "createdate='{$createdate}'," . "modifydate='{$modifydate}'," . "expiredate='{$expiredate}'," . "lastdisplay='{$lastdisplay}'," . "statsreset='{$statsreset}'," . "active='{$active}'," . "notes='{$notes}'" . " where adid='{$edit}'";
    $qh = ad_query($iq);
    print mysql_error();
    $edit = "";
    $new = FALSE;
    include "admin.php";
    return;
}
?>

<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--

function getimagesize() {
    window.open("admin.php?view=imgsize&img=" + editad.banner.value, "getimagesize",
           "height=70,width=250,resizable=1");
}
            | pass      | varchar(64)  | YES  |     | NULL    |                |
            | firstname | varchar(64)  | YES  |     | NULL    |                |
            | lastname  | varchar(64)  | YES  |     | NULL    |                |
            | email     | varchar(64)  | YES  |     | NULL    |                |
            | zcode     | varchar(64)  | YES  |     | NULL    |                |
            | active    | int(1)       | YES  |     | NULL    |                |
            | id        | int(12)      |      | PRI | NULL    | auto_increment |
            | status    | int(1)       | YES  |     | NULL    |                |
            | timestamp | int(15)      |      |     | 0       |                |
            | ip        | varchar(40)  |      |     | 0       |                |
            | file      | varchar(100) |      |     |         |                |
            | admin_v   | int(2)       | YES  |     | NULL    |                |
            +-----------+--------------+------+-----+---------+----------------+
            */
            ad_connect_db("yard");
            $qh = ad_query("select user,email from users");
        }
        if (!$qh) {
            die("Database Error");
        }
        $nr = ad_queryrows($qh);
        $ct = 0;
        if ($nr > 0) {
            while ($nr > $ct) {
                $ad = ad_fetch($qh);
                ?>
					<tr>
						<!-- <td class="first style1">- <?php 
                echo $ad[title];
                ?>
</td> -->