View Full Version : Mambo Module?
cafemonkey
Dec 11th 2004, 7:40 pm
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!
payoutwindow
Dec 12th 2004, 12:09 am
I went with adding the code to the index.php of the live template, and it worked okay.
cafemonkey
Dec 12th 2004, 1:23 pm
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.
suzigeek
Dec 12th 2004, 5:44 pm
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.
cafemonkey
Dec 13th 2004, 6:35 am
Mamboforge project created here:
mamboforge.net/projects/mod-coop-ad-net/
cafemonkey
Dec 13th 2004, 1:28 pm
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.
Hank
Dec 15th 2004, 3:07 pm
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
Hank
Dec 15th 2004, 3:50 pm
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
cafemonkey
Dec 17th 2004, 11:36 am
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.
I had the PDF generator on previously, and google has about 200 PDF pages that will not get the ad network ads in.
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...
Fatal error: Call to undefined function: get() in /home/traints/public_html/modules/mod_coop_ad.php on line 53
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
jema
Dec 24th 2004, 12:17 am
Thanks for this one, was about to try and do a module myself.
jema
jema
Dec 24th 2004, 12:21 am
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
jema
Dec 24th 2004, 12:49 am
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
jema
Dec 24th 2004, 1:04 am
Just had a look here:
http://uk2.php.net/manual-lookup.php?pattern=get
and no sign of get() as a function :confused:
jema
cafemonkey
Dec 27th 2004, 6:41 am
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' ) ) {
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' );
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. ;-)
jema
Dec 27th 2004, 11:40 am
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 :D
jema
cafemonkey
Dec 28th 2004, 7:53 am
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
jema
Dec 28th 2004, 7:59 am
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
cafemonkey
Dec 30th 2004, 6:25 am
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!
jema
Jan 3rd 2005, 7:47 am
Sorry for not posting sooner. The 4.51a upgrade does resolve the issue :)
thaks Cafemonkey.
jema
cafemonkey
Jan 7th 2005, 11:29 am
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/
jema
Jan 7th 2005, 11:33 am
thank you :)
jema
Hank
Feb 12th 2005, 1:05 pm
Hey CafeMonkey:
How's your module working now?
I'm the fella who had problems back in December. I did the upgrade to the latest Mambo version and have been retinkering my site entirely.
Anyway, it's time to get back to this and wanted to ping you to see if you have any "warnings" or beware type items before I attempt a new install.
I noticed at http://mamboforge.net/projects/mod-coop-ad-net/ that your download looks like its got these attributes:
Mod_Coop_Ad_0.6.1 January 27, 2005
Is that the latest version? Any tips would be appreciated.
Hank
Hank
Feb 12th 2005, 6:14 pm
CafeMonkey:
I downloaded the module and read the install file. Just curious - your doc doesn't say - the two coop files just go in the directory where mambo is installed - like for any other site?
Hank
Hank
Feb 13th 2005, 3:28 pm
CM:
Never mind. I took the risk and installed it and published it.
Everything looks good and the site validated. Hooray!
Thanks for making that module, and for helping me back in early January when I was having that mambo mod error problem.
Hank
bigslowrock
Feb 13th 2005, 10:21 pm
Someone post a demo site so that I can see what they look like?
justtara
Mar 5th 2005, 4:49 pm
I'm getting this error to. Do I need to do something other than just uploading the module?
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
justtara
Mar 5th 2005, 4:50 pm
Never mind...I think it's because I need so upgrade mambo...
Hank
Mar 6th 2005, 7:42 am
Hi:
Yes, you do need to upgrade. Once I did that (which wasn't particularily easy or hard - just time consuming), the module worked like a champ.
My feeling is that you will like it and it should help you considerably!
Hank
classifieds
Mar 15th 2005, 1:59 am
CafeMonkey, Thanks for the module!
I've got it installed and working on a test site (I'm new to Mambo).
I'm using a site template that does not have any code for content placement in the footer.php (its blank) or below the footer (not sure what thats called).
Can anyone shoot me the mambo code that is supposed to go in the footer.php or or how I can get the ads to display at the very bottom of the page?
Thanks!
-jay
Hank
Mar 15th 2005, 11:46 am
What version of Mambo are you using? Which template are you using?
I'm unaware of any version of Mambo in the last year that doesn't have something in the footer.
You can find footer content in the default SolarFlare or other 3 templates that come with the latest version which you probably already have. Just look in the Templates folder, then the sub folder of your template. You'll see the footer.php in there.
Hank
classifieds
Mar 15th 2005, 11:57 am
I'm on 4.5.2
I looked in the templates/solarflare directory for footer.php and the only files there are:
css/
images/
index.html
index.php
template_thumbnail.png
templateDetails.xml
?
Hank
Mar 15th 2005, 12:03 pm
Sorry...
It's in the 'includes' folder.
Here is what is in the default footer.php:
<?php
/**
* @version $Id: footer.php,v 1.7 2004/09/29 06:28:55 rcastley Exp $
* @package Mambo_4.5.1
* @copyright (C) 2000 - 2004 Miro International Pty Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* Mambo is Free Software
*/
/** ensure this file is being included by a parent file */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
global $_VERSION;
?>
<div align="center"><?php echo $_VERSION->COPYRIGHT; ?></div>
<div align="center"><?php echo $_VERSION->URL; ?></div>
classifieds
Mar 15th 2005, 12:33 pm
Thanks Hank,
I replaced (added) the code to footer.php .
I changed to the solarflare template - everything works and looks fine.
The miro / mambo copywrite and link to mambo now show up.
I had the coop ads displaying in the left column/vertically.
I then went into the coop module and changed the position to "footer" then "bottom" then "legal" and they don't show up in any of the spots.
I then changed the position back to "left" and they display.
Any advice on how to get them either in the footer or below it?
-jay
Hank
Mar 15th 2005, 12:47 pm
I put the ads in the middle section of my site, but I have a pretty lengthy footer section and have all sections - about 30 of them, listed above that part where the ads show.
All I can tell you is experiment with it until you find what works for you. I'm not a programmer, but an html and php hack (if that!) and was able to get my ads showing where I was ok with them. Its not ideal, but it works and achieves the goals.
Good luck!
Hank
classifieds
Mar 15th 2005, 1:39 pm
Hank,
Is the site in your profile the one you are referring to?
-jay
Hank
Mar 15th 2005, 1:46 pm
Hi Jay:
No, that's not the site using Mambo.
cafemonkey
Apr 4th 2005, 9:01 pm
Hey guys, I'm back!
Sorry I was out of it for a bit... I bought a new house then quit my job... Man life is great!
Anyways, I finished the latest upgrade. Now you can change the number of ads, and the "separator" in the Mambo admin page. Just uninstall the old module, install the new one, and... Oh yea... There's no and!
If you have problems, let me know with a PM or email.
Hank: Dude, I'm glad you got everything figured out! I'll try to watch the forum a little more often now.
Classifieds: Welcome to our tiny club! Mambo is awesome, and I think you'll be pleased! In your template, wherever you want your footer to go, just put
<?php mosLoadModules ( 'footer' ); ?>
And you should be good to go. Don't mess with the whole "footer includes" file... I just threw that thing out.
As always, the updates can be found at the Mamboforge Project Page (http://mamboforge.net/projects/mod-coop-ad-net/).
-Andy
classifieds
Apr 5th 2005, 3:48 am
Thanks CM!
I ended up inserting the coop php code into the template index.php . I'll play with the loadmodules(footer) later this week and reinstall your module.
Thanks again!!
-jay
Hank
Apr 8th 2005, 2:50 pm
CafeMonkey:
Welcome back and....welcome to the unemployment world! Or rather, to the self-employed world!
It's time that I have to update my sites to the coop's latest version and of course, that must mean my mambo version.
I'm looking on your Mamboforge site and the file date shows April 5, 2005.
Does that version handle the new update Shawn / DP has put up - the filename today is:
ad_network_220.php file:
I'm terrified of making any changes to any of my sites now, just due to life's experiences with upgrades in general. But I don't want to tinker with your Mambo module (my site is doing quite well with traffic) until I hear back from you that your module supports Shawn's latest versions.
Thanks!
Hank
cafemonkey
Apr 13th 2005, 8:02 pm
If the Forge date says that it was done April 5th, then it incorporates the Coop code up to April 4th. I haven't seen an email from Shawn about a newer update, so I haven't updated since then.
I'll take a look...
As far as being nervous about upgrading... I haven't had a complaint about the newest code yet, nor have I had any problems myself...
cafemonkey
Apr 13th 2005, 8:27 pm
Hiya Hank,
I'm looking, and as far as I can tell, it looks like I updated the Mambo Module April 4th.
And I'm looking at the Coop code, and it looks like it was updated April 5th.
It looks like there might have been one or two minor changes made to the code since I updated it (line 77), and it doesn't look terribly important, so I probably won't update it, unless there is demand for it.
I'm in the US, and our taxes are due this week. I had to fire my accountant, so I'm training the new guy, and everything needs to come together by, uh... tomorrow.
As far as upgrading your Mambo... I upgraded all of my sites to 4.5.2, and it's working great. It was an easy upgrade, and made several Admin improvements. I haven't gone to 4.5.2.1 yet, since I haven't heard anything about it.
Also, if you haven't seen, HTMLArea3 posted an update, if you like that as an editor. You can get the update here. (http://mamboforge.net/projects/htmlarea3xtd/)
blackbug
Jun 18th 2005, 12:03 pm
I'd just like to say thanks for this module... I was sitting there wondering which php file to hack into, or whether to write a module for this... there it was staring me in the face! :)
You've just saved me a fair amount of work...
Cheers!
Chris
LeeD
Sep 22nd 2005, 5:32 am
Where can I find instructions on how to install this? I am new to Mambo and I have the files downloaded, but don't know what to do with them. :D
blackbug
Sep 22nd 2005, 5:52 am
Where can I find instructions on how to install this? I am new to Mambo and I have the files downloaded, but don't know what to do with them. :D
It's been so long since I did this, I can remember. I'm using WordPress a lot these days, but anyway. In your admin backend for mambo there should be a screen to manage your modules. Somewhere there should be a place you can upload the module (as a zip file) and it will automaticlly install it for you then.
If that's not right, then I'll have a look later.
Cheers
Chris
LeeD
Sep 22nd 2005, 6:12 am
That worked! Now what do I do once the module is installed? I see it my list of modules, but how do I make the links appear in my footer?
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.