View Full Version : How do you edit your database driven site?
Kai-Peter
02-12-2004, 02:05 AM
Mistaril.com is more or less totally PHP/MySQL scripted, most of the main pages just include a few PHP headers (most of them aren't valid HTML by a far shot) and the main text. All pages use MySQL at a minimum once, most pages do several queries.
I currently use a local editor and version control on my desktop (Emacs/TopStyle/Perforce) and the upload the files using CuteFTP folder synchronization feature. The problem is that it takes 1-2 minutes to do the synchronization, which is pretty long for small layout changes. However, running PHP/MySQL on the local machine is also out of question, the Windows and Linux implementations are sufficiently different (I tried this).
Here are my questions:
- If you have a similar database driven site, how do you edit the individual pages? Am I missing something very fundamental in productivity? Ie. Are you using some external tool and editing all the pages directly online using some kind of publishing system?
- Are there FTP clients available that would "hotsync" a local folder with a remote one. Ie. listen to windows file change messages and immediately upload only the files needed when they are changed?
Anything else? Do I need a paradigm shift?
Dexterity
02-12-2004, 07:42 AM
The way I did it was to create some basic content management tools. So most of the pages on this site can be edited directly online w/o needing to do any FTPing. This is especially useful for the individual game pages. But other pages like the home page and the links page are also auto-generated from database tables plus a page template.
Editing the templates is still done manually, but this is much less frequent than content changes. If I just want to add a new product to the site, the only things that have to be FTP'd are the images.
Kai-Peter
02-12-2004, 07:56 AM
How about experiments? If you want to test different headlines for example, without changing the copy, how do you do that?
Dexterity
02-12-2004, 08:14 AM
That could be done either as a content change or a template change, depending on what's being tested. The basic code for running and tracking experiments is already part of the site's main template. So really all that's needed to run a content-based experiment in most cases is just to add a few lines of PHP to the content, such as "if the visitor cookie is odd, show this, else show that." This doesn't require any FTPing. To get the results of experiments, I just run a database query.
Kai-Peter
02-12-2004, 08:57 AM
Thank you Steve, now it clicked .. :)
SunAndGames
02-12-2004, 12:36 PM
There are a bunch of content management systems available that are quite good, and quite free. Two of my favourite are Xaraya (http://xaraya.com) (PHP/MySQL) and Plone (http://plone.org) (Python). Xaraya is a fork of PostNuke, which of course is a fork of PHP-Nuke. Each one being a big improvement on the previous IMHO.
I haven't noticed very many indies using these systems, and I wasn't sure why. Is it because of the amount of customization that an indie typically does (ie. market testing), or just that "gotta-build-everything-from-scratch" mentatility that seems hard to get away from?
I would have thought that less time working on the website, means more time working on the game. Which I'm sure is what everyone would rather be doing.
Kai-Peter
02-13-2004, 02:14 AM
My personal reasons for not using a prefabricated content management system is mainly the first ones you mention. The things I want to do would require custom programming anyway and major parts from the rest of the system would be useless. The cost of learning a new system (and keeping it up to date and stable) is in my estimates higher than doing the small scale content production system by myself. And by doing it myself I'm also able to do as little as possible, to move costs to the future.
The hard work is writing the content for the pages in the first place. A good marketing page might take 2 days or more to write, while the whole system was probably put together in <30 days. And as most of your pages are marketing pages the content productions dwarfs the infrastructure.
But as I said, these are just my personal estimates.
Nick Bischoff
02-14-2004, 02:02 AM
KP,
Am I missing something, why don't you just read the text/copy etc. from the mysql db? Editing then requires a simple online tool to write those values to the db. The sites we develop have a standard static template with several includes that are pulled from the db.
Nick
Kai-Peter
02-14-2004, 04:02 AM
Originally posted by Nick Bischoff
Am I missing something, why don't you just read the text/copy etc. from the mysql db?
I have been using version control on the site so far, especially the scripted side (it's code after all, you might need to back up at some point). That way it has been easier to add everything under VC and use the same system for publishing it.
After reading this thread it seems like placing the copy in the DB and just versioning the scripts might be the way to go. I have to thinkg about it ..
Anyway, thank you for the ideas all of your. Great stuff! :)
Nutter
02-14-2004, 11:45 AM
However, running PHP/MySQL on the local machine is also out of question, the Windows and Linux implementations are sufficiently different (I tried this).I have to seriously disagree with this statement - I do all my development locally before uploading to my web host.
You just have to have the same basic mentality as you would for cross-platform development (as, well.. it is cross-platform development). What this means is that things like paths, executable locations, etc either have to be relative, or you need to be able to switch between two versions of them depending on where the page is running.
What I do is have a configuration file that I include in every page, and it includes the paths and names (ie the MySQL server) of everything I use, so there isn't anything I need to change to run either locally or on the web server. You definitely do not want to be developing on your live site, that's just asking for trouble.
A great PHP/Perl/MySQL/Apache distribution is XAMPP (http://www.apachefriends.org/xampp-en.html), as it is very easy to install, and sets everything up for you. Definitely saves a lot of headaches and time.
As for how to add/edit content - yep, what everyone has said; online forms/content management tools.
*edit: Oh, and for templates in PHP, I can't say enough good things about Smarty (http://smarty.php.net). Use it.
Uhfgood
02-14-2004, 01:10 PM
I just do everything the old fashioned way... make my web pages via html here locally, and upload it via ftp. Since I don't know how to do anything else. ;-)
Kai-Peter
02-17-2004, 01:58 AM
@Nutter: The specific case I ran into was creating symbolic links. This was not possible in the Windows implementation. The other issue is the database, but it might be worthwhile or run a local copy of that as well .. Hmm.. I need to rethink my strategy here .. Thanks .. :)
Oh, and great link to Smarty, I'll give it a close look.
SpikeSpiegel
02-17-2004, 09:00 AM
I've been working with the .NET version of PHP-NUKE (DotNetNuke & IBuySpy) for a few years now. After working with a database driven portal.. I dont think I could ever work with a straight HTML website ever again.
I can manage my content anywhere in the world and it comes with so many cool features, like traffic logging and system metrics, so I can see what people are looking at and how often.
I've also written some custom modules for my own portal that lets me easily post templated content like games and modules.
On top of that If I ever want to start selling directly from my site, I can buy a working store component for a few hundred dollars and upload it and it self-installs into my portal. Sweetness:D (www.snowcovered.com is the module store if your interested)
Sure you need a SQL server but my host takes care of all of that, so for 9.95 a month hosting I'm totally taken care of.