tigerincanada
26th June 2006, 04:03 AM
Are you tired of copying and pasting URLs to set up and edit banners for your affiliates and campaigns?
With this patch, you can scroll through all your available banners and select the one you want to use.
This code segement should be pasted into /affiliate/merchants/templates/standard/banner_edit.tpl.php
...
<? } else if($_REQUEST['type'] == 'image') { ?>
<!-- Code being replaced -- <tr>
<td class=dir_form nowrap><?=L_G_PICTUREURL;?></td>
<td><input type=text name=sourceurl size=54 value="<?=$_POST['sourceurl']?>"></td>
</tr>-->
<tr>
<td class=dir_form nowrap><?=L_G_PICTUREURL;?></td>
<td>
<div class="listing" style="overflow: auto; width: 90%; height: 650px;">
<table border="0">
<tr>
<?
$bannerdir = $GLOBALS['Auth']->getSetting('Aff_banners_dir');
$bannerurl = $GLOBALS['Auth']->getSetting('Aff_banners_url');
$d = dir( $bannerdir );
while (false !== ($file = $d->read())) {
// Ingnore non-image files
if (!stristr($file,'.gif') && !stristr($file,'.jpg') && !stristr($file,'.png')) continue;
$imagepath = $bannerdir.$file;
$imageurl = $bannerurl.$file;
?>
<td align="center" valign="bottom">
<?=$imagepath?>
<input type=radio name=sourceurl value="<?=$imageurl?>"<? if ($imageurl==$_POST['sourceurl']) {?> checked="checked"<? } ?> />
</td>
<?
}
$d->close();
?>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td></td>
<td align=left><?=L_G_OR?></td>
</tr>
<tr>
<td class=dir_form nowrap><?=L_G_SELECTIMAGE;?></td>
<td><input type=file name=sourcebanner size=40 value="<?=$_POST['sourcebanner']?>"></td>
</tr>
<? } ?>
...
Enjoy!
With this patch, you can scroll through all your available banners and select the one you want to use.
This code segement should be pasted into /affiliate/merchants/templates/standard/banner_edit.tpl.php
...
<? } else if($_REQUEST['type'] == 'image') { ?>
<!-- Code being replaced -- <tr>
<td class=dir_form nowrap><?=L_G_PICTUREURL;?></td>
<td><input type=text name=sourceurl size=54 value="<?=$_POST['sourceurl']?>"></td>
</tr>-->
<tr>
<td class=dir_form nowrap><?=L_G_PICTUREURL;?></td>
<td>
<div class="listing" style="overflow: auto; width: 90%; height: 650px;">
<table border="0">
<tr>
<?
$bannerdir = $GLOBALS['Auth']->getSetting('Aff_banners_dir');
$bannerurl = $GLOBALS['Auth']->getSetting('Aff_banners_url');
$d = dir( $bannerdir );
while (false !== ($file = $d->read())) {
// Ingnore non-image files
if (!stristr($file,'.gif') && !stristr($file,'.jpg') && !stristr($file,'.png')) continue;
$imagepath = $bannerdir.$file;
$imageurl = $bannerurl.$file;
?>
<td align="center" valign="bottom">
<?=$imagepath?>
<input type=radio name=sourceurl value="<?=$imageurl?>"<? if ($imageurl==$_POST['sourceurl']) {?> checked="checked"<? } ?> />
</td>
<?
}
$d->close();
?>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td></td>
<td align=left><?=L_G_OR?></td>
</tr>
<tr>
<td class=dir_form nowrap><?=L_G_SELECTIMAGE;?></td>
<td><input type=file name=sourcebanner size=40 value="<?=$_POST['sourcebanner']?>"></td>
</tr>
<? } ?>
...
Enjoy!