Jump to content


Photo

phpadsnew - Randomisation


  • Please log in to reply
8 replies to this topic

#1 sully

sully

    Young Padawan

  • Members
  • Pip
  • 22 posts

Posted 30 September 2004 - 02:16 PM

Hey all,

Im using phpadsnew to generate ads on my site. It displays the 88*31 mini buttons and im hell bent on trying to get it to work, but the code only displays one link at a time - and I want it to display 5! Can anybody help me on this one?

Code generated is:
<script language='JavaScript' type='text/javascript'>
<!--
   if (!document.phpAds_used) document.phpAds_used = ',';
   phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
   
   document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
   document.write ("http://www.thenet2k.com/phpads/adjs.php?n=" + phpAds_random);
   document.write ("&amp;what=zone:2");
   document.write ("&amp;exclude=" + document.phpAds_used);
   if (document.referer)
      document.write ("&amp;referer=" + escape(document.referer));
   document.write ("'><" + "/script>");
//-->
</script><noscript><a href='http://www.thenet2k.com/phpads/adclick.php?n=a6801692' target='_blank'><img src='http://www.thenet2k.com/phpads/adview.php?what=zone:2&amp;n=a6801692' border='0' alt=''></a></noscript>

Hope someone here can help because the support for phpadsnew is terrible!

- Sully

#2 sully

sully

    Young Padawan

  • Members
  • Pip
  • 22 posts

Posted 30 September 2004 - 03:18 PM

<?php
    if (@include(getenv('DOCUMENT_ROOT').'/phpads/phpadsnew.inc.php')) {
        if (!isset($phpAds_context)) $phpAds_context = array();
        $phpAds_raw = view_raw ('zone:2', 0, '', '', '0', $phpAds_context);
        echo $phpAds_raw['html'];
    }
?>

Thats the code in PHP, again one at a time but maybe someone can get it to display a random 5 at a time with the help of this code?

Help needed BADLY!

- Sully

#3 z77

z77

    Content Contributor

  • Members
  • Pip
  • 176 posts
  • Location:Atlanta
  • Interests:Art, Computers, Goldfish, Church, Pizza, Ice Cream, Frisbee, Paintball, PHP, C4D, Photoshop, Friends :)

Posted 30 September 2004 - 03:53 PM

The php script you posted has an include to another file in the phpads directory called phpadsnew.inc.php. Can you post whats in that file? The script you posted doesnt control the number that shows up.

#4 sully

sully

    Young Padawan

  • Members
  • Pip
  • 22 posts

Posted 30 September 2004 - 04:59 PM

OK here is whats in it:

<?php // $Revision: 2.0.2.1 $

/************************************************************************/
/* phpAdsNew 2                                                          */
/* ===========                                                          */
/*                                                                      */
/* Copyright (c) 2000-2003 by the phpAdsNew developers                  */
/* For more information visit: http://www.phpadsnew.com                 */
/*                                                                      */
/* 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 (!defined('PHPADSNEW_INCLUDED'))
{
	// Figure out our location
	if (strlen(__FILE__) > strlen(basename(__FILE__)))
     define ('phpAds_path', substr(__FILE__, 0, strlen(__FILE__) - strlen(basename(__FILE__)) - 1));
	else
     define ('phpAds_path', '.');
	
	// If this path doesn't work for you, customize it here like this
	// Note: no trailing backslash
	// define ('phpAds_path', "/home/myname/www/phpAdsNew");
	
	
	// Globalize settings and IO
	// (just in case phpadsnew.inc.php is called from a function)
	global $phpAds_config, $HTTP_SERVER_VARS;
	
	
	// Include required files
	require	(phpAds_path."/config.inc.php"); 
	require (phpAds_path."/libraries/lib-io.inc.php");
	require (phpAds_path."/libraries/lib-db.inc.php");
	
	
	if (($phpAds_config['log_adviews'] && !$phpAds_config['log_beacon']) || $phpAds_config['acl'])
	{
  require (phpAds_path."/libraries/lib-remotehost.inc.php");
  
  if ($phpAds_config['log_adviews'] && !$phpAds_config['log_beacon'])
 	 require (phpAds_path."/libraries/lib-log.inc.php");
  
  if ($phpAds_config['acl'])
 	 require (phpAds_path."/libraries/lib-limitations.inc.php");
	}
	
	require	(phpAds_path."/libraries/lib-view-main.inc.php");
	
	
	// Prevent duplicate includes
	define ('PHPADSNEW_INCLUDED', true);
}

?>

Hope you can help. Cheers :)

- Sully

#5 z77

z77

    Content Contributor

  • Members
  • Pip
  • 176 posts
  • Location:Atlanta
  • Interests:Art, Computers, Goldfish, Church, Pizza, Ice Cream, Frisbee, Paintball, PHP, C4D, Photoshop, Friends :)

Posted 30 September 2004 - 05:10 PM

lol, i still dont see anywhere you can change it. There seems to be a lot of files for such a simple task... How does the software work? Does it run off a database?

#6 sully

sully

    Young Padawan

  • Members
  • Pip
  • 22 posts

Posted 30 September 2004 - 05:12 PM

Ya it runs of MySQL. Its a very advanced script, dunno how it works as such. You got MSN? We could take about it on it if you like!

- Sully

#7 sully

sully

    Young Padawan

  • Members
  • Pip
  • 22 posts

Posted 03 October 2004 - 07:07 AM

Still no look. Support for PHPAds doesnt work either.

:/ Guess I have to use another script to do affiliates lol.

- Sully

#8 sully

sully

    Young Padawan

  • Members
  • Pip
  • 22 posts

Posted 17 October 2004 - 09:42 AM

Well I still cant get the heap of crap to work.

Can anyone suggest a good script to manage affiliates? Free of course ;P

- Sully

#9 Gio

Gio

    Jedi In Training

  • Members
  • PipPip
  • 317 posts

Posted 17 October 2004 - 11:18 AM

Check in the php tutorials forum, I posted a tutorial on how to make your own.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users