News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Need phpAdsNew Help

Started by SKETCHi, April 29, 2005, 09:45:12 PM

Previous topic - Next topic

SKETCHi

Alright, I've searched and found nothing. The only helpful bit of information was on how to use the javascript code, which doesn't help me. I'm using the php code provided by phpAdsNew, how can I get it to work with SMF?

Here is the code.
<?php
    
if (@include(getenv('DOCUMENT_ROOT').'/adsnew/phpadsnew.inc.php')) {
        if (!isset($phpAds_context)) $phpAds_context = array();
        $phpAds_raw view_raw ('zone:1'0'''''0'$phpAds_context);
        echo $phpAds_raw['html'];
    }
?>


Here is the JavaScript code that doesn't work either. Even with the "fix" from another thread.
<script language='JavaScript' type='text/javascript' src='http://graphicaddicts.net/adsnew/adx.js'></script>
<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://graphicaddicts.net/adsnew/adjs.php?n=" + phpAds_random);
   document.write ("&amp;what=zone:1");
   document.write ("&amp;exclude=" + document.phpAds_used);
   if (document.referrer)
      document.write ("&amp;referer=" + escape(document.referrer));
   document.write ("'><" + "/script>");
//-->
</script><noscript><a href='http://graphicaddicts.net/adsnew/adclick.php?n=a95af63c' target='_blank'><img src='http://graphicaddicts.net/adsnew/adview.php?what=zone:1&amp;n=a95af63c' border='0' alt=''></a></noscript>


[Unknown]

Use:

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


Or:

<script language="JavaScript" type="text/javascript" src="http://graphicaddicts.net/adsnew/adx.js"></script>
<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://graphicaddicts.net/adsnew/adjs.php?n=" + phpAds_random);
   document.write ("&amp;what=zone:1");
   document.write ("&amp;exclude=" + document.phpAds_used);
   if (document.referrer)
      document.write ("&amp;referer=" + escape(document.referrer));
   document.write ("\'><" + "/script>");
//-->
</script><noscript><a href="http://graphicaddicts.net/adsnew/adclick.php?n=a95af63c" target="_blank"><img src="http://graphicaddicts.net/adsnew/adview.php?what=zone:1&amp;n=a95af63c" border="0" alt=""></a></noscript>


-[Unknown]

SKETCHi

Neither of those worked. The PHP gave me an error and the JavaScript simply didn't show the banners, but atleast the page loaded...

[Unknown]

Post 5 lines above and below of what you're trying with the PHP.

-[Unknown]

SKETCHi

Well, it turns out that the Java does work... but only for Windows. A good amount of Mac users visit my website also, I need it to work for them too.

Also, what do you mean by 5 lines above or below? Wouldn't that put a huge gap on the page?

[Unknown]

Please copy and paste 5 lines above and 5 lines below the code you're trying to put this into in index.template.php with the non-JavaScript solution (the first one.)

How do I modify files?

-[Unknown]

SKETCHi

I put 5 lines between them and it still gives me an error. The JavaScript doesn't work with Mac OS9 and the PHP doesn't work period. Maybe something is slightly wrong with the PHP?

[Unknown]

Let's say you're trying to insert this code on line 50.  Please copy line 45 to line 55 (before inserting any code) and paste it in the little post box on your screen in your web browser.  Next, click the "Post" button.

This will post the code I wish you to show me on this forum, such that I can see it and tell you what you're doing wrong.

-[Unknown]

Advertisement: