Warning: Cannot modify header information - headers already sent by (output started at /home/mptim/public_html/modules/Blogs/Blogs.module.php:431) in /home/mptim/public_html/modules/Blogs/rssfeed.php on line 101
mProduction Blog - CMS Made Simple http://www.mproduction.net/admin/index.php?mact=Blogs,cntnt01,rssfeed,0&cntnt01show=category&cntnt01catid=3&cntnt01returnid=-1 various items I come across en tim@timothymahoney.com Tim Mahoney Beware what host you choose for CMS Made Simple <p>I recently transferred a client off my web host, and their web guy signed up for a <a href="http://www.1and1.com">1and1.com</a> account. Keep in mind, I have nothing against 1and1.com; to the contrary, their administration area is pretty good, and their prices are fantastic.</p> <p>They support both PHP4 and PHP5, which is key. However, PHP5 files need to be suffixed with the file extension .php5. Something that makes working with a CMS that uses dynamic file reading very complicated. (read: impossible without a rewrite of a lot of code)</p> <p>The base installation of CMS Made Simple works fine; it throws a warning for the PHP Version, but otherwise flows smoothly, and works properly. The problem lies when you go to install modules. A very important one, as it happens. CGExtensions is a module by CalGuy that allows modules to create templates that get stored in the database. It's heavy on PHP5 code, and therefore on 1and1 throws an error when you try to install it.</p> <p>The only workaround I can figure out without changing the module's code is to install a prior version of the module, 1.15.</p> <p>This would not be the end of the world if it was an isolated module; I would create another one by myself and move on. Unfortunately, many other modules are based upon this, and therefore a LOT of work would need to be done to get everything re-coded for PHP 4. And honestly, why should I do that if plenty of other hosts are fine with PHP5?</p> <p>In conclusion, 1and1.com is a good host; I would steer clear of them for CMS Made Simple, however.</p> http://www.mproduction.net/index.php?mact=Blogs,cntnt01,showentry,0&cntnt01entryid=10&cntnt01returnid=15 Tue, 13 Oct 2009 09:48:58 -0500 Creating a Document Management System with CMS Made Simple and some modules <p>So I had to create a system where users could register, login, and upload files. The system would need to show each user his/her files and no one else's, and get in touch with the administrator to let them know a new file was uploaded.</p> <p>There's nothing inherent in CMS Made Simple to accomplish this, but I used a couple of modules (FrontEndUsers, SelfRegistration, CustomContent, and Uploads) to take care of the job. It's easy enough that I know the developer meant it to be used this way if someone needed it. I'm not going to explain SelfRegistration here, that's for another post. However, here's the instructions for the Document Manager:</p> <ol> <li>Install FrontEndUsers, SelfRegistration, CustomContent, and Uploads (Front End File Management)</li> <li>Add 2 pages to the site. Call one "Document Manager" and the other "Send a File"</li> <li>In FrontEndUsers, create the User Properties you'll need for your registered users.</li> <li>Create the User's Group.</li> <li>Put the "Document Manager" and "Send a File" pages behind a login using FEU</li> <li>In Uploads, create the Category "Client Uploads."</li> <li>In the Page "Document Manager," insert the code below: <code> {assign var=email value=$ccuser->username()} {cms_module module="Uploads" category="Client Uploads" mode="summary" key=$email} </code> <p>For some reason, I always have better luck assigning any Smarty object variable to a regular variable before using it in another tag. Might be me, I dunno.</p></li> <li>In the Page "Send a File," insert the code below: <code> {assign var=email value=$ccuser->username()} {cms_module module="Uploads" category="Client Uploads" mode="upload" noauthor="1" key=$email} </code> <p>Using the Key attribute for the Uploads module tag in both places inserts whatever file into the database with the key equal to the user's username, and then allows me to pull it out by the same.</p></li> <li>Pretty much done; make it look pretty with some CSS and you should be all set.</li> </ol> <p>Users can register, login, and upload files. They only see their files, and the administrator can log into the backend and manage them there. Mission accomplished.</p> http://www.mproduction.net/index.php?mact=Blogs,cntnt01,showentry,0&cntnt01entryid=11&cntnt01returnid=15 Tue, 13 Oct 2009 10:04:39 -0500 Front End User Photo Galleries <p>This was somewhat quick and dirty. However, it works very well for what I need and if anyone else would like to use it, go for it.</p> <p>I had a need for a way to enable an administrator to manage photo galleries on a per-user basis. I figured that the best thing to do would be to make some sort of connector between Photo Album and FrontEndUsers, but I wasn't quite sure that was possible, and also whether or not I could pull it off regardless. So, instead I edited FrontEndUsers, and Copied and created a new Module from Photo Albums and called it FEUAlbum. Neither of these modules will be supported by me, (unless there's money involved) and I don't expect to extend them beyond what I've done. Obviously the original authors of the modules are not going to support an edited version of their module.</p> <p>Those disclaimers aside, here we go.</p> <p>Vanilla installation of CustomContent is used.</p> <p>In FrontEndUsers, I created a new "field type" in the User Properties called "Album." Adding this to a group will make a link appear when you edit a user. Clicking the link, if the user has no photo album at the moment, will create the photo album using the user's FEU id as the album id, and the user's username as the album name. If the user has a current album created already, this link will take the administrator to it to manage it.</p> <p>Copying Album to a new module was easy. Installing FEUAlbum will NOT overwrite anything from the original module (Album) and both can run side-by-side. New database tables were created throughout and the links to files are correct. All other functionality, including templates, works as expected.</p> <p>Insert the module tag in the template or page like so:</p> <code>{cms_module module="FEUAlbum" albums=$ccuser->LoggedIn()}</code> <p>Calls the module and uses the user's ID as the album number, which pulls in the relevant album. Obviously the user should be required to log in before access to the album is allowed.</p> <p>The goal was to do the least amount of work and get the greatest functionality out of it. One caveat is that each user can only have 1 album assigned to them.</p> <p>I hope this helps someone out; I've attached zip files for the edited modules.</p> http://www.mproduction.net/index.php?mact=Blogs,cntnt01,showentry,0&cntnt01entryid=16&cntnt01returnid=15 Wed, 18 Nov 2009 10:53:32 -0600 CMSMS and mP CMS <p>I love CMSMS. Adding functionality (when you even need to do it) is so ridiculously easy </p> <p>I'm currently working on a project that I hope will (slowly) phase out CMSMS in my projects, but it's TOTALLY not ready yet, and won't be for a good while. It's called mP CMS, and I have very high aspirations for what it will be capable of.</p> <p><a href="http://www.twitter.com/mpcms">mP CMS Twitter Account</a></p> <p><a href="http://www.timothymahoney.com">Where I'm building and playing with mP CMS</a></p> http://www.mproduction.net/index.php?mact=Blogs,cntnt01,showentry,0&cntnt01entryid=2&cntnt01returnid=15 Thu, 27 Aug 2009 15:55:21 -0500 Integrating Calendar and Google Maps in CMSMS <p>I recently had to do a website for a family friend who's getting married. They were having a destination wedding, and one of the things they wanted to do on the site was have calendar items below a <a href="http://maps.google.com/" target="_blank">Google Map,</a> with the addresses associated with the events reflected on the map.</p> <p>I could have had it be a little redundant, but this is the sort of puzzle I like figuring out, so I set to work.</p> <p>I use <a href="http://www.cmsmadesimple.org" target="_blank">CMS Made Simple</a> for most of the sites I do for folks nowadays, because it's open source and excellently put together.</p> <p>I installed Calguy's Calendar and Google Maps modules, and set to work. I created an upcoming list template to display all the events; pretty easy.</p> <p>One of the field definitions on the Calendar module was "Address" so that they could put in the event's location. This would come in handy for my map points!</p> <p>Next was getting the map set up. After setting up the module with the API key for Google Maps, I created an new map and added a central map point. (the map won't display without one, something I didn't realize at first)</p> <p>The Google Maps module includes a plugin for creating dynamic map points on the fly. I created another upcoming list template in the calendar module to automatically create these map points dynamically. Sample code below. I had to use the smarty "assign" function to get them to work correctly; don't ask me why.</p> <code> {foreach from=$events key=key item=event} {assign var=event_title value=$event.event_title} {assign var=event_date value=$event.event_date_start|date_format:"%e"} {assign var=event_summary value=$event.event_summary} {assign var=event_address value=$event.fields.Address} {cggm_add_dynpoint map=1 name="$event_title" address="$event_address" description="$event_summary"} {/foreach} </code> <p>This way, any new calendar item they created would be created on the map!</p> <p>Note: when you add any code or dynamic points, make sure to add them <strong>below</strong> wherever you create the map! Otherwise they don't show up!</p> http://www.mproduction.net/index.php?mact=Blogs,cntnt01,showentry,0&cntnt01entryid=9&cntnt01returnid=15 Wed, 07 Oct 2009 13:16:18 -0500 Adding an archive list by month to CMS Made Simple's Blogs Made Simple module <p>Something that's bugged me for a couple of months is that the Blogs module of CMS Made Simple does not include the functionality to output a list of the Months that my posts fall into, so that if someone wanted to go and see, for example, what posts I made last month, they would click "September 2009" and see all of them.</p> <p>Finally I was able to take some time and code it out. It's not a really big deal, but it makes me happy to share it with anyone that might need it.</p> <p>Please Note: I have yet to figure out pretty urls, so it does not create pretty urls.</p> <p>Just insert an archive list with the following smarty tag:</p> <code>{cms_module module="Blogs" show="archivelist"}</code> <p>It fits right in with the current version of Blogs. (0.3.3.1)</p> <p>If it's a fresh installation, the templates will install automatically. If you're copying over your existing Blogs installation, the 2 templates are in the zip file in the templates/ folder, and you can copy and paste them into the module's corresponding back-end template yourself.</p> <p>Of course, I'm not responsible for your site going down, loss of data, etc; be smart and back up your database and php files before installing and testing this.</p> <p>That being said, I'd be happy to answer questions in the forum</p> http://www.mproduction.net/index.php?mact=Blogs,cntnt01,showentry,0&cntnt01entryid=8&cntnt01returnid=15 Thu, 01 Oct 2009 14:36:54 -0500 Addendum to Beware what host you choose: Making PHP5 work on 1and1 <p>Earlier today I had an issue with PHP 5 not working correctly on 1and.com hosting. A helpful CMS Made Simple Forum member (SideshowBob) pointed me in the right direction to get it working.</p> <p>By default Apache uses PHP 4 for .php extension. If you don't want to rename all your scripts to .php5 you can do the following:</p> <p>Create a .htaccess file and place the following line in it: </p> <code> AddType x-mapp-php5 .php </code> <p>Then, upload this file to the server at your web root. Apache will now recognize .php files and feed them through the PHP5 processor correctly!</p> <p>Thanks, SideshowBob!</p> http://www.mproduction.net/index.php?mact=Blogs,cntnt01,showentry,0&cntnt01entryid=12&cntnt01returnid=15 Tue, 13 Oct 2009 12:17:46 -0500