Can we do Custom PHP/Mysql with ExpressionEngine - php

I'm looking into expressionEngine as a CMS for a project i'm working on. I'm not sure if EE works with Custom PHP/JQuery. I'm want to allows users to upload images, Each user's images would go into the user's folder named after his userid. User can then access his uploaded images y clicking on show all images... Something along this liken. I have this done in Pure PHP, but the questions is can this be done in EE and how efficient or easy it is to do so.

I don't see why you couldn't accomplish these things within EE. EE has some good image gallery setups, and custom programming (as of EE 2.0) relies on CodeIgniter.
http://www.packtpub.com/article/expressionengine-creating-a-photo-gallery
Be willing to learn the "EE" (now "CodeIgniter") way of doing it. But sure, you could easily build your own system on top of EE.
http://net.tutsplus.com/tutorials/php/codeigniter-from-scratch-file-uploading-and-image-manipulation/
A bonus is that the EE community is very friendly and active. Plus there are some great developers, such as Leevi Graham:
http://leevigraham.com/
http://ee-garage.com/
And some more specific examples:
http://codeigniter.com/user_guide/libraries/file_uploading.html
http://jefim.eu/blog/2009/10/image-file-upload-with-codeigniter/
http://codeigniter.com/forums/viewthread/80610/
Some more good information:
http://net.tutsplus.com/articles/web-roundups/30-awesome-codeigniter-tutorials-for-all-skill-levels/

I haven't touched ExpressionEngine a lot, but I have done some freelance work for designers who have used EE. You can use templates in EE and inject your own PHP code into them no problem. You just have to tweak a couple of settings on a per template basis (enable PHP code and set PHP processing to occur at either the input stage or the output stage - not entirely sure what the effect of that is though).
Basically, yeah you can use your own PHP in EE.

ExpressionEngine (EE) is based on CodeIgniter (CI) a free PHP (MVC) framework. So you you may have to create a custom controller and model to do this but its a simple request so should be easy. Start here: http://codeigniter.com/

As mentioned above, there are several ways of achieving the functionality that you're seeking. The easiest methods involve relying on a couple of carefully crafted conditional statements in EE template code, but this method would dump all images into one folder (instead of storing them within a folder named after each user's ID).
If you find that you really want to break out of this structure and store each user's photos in a unique folder, you could use the EE API. The API allows you to do many powerful things and can be much more convenient to use than standard PHP , depending on the task at hand.

Related

Website with login

I want to create do the following things:
1. Create a new E-Commerce website
2. Update a already made website(superbrainacademy.com)
So the second thing, I have to include a log in provision so that some people which I authorize can get to see certain extra pages than others.
In e-commerce website I want everything like they can sign up themselves, I do not want to add each person manually, they log in with their email id and password and do shopping like something like flipkart.com. Well, payment gateway is out of scope for this question. What I need to know is how to start? In what language to make all this? Any guide on this?
What I know and i have created: I know programming in html and a little bit css. I make websites from downloading some good templates or just putting nice images at back and all. See my websites to have an idea(superbrainacademy.com or octindia.com)
I thought that maybe I could achieve this through joomla/drupal/wordpress. So I downloaded xampp and installed wordpress, drupal and joomla on it. The websites that open up look basic blogs to me (sorry but i am new to it) So I have no idea whether or not what I want can be accomplished by use of any of them. I also downloaded many many wordpress templates but they looked disgusting.
So what I need: A way to create a website with login id and password (signing in and signing up) but one has to be authorized by me as the users < 20 or so and the other needs to be done automatic as users > 100 or idk maybe greater. So how should i start.
Note: I do not prefer using automatic website making like weebly and all...
I would recommend using a CMS. If your willing to put some time into it you can learn to build your own template. I haven't used wordpress but I have built templates for Joomla, it takes some time to learn probably just as much time it would take to do what you want to do from scratch. Check out their guide to building a basic Joomla template.
http://docs.joomla.org/Creating_a_basic_Joomla!_template
So it seems that, you just need an e-commerce cms, and its likes of .
My suggestion for you is to deploy a Magento installation with a prebuilt template and demo just so you know where to start, and it gets easier for you to do stuff yourself, once you get a hang of it.
There are various of Magento/osCommerce template service providers out there some of them free maybe, some of them premium. Though I strongly bias my recommendation towards Magento than osCommerce, after myself having worked on both.
Note:- I am taking about opensource here, and mostly all of these cms installations tend to be quite similar.
Update:-
About integrating a login system inside your current website, you can use a script from HERE as per your requirement and complexity.
Joomla has inbuilt ACL:
http://docs.joomla.org/J3.2:Access_Control_List_Tutorial
so that would enable you to set specific access for specific user groups eg branches
It would allow you to either:
a) let people register individually
b) you approve each registration
c) you set up each user individually
You could also combine Joomla with an eCommerce component.
I find mixing Joomla with Mijoshop (OpenCart for Joomla) a good solution.
You can install Joomla with VirtualMart. If you don't need all functionalities of joomla just disable those from back-end. If you need a pure e-commerce site you can use OpenCart (lightweight solution) or Magento which is a much more complex e-commerce solution.
Update:
The second thing couldn't be accomplished by using HTML only. wardha-Web's answer below (php login) seems to be a good choice since it's quite simple. Another sophisticated way would be to modify your existing site and put it behind to a php framework where you can define access role based authentication, but for this you need to have some php and object oriented programming skills

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?

Joomla: What is a good technical approach for data entry?

I have a background in .NET and Perl, but have found myself working on a project where the customer is mandating Joomla. They would like me to setup a web site that will allow them to enter rental properties, which would likely include a large description field and a number of smaller metadata fields. What is a good way to approach this problem using Joomla? Would I somehow add metadata fields to articles for entry of rental properties? Would I need to create something outside the realm of an article (I'm thinking maybe a component, based on some intro training videos that I have watched on Joomla)?
My HTML and CSS skills are pretty solid, and I have a little bit of experience with PHP, so I don't mind getting my hands dirty. However, I'd like to get an idea of how a Joomla veteran would approach the problem.
Trying to tack meta information on to the articles is almost certainly not the way to go - for a ton of reasons. You are on the right track with a component. Consider designing a component with a back-end database, admin capability and a few front-end data-entry/information screens. The Joomla framework is a little cumbersome to begin with, but ultimately the MVC implementation makes sense and is quite powerful.
This tutorial at the Joomla documentation wiki runs through pretty much everything you need to know from a basic "hello world" to databases and more complex implementations. It sounds like the basic database-enabled example would get you really close to your objective. The example application builds on itself from one tutorial to the next, so it is not at all a waste to start at the beginning and work through it.
And a couple random bits of advice for a Joomla component development beginner:
One thing you may want to research related to data-entry is the JHTML class (the JHTML::_() function in particular). IMO the approach is less than intuitive, but using it is required to leverage built-in widget classes defined for the standard form fields in more advanced applications. It is also important for working with customized form field types and handlers.
Also, the objects returned by JFactory::getApplication() and JFactory::getDocument() have a ton of useful/important functionality when it comes to manipulating the Joomla application (like access to the JInput object). Get familiar with what they can do and remember how to retrieve them.
Good luck.
While building a component from scratch is the most flexible the initial learning curve might be too expensive (time wise) if you're not experienced with PHP and the Joomla framework.
Generally, if we're asked to do something outside our normal areas in Joomla the first place I look is the Joomla Extension Directory (JED).
From that I can usually find a very good solution or a very near match. If it's not a perfect match I can easily extend it (e.g. adding a plugin for a local payment gateway) or work with the developer to add the features we need to the extensions core). Which is probably a good way to start with Joomla, i.e. modifying or extending an existing extension.
You're lucky though, the area you're interested in has it's own category on the JED — the Real Estate section has 15 items listed and most them seem to have good ratings and reviews.
So, I'd start there.
You could make a form plugin for articles to add the extra field or to divide the body field into sections with json or using the profile plugin as a model you could add fields and store them in a separate table.
YOu could repurpose the contact component and use its many fields, or just clone it and change the names.
You could also use an advanced form extension.

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!

Several copies of a PHP site with tweaks: maximize code reuse and minimize duplication?

Sorry for the confusing title....
We are developing an application to be used by multiple companies. For the most part, the application is the same, your standard sort of database manipulation pages (search pages, edit pages, etc.) customized for the data that it is designed for.
However, each company has a slightly different process, and we will be dealing directly with each company so we'd like to use some sort of system that would allow us to tweak pages depending on which company is viewing the page. For example, one company might want a couple extra fields on a data input page, or another company might want to view a different piece of data on a search results screen, and so on.
I understand this is all hypothetical and I wish I had a concrete example to give you, but honestly the companies haven't even given us very good examples. We just want to be ready.
So my basic question is, what is the most flexible way to allow for these tweaks and customizations on a per-company basis? Obviously, the most flexible but least programmer-friendly way would be to make a complete copy of the app for each company. This obviously isn't an option because we'd need to manage updating code on all the sites, trying to keep them all running and tested and having issues resulting from the customized code.
What are your thoughts on Smarty being a solution to this? Perhaps if we have a master set of templates, but then each company can have a different subfolder with any replacement template files... Of course we'd still need to update a bunch of different template files whenever we change one of them, but it would be a little more localized anyway.
Is there a better way? Some sort of differencing template engine maybe, so that we can still edit the original files and the changes will adapt on top of the originals (kind of like a patch)? Or perhaps we should use the object-oriented features of PHP5 and then use polymorphism? What is your best suggestion, and especially if you've had experience with this sort of thing, what are the options and which have you used and why?
I think the template method pattern will help you out a lot. It's really a great pattern for factoring stuff that is mostly the same but differs in a few places. I'm actually working out a template method hierarchy for my own project right now.
I would suggest you try to create the application either using an mvc framework or using your own implementation of mvc.
In this manner you could create models that could be reused (and also views) for other companies.

Categories