View Full Version : InvisionBoard
blueuniverse
Sep 23rd 2004, 1:17 pm
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?
exam
Sep 23rd 2004, 5:25 pm
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.
Spacen
Sep 27th 2004, 9:54 am
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 );
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.
blueuniverse
Sep 27th 2004, 9:57 am
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.
Spacen
Sep 27th 2004, 9:59 am
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.
maha
Oct 2nd 2004, 9:36 am
6. Edit the skin for the forums and insert "<!--COOP.AD.NETWORK-->" where you want the ads to appear.
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?
Spacen
Oct 2nd 2004, 1:15 pm
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.
maha
Oct 2nd 2004, 2:35 pm
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..
Spacen
Oct 4th 2004, 2:20 pm
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']);
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']);
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.
maha
Oct 4th 2004, 7:54 pm
Spacen,
Thank you for the reply and the code. I'll give it a try. Thanks again!
g00gl3r
Nov 11th 2004, 10:04 am
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)
blueuniverse
Nov 11th 2004, 10:06 am
The above code was for IPB 1.3. Try what I did, top 8 or so posts for IPB2.
Spacen
Nov 11th 2004, 10:10 am
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.
g00gl3r
Nov 11th 2004, 10:36 am
The above code was for IPB 1.3. Try what I did, top 8 or so posts for IPB2.
What, did you get the thing from invisionize or manage to add the code made for 1.3?
Eb0la
Nov 24th 2004, 11:28 am
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']);
}
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>
my ad_network.php is in hxxp://keepingscore.ca/forums
on my site this is what it gives me..
hxxp://keepingscore.ca/error.gif
digitalpoint
Nov 24th 2004, 11:29 am
Try changing this:
$ibforums->skin['template'] = str_replace( "<% COOP.AD.NETWORK %>" , $ad_network , $ibforums->skin['template']);
to this:
$ibforums->skin['template'] = str_replace( "<% COOP.AD.NETWORK %>" , $ad_network[0] , $ibforums->skin['template']);
Spacen
Nov 24th 2004, 11:44 am
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.
Eb0la
Nov 24th 2004, 12:26 pm
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
g00gl3r
Dec 16th 2004, 4:56 am
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 16th 2004, 4:58 am
Just to let people know, I have upgraded the forums to 2.0.3 and I the functions file is still giving me sh**
Spacen
Dec 16th 2004, 7:31 am
The reason why my mod doesn't work on your forums is because you have a much newer version than I do. I still have version 1.3.1 final. They made major changes with version 2.0.
I don't know how to modify that version as I have never worked with it.
hetheman
Dec 29th 2004, 7:51 pm
Okay I used this mod, and got the ads in the main template, now how do I get it on the lo-fi and printer-friendly pages?
Thanks
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.
Spacen
Apr 18th 2005, 11:06 am
Sorry to bump this very old thread but I just updated my site with the new coop code and thought I would paste it here for those who also have invision power boards.
In file /forums/sources/functions.php find this code block somewhere around line 2110:
//---------------------------------------
// Get the template
//---------------------------------------
$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']);
Just after that code block add the following lines (the following code assumes you used the default file names for your coop files and placed them in the root of your site. It also assumes you have chosen to display 5 ads in a text only fashion using "|" as the ad separator. It separates the ads into two lines; two ads on the first line and three ads on the second. If any of these assumptions don't match your situation and you need help customizing the following lines, just reply in this thread and I will try to help you out.):
// Custom mod for coop ad network
ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
include ('ad_network_230.php');
$ad_network = substr_replace($ad_network,"<BR>",strpos(substr($ad_network,strpos($ad_network,"|")+1),"|") + strpos($ad_network,"|")+1,1);
$ibforums->skin['template'] = str_replace( "<% COOP.AD.NETWORK %>" , $ad_network , $ibforums->skin['template']);
g00gl3r
Apr 21st 2005, 8:35 am
Is this for 2.0.x?
Spacen
Apr 21st 2005, 8:39 am
No, this is for 1.3.1 final. 2.0 MIGHT be similar but I wouldn't count on it.
g00gl3r
Apr 21st 2005, 8:40 am
Can't be lol, my functions file can be found HERE (http://www.untoldmedia.com/functions.php), please feel free to take a look at it.
Has anybody got 2.0.3 with the Ads running?
Spacen
Apr 25th 2005, 5:56 pm
The functions file you link to is the same one for version 1.3. You should be able to follow my instructions.
Once you finish modifying functions.php, simply put
<% COOP.AD.NETWORK %> in your wrapper or whatever they may call it in version 2.0
CrustyGeek
Jun 4th 2005, 5:18 am
Has anybody got 2.0.3 with the Ads running?
I just managed to get it running.
1. Upload the ad files as per the instructions to your root directory.
2. Download, backup and open sources/classes/class_display.php
3. Find:
$ibforums->skin['_wrapper'] = str_replace( "<% LOFIVERSION %>" , $this->_get_lofi_link() , $ibforums->skin['_wrapper']);
Add below:
// Custom mod for coop ad network
ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
include ('ad_network_277.php');
$ad_network = substr_replace($ad_network,"<BR>",strpos(substr($ad_network,strpos($ad_network,"|")+1),"|") + strpos($ad_network,"|")+1,1);
$ibforums->skin['_wrapper'] = str_replace( "<% COOP.AD.NETWORK %>" , $ad_network , $ibforums->skin['_wrapper']);
Upload
4. Log into your AdminCP, Go to the Skin Manager and edit the Board Wrapper.
put <% COOP.AD.NETWORK %> where you want the ads to show.
Tis done :D
Now all I've got to figure out is how to show it on my Portal.
Update: Got it working on my bfarber's Portal by doing the same edits to sources/portal.php
:D
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.