Our client would like to be able to edit a few pages on their website that we just built. Now I know this probably doesn't deserve something like Wordpress, but something very small probably just custom built where I store the page information in the database.
I just wanted to see if there are any suggestions to make sure I have the right plan here and see if there are any security issues or better solutions.
So I figured I would just store the 4-5 pages text in a database using TEXT. Then I would create a little backend page for them to log in and have access to edit the content with a simple WYSIWYG editor, and hit submit and it updates the database.
I know it sounds super simple but is there any problems doing it like this? Is there a better solution out there without having to implement the whole site like Wordpress?
Edit: Thank you for your responses. I ended up going with PageLime (thank you Maggie!) I remember hearing about it before, I read that article on nettuts a while back but never really acted on it but PageLime is PERFECT for what I was looking for.
It does exactly what I need and more! I love it, I recommend it to anyone :)
I took exactly the same approach in my project. Users enter/edit their text in separate application and store it into database. And this data is later read and inserted directly into HTML.
Later they wanted to add images and hyperlinks and do more advanced stuff for some pages so I started to use CushyCMS - it's free and quite simple to use
This answer is a bit, too late. Its here for anyone else stumbling on the same question.
I found CouchCMS do the same job but self hosted.
Nonetheless, CushyCMS and PageLime are also very good
Related
Ok, I have a website that uses no Framework or CMS because it is a simple site that just displays some text. Nothing more, nothing special for what you would need a real CMS for.
But when I want to change some text I don't want to download the file, edit it in PhpStorm and then reupload it. So I wanted to ask if there's a minimalistic framework that enables this for me without too much time effort.
I had same problem with that.
I used CutePHP.
I suggest you to browser over here
Top 10 simple CMS
Why don't you write your own CMS then as that is exactly what you are describing.
It should be a simple matter of creating a database table:
create table mypages(url VARCHAR(128),content TEXT)
You can then echo the content field as your page when needed.
SELECT content FROM mypages WHERE url='{$_SERVER['PHP_SELF']}'
Updating could be as basic as dumping the content into a textarea in a simple HTML form. Handle login with .httaccess for simplicity and Robert's your father's brother. If you have problems writing the code then just ask here!
I reckon this is an hour or two of programming at best.
I do think that time would be better spent though, if you were to learn to use Drupal instead. Drupal is free, takes about 10 minutes to install and about 6-10 hours to get your first web pages running properly. Less if you are not fussy about themes. It is easy to use and yet was good enough to power the White House site.
Better yet, it's written in PHP so its easy to follow and understand.
The real advantage of doing it this way is that though there is a very steep learning curve as for any major CMS, once you are up there, you can do so much more so much faster. You need only learn it once, after all.
I have to use php,mysql to do a prroject.I have chosen to make a simple forum and use a lot of Ajax with it.since i am still a novice, can you guide me to a simple ajax guestbook which i can work on to make a forum? i want to end up with something like this but even simpler. http://board.fuzzylime.co.uk/
It's not terribly complex. Just set up a MySQL database, and use a PHP script to connect to it, check for a login, and add a record for a post or list records to view a post.
If you are just starting out, I would suggest that you first understand the basics of building a forum in PHP.
Personally I liked the forum example in this book . I thought it was explained very well. You can also just google for "PHP forum tutorial" to find a couple examples, like this one and this one.
Once you have the basic idea figured out you can start looking at how to make an AJAX style implementation. For that, you can also just google AJAX tutorials and go from there. Either way, I think if you are going to build a forum, its important to understand the basics behind building a forum before jumping into a more complicated example like an AJAX driven one. Understanding the PHP portion of the application, and the database behind the whole thing is a very important step.
In an effort to give a website im working on more functionality, im wanting the ability for readers to post comments/thoughts to the stories they read.
any ideas the best way to go about this?
ive tried Google but the minute i add the word "comments " + html or php etc (assuming i can do it in these languages) then google just gives me methods to commenting on code....
Any ideas, tips, tutorials etc ill gladly jump on.
Thanks in advance
-somdow
Well the most popular embeddable comment system is probably Disqus. Besides that you will have to look if there are plugins for your framework of choice - or just roll your own (a comment system is basically just like any other database backed PHP application - and there are many ways to implement these).
Why not just look at how popular content management systems have implemented comments? (For instance, take a look at how Drupal and Wordpress do it.) The manner in which you build a comment system will depend on your needs and the limitations imposed by the structure of the system you're trying to integrate it with.
You should work out your database schema first. I'm assuming you're writing all of this from from scratch. You haven't given a lot of details.
It will be easier if you put your comments in a separate table. Make sure you have some basic protections against bots(captcha, etc.)
Sort the results by the timestamp.
comments_table
Id
UserId
UserDisplayName
ArticleId
Comment
PostTime
Disqus is nice, I must say. If you want code that you want to copy/paste, Google Friend Connect is a different route you can take... Almost everyone has a google account and it only takes a few minutes to set up. They also have some sweet other widgets you might want to try out like rating, etc.
http://google.com/friendconnect
If you really want to customize it just how you want it, I would create your own commenting system with a MYSQL database to store all your data. You could even use some nice jQuery animations when they write / delete a comment. (I just did something simular to that and it's really nice).
Whatever works best for you -- roll with it!
Good luck,
Coulton
I've just got started with the basics (as well as a few intermediate aspects) of HTML, CSS and PHP. What is a good starting point to practice these 3 languages?
I was thinking of writing a URL shortening script but I was wondering if anyone here might have a better idea.
I am looking to develop something that would help me broaden my knowledge of the above 3 languages, but it shouldn't be too advanced that I wouldn't even know how to start it.
Any suggestions would be appreciated.
Whatever you write, if you allow users to input anything, prepared for it to get spammed and hacked mercilessly as soon as it goes live.
Therefore I'd suggest starting with something where you don't give end users any input ability. Something like an image gallery, or a CMS where you as the site admin can create the content, but end users only get to see the finished pages.
If you're feeling more adventurous, you could write a guestbook app, or something like that, but be warned that you'll have to learn quickly all the security aspects of allowing end user input. You'll need to learn how to block spam, avoid SQL injection attacks, prevent cross-site scripting attacks, and a whole bunch of other stuff.
That's all important stuff to know about, but perhaps best left to your second project rather than your first.
Some common beginner tasks are:
- image gallery
- message board
- phone book
- simple forum
These simple projects will allow you to get accustomed to the languages and prepare you for the next steps: security, optimization, user experience, and maybe other.
I recommend trying something very simple at first and finishing it. Only after that you should start something bigger, or better still improve on your first project.
A simple blog platform would be a potentially good second or side project, with the opportunity for enhancement as your skills improve and incorporating things you'll learn from other smaller systems. Start from a single-user blog without comments, and build things up as you go along. Gives you some more free reign to play around on the design (HTML and CSS) side of things as well, and you can always throw in some simple JavaScript as well.
I'll say that #Alin's answers are some good potential starter projects as well, and #Spudley's answer is a good one.
And above all else - have fun!
I support a few of these. I would also suggest you look into doing something for someone else, say a small project. One think I find with myself and those I've taught is that it's a lot harder to commit to something when it's your own project. You also get caught up in the details. When you're doing it for someone else, though, it minimizes the chance.
Also look into using a MVC framework as a way to learn. Good MVC frameworks will allow you to play around while learning how classes work in PHP. I'm sure there are plenty of questions regarding them on SO.
Finally, if none of that leads you anywhere, think of something fun you'd like to try, not matter the difficulty, and go with that. Even if you don't complete a project, there's a high chance you learned something on the way, and that's worth your time.
You can start by reading and do some examples from here http://www.w3schools.com, they have good explanations for everything you want to use in html, php and css.m
Here are a couple suggestions:
Guest book
Simple client / project management
No PHP script could help you with html and css.
You have to master these things separately.
if you want to practice with html and css - just create an HTML page that represents one of your site/script pages and use it to train your html,css skills.
And it will have absolutely nothing to do with PHP part.
Just once you have finished with HTML, you will need to produce the same text dynamically.
Make blog. One step at a time:
On the main page articles one after another. Store them in files.
On the main page only 3 newest. Access the rest of them by menu.
Add option to create new articles.
Add option to edit or delete them.
Restrict access to these actions by using logins and passwords stored in file.
Add option to comment articles.
Add option to remove comments only by administrators (those logged with login and password).
I am currently building a blog type website for myself. I have used wordpress in the past and really enjoy it, but when it comes to building more than just a blog I usually get bogged down in writing hacks for it.
The site I'm building is going to pretty much be a blog, but with a 'question and answer' side to it (NOT A FORUM - purely Q&A). Therefore, bbPress and buddyPress doesn't quite hit the mark. I have used CI for awhile now, but when it comes to security I fall short. CI does not have an auth library, however, Kohana does.
My question is: I would like to have full control over my site, but I'm worried about my lack of knowledge in the security department. Would I be better off using Wordpress as a base, or would it be beneficial for me in the long run to use something like Kohana?
Your advice is greatly appreciated.
First of all, I would like to say that you can't compare Wordpress and Kohana. One is a content management system and the other is a programming framework.
As for your question: Since you've stated you're not that experienced with security I suggest you stick with Wordpress; It's maintained by developers who know what they're doing.
If you want to go ahead and create something yourself then make sure you keep up-to date with all the current security issues and how to resolve them. Here are a few resources you might be interested in: PHPSEC, OWASP and PHP Security. You should probably read those anyway (as you're writing Wordpress plugins).
Good luck with your choice either way.
Hmm, if you can write the "hacks" for wordpress, than modify it to your needs.
If you think you can write the security better, than use Zend Framework since it has a Auth lib.
http://framework.zend.com/
I dont realy know about kohana
Hmmm... for the Questions and Answers, have a look at Qhub. I'm aboutto implement it for a client of mine who's an adoption counselor. She gets tons of questions via emails and it's always the same ones over and over. I saw it on Design Reviver a while back and I thought it was a great idea. Plus I got in contact with one of the co-founders of Qhub and they told me that they are implementing some more privacy and privileges controls which is really good news since I only want my client to be able to answer the questions.
I would use WP with Qhub to be honest. If it's a blog-type site and you're already comfortable with WP, why not stick with it?
Hope this helps!
Check out the TDO Mini Forms plugin. I think it may serve your needs perfectly!