I'm using Mambo CMS for my sites, and I made a basic module for the ad network. I'm happy to share this, however, I'm not a coder, so I don't know how to improve it much. So 2 things: 1. If you want the module as I have it, PM me and I'll send it to you. 2. If you know PHP/Mambo Modules let me know and I'll see if I can help improve this thing. Currently it installs properly, but you still have to manually setup the .txt file, and make manual changes to the include file if you want to change the number/type of ads. It really needs an admin page to allow changes. Thanks for the great tool guys!
Yeah, that works, but it's really a hack. The "spirit" of a content management system is to make it as modular as possible. Now, if you wanted to change templates, or use a template chooser, you'd have to hard-code the php into each template. If you have a working system, I wouldn't change it. But I thought I'd share in case someone else wanted to use a Mambo module.
You can put the ad in the footer file which is in the includes folder. Most of the off the shelf templates include the footer in the templates. Thats how I did it with my mambo sites.
OK good news! I've been working on the module all day, and I have something that works, and works well! The module installer works smoothly, it includes a radio button to change from horizontal to vertical ad alignment, lets you choose links, text, or text and banner, and now includes support for the ad_network_ads.txt file... So you don't have to manually create and modify this bugger again! www (dot) mamboforge.net/projects/mod-coop-ad-net/ If you downloaded it earlier, be sure to upgrade. Upgrade instructions are in the documentation section of the project.
CafeMonkey: I installed your module. Great start. Prior to your tool, I've been tinkering with my footer and while I could get the ads to work on my mambo site, I had the PDF generator on previously, and google has about 200 PDF pages that will not get the ad network ads in. Anyway, after installing your module, I get this error: Fatal error: Call to undefined function: get() in /home/traints/public_html/modules/mod_coop_ad.php on line 53 in the place on my site where the ads should display. Also, I get this error at the very top of my browser, before the header graphic: "; defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); ?> So not sure what's up there...... Hank
Cafe: does your module modify any of the native mambo site templates? I can't seem to get rid of the error at the top of the page: "; defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); ?> I've reverted my index.php and footer.php back to prior versions with no luck. Any tips would be welcomed! Hank
Hi Hank, got your email. Thanks for emailing me, cause I haven't checked this thread. I see your site, and I see that it still has this problem. PM me or email me your template html(php) file so I can take a look. That line shouldn't get passed to the html side, so we'll have to see where it's coming from. YES!! I have that problem all the time! But I've found that revalidating tries a different page, and it usually catches it after a few clicks. I've since turned off the PDF pages, but Google still has some indexed... What version of PHP are you running? Like I've said, I'm but much of a developer, but "get" seems like a pretty basic function. Maybe you could make a phpinfo page for me to look at? Thanks, Andy
Also get the: Fatal error: Call to undefined function: get() in /home/marsjupi/public_html/mambo/modules/mod_coop_ad.php on line 105 error. jema
Removing the "get" does make it work, not too sure on things though as I have jst started with this network, so am a but unclear on things. jema
Just had a look here: http://uk2.php.net/manual-lookup.php?pattern=get and no sign of get() as a function jema
I just borrowed that "get" function from the "Main Menu" module. In my version (4.5.1) in modules/mod_mainmenu.php, line 89, I have this: if ( $params->get( 'menu_images' ) ) { Code (markup): That gets the "menu_images" parameter from your Mambo admin page. Go to Modules -> Site Modules -> Main Menu -> Parameters tab. The "Show Menu Icons" controls the "menu_images" parameter. If you can run the main menu, you should be able to run the Coop Module. And, your message surprises me, because "get" is called earlier at line 53: $ad_type = $params->get( 'ad_type', 'link' ); Code (markup): Removing that get line will make the ad work, you just won't be able to "select" from the Admin page which type of ad you want to use. Again, I'm not much of a coder, I just tinkered till it worked. If you can write more than 2 lines of code, you're qualified to be a lead developer on the project. ;-)
May be something about the "includes" that works differently. Perhaps you have othe rmodules loaded that give you access to the get function. I did replace a couple in the module to make things work. I will try and have more of a look, as I have done quite a lot of php jema
I posted to the Mambo forums about this too.... It seems to be a problem with other modules as well. http://forum.mamboserver.com/showthread.php?t=26151
Maybe it is a problem if you are not on 4.51a? I am upgrading currently, so will be able to see if this resolves things. jema
Mambo module has been updated with the new ad_network.php code changes. Also, It now supports background color changes. http://mamboforge.net/projects/mod-coop-ad-net/ Please let me know about any bugs!
The Mambo Module has been updated with the latest changes to the ad_network code. Download from here: http://mamboforge.net/projects/mod-coop-ad-net/