+ Reply to Thread
Results 1 to 7 of 7

Thread: How To Add Ad Code To PHPNUKE Made Easy

  1. #1
    tvale is offline Junior Member tvale is on a distinguished road
    Join Date
    Jan 2006
    Posts
    12

    Default How To Add Ad Code To PHPNUKE Made Easy

    Dear John.

    I now know a much easier way to add the ad code to PHPNUKE sites.

    1) in includes/custom_files/

    Create a file called custom_header.php

    In there place this code

    PHP Code:
    <?php
    if (eregi("block-AdSense.php",$PHP_SELF)) {
      
    Header("Location: index.php");
      die();
    }
    ?>

    <script language='JavaScript' type='text/javascript' src='http://ads2.psychz.net/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://ads2.psychz.net/adjs.php?n=" + phpAds_random);
    document.write ("&amp;what=zone:8");
    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://ads2.psychz.net/adclick.php?n=a477094b' target='_blank'><img src='http://ads2.psychz.net/adview.php?what=zone:8&amp;n=a477094b' border='0' alt=''></a></noscript>

    <?php
    $content 
    .= "<center><script language=\"JavaScript\"
    src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\">"
    ;
    $content .= "</script></center>";
    ?>
    Save and upload to includes/custom_files/

    2) Footer ad

    go to http://yournukesite.com/admin.php?op=Configure

    go down to footer message and add
    PHP Code:
    Free Webhosting By <a href="http://www.profusehost.net" target="_blank">Profusehost.net</a
    And that is it, this will place the ads at the top of every page on the PHPNUKE site as the header.php checks for a custom header and places it at the very top of the page and the footer message at the bottom of every page. To view a samlpe go to http://www.tvale.co.uk

  2. #2
    tvale is offline Junior Member tvale is on a distinguished road
    Join Date
    Jan 2006
    Posts
    12

    Default

    This now works, i find this easier has you dont have to add it to every module, or every theme. just one file needs to be created. Hope this helps a few people

  3. #3
    John is offline Administrator John has disabled reputation
    Join Date
    Sep 2005
    Posts
    504

    Default

    thank you, i'll move this to tutorial section. :-)

  4. #4
    tvale is offline Junior Member tvale is on a distinguished road
    Join Date
    Jan 2006
    Posts
    12

    Default New Way

    You all should need to do is upload these to files to includes/custom_files/

    thats it

    *please do not that this was tested on PHP-NUKE Platinum 7.6 b 4 v 2

    I would be very greatful if some was to tell me if it was working on my site as i have tried to disable ad blocking but it still doesnt show but i added a extra banner of my own to see if that worked the site is www.tvale.co.uk and just leave a message in the shout box please.

  5. #5
    John is offline Administrator John has disabled reputation
    Join Date
    Sep 2005
    Posts
    504

    Default

    I just visited your site and only saw ads in the header. The ad column on the right hand side is empty and is not displaying any ads. Php nuke is very hard to work with when it comes to embedding any extra code.

  6. #6
    tvale is offline Junior Member tvale is on a distinguished road
    Join Date
    Jan 2006
    Posts
    12

    Default

    hi john it should now be fixed and showing ads on the top right hand side.

    if this is true i would like to post a new thread saying how to do it containing the correct files but for a reason unknown to me i cant create new threads.

    also just to clear up the ad rule as i think i was still under the old ad rule

    Does the ads have to be displayed in the header only or the header and right/left side. and is it still Free webhosting provided by profusehost.net in the footer or the new ad code for the footer.

    If this is the cass for the footer i will need a few more days to find a easy way to add the ad code in.

  7. #7
    MoonShops is offline Junior Member MoonShops is on a distinguished road
    Join Date
    Oct 2007
    Posts
    5

    Default

    These solutions posted here would not work for me so I just placed the javascript code in the advertising banner section and the free hosting link in the footer. It works just fine in the left advertising block I made just for profusehost.

    I hope the footer is okay as I couldn't figure out how to put the javascript in the footer but could put the clickable link just fine.

    If John approves the footer part I hope my solution helps someone.

    moonshops.profusehost.net

+ Reply to Thread

Similar Threads

  1. html code... plz debug... easy 10 pts!?
    By ConFusedReaLitY in forum HTML/CSS/DHTML
    Replies: 3
    Last Post: 02-07-2010, 06:03 AM
  2. Replies: 1
    Last Post: 01-06-2010, 09:45 PM
  3. Replies: 0
    Last Post: 12-29-2007, 01:37 PM
  4. Ads code problems with PHPNuke
    By EAGarcia in forum Web Hosting Support
    Replies: 4
    Last Post: 04-04-2007, 04:23 AM
  5. How To Add Ad Code To PHPNUKE Made Easy
    By tvale in forum Web Hosting Support
    Replies: 2
    Last Post: 05-25-2006, 01:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts