InvisionBoard

Discussion in 'Co-op Advertising Network' started by blueuniverse, Sep 23, 2004.

  1. #1
    Is there any easy way of operating the coop ads on an IPB2 forum. I tried it using the manual PHP method, but it doesn't seem to work after adding the php include in the template (probably because it doesn't like it being php)

    I'd really like to have these ads on the site, as they worked well while I had PHPBB. Any solutions?
     
    blueuniverse, Sep 23, 2004 IP
  2. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try looking for the right place to put the php code. You will need to look wherever the html is last generated and put the php there. ie: look where it parses the template files etc.
     
    exam, Sep 23, 2004 IP
  3. Spacen

    Spacen Peon

    Messages:
    92
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I too have invision power boards although I don't have 2.0. I have 1.3.1 Final. I found a way to put the ads on all pages but it takes a little bit of program editing which I don't recommend if you don't know what you're doing.

    Here are the steps and they will likely vary quite a bit considering we have two different versions and I have also done some other customization of mine.

    1. In your forums directory, find file "sources/functions.php"
    2. Find function "do_output". For me, this function begins on line 1861.
    3. Scroll down a ways until after you see the commented out paragraphs about the copyright. Following the copyright should be the rules link section beginning with "// Show rules link?"
    4. Just above "// Show rules link?", insert the following code:
    // Special macro for coop ad network
    
    		ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
    		include_once ('ad_network.php');
    
    		$this_header = str_replace( "<!--COOP.AD.NETWORK-->", $ad_network, $this_header );
    Code (markup):
    5. Save file and upload it.
    6. Edit the skin for the forums and insert "<!--COOP.AD.NETWORK-->" where you want the ads to appear.

    Notes: I would make a backup copy of the original functions.php file before doing anything. The code you have to insert may also have to be modified just a bit to match the code for that version. It is also entirely possible that the code for that version is nothing like mine. Anyway, I hope this helps.
     
    Spacen, Sep 27, 2004 IP
  4. blueuniverse

    blueuniverse Guest

    Messages:
    217
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Yeah, thats a bit like what I eventually found.

    There is a mod, which allows php to be put in the global bit (over at invisionize) and I put the code required in an include file, and it included it (the mod only allowed includes).


    Anywho, working now, and all validated. Thanks for the help.
     
    blueuniverse, Sep 27, 2004 IP
  5. Spacen

    Spacen Peon

    Messages:
    92
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I may have to check out that mod. I wonder if it will work with my version. It looks like I was a touch too late to help but I only just figured out what needed to be done this morning.
     
    Spacen, Sep 27, 2004 IP
  6. maha

    maha Well-Known Member

    Messages:
    304
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    123
    #6
    Hi,

    I also have IPBv1.3 Final. I did the changes to function.php. Can you explain where do I edit the Skin? Do you mean the wrapper?
     
    maha, Oct 2, 2004 IP
  7. Spacen

    Spacen Peon

    Messages:
    92
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I forgot to mention in my original set of instructions that the edit to functions.php will only allow the ad to be inserted into the board header. You edit the board header by going to the admin control panel, then going to skins and templates, manage skin sets, HTML -> Global HTML Elements -> Board Header.

    If you wish to put the ad at the bottom of the page, it will require a different edit to functions.php. I don't have the code in front of me right now, but I do remember that the edit is very similar to first. In fact, it's in the same function several lines down. You should see several more str_replace function calls replacing wrapper macros (such as <% COPYRIGHT %>).

    I hope you can figure it out but if you can't I plan to post instructions for this edit on Monday when I have time to copy and paste the code and give exact line numbers.
     
    Spacen, Oct 2, 2004 IP
  8. maha

    maha Well-Known Member

    Messages:
    304
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    123
    #8
    Thanks for the reply.

    I was able to get the ad to work on the board header, but it's pretty ugly. :rolleyes: So if you don't mind, please post the codes and steps on how to do the mod Invision Board 1.3 so so I can edit it with the Skin "wrapper" from admin.

    I did look and found the "str_replace function calls" you mentioned, but not being a PHP programmer, I had no clue on where to place the code.

    Thank you again for helping..
     
    maha, Oct 2, 2004 IP
  9. Spacen

    Spacen Peon

    Messages:
    92
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    OK, here are the instructions on how to edit sources/functions.php to allow coop ads in the wrapper. You'll want to do this edit instead of the first if you want to place ads at the bottom of the page. In my case, I use both because I have an ad at the top and bottom.

    Look for the following lines in functions.php:

    $ibforums->skin['template'] = str_replace( "<% CSS %>"			, $css					 , $ibforums->skin['template']);
    $ibforums->skin['template'] = str_replace( "<% JAVASCRIPT %>"	 , ""					 , $ibforums->skin['template']);
    $ibforums->skin['template'] = str_replace( "<% TITLE %>"		 , $output_array['TITLE'] , $ibforums->skin['template']);
    $ibforums->skin['template'] = str_replace( "<% BOARD %>"		 , $this->to_print		 , $ibforums->skin['template']);
    $ibforums->skin['template'] = str_replace( "<% STATS %>"		 , $stats				 , $ibforums->skin['template']);
    $ibforums->skin['template'] = str_replace( "<% GENERATOR %>"	 , ""					 , $ibforums->skin['template']);
    $ibforums->skin['template'] = str_replace( "<% COPYRIGHT %>"	 , $copyright			 , $ibforums->skin['template']);
    $ibforums->skin['template'] = str_replace( "<% BOARD HEADER %>" , $this_header			 , $ibforums->skin['template']);
    $ibforums->skin['template'] = str_replace( "<% NAVIGATION %>"	 , $nav					 , $ibforums->skin['template']);
    Code (markup):
    For me, this code block begins on line 2123 but I have added several lines to this file already so you will probably find it around 2115 or 2120. Insert the following code after the code block above:

    // Second custom mod for coop ad network - places ad in skin wrapper
    ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
    include ('ad_network.php');
    $ibforums->skin['template'] = str_replace( "<% COOP.AD.NETWORK %>"	 , $ad_network					 , $ibforums->skin['template']);
    Code (markup):
    Note: I use "include" instead of "include_once" because I have two coop ads on each page. If you only have one ad on a page, then use "include_once".

    Now, log into the ipb admin control panel and go to Skins and Templates -> Manage Skin sets. Now choose the wrapper for the skin you want to place the ad in. Insert "<% COOP.AD.NETWORK %>" where you want the ad. I placed mine just before the copyright.

    I hope this helps.
     
    Spacen, Oct 4, 2004 IP
  10. maha

    maha Well-Known Member

    Messages:
    304
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    123
    #10
    Spacen,

    Thank you for the reply and the code. I'll give it a try. Thanks again!
     
    maha, Oct 4, 2004 IP
  11. g00gl3r

    g00gl3r Well-Known Member

    Messages:
    167
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    128
    #11
    I've got IPB 2.0 (.01) and can't find the above code, not the code in the third post, i've tried adding it and then calling for the code from the header, then tried the 'second' code in a few places which I thought might have been updated versions of the above code (that you asked to find) and neither worked :p

    Anybody know IPB 2 well?

    (just to add, at least I am getting somewhere now, I can see the light at the end of the tunnel, just walking towards it slowley, lol)
     
    g00gl3r, Nov 11, 2004 IP
  12. blueuniverse

    blueuniverse Guest

    Messages:
    217
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #12
    The above code was for IPB 1.3. Try what I did, top 8 or so posts for IPB2.
     
    blueuniverse, Nov 11, 2004 IP
  13. Spacen

    Spacen Peon

    Messages:
    92
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #13
    I wish I could help but I have never looked at 2.0. When you do find the solution, could you post a direct link to it? I have been considering upgrading to 2.0 and wouldn't mind taking a look at the mod once I begin a more in depth evaluation of the new version.
     
    Spacen, Nov 11, 2004 IP
  14. g00gl3r

    g00gl3r Well-Known Member

    Messages:
    167
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    128
    #14

    What, did you get the thing from invisionize or manage to add the code made for 1.3?
     
    g00gl3r, Nov 11, 2004 IP
  15. Eb0la

    Eb0la Peon

    Messages:
    19
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #15
    Im having issues with this

    hmm doesn't seem to work for me..

    here is the functions.php

    $stats                   , $ibforums->skin['template']);
            $ibforums->skin['template'] = str_replace( "<% GENERATOR %>"      , ""                       , $ibforums->skin['template']);
    		$ibforums->skin['template'] = str_replace( "<% COPYRIGHT %>"      , $copyright               , $ibforums->skin['template']);
    		$ibforums->skin['template'] = str_replace( "<% BOARD HEADER %>"   , $this_header             , $ibforums->skin['template']);
    		$ibforums->skin['template'] = str_replace( "<% NAVIGATION %>"     , $nav                     , $ibforums->skin['template']);
    
    // Second custom mod for coop ad network - places ad in skin wrapper
    ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
    include ('ad_network.php');
    $ibforums->skin['template'] = str_replace( "<% COOP.AD.NETWORK %>"	 , $ad_network					 , $ibforums->skin['template']);
    
    		
    		if ( empty($output_array['OVERRIDE']) )
    		{
          	    $ibforums->skin['template'] = str_replace( "<% MEMBER BAR %>"     , $output_array['MEMBER_BAR'], $ibforums->skin['template']);
            }
    Code (markup):
    and here is the wrapper

    <meta name="revisit-after" content="1 days">
    <meta name="rating" content="general">
    <meta name="distribution" content="global">
    <% GENERATOR %> <% CSS %> <% JAVASCRIPT %></head> <body> <% BOARD HEADER %> <% NAVIGATION %> <% BOARD %> <% COOP.AD.NETWORK %><% STATS %> <% COPYRIGHT %> </body> </html>
    Code (markup):
    my ad_network.php is in hxxp://keepingscore.ca/forums

    on my site this is what it gives me..

    hxxp://keepingscore.ca/error.gif
     
    Eb0la, Nov 24, 2004 IP
  16. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #16
    Try changing this:

    $ibforums->skin['template'] = str_replace( "<% COOP.AD.NETWORK %>"       , $ad_network                                   , $ibforums->skin['template']);
    PHP:
    to this:

    $ibforums->skin['template'] = str_replace( "<% COOP.AD.NETWORK %>"       , $ad_network[0]                                   , $ibforums->skin['template']);
    PHP:
     
    digitalpoint, Nov 24, 2004 IP
  17. Spacen

    Spacen Peon

    Messages:
    92
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #17
    I think your problem might be in the wrapper, not the code.

    Try moving <% COOP.AD.NETWORK %> down after <% STATS %>. There may be a layer problem or something.

    EDIT: On second look, it does appear to be a problem in the code somewhere. I will look at it further.

    EDIT2: OK, think I figured out the problem.

    you are including ad_network.php with the following code: include ('ad_network.php');

    This is the wrong path. It's looking for the include file in your domain root, not /forums.

    You need to either change the include line to: include ('/forums/ad_network.php');
    or
    move the include file to the root of the domain.

    Hope this helps.
     
    Spacen, Nov 24, 2004 IP
  18. Eb0la

    Eb0la Peon

    Messages:
    19
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #18
    ok it now works... you can see the ads in the forums... but i cant get them to display on IPDL the main page http://www.keepingscore.ca so therfor it's not auto validating the ads ... what can I do?

    ok nm




    Logout | Setup Instructions | Edit Account Settings

    Ads appear to be live on your site (as of 2004-11-24).

    Any questions? Please read the FAQ, or visit the forum.


    next question.. how often and how does the user wieght go up? I get thousands and thousands of page views per day
     
    Eb0la, Nov 24, 2004 IP
  19. g00gl3r

    g00gl3r Well-Known Member

    Messages:
    167
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    128
    #19
    I am having trouble with this adding the code to the finctions.php....

    I can't find either, 'do_output' (without the marks) as Spacen suggested at the start of this topic or 'str_replace( "<% NAVIGATION %>"' (without the marks) as suggested by loads of people.

    More info on my problem can be found HERE: http://forums.digitalpoint.com/showthread.php?t=6355 .... please help me!!!!!
     
    g00gl3r, Dec 16, 2004 IP
  20. g00gl3r

    g00gl3r Well-Known Member

    Messages:
    167
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    128
    #20
    Just to let people know, I have upgraded the forums to 2.0.3 and I the functions file is still giving me sh**
     
    g00gl3r, Dec 16, 2004 IP