Dynamic Sites with Wordpress (PHP) - php

Hey I'm slightly newb when it comes to building comment boxes and avatar/profile pic systems linking with acccounts
My question is: Is there a way I can just use parts of Wordpress CMS such as the content system (because it is* separate via comments.php) into my dynamic php/sql driven website?
Are there any examples of this? I've been having a hard time finding any examples/tutorials/github stuff on this
Thanks :)

Wordpress wouldn't really be something you could pick apart like that, most of the components are tied together and I don't think it would be easy to use just the cms part and not others. The admin interface would definitely be hard to change, and since wordpress updates frequently, you would have trouble merging the updates back to your site I would think.
That said, you can find or create a custom theme and disable comments and remove all the comment functionality from your site. If not, can you describe your needs more and/or what you already have done? Maybe another CMS or system would be more suitable for you.
Or look at one of the PHP frameworks such as Zend Framework, symfony, or Codeigniter. These frameworks can ease development but have some learning curve.

Related

Converting PHP site to Joomla

I have a large complex web site currently implemented using PHP and MySQL.
Some of the pages (about, contact us, etc) are largely static, but need to be updated from time to time. I'd like these updates to be able to be done by non technical admins, so I'm migrating the site to Joomla CMS. I've created a Joomla template to reproduce the banners, styling etc of my existing web site and have successfully reproduced the static pages by cutting and pasting into Joomla articles.
I'm now trying to embed my existing dyanamic php pages into the Joomla framework. I assume that I need to convert them into one or more Joomla components? I realize that I'll need to strip out the php code that currently generates banners, menus, etc, but I don't want to make major changes to these php pages, i.e. I don't want to re-implement them to follow an MVC pattern. I'm looking for a simple Joomla 3.2 hello world component tutorial. The tutorials that I've found are either too complex (i.e. MVC) or they're "too simple". By too simple I mean the component is not listed when I select Menu Item Type within the Menu Manager. Can anyone point me to any documentation that explains the minimal config that I need to include in a custom Joomla 3.2 component in order for the component to be listed when selecting Menu Item Type?
Also, should I create one big custom component to wrap my existing PHP application containing multiple pages("views"?)? Conceptually there the system could be considered as about 3 sub-systems, but there is some overlap between the MySQL tables used in these different sub-systems.
I don't need the implementation to be portable, i.e. I'm not trying to create a reusable component that others could use, I just need it to work on my site, using the least amount of work possible.
Thanks, Wayne.
I hope to clarify a bit and give you way out.
In response to your comment on #user3057084, the power of Joomla and its flexibility comes from it being MVC! If you want to wrap your existing code with little modifications, Wordpress will let you do all kind of nasty things! Nasty in the sense of mixing logic with data, i.e. copying and pasting your code and getting it to work quickly.
Joomla coding standards require that you separate models from views. And that you understand how the Joomla MVC implementation works. It will take longer, but you'll learn a useful skill that can and should be applied if you want to write portable maintainable code following Design Patterns.
Now about the way out.
Nothing keeps you from putting your raw php code in a Joomla view, including the database access. It's really ugly and I feel bad even suggesting this, but if it can be a small step towards using a great framework, then the end justifies the means.
The absolute easiest way for you in Joomla would be to create a template override (which you'll do from the admin with a few clicks in the template manager), then throw your code in, and it will run. Then, a little bit at a time, you might learn to separate the parsing of the input in the controller, store / retrieve the data in a model, and leave just the markup in the view.
But are you absolutely sure you need to code for this? There are thousands of (free) extensions out there that might do the job for you with no coding and little configuration, leaving you just a data migration to handle.
Have you had a look at Wordpress yet? In my experience, non-technical people find it easier to administer a wordpress website in comparison to a Joomla website.
When it comes to the menu structures,themes and contact forms and blogs - Wordpress takes the cake.
It would be worth your while to check it out? It might save you hours of frustration?

How do I migrate a PHP based website to Joomla?

I have a PHP based website, with database connections, form processing, etc, that I need to use a CMS on. I'm trying to use Joomla but after using it for 2 days and reading tutorials on it I'm getting the impression that it's designed to handle static content and that all form processing is to be handled by 3rd party extensions.
Am I getting the wrong impression? Is there a standard way to import a PHP website into a Joomla CMS?
I inherited a Joomla 1.5 site a few months ago, so I was in a similar situation to you - where to begin, with lots of questions about Joomla, its ethos, etc. What I've learnt in the meantime is:
Joomla is very heavily dependent on 3rd-party extensions. Some of these are good, some not so good - evaluation and caution is advised.
Joomla encourages the use of extensions, even for relatively static content. Whether these are full blown 'components', or 'modules', depends on quite how powerful/flexible they need to be.
The MVC architecture that underlies everything has its positives and negatives. On the plus side, if everything is done consistently, there is a good separation of concerns and - in particular - the template system offers good configurability. On the downside, very simple components/modules have an awful lot of complexity - e.g. just in terms of number of files.
Joomla is open-source ... sort of. If your familar with the open-source community, you might be a bit disappointed with Joomla, especially when it comes to 3rd-party extensions. Many of them do not embrace the open source ethos, and try to sell code and/or support so, to reiterate, choose your extensions carefully.
Writing your own extension is fairly simple, especially if you're familiar with PHP. Although the documentation isn't great, there are some gems - in particular, take a look at:
http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_1
http://docs.joomla.org/Accessing_the_database_using_JDatabase
When it comes to forms, I'm still undecided. The site I've inherited uses a third-party extension to manage them (mod_breezingforms), but it has its issues. If you have the luxury of trying out several alternatives, take it.
Run your development site in debug mode. Take a look at database queries. In my own experience, Joomla is very, very demanding on the database. For example, I have some pages that make hundreds of calls to the database with every request. Watch out for this.
At some point, you'll see itemid in the URL and wonder what on earth it is. It refers to a menu item. Menus in Joomla are a bit more general than you might think - they don't necessarily represent a 'menu' and they're quite important. For example, the built-in way to include content on a series of pages is for them to belong to the same menu item, so you might need to create 'fake' menus to house content.
Try MODx Revolution. You can insert your existing php form processors straight into Snippets with next to no modification required, or using the existing FormIt extra. Ajax is easy as pie.
Some docs to get your started:
Overview
Making Sites with MODx
Snippets
edit: apologies if it looks like I've tried to hijack this thread, somehow missed the fact the question is referring specifically to Joomla. MODx is definitely worth a look though ;)
There aren't many CMS's that can handle forms correctly (maybe only the very very generic ones, such as contact me forms, or shopping carts), but for any other purpose, you probably want to use your own PHP script to handle and process the form.
Nothing is stopping you from having a CMS on one part of the page, and your own PHP script on another.
I've once had a website with 2 different CMS's (Wordpress and Joomla), as well as some custom made pages. Slightly trickier to handle, but it's possible.
This question is very broad to answer. There are few step-by-step tutorial available on the internet for this.
From Joomla
Site Ground tutorial
If you follow this head start. You are sure to know a lot of joomla along way and convert your website to the joomla.
BUT, it is easier to build on Joomla rather than convert to it
The first trick to using Joomla effectively is to not over think things and use code that is proven so you don't have to work so hard.
Your existing content can likely be imported to Joomla just be exporting it to a CSV then importing back in to the Joomla article table.
Form handling is incredibly easy. There are dozens of form handling extensions, some of which do more than you will likely ever need. I use ChronoForms most of the time because it can be made to do basically anything once you learn how it works. I also like RSForms if you need non-tech people to be able to create forms on their own.
"Load dynamic data" in to a Joomla article is not very specific, but I'll take a stab at it. If you mean getting user submissions, then there are front end content submission options built in. If you mean loading data from another source, then you can generally use either a module or a plugin to get that data loaded either on the page or actually within the article itself.
Spend a little time getting to know how it works. Learn the difference between a component, plugin, and module and that will help you get a better grasp of what you can do. Joomla is an extensible framework, there's nothing you can't make it do and many things that are already built for you.
I would use JUMI, a Joomla component for embending your own PHP scripts. No scripts modifications are required!

CMS or Framework?

I'm looking to build a online store. However, the first question, past the idea of the store, is the platform. I've previously worked with Java and PHP and am quite comfortable with PHP. So my first considerations were Drupal or maybe CodeIgniter (which I have heard lots of good things about)
On discussions with friends, they suggested Django. But I have no experience with Python or Django.
So my question is, is CI better or Drupal? And further, if not either of them, is Django better in terms of ease of development and extensibility?
Request you to not make this a php vs python battle as I'm looking for advice here. Thanks
Edit: More information about the project:
The Project is intended to create a web-store for certain products which aren't currently sold online. The store will have high-resolution images of the products and other associated details. A few other special features related to the products will be added on in time so they aren't that important.
Another clarification: I understand that Drupal is a CMS and not a framework per so. The only reason I compared it to CI was due to the base platform - php. Perhaps the better comparison would have been Joomla vs Django (but I'm not sure as I do not know enough about either, yet)
Choosing a framework for a project you already know what will be the purpose will only slow your development down. If your project's main goal is to be an online store, then pick your choice among the many projects already implemented for you with payment gateways, shipping options, product management, etc. A framework may offer all that too, but will not be ready-to-use out of the box and you will have to bind everything together yourself. My personal opinion is that frameworks are good candidate when you need an highly customized web application that you will write from scratch, that will not only do e-Commerce but handle other specific business models too.
General purpose CMS such as Drupal, WordPress, etc. are good if you plan to extend your online store to also offer other options (i.g. forums, blogs, multimedia/interactive contents, etc.) If you choose to pick this avenue, I would suggest you download the source code of each CMS you retain and play with it for a while and pick the one you feel the most comfortable with, and which has a good user community. Because there's nothing worst than being stuck with someone else's broken code with no one to help you out.
For e-Commerce solutions, you can find many good projects here. If I may choose one to suggest, a solution that you may consider as it looks simple, it is written in PHP and has good reviews is OpenCart
A good one I have worked with is the Instinct e-Commerce plugin for WordPress. I don't necessarily like WordPress, but that plugin is fairly good and will have you get your online store up and running in no time. The plugin also enable you to code new custom payment gateways fairly easily (just one file to code...)
CI and Django are frameworks that help you build a web application from scratch, if you are willing to do this - go ahead and try it. There should be plenty of modules available that allow you to easily extend the framework.
Drupal however is a CMS, so it comes with multiple plugins already installed and is able to manage your content. You'd still need to develop the "store" functionality - payment, listings, etc. - yourself.
If the CMS fits you perfectly now and in the future then CMS, otherwise framework. The framework will allow you total liberty for the price of time spent on development
Have you read and heard about JOOMLA i think its very poweful CMS in php and has a lot of community support as well, In java LifeRay is a good option.
I'd only use a framework if the requirements can not be engineered into an existing cart CMS.
I'd use a CMS over a shopping cart if the commerce aspect was relatively trivial
I'm surprised you're not considering an off the shelf cart. Open Cart is pretty extensible, and Trading Eye has a nice CMS component.
I would generally advise to stick with a language you know for important projects, although I like Python as a language much more than PHP, and Django is a nice framework.
Drupal is not only a framwork, but also a CMS. You can build an online store with some modules (Ubercart), so I would recommend to try that and see if the stock solution fits to your needs.
I suggest you have a look at Drupal's repository of modules -- in particular those in the e-commerce group here: http://drupal.org/project/modules?filters=tid:104&solrsort=sis_project_release_usage%20desc
There's a ton of them that could really help to speed you along on this project.
If you know PHP and have a good grasp of HTML/CSS/JS, you should do OK in Drupal too.
Choose Django if you want to learn Python/Django and use them in your future projects. Django is cool and you'll have fun learning Python. And you'll be able to make an informed decision for your next project.
However, if you have a budget/timeframe or just want to make this project out of the door without needing to learn a new framework I'd suggest choosing a tool/language you're familiar with.
The Bricksett CMS will build the website for you but you can also modify it using PHP for additional functionality. Modify its CSS for a better look and feel. The layout is also simple yet it has a design distinct from other CMS.
A new addition to open-source CMS
Yahoo has something like a specialized CMS for online stores, called Yahoo Stores. They make it very easy to set up an online store, and provide other logistical services. You may want to take a look at that. Of course, they take a small percentage from your sales.

Simple PHP CMS as an alternative to hacking Wordpress

For creating common user modifiable site I've been forcing Wordpress to do the work of a CMS. It's worked and the back-end is purdy but it's just too hacky for my tastes. So I'd like a simple CMS that is easy to customize and add dynamic content to.
Right now it looks like modx is my best bet. I've tried Joomla a while ago but it was a real pain to customize and the back-end was not intuitive.
Basic requirements:
Free
Runs under PHP5
Easy to customize
Easy for content authors
Easy to add dynamic content
If it doesn't have these, then I doubt it's more fit than modx.
I'm a huge fan of modx, I don't have much to add other than to say if you are happy with modx and it does what you need then stick with it.
I just haven't come across anything as easy to use for a developer. The template system, ease of creating your own snippets if you can't find what you need already, everything just seems to fit from a developers point of view.
I have also had no trouble training clients to use it.
The main problem with modx for me is that I haven't really been impressed with any shopping carts/store solutions for modx yet, but I guess it depends on what kind of site you want to make.
i can recommend frog cms http://www.madebyfrog.com/
it's a copy of radiant cms (which is running on ruby/rails, see http://www.radiantcms.org/)
Have a look at this http://php.opensourcecms.com/scripts/show.php?catid=9&cat=Lite
The list contains very lite php opensource CMS, most of them dont even use a database.
You can go through the demo of these and pick the one you like.

Cms to plugin to a multiple controller php site

I have a php site setup with multiple controllers for the different sections of the site.
e.g index.php, gallery.php, faq.php etc.
Currently I have a base template which I call from each controller, which in turn includes the relevant content for the page. I also use tinymce to edit this content file.
So it's really a very simple cms.
Edit: To clarify, I have several new features I would like for my cms. e.g Specific section editing, menu editing and a few others.
But I thought instead of continuing development on this and reinventing the wheel, I'd try to find a cms which can plug in to my multi-controller system, instead of forcing me to develop my app in it's framework. I guess I want it to manage just the content, not any other backend stuff of my site.
Hope this is understandable.
I'm not sure if I'm understanding your question correctly. You have a site with a basic CMS using a template system and multiple controllers. You don't want a framework to port your site to, but you instead want a CMS that will "plug in" to your current site? What exactly do you want plugged in to your site? (i.e. What features/functionality are you looking for?)
Edit:
I still think you should consider an MVC framework like CakePHP if your goal is to build a more robust CMS without re-inventing the wheel. Building on a well-designed framework would also make extending your site's functionality in the future much easier (as well as make it easier to maintain a complex web application).
The only other option I can think of is to simply replace your existing CMS with a more robust one, like Drupal/Joomla/Wordpress, which you could then extend with modules. But that would probably give you less flexibility, not more.
Le me see if I have this right. You want a CMS. But it has to be one that will conform to your arbitrary way of doing things that you can drop in and have work. You want a CMS that isn't frameworkish at all. A CMS that will only do the frontend, and not the backend.
You don't want a CMS at all. A CMS, by its very nature, does backend work. That's the point of a CMS. What you want is Dreamweaver-esque magic template handling.
Or maybe you should adopt a real CMS or framework, and work from there. It's not really reasonable to expect this sort of magic psychic power from a CMS.
i also recommend Drupal. its very well organized and is easily adjusted to almost any style of website. you can use it as a pure cms or add plugins w additional features as needed .. the core package is fairly small, very easy to set up and play with, and very well supported .. worth looking at
If you wrote a very basic CMS for your own use it seems to me that you should have no problem adopting an existing out of the box solution like Drupal, Joomla, etc. These are full featured CMSs that are ready to go and with some graphics work and a little hacking on your end can look like anything you want.
Your other option is using an existing framework like others have suggested such as CakePHP, CodeIgniter, etc. These are all frameworks which basically give you all the tools you need in order to build a more robust custom CMS than what you have now.
It seems to me that you know at least a little bit about what you're doing. I would suggest you check out the different frameworks that are available and run with that.
CodeIgniter
CakePHP

Categories