Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x
Author Message
cheffette
New Member
New Member



Joined: Jul 29, 2004
Posts: 4
Location: Washington

PostPosted: Fri Aug 29, 2014 7:49 pm Reply with quote

Hi all.
First and foremost, even though I have been a member here at RavenNuke for like years, I generally never have the need to post a question because generally, everything that I need to find answers for is always here, if you take the time to search; but I'm stuck with The Advertising Module and Raven's latest release.
I have noticed that in my Advertising Module, when I add a banner and I use the Ad Class of Javascript/HTML code, my clicks and % of clicks all say N/A but when I add a banner via the Ad Class Image, I automatically get data filling in the Clicks and % of Clicks tables.
I would like to be able to offer the option of selling Ad Space using the Flash/Html Ad Class option (everything seems to be either flash/html linking capabilities nowadays.)
Okay to all of you Raven wizards out here..what do I do, need to look for or change in order for me to see the number of clicks etc for my banners?
Thanx..Happy Labor Day Smile
 
View user's profile Send private message
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1774

PostPosted: Sat Aug 30, 2014 4:16 am Reply with quote

Ok thats not hard but please note, that you need to use a generated clickURL to count the clicks and you must add this ClickURL in your HTML ode JS code. And its needed to have the input-fields for the ClickURL also for HTML/JS and Falsh in the formulars for ADD and EDIT of your banner-eintries.

I have modified the functions add_banner and BannerEdit of the index.php in the admin-folder of the Advertising module. Please replace the both functions but create backup of this file before you start the replacement!

open modules/Advertising/admin/index.php and find:

php Code:
function add_banner() {

global $prefix, $db, $banners, $admin_file, $ad_admin_menu, $AllowableHTML, $advanced_editor;
include_once ('header.php');
GraphicAdmin();
OpenTable();
echo $ad_admin_menu;
CloseTable();
echo '<br />';
OpenTable();
$imageurl = 'http://';
$clickurl = 'http://';
$alttext = '';
$ad_width = '';
$ad_height = '';
$result = $db->sql_query('SELECT * FROM ' . $prefix . '_banner_clients');
$numrows = $db->sql_numrows($result);
if ($numrows > 0) {
if (isset($_POST['ad_class'])) {
$ad_class = $_POST['ad_class'];
$addmsg = _ADDBANNER;
$step2flag = TRUE;
$opset = 'BannersAdd';
if (isset($_POST['adname'])) {
$adname = check_html($_POST['adname'], 'nohtml');
}
else {
$adname = '';
}
if (isset($_POST['imptotal'])) {
$imptotal = intval($_POST['imptotal']);
}
else {
$imptotal = '0';
}
if (isset($_POST['imageurl'])) {
$imageurl = check_html($_POST['imageurl'],'nohtml');
}
if (isset($_POST['clickurl'])) {
$clickurl = check_html($_POST['clickurl'],'nohtml');
}
if (isset($_POST['ad_width'])) {
$ad_width = intval($_POST['ad_width']);
}
if (isset($_POST['ad_height'])) {
$ad_height = intval($_POST['ad_height']);
}
if (isset($_POST['alttext'])) {
$alttext = check_html($_POST['alttext'],'nohtml');
}
}
else {
$addmsg = 'CONTINUE';
$ad_class = '';
$step2flag = FALSE;
$imptotal = '0';
$adname = '';
$opset = 'add_banner';
}
echo '<div style="text-align:center;" class="title">' . _ADDNEWBANNER . '<br /><br />';
if (isset($_POST['errormsg'])) {
$errormsg = check_html($_POST['errormsg'], '');
echo ' There were errors on your previous input:<br /> '. $errormsg . '<br /><br />';
}
echo '</div>';
echo '<form action="' . $admin_file . '.php?op='.$opset. '" method="post">'
. '<table border="0"><tr><td>'
. _CLIENTNAME . ':</td>'
. '<td><select name="cid">';
$result = $db->sql_query('SELECT cid, name FROM ' . $prefix . '_banner_clients ORDER BY name');
while ($row = $db->sql_fetchrow($result)) {
$cid = intval($row['cid']);
$name = $row['name'];
echo '<option value="' . $cid . '">' . $name . '</option>';
}
echo '</select></td></tr>'
. '<tr><td nowrap="nowrap">' . _BANNERNAME . ' : </td>'
.'<td><input type="text" name="adname" size="12" maxlength="50" value = "'.$adname.'" />';
echo '</td></tr><tr><td nowrap="nowrap">' . _PURCHASEDIMPRESSIONS . ':</td><td><input type="text" name="imptotal" size="12" maxlength="11" value= "'.$imptotal.'" /> 0=' . _UNLIMITED;
echo '</td></tr>';
if (!$step2flag) {
echo
'<tr><td>' . _ADCLASS . ':</td><td><select name="ad_class">'
. '<option value="image">' . _ADIMAGE . '</option>'
. '<option value="code">' . _ADCODE . '</option>'
. '<option value="flash">' . _ADFLASH . '</option>'
. '</select></td></tr>'
. '<tr><td>&nbsp;</td><td><span class="italic">Select One of the Three Ad Classes, then proceed to fill out the appropriate information about each class.</span></td></tr>';
}
else {
echo '<tr><td>' . _ADCLASS . ' : ' . $ad_class . '<input type="hidden" name="ad_class" value = "'.$ad_class.'" /></td></tr>';
}
if ($step2flag) {
if ($ad_class == 'image' || $ad_class == 'flash') {

echo '<tr><td>' . _IMAGESWFURL . ':</td><td><input type="text" name="imageurl" size="50" maxlength="100" value="'.$imageurl.'" /></td></tr>'
. '<tr><td>' . _IMAGESIZE . ':</td><td>' . _WIDTH . ': <input type="text" name="ad_width" size="4" maxlength="4" value="'.$ad_width.'"/> &nbsp; ' . _HEIGHT . ': <input type="text" name="ad_height" size="4" maxlength="4" value="'.$ad_height.'" /> &nbsp; ' . _INPIXELS . '<input type="hidden" name="ad_code" value = "" /></td></tr>';
if ($ad_class == 'image') {
echo '<tr><td>' . _CLICKURL . '</td><td><input type="text" name="clickurl" size="50" maxlength="200" value="'.$clickurl.'" /></td></tr>'
. '<tr><td>' . _ALTTEXT . ':</td><td><input type="text" name="alttext" size="50" maxlength="255" value="'.$alttext.'" /></td></tr>';
}
}
else {
echo '<tr><td><input type="hidden" name="imageurl" value="" /><input type="hidden" name="clickurl" value="" /><input type="hidden" name="ad_width" value="" /><input type="hidden" name="ad_height" value="" /><input type="hidden" name="alttext" value="" />' . _ADCODE . ':</td><td><div>';
wysiwyg_textarea('ad_code', '', 'PHPNukeAdmin', 70, 12);
echo '</div></td></tr>';
echo '<tr><td colspan="2">'._AREYOUSURE.'</td></tr>';
//echo '<tr><td colspan="2"> . '_ALLOWEDHTML . '</td></tr><tr><td colspan="2">';
//while (list($key) = each($AllowableHTML)) echo ' &lt;'.$key.'&gt;';
//echo '</td></tr>';
}
echo '<tr><td>' . _TYPE . ':</td><td><select name="position">';
$result = $db->sql_query('SELECT position_number, position_name FROM ' . $prefix . '_banner_positions ORDER BY position_number');
while ($row = $db->sql_fetchrow($result)) {
echo '<option value="' . $row['position_number'] . '">' . $row['position_number'] . ' - ' . $row['position_name'] . '</option>';
}
echo '</select></td></tr><tr><td>&nbsp;</td><td>' . _POSITIONNOTE . '</td></tr>'
. '<tr><td>' . _ACTIVATE . ':</td><td><input type="radio" name="active" value="1" checked="checked" />' . _YES . '&nbsp;&nbsp;<input type="radio" name="active" value="0" />' . _NO . '</td></tr>';
}
echo '<tr><td>&nbsp;</td><td><input type="hidden" name="op" value="'.$opset.'" />'
. '<input type="submit" value="' . $addmsg . '" />'
. '</td></tr></table></form>';
}
else {
echo '<div class="text-center"><span class="title thick">' . _ADDNEWBANNER . '</span><br /><br />'
. _ADSNOCLIENT . '<br /><br />' . _GOBACK . '</div>';
}
CloseTable();
include_once('footer.php');
}


replace it with:

php Code:
function add_banner() {

global $prefix, $db, $banners, $admin_file, $ad_admin_menu, $AllowableHTML, $advanced_editor;
include_once ('header.php');
GraphicAdmin();
OpenTable();
echo $ad_admin_menu;
CloseTable();
echo '<br />';
OpenTable();
$imageurl = 'http://';
$clickurl = 'http://';
$alttext = '';
$ad_width = '';
$ad_height = '';
$result = $db->sql_query('SELECT * FROM ' . $prefix . '_banner_clients');
$numrows = $db->sql_numrows($result);
if ($numrows > 0) {
if (isset($_POST['ad_class'])) {
$ad_class = $_POST['ad_class'];
$addmsg = _ADDBANNER;
$step2flag = TRUE;
$opset = 'BannersAdd';
if (isset($_POST['adname'])) {
$adname = check_html($_POST['adname'], 'nohtml');
}
else {
$adname = '';
}
if (isset($_POST['imptotal'])) {
$imptotal = intval($_POST['imptotal']);
}
else {
$imptotal = '0';
}
if (isset($_POST['imageurl'])) {
$imageurl = check_html($_POST['imageurl'],'nohtml');
}
if (isset($_POST['clickurl'])) {
$clickurl = check_html($_POST['clickurl'],'nohtml');
}
if (isset($_POST['ad_width'])) {
$ad_width = intval($_POST['ad_width']);
}
if (isset($_POST['ad_height'])) {
$ad_height = intval($_POST['ad_height']);
}
if (isset($_POST['alttext'])) {
$alttext = check_html($_POST['alttext'],'nohtml');
}
}
else {
$addmsg = 'CONTINUE';
$ad_class = '';
$step2flag = FALSE;
$imptotal = '0';
$adname = '';
$opset = 'add_banner';
}
echo '<div style="text-align:center;" class="title">' . _ADDNEWBANNER . '<br /><br />';
if (isset($_POST['errormsg'])) {
$errormsg = check_html($_POST['errormsg'], '');
echo ' There were errors on your previous input:<br /> '. $errormsg . '<br /><br />';
}
echo '</div>';
echo '<form action="' . $admin_file . '.php?op='.$opset. '" method="post">'
. '<table border="0"><tr><td>'
. _CLIENTNAME . ':</td>'
. '<td><select name="cid">';
$result = $db->sql_query('SELECT cid, name FROM ' . $prefix . '_banner_clients ORDER BY name');
while ($row = $db->sql_fetchrow($result)) {
$cid = intval($row['cid']);
$name = $row['name'];
echo '<option value="' . $cid . '">' . $name . '</option>';
}
echo '</select></td></tr>'
. '<tr><td nowrap="nowrap">' . _BANNERNAME . ' : </td>'
.'<td><input type="text" name="adname" size="12" maxlength="50" value = "'.$adname.'" />';
echo '</td></tr><tr><td nowrap="nowrap">' . _PURCHASEDIMPRESSIONS . ':</td><td><input type="text" name="imptotal" size="12" maxlength="11" value= "'.$imptotal.'" /> 0=' . _UNLIMITED;
echo '</td></tr>';
if (!$step2flag) {
echo
'<tr><td>' . _ADCLASS . ':</td><td><select name="ad_class">'
. '<option value="image">' . _ADIMAGE . '</option>'
. '<option value="code">' . _ADCODE . '</option>'
. '<option value="flash">' . _ADFLASH . '</option>'
. '</select></td></tr>'
. '<tr><td>&nbsp;</td><td><span class="italic">Select One of the Three Ad Classes, then proceed to fill out the appropriate information about each class.</span></td></tr>';
} else {
echo '<tr><td>' . _ADCLASS . ' : ' . $ad_class . '<input type="hidden" name="ad_class" value = "'.$ad_class.'" /></td></tr>';
}
if ($step2flag) {
if ($ad_class == 'image' || $ad_class == 'flash') {

echo '<tr><td>' . _IMAGESWFURL . ':</td><td><input type="text" name="imageurl" size="50" maxlength="100" value="'.$imageurl.'" /></td></tr>'
. '<tr><td>' . _IMAGESIZE . ':</td><td>' . _WIDTH . ': <input type="text" name="ad_width" size="4" maxlength="4" value="'.$ad_width.'"/> &nbsp; ' . _HEIGHT . ': <input type="text" name="ad_height" size="4" maxlength="4" value="'.$ad_height.'" /> &nbsp; ' . _INPIXELS . '<input type="hidden" name="ad_code" value = "" /></td></tr>';
if ($ad_class == 'image') {
echo '<tr><td>' . _ALTTEXT . ':</td><td><input type="text" name="alttext" size="50" maxlength="255" value="'.$alttext.'" /></td></tr>';
}
} else {
echo '<tr><td>' . _CLICKURL . '</td><td><input type="text" name="clickurl" size="50" maxlength="200" value="'.$clickurl.'" /></td></tr>';
echo '<tr><td><input type="hidden" name="imageurl" value="" /><input type="hidden" name="clickurl" value="" /><input type="hidden" name="ad_width" value="" /><input type="hidden" name="ad_height" value="" /><input type="hidden" name="alttext" value="" />' . _ADCODE . ':</td><td><div>';
wysiwyg_textarea('ad_code', '', 'PHPNukeAdmin', 70, 12);
echo '</div></td></tr>';
echo '<tr><td colspan="2">'._AREYOUSURE.'</td></tr>';
//echo '<tr><td colspan="2"> . '_ALLOWEDHTML . '</td></tr><tr><td colspan="2">';
//while (list($key) = each($AllowableHTML)) echo ' &lt;'.$key.'&gt;';
//echo '</td></tr>';
}
echo '<tr><td>' . _TYPE . ':</td><td><select name="position">';
$result = $db->sql_query('SELECT position_number, position_name FROM ' . $prefix . '_banner_positions ORDER BY position_number');
while ($row = $db->sql_fetchrow($result)) {
echo '<option value="' . $row['position_number'] . '">' . $row['position_number'] . ' - ' . $row['position_name'] . '</option>';
}
echo '</select></td></tr><tr><td>&nbsp;</td><td>' . _POSITIONNOTE . '</td></tr>'
. '<tr><td>' . _ACTIVATE . ':</td><td><input type="radio" name="active" value="1" checked="checked" />' . _YES . '&nbsp;&nbsp;<input type="radio" name="active" value="0" />' . _NO . '</td></tr>';
}
echo '<tr><td>&nbsp;</td><td><input type="hidden" name="op" value="'.$opset.'" />'
. '<input type="submit" value="' . $addmsg . '" />'
. '</td></tr></table></form>';
}
else {
echo '<div class="text-center"><span class="title thick">' . _ADDNEWBANNER . '</span><br /><br />'
. _ADSNOCLIENT . '<br /><br />' . _GOBACK . '</div>';
}
CloseTable();
include_once('footer.php');
}


find:

php Code:
function BannerEdit($bid) {

global $prefix, $db, $admin_file, $ad_admin_menu, $AllowableHTML, $advanced_editor;
include_once('header.php');
GraphicAdmin();
OpenTable();
echo $ad_admin_menu;
CloseTable();
echo '<br />';
$bid = intval($bid);
$row = $db->sql_fetchrow($db->sql_query('SELECT cid, name, imptotal, impmade, clicks, imageurl, clickurl, alttext, date, position, active, ad_class, ad_code, ad_width, ad_height FROM ' . $prefix . '_banner WHERE bid=\'' . $bid . '\''));
$cid = $row['cid'];
$imptotal = $row['imptotal'];
$impmade = $row['impmade'];
$clicks = $row['clicks'];
$imageurl = $row['imageurl'];
$clickurl = $row['clickurl'];
$alttext = $row['alttext'];
$date = $row['date'];
$date = explode(' ', $date);
$date = $date[0] . ' @ ' . $date[1];
$position = $row['position'];
$active = $row['active'];
$ad_class = $row['ad_class'];
$ad_code = $row['ad_code'];
$ad_width = $row['ad_width'];
$ad_height = $row['ad_height'];
$bannername = $row['name'];
OpenTable();
echo '<div style="text-align: center;" class="title">' . _EDITBANNER . '</div><br /><br />';
if ($ad_class == 'code') {
echo '<table border="0" align="center"><tr><td>' . $ad_code . '</td></tr></table><br /><br />';
} elseif ($ad_class == 'flash') {
echo '<div style="text-align: center;">
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"
WIDTH="' . $ad_width . '" HEIGHT="' . $ad_height . '" id="' . $bid . '">
<PARAM NAME=movie VALUE="' . $imageurl . '">
<PARAM NAME=quality VALUE=high>
<EMBED src="' . $imageurl . '" quality=high WIDTH="' . $ad_width . '" HEIGHT="' . $ad_height . '"
NAME="' . $did . '" ALIGN="" TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</EMBED>
</OBJECT>
</div><br /><br />';
} else {
echo '<div style="text-align: center;"><img src="' . $imageurl . '" border="1" alt="' . $alttext . '" title="' . $alttext . '" width="' . $ad_width . '" height="' . $ad_height . '" /></div><br /><br />';
}
echo '<form action="' . $admin_file . '.php?op=BannerChange" method="post">';
echo '<table width="100%">';
echo '<tr><td width="20%">'._CLIENTNAME . ':</td><td>'
. '<select name="cid">';
$row2 = $db->sql_fetchrow($db->sql_query('SELECT cid, name FROM ' . $prefix . '_banner_clients WHERE cid=\'' . $cid . '\''));
$cid = $row2['cid'];
$clientname = $row2['name'];
echo '<option value="' . $cid . '" selected="selected">' . $clientname . '</option>';
$result3 = $db->sql_query('SELECT cid, name FROM ' . $prefix . '_banner_clients');
while ($row3 = $db->sql_fetchrow($result3)) {
$ccid = $row3['cid'];
$clientname = $row3['name'];
if ($cid != $ccid) {
echo '<option value="' . $ccid . '">' . $clientname . '</option>';
}
}
echo '</select></td></tr>';
if ($imptotal == 0) {
$impressions = _UNLIMITED;
} else {
$impressions = $imptotal;
}
if ($active == 1) {
$check1 = ' checked="checked"';
$check2 = '';
} else {
$check1 = '';
$check2 = ' checked="checked"';
}
if ($imptotal != 0) {
$unl = '<span class="italic">(' . _XFORUNLIMITED . ')</span>';
} else {
$unl = '';
}
echo '<tr><td>' . _BANNERNAME . ':</td><td><input type="text" name="adname" size="20" maxlength="50" value="' . $row['name'] . '" /></td></tr>';
echo '<tr><td>' . _ADDEDDATE . ':</td><td>' . $date . '</td></tr>';
echo '<tr><td>' . _IMPPURCHASED . ':</td><td class="thick">' . $impressions . '</td></tr>';
echo '<tr><td>' . _IMPMADE . ':</td><td class="thick">' . $impmade . '</td></tr>';
echo '<tr><td>' . _ADDIMPRESSIONS . ':</td><td><input type="text" name="impadded" size="12" maxlength="11" value="0" /> ' . $unl . '</td></tr>';
echo '<tr><td>' . _ADCLASS . ':</td><td class="thick">' . ucFirst($ad_class) . '</td></tr>';
if ($ad_class == 'code') {

echo '<tr><td colspan="2" style="text-align:center;">' . _ADCODE . ':</td></tr><tr><td colspan="2"><div>';
if (!isset($advanced_editor) || $advanced_editor == 0) {
$ad_code = htmlentities($ad_code, ENT_QUOTES);
}
wysiwyg_textarea('ad_code', $ad_code, 'PHPNukeAdmin', 70, 15);
echo '</div></td></tr>';
echo '<tr><td colspan="2">'._AREYOUSURE.'</td></tr>';
//echo <tr><td colspan="2"> . _ALLOWEDHTML . '</td></tr><tr><td colspan="2">';
//while (list($key) = each($AllowableHTML)) echo ' &lt;'.$key.'&gt;';
//echo '</td></tr>';
echo '<tr><td>'
. '<input type="hidden" name="imageurl" value="' . $imageurl . '" />'
. '<input type="hidden" name="ad_width" value="' . $ad_width . '" />'
. '<input type="hidden" name="ad_height" value="' . $ad_height . '" />'
. '<input type="hidden" name="clickurl" value="' . $clickurl . '" />'
. '<input type="hidden" name="alttext" value="' . $alttext . '" /></td><td>&nbsp;</td></tr>';
} elseif ($ad_class == 'flash') {
echo '<tr><td>' . _FLASHFILEURL . ':</td><td><input type="text" name="imageurl" size="50" maxlength="255" value="' . $imageurl . '" /> &nbsp; <a href="' . $imageurl . '" target="_blank"><img src="images/view.gif" border="0" alt="' . _SHOW . '" title="' . _SHOW . '" /></a></td></tr>'
. '<tr><td>' . _FLASHSIZE . ':</td><td>' . _WIDTH . ': <input type="text" name="ad_width" size="4" maxlength="4" value="' . $ad_width . '" /> &nbsp; ' . _HEIGHT . ': <input type="text" name="ad_height" size="4" maxlength="4" value="' . $ad_height . '" /> &nbsp; ' . _INPIXELS
. '<input type="hidden" name="clickurl" value="' . $clickurl . '" />'
. '<input type="hidden" name="alttext" value="' . $alttext . '" />'
. '<input type="hidden" name="ad_code" value="' . $ad_code . '" /></td></tr>';
} else {
echo '<tr><td>' . _IMAGEURL . ':</td><td><input type="text" name="imageurl" size="50" maxlength="255" value="' . $imageurl . '" /></td></tr>'
. '<tr><td>' . _IMAGESIZE . ':</td><td>' . _WIDTH . ': <input type="text" name="ad_width" size="4" maxlength="4" value="' . $ad_width . '" /> &nbsp; ' . _HEIGHT . ': <input type="text" name="ad_height" size="4" maxlength="4" value="' . $ad_height . '" /> &nbsp; ' . _INPIXELS . '</td></tr>'
. '<tr><td>' . _CLICKURL . ':</td><td><input type="text" name="clickurl" size="50" maxlength="200" value="' . $clickurl . '" /></td></tr>'
. '<tr><td>' . _ALTTEXT . ':</td><td><input type="text" name="alttext" size="50" maxlength="255" value="' . $alttext . '" />'
. '<input type="hidden" name="ad_code" value="' . $ad_code . '" /></td></tr>';
}
echo '<tr><td>' . _TYPE . ':</td><td><select name="position">';
$result4 = $db->sql_query('SELECT position_number, position_name FROM ' . $prefix . '_banner_positions ORDER BY position_number');
while ($row4 = $db->sql_fetchrow($result4)) {
if ($position == $row4['position_number']) {
$sel = ' selected="selected"';
} else {
$sel = '';
}
echo '<option value="' . $row4['position_number'] . '"' . $sel . '>' . $row4['position_number'] . ' - ' . $row4['position_name'] . '</option>';
}
echo '</select></td></tr>'
. '<tr><td>' . _ACTIVATE . ':</td><td><input type="radio" name="active" value="1"' . $check1 . ' />' . _YES . '&nbsp;&nbsp;<input type="radio" name="active" value="0"' . $check2 . ' />' . _NO . '</td></tr>'
. '<tr><td>&nbsp;</td><td><input type="hidden" name="bid" value="' . $bid . '" />'
. '<input type="hidden" name="imptotal" value="' . $imptotal . '" />'
. '<input type="hidden" name="impmade" value="' . $impmade . '" />'
. '<input type="hidden" name="op" value="BannerChange" />'
. '<input type="submit" value="' . _SAVECHANGES . '" />'
. '</td></tr></table></form>';
CloseTable();
include_once('footer.php');
}


replace it with:

php Code:
function BannerEdit($bid) {

global $prefix, $db, $admin_file, $ad_admin_menu, $AllowableHTML, $advanced_editor;
include_once('header.php');
GraphicAdmin();
OpenTable();
echo $ad_admin_menu;
CloseTable();
echo '<br />';
$bid = intval($bid);
$row = $db->sql_fetchrow($db->sql_query('SELECT cid, name, imptotal, impmade, clicks, imageurl, clickurl, alttext, date, position, active, ad_class, ad_code, ad_width, ad_height FROM ' . $prefix . '_banner WHERE bid=\'' . $bid . '\''));
$cid = $row['cid'];
$imptotal = $row['imptotal'];
$impmade = $row['impmade'];
$clicks = $row['clicks'];
$imageurl = $row['imageurl'];
$clickurl = $row['clickurl'];
$alttext = $row['alttext'];
$date = $row['date'];
$date = explode(' ', $date);
$date = $date[0] . ' @ ' . $date[1];
$position = $row['position'];
$active = $row['active'];
$ad_class = $row['ad_class'];
$ad_code = $row['ad_code'];
$ad_width = $row['ad_width'];
$ad_height = $row['ad_height'];
$bannername = $row['name'];
OpenTable();
echo '<div style="text-align: center;" class="title">' . _EDITBANNER . '</div><br /><br />';
if ($ad_class == 'code') {
echo '<table border="0" align="center"><tr><td>' . $ad_code . '</td></tr></table><br /><br />';
} elseif ($ad_class == 'flash') {
echo '<div style="text-align: center;">
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"
WIDTH="' . $ad_width . '" HEIGHT="' . $ad_height . '" id="' . $bid . '">
<PARAM NAME=movie VALUE="' . $imageurl . '">
<PARAM NAME=quality VALUE=high>
<EMBED src="' . $imageurl . '" quality=high WIDTH="' . $ad_width . '" HEIGHT="' . $ad_height . '"
NAME="' . $did . '" ALIGN="" TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</EMBED>
</OBJECT>
</div><br /><br />';
} else {
echo '<div style="text-align: center;"><img src="' . $imageurl . '" border="1" alt="' . $alttext . '" title="' . $alttext . '" width="' . $ad_width . '" height="' . $ad_height . '" /></div><br /><br />';
}
echo '<form action="' . $admin_file . '.php?op=BannerChange" method="post">';
echo '<table width="100%">';
echo '<tr><td width="20%">'._CLIENTNAME . ':</td><td>'
. '<select name="cid">';
$row2 = $db->sql_fetchrow($db->sql_query('SELECT cid, name FROM ' . $prefix . '_banner_clients WHERE cid=\'' . $cid . '\''));
$cid = $row2['cid'];
$clientname = $row2['name'];
echo '<option value="' . $cid . '" selected="selected">' . $clientname . '</option>';
$result3 = $db->sql_query('SELECT cid, name FROM ' . $prefix . '_banner_clients');
while ($row3 = $db->sql_fetchrow($result3)) {
$ccid = $row3['cid'];
$clientname = $row3['name'];
if ($cid != $ccid) {
echo '<option value="' . $ccid . '">' . $clientname . '</option>';
}
}
echo '</select></td></tr>';
if ($imptotal == 0) {
$impressions = _UNLIMITED;
} else {
$impressions = $imptotal;
}
if ($active == 1) {
$check1 = ' checked="checked"';
$check2 = '';
} else {
$check1 = '';
$check2 = ' checked="checked"';
}
if ($imptotal != 0) {
$unl = '<span class="italic">(' . _XFORUNLIMITED . ')</span>';
} else {
$unl = '';
}
echo '<tr><td>' . _BANNERNAME . ':</td><td><input type="text" name="adname" size="20" maxlength="50" value="' . $row['name'] . '" /></td></tr>';
echo '<tr><td>' . _ADDEDDATE . ':</td><td>' . $date . '</td></tr>';
echo '<tr><td>' . _IMPPURCHASED . ':</td><td class="thick">' . $impressions . '</td></tr>';
echo '<tr><td>' . _IMPMADE . ':</td><td class="thick">' . $impmade . '</td></tr>';
echo '<tr><td>' . _ADDIMPRESSIONS . ':</td><td><input type="text" name="impadded" size="12" maxlength="11" value="0" /> ' . $unl . '</td></tr>';
echo '<tr><td>' . _ADCLASS . ':</td><td class="thick">' . ucFirst($ad_class) . '</td></tr>';
if ($ad_class == 'code' || $ad_class == 'flash') {
$inlinejs = '<script type="text/javascript">' . PHP_EOL
. '$(".selectall").click(function () {' . PHP_EOL
. ' $(this).select();' . PHP_EOL
. '});' . PHP_EOL
. '</script>' . PHP_EOL;
addJSToBody($inlinejs, 'inline');
}
if ($ad_class == 'code') {
echo '<tr>'
. '<td style="vertical-align:top;">' . _CLICKURL . ':</td>'
. '<td>'
. '<input type="text" name="clickurl" size="50" maxlength="200" value="' . $clickurl . '" /><br /><br />'
. '<input type="text" readonly="readonly" size="50" maxlength="200" value="' . htmlspecialchars('index.php?op=ad_click&amp;bid=' . $bid, ENT_QUOTES, _CHARSET) . '" class="selectall" /><br /><br />'
. '</td>'
. '</tr>'
. '<tr><td colspan="2" style="text-align:center;">' . _ADCODE . ':</td></tr><tr><td colspan="2"><div>';
if (!isset($advanced_editor) || $advanced_editor == 0) {
$ad_code = htmlentities($ad_code, ENT_QUOTES);
}
wysiwyg_textarea('ad_code', $ad_code, 'PHPNukeAdmin', 70, 15);
echo '</div></td></tr>';
echo '<tr><td colspan="2">'._AREYOUSURE.'</td></tr>';
//echo <tr><td colspan="2"> . _ALLOWEDHTML . '</td></tr><tr><td colspan="2">';
//while (list($key) = each($AllowableHTML)) echo ' &lt;'.$key.'&gt;';
//echo '</td></tr>';
echo '<tr><td>'
. '<input type="hidden" name="imageurl" value="' . $imageurl . '" />'
. '<input type="hidden" name="ad_width" value="' . $ad_width . '" />'
. '<input type="hidden" name="ad_height" value="' . $ad_height . '" />'
#. '<input type="hidden" name="clickurl" value="' . $clickurl . '" />'
. '<input type="hidden" name="alttext" value="' . $alttext . '" /></td><td>&nbsp;</td></tr>';
} elseif ($ad_class == 'flash') {
echo '<tr><td>' . _FLASHFILEURL . ':</td><td><input type="text" name="imageurl" size="50" maxlength="255" value="' . $imageurl . '" /> &nbsp; <a href="' . $imageurl . '" target="_blank"><img src="images/view.gif" border="0" alt="' . _SHOW . '" title="' . _SHOW . '" /></a></td></tr>'
. '<tr><td>' . _FLASHSIZE . ':</td><td>' . _WIDTH . ': <input type="text" name="ad_width" size="4" maxlength="4" value="' . $ad_width . '" /> &nbsp; ' . _HEIGHT . ': <input type="text" name="ad_height" size="4" maxlength="4" value="' . $ad_height . '" /> &nbsp; ' . _INPIXELS
. '<tr>'
. '<td style="vertical-align:top;">' . _CLICKURL . ':</td>'
. '<td>'
. '<input type="text" name="clickurl" size="50" maxlength="200" value="' . $clickurl . '" /><br /><br />'
. '<input type="text" readonly="readonly" size="50" maxlength="200" value="' . htmlspecialchars('index.php?op=ad_click&amp;bid=' . $bid, ENT_QUOTES, _CHARSET) . '" class="selectall" /><br /><br />'
. '</td>'
. '</tr>'
#. '<input type="hidden" name="clickurl" value="' . $clickurl . '" />'
. '<input type="hidden" name="alttext" value="' . $alttext . '" />'
. '<input type="hidden" name="ad_code" value="' . $ad_code . '" /></td></tr>';
} else {
echo '<tr><td>' . _IMAGEURL . ':</td><td><input type="text" name="imageurl" size="50" maxlength="255" value="' . $imageurl . '" /></td></tr>'
. '<tr><td>' . _IMAGESIZE . ':</td><td>' . _WIDTH . ': <input type="text" name="ad_width" size="4" maxlength="4" value="' . $ad_width . '" /> &nbsp; ' . _HEIGHT . ': <input type="text" name="ad_height" size="4" maxlength="4" value="' . $ad_height . '" /> &nbsp; ' . _INPIXELS . '</td></tr>'
. '<tr><td>' . _CLICKURL . ':</td><td><input type="text" name="clickurl" size="50" maxlength="200" value="' . $clickurl . '" /></td></tr>'
. '<tr><td>' . _ALTTEXT . ':</td><td><input type="text" name="alttext" size="50" maxlength="255" value="' . $alttext . '" />'
. '<input type="hidden" name="ad_code" value="' . $ad_code . '" /></td></tr>';
}
echo '<tr><td>' . _TYPE . ':</td><td><select name="position">';
$result4 = $db->sql_query('SELECT position_number, position_name FROM ' . $prefix . '_banner_positions ORDER BY position_number');
while ($row4 = $db->sql_fetchrow($result4)) {
if ($position == $row4['position_number']) {
$sel = ' selected="selected"';
} else {
$sel = '';
}
echo '<option value="' . $row4['position_number'] . '"' . $sel . '>' . $row4['position_number'] . ' - ' . $row4['position_name'] . '</option>';
}
echo '</select></td></tr>'
. '<tr><td>' . _ACTIVATE . ':</td><td><input type="radio" name="active" value="1"' . $check1 . ' />' . _YES . '&nbsp;&nbsp;<input type="radio" name="active" value="0"' . $check2 . ' />' . _NO . '</td></tr>'
. '<tr><td>&nbsp;</td><td><input type="hidden" name="bid" value="' . $bid . '" />'
. '<input type="hidden" name="imptotal" value="' . $imptotal . '" />'
. '<input type="hidden" name="impmade" value="' . $impmade . '" />'
. '<input type="hidden" name="op" value="BannerChange" />'
. '<input type="submit" value="' . _SAVECHANGES . '" />'
. '</td></tr></table></form>';
CloseTable();
include_once('footer.php');
}


Now you have the inpult-field for the Click-URL also in the ADD and EDIT formulars for HTML/JS and flash to store your wanted URL.

Example:

If you would have now a simple hyperlink in your html-code like this:

html Code:
<a href ="http://www.ravenphpscripts.com">Raven Forums</a>


... and you would have stored a ClickURL like this:

Code:
http://www.ravenphpscripts.com


... then you have to replace the URL of your hyperlink with the generated ClickURL, that you will find in the EDIT formular below the input-field of your stored ClickURL.

That should be look like this:

html Code:
<a href ="index.php?op=ad_click&bid=1">Raven Forums</a>



I hope this is what you were looking for. Don't forget to make a Backup before you are trying this and let me know if you will get some errors.

Please note: If you are using flash-objects, then you must have a chance to edit the flash-objects to use the genereated click-urls otherwise you can't use it in this way.

Wink

_________________
Github: RavenNuke 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©