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?
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.
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.
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.
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.
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?
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.
Thanks for the reply. I was able to get the ad to work on the board header, but it's pretty ugly. 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..
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.
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 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)
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.
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
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:
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.
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
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!!!!!
Just to let people know, I have upgraded the forums to 2.0.3 and I the functions file is still giving me sh**