First Larger-Scale Web Dev Project - Advice for Content Management? - php

I'm familiar with HTML, CSS, and some PHP and Javascript. I've made several fairly complicated websites for which I've acted as webmaster, manually adding all content in HTML.
I'm about to put in a proposal for my first outside client at a larger business. They have an IT person that would be responsible for updating the website that I create for them.
My question is what to do about content management. I've looked into things like Drupal, but they seem overly complex for this kind of situation, with a single person adding updates of things like text, images, and PDFs.
What would you recommend as the next step above the simple way of manually uploading files and editing HTML like I'm used to? Something like a MySQL database and PHP calls? Would I then store all the images in the database as well?
I guess I'm just trying to figure out what's most common at a medium-sized business. I appreciate any guidance you can offer!
Nathaniel

My company has built large scale projects and medium scale as well. What we like to do is setup a outer page with navigation and an inside page that the client has control of by a control panel with FCK Editor or TinyMCE.
So essentially we have a wrapper page (in our case a MasterPage but in PHP you would use an include or a index.php with a query string to pull the content) and then we drop in HTML content from the database.
That database is populated by the client in their control panel. FCK Editor allows them to upload images and manage links, etc.
For our bigger clients we get very specific in our control panel allowing them to add videos, PDF attachments, blog entries, FAQ content, etc.
Some examples we have are http://pspwllc.com and http://needsontime.com and http://nwacasa.org

Drupal can be bit complex at first but if you stick with the basic modules - it is great for website content management.You can write your own mini content management system - store text and images(MySQL blob format) in MySQL.It will be couple of PHP admin pages and a good render() function responsible for page rendering.

Also have a look at wordpress, it is much easier than drupal. It is less powerful but it may serve your needs. You will NOT need to configure modules like FCKeditor, with it bcoz they come inbuilt. Anybody will be able to edit the content easily. Do note that wordpress is not just for blogs, you can create different kinds of websites with it. Another choice is Joomla, it is also simpler than drupal. But, wordpress is the simplest.

Related

html and css in mysql

I am having trouble designing a solution to a complex problem. I am building a site that creates html templates including both the css files and html files. Users will be able to create multiple templates/sites.
In an attempt to create a normalized database I have a user table (id, name, email, password, etc.), a site list table (user_id, site_id, site_name, description), and the rest I am having trouble figuring out.
I am trying to develop a way to break down both the html files and css files into a database that can be used to reproduce the designed template. Constant editing and adding to the database will take place when creating/editing a template. Basically, an extremely simplified dreamweaver. Flat files may be an option as well.
Any input or suggestions on how to go about such site would be greatly appreciated such as how to break down the html and css into mysql tables/records. Im not so much looking for code, but the fundamental concepts/workings of such a site. Thanks in advance.
First of all, are you sure you even want to store that content in the database? That's going to place a heavy burden on your servers over generating them as files onto the filesystem inside the DocumentRoot and directly servable by the web server. I can see storing the configuration options (color choices, image names, etc) in the database, but not the files themselves.
Can these websites have any content the customer wants, or are they variations on a theme? If it's the former, then you really can't automate it much. You can store the content in a database instead of a file, but it won't really be advantageous.
Your best bet, I think, is to look how CMS programs like WordPress/Joomla break up a page into separate include files (header, footer, left menus, right menus, etc) and use that as a model. The customer picks a template, and each template has defined sections that can be laid out separately with different content.
You could store the templates in text files then store settings (such as CSS attributes or images they may want) in the database. That way, you just load the template with the applied settings.

How do I properly use code in joomla articles?

I am very new to web development and CMSs. I want to make a Joomla site that features articles with a lot of graphs at the top of the page and written content below them. The charts will probably be done with fusioncharts and some controls directly below them to dynamically influence the data displayed in the charts preferably without reloading the page.
My question is what is the most appropriate way to do this in joomla? Can I get the sourcer add in and simple create articles using inline javascript calls to place the charts and controls directly in the article? Is this how people usually embed non text based content in joomla? Is it possible to access the database with code directly embedded in the article to generate the chart?
I dont really want to learn too much of the joomla API right now, I'm more interested in using the CMS features to create the pages and then just coding everything else in javascript/php directly in the page but I'm not sure if that is appropriate or if it would introduce security concerns to my site.
Why not try the FusionCharts extension for Joomla -
This will be much easier than coding this yourself, the work has already been done.
I believe the best thing to do is just use a good WSIWYG and then use the source code feature.
TinyMCE does the work just fine.
Are you looking for plugins or components to add and do this or do you just want to log into administrator and start doing this right away?

How to change and add new web page and content in an existing PHP web appliaction and get rid of design and view problems?

Currently, I work in an existing php web application with sybase database connection.
The web site is built using HTML, CSS, JavaScript, Photoshop, Flash, PHP, IIS, and Sybase.
I would like to add some web pages to this web application so I take a copy of one web page like AboutUs.php for Example and I determine a certain area inside it to change the content either static (text and HTML tags) or dynamic (connecting to the database) and its appearence using CSS.
This web application uses a web template with *.dwt.php Extension and applys for all web site pages as the master web page contains some fixed data like header,footer,rightside,leftside,center and this data includes images and flash objects with predefined sizes and types.
How I can disable the template or modify it to get rid of the design and view changing problems ?
Is there any alternative to replace this template with a new customized template developed by me ?
The problem I face now is when i add my content in the web page the display and the view of it becomes strange and some items and elements overlapped especially in the header, the footer and the sides of the page.
It gives a bad looking for the web page as when data is got from the database or any change happened, the web page design differs especially the images and their borders change and overlapped and intersects.
I do not know Photoshop very well as i think to edit or change the sizes and revise all the web application images properties and sizes to know what is the cause of that.
Is there a fast and proper way to solve that problem instead of rebuilding the web application or testing and verifying all objects and items as this will take long time ?
.dwt is a Dreamweaver template format, so it sounds as if the site has been built in Dreamweaver (a WYSIWYG programme made by Adobe). If you don't know much about web development, or aren't comfortable editing the template then the easiest option may be to use Dreamweaver to edit the site, since this is the format it is currently in.
Well I think you need to invest some time and or money in webapplication development. It is hard to expain you how to do it if you have no experience in web application development.
So, no there is no fast way to solve your problem.

Is php capable of doing what I want?

I'm working on a biology web based application and trying to figure out what language to use. The features I need to include are:
Image viewing frame - This area will display the current image that the biologists wish to see. The application needs to take in a number of coordinates from a file and draw those points on the image displayed here. When the biologist wishes to change images there needs to be no flickering from the refresh. Will do this using multiple image buffers probably. Content needs to be scrollable and able to be zoomed in.
There need to be labeled buttons that advance, step back, zoom, and play the images displaying in the image frame. There also needs to be some type of list view where images titles can be selected to be displayed.
There will be a bunch of folders of images on the server that can be selected from. The application must allow the user to select which folder of images to be loaded. It also must be able to read from either an txt or xml file and visually display the information there by way of line graph.
Would like to be able to run scripts on the server from the application.
I feel that all these things are doable by a web application but I have no idea what language to use. Most people recommend php, but i don't want to delve deeper until I know what its limitations are. Any suggestions are welcome. Thanks in advance.
-Mike
PHP can do everything you need for the back end, but most of the stuff that you describe is UI based, and this is dependent on the client, which is, of course, the browser. For highly graphical projects, you can do a lot in JavaScript and some JavaScript libraries have a lot of these capabilities built in. You might also consider Flash or Flex.
You might even consider a desktop application that runs outside of the browser. You can use Java, which is easy to deploy, but still requires the user to have the Java Runtime Engine, or you could go with a language that you can compile down to a native application.
Regardless of the front end technology that you choose, you'll still need a back end, and PHP can handle this.
You will find almost every server side platforms such as php , asp.net, asp, etc will do all of the above.
PHP is a language that resides on the server and handles all requests. Javascript (and associated libraries) is a language which is executed by the client's browser and handles (almost) all interaction. PHP is definitely able to do what you want, but for the interaction stuff (particularly the zoom, scrolling, etc.), you'll also need to use Javascript.
So, short answer, PHP is good, but you're going to need to use client-side scripting as well.
PHP is more than capable of doing this. You are going to need to use it in combination with some Javascript to handle the client side effects you describe. I would look into modifying galerific for your needs and then whip up some javascript to write points over the images.
From your concerns about image refresh/flicker, it really sounds like a desktop app is what you are looking for, for a rapid response on image changes. The requirements on this really seem to need to be defined better before you can choose a language... PHP can do all the server side stuff you mentioned, but you might have a harder time getting the image viewing "frame" to provide the functionality you want.
Due to the image manipulation requirements it might be easier to go with something like flash with a php backend or asp.net with silverlight. It might be difficult to prevent flicker and delays with using pure javascript as opposed to flash/silverlight.
Image viewing frame
This will most likely need to be done on the client side using tools/frameworks such as jQuery, the canvas element, silverlight, or any of the other 100's that are out there.
There need to be labeled buttons that advance, step back, zoom, and play the images displaying in the image frame. There also needs to be some type of list view where images titles can be selected to be displayed.
PHP or any other server-side scripting language could pull this off. If this is meant to be a quick project running on free/cheap hardware then PHP would be a good choice. If the plan is a large application that will have to be maintained over the course of many years and hosting/price is not an issue then I would suggest something like ASP.NET
There will be a bunch of folders of images on the server that can be selected from. The application must allow the user to select which folder of images to be loaded. It also must be able to read from either an txt or xml file and visually display the information there by way of line graph.
Again any server side language could do the folder listing portion. As for reading files and creating graphs, this would most likely be a combination of server side and client side programming. jQuery for example, has plugins that could quite easily take a xml file and create a line graph.
Would like to be able to run scripts on the server from the application.
PHP, ASP.NET - both could do this. I'm sure many others could, but these are the ones i use most often
The issue with PHP is that quite often, the code turns into a mess over time. This is maybe not so much an issue with the language as the people using it and the purpose the app was built for (a quick, one time project). Classic ASP also has the same issues.
ASP.NET is a good combination of OOP programming that allows you to separate presentation from logic with minimal effort.

What are best practices for determining if I should create a new Drupal module?

I'm using Drupal for the first time for a project at work. I'm finally getting my head wrapped around some of the core concepts, but when it comes to customizing output I'm unsure of how to proceed.
I have to build a fairly specialized image gallery. I've managed to cobble something workable together using Views2, but it's not quite where it needs to be. I'd like to write it from scratch, using SQL and actual PHP, rather than working through this web UI.
I figure I'll put this functionality in a new module. Is that right? Or is that an abomination to the Drupal world?
Edit:
Here's what I've got so far. I've created Image Gallery and Image content types with CCK. Images can be assigned to multiple galleries, via nodereference. I've got imagecache creating two sizes for each uploaded image - a thumbnail size and a gallery size.
Two gallery formats are required, but let's assume I'm going to have a carousel style for now, with some custom JQuery and CSS to match the rest of the site's look and feel. Clicking a thumb in the carousel-style navigator will load the full sized image above it.
Now, assuming such a thing does not exist, what is the recommended approach for creating it? Not how to code it, but where would this code live within the Drupal system?
It seems like views will do the job of creating the data you need - a list of all the images for the galleries, based on whatever criteria you need (taxonomy,author or whatever) and that the carousel part - adding the jquery and css could be done by using drupal's themeing system to change the output.
So as ar as 'where would the code live' I would say in your theme, rather than a module.
The views theming system is pretty comprehensive, if possibly a little overwhelming at first.
This looks like a good starting reference: http://www.group42.ca/theming_views_2_the_basics
You can do this. Views is great but will often only get you 90% of what you need out of the box.
You can do views theming, which can take you further, and you can write extentions to the views functionality (but that is not always easy).
There is nothing wrong with writing your own module in stead of views, in some cases it can increase performance. One tip if you are doing this is that you can see use the query that views creates in your custom module, this can save you having to work it out and write it yourself.
Yep, I'd put this in a module. I often wind up writing custom ones for specialised use cases.
Well since it is free software you are free to do (almost) whatever you want with it.
A good practice to decide if you should do it is:
Will the benefits that I will get from
a custom module divided by the time
I'm going to invest in it. Outweigh
the benefits / over time of a solution
that isn't ideal?
Or if you prefer to look it this way:
Custom Development Benefits Not 'ideal' solution benefits
--------------------------- > -----------------------------------
Development Time Time to install and adapt
Since normally the Time to install and adapt normally is smaller than the time to develop something from scratch, the common conclusion is to just use what is already there.
But by all means if you want to develop your own thing and have enough time, go ahead.

Categories