Advertising Block For Phpnuke 7.6

LD Software -> General Support

Author: mrxdotcom PostPosted: Wed 25 Jul 2007, 15:16    Post subject: Advertising Block for phpnuke 7.6

Hi there,



I must say I like your modules and block. very simple but very good tools. However, I have phpnuke version 7.6 and would like to use your Advertising Block but there's no a version phpnuke 7.6.



Is it possible to get hold of a version for phpnuke 7.6?



Many thanks

Author: AffamoleLocation: United Kingdom PostPosted: Wed 25 Jul 2007, 16:35    Post subject:


 Hi mrxdotcom,

Sorry there isn't a version of this block for phpnuke 7.6.

phpnuke 7.6 Advertising block, already has a random selection of active banners.
The Advertising block that I wrote for phpnuke 7.9 fixes the an issue with phpnuke 7.9 not displaying banners.

However I have had a look at the advertising block for phpnuke 7.6 and produce the following code:

php:
<?php
/************************************************************************/
/* PHP Coded System                                                           */
/* ===========================                                          */
/*                                                                      */
/* Avertising Block with Random for phpnuke 7.6                            */
/*                                                                      */
/* Copyright (c) 2006 ld-software.co.uk                                 */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/

if (eregi("block-Advertising-Random.php",$_SERVER[PHP_SELF])) {
    
Header("Location: ../index.php");
    die();
}

global 
$prefix$db;

$numrows $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_banner WHERE type='1' AND active='1'"));

$result_max $db->sql_fetchrow($db->sql_query("SELECT MAX(cid) as max_cid FROM ".$prefix."_banner WHERE position='1' AND active='1'"));
$cid_max $result_max['max_cid'];

$result_min $db->sql_fetchrow($db->sql_query("SELECT MIN(cid) as min_cid FROM ".$prefix."_banner WHERE position='1' AND active='1'"));
$cid_min $result_min['min_cid'];

$bannum rand($cid_min$cid_max);

$row $db->sql_fetchrow($db->sql_query("SELECT bid, imageurl, alttext FROM ".$prefix."_banner WHERE type='1' AND active='1' LIMIT $bannum,1"));
    
$bid intval($row['bid']);
    
$imageurl $row['imageurl'];
    
$alttext $row['alttext'];
if (!
is_admin($admin)) {
    
$db->sql_query("UPDATE ".$prefix."_banner SET impmade=impmade+1 WHERE bid='$bid'");
}
if(
$numrows>0) {
    
$row2 $db->sql_fetchrow($db->sql_query("SELECT cid, imptotal, impmade, clicks, date FROM ".$prefix."_banner WHERE bid='$bid'"));
    
$cid intval($row2['cid']);
    
$imptotal intval($row2['imptotal']);
    
$impmade intval($row2['impmade']);
    
$clicks intval($row2['clicks']);
    
$date $row2['date'];

/* Check if this impression is the last one and print the banner */

    
if (($imptotal <= $impmade) AND ($imptotal != 0)) {
    
$db->sql_query("UPDATE ".$prefix."_banner SET active='0' WHERE bid='$bid'");
    }
    
$content "<center><br><a href=\"banners.php?op=click&amp;bid=$bid\" target=\"_blank\"><img src=\"$imageurl\" border=\"1\" alt=\"$alttext\" title=\"$alttext\"></a><br><br></center>";
}

?>


Just copy the above code and save it as block-Advertising-Random.php.

Hope this works for you.




LD Software -> General Support

All times are GMT

Page 1 of 1