Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Dec 2004
Posts: 36
Junior Member
Junior Member
Offline
Joined: Dec 2004
Posts: 36
I have tried to insert phpadsnew code into header.php
That produces a problem that users get logged out after a couple of seconds , sometimes minutes - very annoying.

Where to (into which file) must I insert this code to get flawless functioning without atomatic logouts?

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


----------------------

phpads inserts this code into the board cookies:

phpAds_blockAd[3]
1103822652
www.nobody.com/
1024
3441436160
29682040
3580020352
29681938


nosleep
Sponsored Links
Joined: Feb 2002
Posts: 295
Member
Member
Offline
Joined: Feb 2002
Posts: 295
Hi,

You need to select the Javascript option for displaying Ads.

The piece of code we have in our header is:
Code
<br /><script language='JavaScript' type='text/javascript'><br /><!--<br />   if (!document.phpAds_used) document.phpAds_used = ',';<br />   phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);<br />   <br />   document.write ("<" + "script language='JavaScript' type='text/javascript' src='");<br />   document.write ("http://tnmedia.th.net/ads/adjs.php?n=" + phpAds_random);<br />   document.write ("&amp;what=zone:1");<br />   document.write ("&amp;exclude=" + document.phpAds_used);<br />   if (document.referer)<br />      document.write ("&amp;referer=" + escape(document.referer));<br />   document.write ("'><" + "/script>");<br />//--><br /></script><noscript><a href='http://tnmedia.th.net/ads/adclick.php?n=a495e2fc' target='_blank'><img src='http://tnmedia.th.net/ads/adview.php?what=zone:1&amp;n=a495e2fc' border='0' alt=''></a></noscript><br />


Sanuk!

Joined: Dec 2004
Posts: 36
Junior Member
Junior Member
Offline
Joined: Dec 2004
Posts: 36
yes, I tried the js code too. Members still get logged out after a few seconds. I'm really puzzled. Cookies are set /
HTTP Referer Check is disabled, Spider friendly URL's disabled, zlib compression enabled, cookie prefix: ac2ubb, Cookie Expiration Time: 63200, Session files disabled.

What can be the cause of this annoying problem?


nosleep
Joined: Dec 2004
Posts: 36
Junior Member
Junior Member
Offline
Joined: Dec 2004
Posts: 36
you can find this cookie forced logout problem referenced here:

http://forum.phpadsnew.com/index.php?showtopic=6454

To my opinion this renders phpadsnew 2.0 unusable for implementation on any larger site.


nosleep
Joined: Apr 2003
Posts: 359
Enthusiast
Enthusiast
Joined: Apr 2003
Posts: 359
NoSleep, I too use PHPAdsNew with my Threads.

I added the java to my header.php file in the includes directory. I've not had any issues with the code included there.

I do not use java on my threads for this code however...

Here's what one of my banner's code looks like:

if (@include(getenv('DOCUMENT_ROOT').'/phpadsnew/phpadsnew.inc.php')) {

if (!isset($phpAds_context)) $phpAds_context = array();

$phpAds_raw = view_raw ('zone:3', 0, '_blank', '', '0', $phpAds_context);

echo $phpAds_raw['html'];

}


Hopefully this helps in some way for ya....

Sponsored Links
Joined: Dec 2004
Posts: 36
Junior Member
Junior Member
Offline
Joined: Dec 2004
Posts: 36
This is Local Mode code. I tried that too. Same cookie problem.

Imagine 7000 users complaining that they always get fired ....


nosleep
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
You could include PHP in the ubbt_header.tmpl file.

Insert this:

[code]

UBBTPRINT;

// Your PHP code here

echo <<<UBBTPRINT


Put it after <body>


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
hatter
hatter
USA
Posts: 69
Joined: January 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)