LD SoftwareBespoke Software, Web Design, Security Consultants and Host Services.

Menu

Sentinel
You have been warned!
We have caught 5848 shameful hackers.

NukeSentinel(tm)

Paypal Referral
Sign up for PayPal and start accepting credit card payments instantly.

Link Exchange
Join our free link exchange

Click Here

 
Advertising Block For Phpnuke 7.6

 
 

 
Post new topic   Reply to topic    LD Software Forum Index -> General Support
View previous topic :: View next topic  
Author Message
mrxdotcom


Newbie


Joined: Jul 24, 2007
Posts: 1

PostPosted: Wed 25 Jul 2007, 15:16     Post subject: Advertising Block for phpnuke 7.6 Reply with quote

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
Back to top
Affamole


Site Admin
Site Admin


Joined: Nov 09, 2005
Posts: 1276
Location: United Kingdom

PostPosted: Wed 25 Jul 2007, 16:35     Post subject: Reply with quote


 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.

Back to top
Display posts from previous:   
Time synchro. with the server - Timezone/DST with your computer
Post new topic   Reply to topic   Download Topic   Printer-friendly version    LD Software Forum Index -> General Support
Page 1 of 1
 

 

 
Jump to: 
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
 

 

Powered by phpBB © 2001 phpBB Group
phpBB port v2.1 based on Tom Nitzschner's phpbb2.0.6 upgraded to phpBB 2.0.4 standalone was developed and tested by:
ArtificialIntel, ChatServ, mikem,
sixonetonoffun and Paul Laudanski (aka Zhen-Xjell).

Version 2.1 by Nuke Cops © 2003 http://www.nukecops.com

LD Software  
 
Forums ©
You can syndicate our News with backend.php And our Forums with rss.php
You can also access our feeds via Feedburner Site News and LD Software Forums
© 2009 ld-software.co.uk All Rights Reserved.
PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.31 Seconds