Vous êtes sur la page 1sur 45

Page 1 of 45 http://www.javascriptkit.com/howto/htaccess.

shtml
Content Management System -- overview
In these lessons we will go over the administration and use of some content management
systems. But first...
What is a Content Management System (CMS)?
It is a piece of software that is installed and configured on the backend server of your webhost. It is
designed to make a website be very easy to edit existing content as well as update with new
content. That is because the content are not coded in static HTML. The content are stored on the
database of the webserver and is dynamically served upon the browser's request. The software
that performs this serving and rendering of the page is the CMS and is sometimes coded in PHP.
The database where this content is pulled is sometimes the MySQL database.
The system makes it very easy to organize content. The site can have sections. Sections can
have categories. And categories can have items (or stories).

Sections, categories, and items can be re-arranged and moved through a web user interface
known as the Admin Panel (which has a password login of course).
An "author" can add new content without touching or knowing anything about HTML. The author
simply logs in, clicks on an menu to add new item, and starts typing into an textbox.
Page 2 of 45 http://www.javascriptkit.com/howto/htaccess.shtml

When done, the author (depending on the privileges granted by the administrator) can either save
the stories for review by a "publisher" or "publish" the stories immediately.
The story that is typed can be formated with an WYSIWYG (What You See Is What You Get)
editor that enables styling such as bolding, linking, coloring, etc. Or if the author is knowledgeable
in HTML, he/she can switch to HTML view and code in that.

[Picture shown with JCE installed.]
With the J CE installed, photos and images can be easily uploaded from the author's desktop.
Styling, rollover images, and linkable images are all possible.
RSS feeds can be enabled so that whenever a story is published, those users with RSS readers
will immediately see the updated content.
Page 3 of 45 http://www.javascriptkit.com/howto/htaccess.shtml

A setting can be enabled to make the entire site SEO (Search Engine Optimization) friendly so that
search engines can index each individual page. If you have an existing site with existing pages, an
automatic redirection can be put in place to redirect any user from the old page to the new page.
What CMS Run On
The specifics will depend, but open-source CMS such as Joomla, Mambo, Drupal, Wordpress,
and TextPattern will run on most Linux host that have PHP and MySQL. Commercial CMS like
Subdreamer is also PHP and MySQL based.
If you need to run on Windows hosting, you might look into open-source systems such as
DotNetNuke, and RainbowPortal. Or a commercial system like ixportal.
Next Lesson
Go to first lesson now to install J oomla.

Joomla Notes
1. Administrator Password: The administrator password is stored as MD5 hash in the jos_users
table. Hence it can not be retrieved. But you can reset it by the instruction in this thread.
2. Missing User Menu : There is a slight bug that occurs when the following scenario happens.
a. User logs in.
b. User deletes cookies, and closes browser without logging out.
c. User opens browser and tries to log in.
d. The back-end system shows the user as being logged in, but user does not see user menu and
thinks he/she is not logged in.
The work-around fix is for the administrator to log the user out using through the User Manager.
The user then must delete cookies on his/her browser and close browser. The next time the tries
to log in, it will work as expected. Sometimes even this doesn't work. Then you have to delete all
records in the jos_sessions table (don't do this if you have real user logged in of course). And the
problem disappears.
3. Sessions: I noticed that the number of logged-ins shown in the upper-right of the User Manager
is too high. This is the session data problem in item #2.
4. JoomlaBoard Forums
Page 4 of 45 http://www.javascriptkit.com/howto/htaccess.shtml
If you want to integrate forums into your J oomla site, try Joomla Board 1.1.4 from tsmf.net. If you
want to jazz up the forum to make it look better, try Plazza Icon Pack (which include PSD files).
The documentation can be found here.
Once you have J oomlaBoard installed, you can go to Components -> Joomlaboard Forum to
configure and administer the forum.

Go through the J oomlaboard Configuration.
Then setup your form in the Forum Administration. You need to set up a Category which is a
container for your Forums. Posts can only be made to Forums and Forum must be within a
Category. So you will need to have at least one Category and then one Forum under that category.
Then publish all the Categories and Forums.
The User Administration is where you can view your users of your forums.
Now create a new menu with the selection of "Component"...

Your forum should now be visible in your menu.
5. Joomla-SMF Forum Component by JoomlaHacks.com
If you want to use J oomla with Simple Machines forum instead, then you can use Joomla-SMF
Forum Component by J oomlaHacks.com with is associated User Guide, Forum, and Help
Topic. From what I understand, it is more recommended than the offical Joomla-SMF Bridge.
J oomla-SMF Component has optional modules to display recent posts on your front page.
6. Forum as a separate entity.
Page 5 of 45 http://www.javascriptkit.com/howto/htaccess.shtml
Alternatively, you can setup your forum totally separate from your website. And then skin the forum
to match the site and integrate into it via a menu link. The method does not require you to hack
J oomla code or use bridges and hence will make upgrade forums and data migration to different
forums easier. But the drawback is that the author and publisher logins are totally separate from
each other. Hence you might want to move the J oomla login component to separate page that only
authors and publishers will know. That way, forum users will not try to use that login.
7. Adding a menu to your separate forum.
Go to the menu in the Admin console and click New menu. Then select Link URL as the menu
type.
7. Moving the Login Component to a separate page
a. Create a new section and category both called "Publisher Login".
b. Create a new content item called "Publisher Login" with a note to the effect "This page is where
authors, editors, and publishers can login to write content." Put this item under the "Publisher
Login" category.
c. Go to Meun and create a new menu item of type "Link - Content Item". Give the menu item the
name "Publisher Login". And link it to the "Publisher Login" item.
d. Go to Module -> Site Module and click on the Login Form module. Set its page/items to
"Publisher Login". Make sure you publish this module.
d. Go to your home page as an regular user and you should see the new menu item. Click on the
menu and you got the URL to the login page. Keep note of this url. It might look something like
http://www.yourjoomlasite.com//index.php?option=com_content&task=view&id=16&Itemid=30
e. Create a new index.php in a new folder called "Publisher". Write PHP that redirects to the above
URL. Such as ...
<?php
header (" location: http://www.yourjoomlasite.com/index.php?
option=com_content&task=view&id=16&Itemid=30" );
?>
where the header function is all in one line.
f. Tell your authors and publisers to go to http://www.yourjoomlasite.com/publisher whenever
they want to login.
g. Unpublish the "Publisher Login" menu item.
5. JCE Joomla Content Editor
If you don't like the default TinyMCE editor that comes with J oomla, try JCE. It allows user to
upload photos from their desktops, which is not possible with TinyMCE. J CE also allows you to
style the <img>tag and easily create linkable and hover over images.
Page 6 of 45 http://www.javascriptkit.com/howto/htaccess.shtml

To install J CE, first install the Admin component, and then the Mambot. Now you got a J CE admin
panel at Components -> JCE Admin where you can configure your J CE editor. There is a J CE
Plugin submenu that you can use to install other J CE plugins. The J CE Media Manager might be
something that you might want to install. To switch to using the J CE editor by default go to Site ->
Global Configuration and change the default WYSIWYG editor. For existing users, you may have
to assign the default editor for them. Here is a visual tutorial on the installation. The component
and support is provided by CellarDoor.
Here is a good tutorial showing users how to upload and style images using the J CE.
If the J CE Mambot Installer does not work, you can install the Mambot manually by these steps.
6. eCommerce
If you want a shopping cart for J oomla and Mambo, try the open-source VirtueMart which has
PayPal IPN module. Or you can buy the PayPal Website Payment Pro module. To learn more
about setting PayPal with VirtueMart see here and here. If you need to pass more order
information to PayPal, here is some code you can put in the customize text area of the PayPal
module.
VirtueMart has an anti-spoof mechanism, so that you can not simply put up your own login form
that post to VirtueMart's backend. What you have to do is in the index.php under templates, is to
do an include to checkout.login_form.php as in ...
<?php
if ($auth["user_id"] != 0 ) {
echo ("Thanks for logging in.");
} else {
include('/administrator/components/com_virtuemart/html/checkout.login_fo
rm.php');
}
?>
And the way to detect if the user is logged in or not is by $auth["user_id"].
Do similar for the registration form, except the include file is
administrator/components/com_virtuemart/html/checkout_register_form.php.
Page 7 of 45 http://www.javascriptkit.com/howto/htaccess.shtml
7. SEO friendly URLs
SEO friendly URLs can be set by Site -> Global Configuration -> SEO. You also need to change
the htaccess.txt to .htaccess. If that is still not good enough, you can try OpenSEF.
8. Backup
You need to backup the database and the PHP files. The database backup can be done by using
your webhost tools such as phpMyAdmin or use any number of J oomla extension.
9. Remove XML prolog
In order to not throw IE6 into quirks mode, it is recommended that you remove the following XML
prolog from the index.php template file.
<?php
defined( '_VALID_MOS' ) or die( 'Restricted access' );
// needed to seperate the ISO number from the language file constant
_ISO
$iso = explode( '=', _ISO );
// xml prolog
echo '<?xml version="1.0" encoding="'. $iso[1] .'"?' .'>';
?>
10. URL of site
To return the URL of the J oomla base-install, you can use this PHP ...
<?php echo $mainframe->getCfg('live_site'); ?>
Next Lesson
Installing Joomla Content Management System
In these lessons, we will be installing and using J oomla version 1.0.12. For details instructions see
here. For questions, ask their forums. Their Joomla Template tutorial is a good overview of how
the J oomla site process works. And also Visual tutorials
Documentation are Installation Guide, User Manual, Administration Guide, and Developer
Manual. You might also want to look at JoomlaTutorials.
Installing J oomla...
1. Go to joomla.org and click download and download the latest stable zip package. You want to
download the documentation as well. Follow instructions in the Installation Guide or User Manual.
2. If not using third-party components that require register_global on, you should change to
define( 'RG_EMULATION', 0 );
in globals.php.
3. Setup a MySQL database on your webhost and create an admin user for that database.
4. Run browser install following the steps in the Installation Guide.
5. When browser install is done, copy the configuration information in the last step to
configuration.php if not already there.
Page 8 of 45 http://www.javascriptkit.com/howto/htaccess.shtml
6. Remove the installation directory from your webhost.
Your J oomla site is now up at the http://www.yourdomain.com/index.php

This is the rhuk_solarflare_ii template, which is one of two templates shipped with J oomla.
The adminstration panel is at http://www.yourdomain.com/administrator/

To enter, use the "admin" login and password that you chose during the setup. This is the "Super
Administrator" account that is created during the install.
Next Lesson
User Accounts - Joomla Content Management System
Page 9 of 45 http://www.javascriptkit.com/howto/htaccess.shtml
The various type of users are ..
Registered: No ability to create content, but may submit links and access privelegded content.
Author: Can create content.
Publisher: Can publish content.
Manager: Has access to administrator panel.
Administrator: Can also change web site layout and templates. Can manage users.
Super Administor: The global all powerful login that was created during setup.
New User Registration
A user can become a registered user by clicking on the register link on the front page of website.

And that user will show up in the Administrator panel under User Manager.
Page 10 of 45 http://www.javascriptkit.com/howto/htaccess.shtml

However, that user will not be enabled until, he/she clicks the confirmation link in the welcome
email that is sent to the new registered user. This procedure known as double opt-in is used to
verify the correctness of the email address.
The Super Administrator is also sent a notification email whenever there is a new user created.
Creating a New User
Beside a user registering himself/herself. An administrator can create a new user from the
Administrator Control panel.
1. Go to Site -> User Manager and click New.

2. Fill in the info and assign the user a permission level and click Save.
Page 11 of 45 http://www.javascriptkit.com/howto/htaccess.shtml

And you got yourself a new user.
Next Lesson
Go to next lesson to learn about Link Management function.
Link Management
Submitting Links
After a newly register user logs in, they have a user menu where they can submit new links.
Page 12 of 45 http://www.javascriptkit.com/howto/htaccess.shtml

For example...

After making edit, one should always either "Save" or "Cancel". If an user abandons or closed the
browser without saving or cancelling, the content will be still "locked". To unlock this content so
that it can be edited or published, the user should log back in and click "Check In My Items"

Any locked item can been seen by the Administrator from the Administrator Panel by going to
Content -> All Content Item.
Page 13 of 45 http://www.javascriptkit.com/howto/htaccess.shtml

A Super Administrator can perform a "global check in" of all locked items by System -> Global
Checkin. Note that after checkin, the item might still need to be published before it shows up on
the live site.

Note that an email to Super Admin is sent to notify of all newly submitted content.
Logout
When a user has completed his/her task, he/she should click the Logout menu.
Publishing
J ust because an "Author" has saved an item does not mean that the item will show up on the
website. A publisher (or higher) must go into the Admin panel under Components -> Web Links -
> Web Link Items and publish it by clicking as shown.
Page 14 of 45 http://www.javascriptkit.com/howto/htaccess.shtml

You can unpublish and delete items in similar fashion. You can click on the blue arrows to re-order
the items.
The newly published link shows up on the website here...

But it is in the wrong category. So next we will learn how to manage categories next.
Creating New Link Category
In the admin panel, go to Components -> Web Links -> Web Link Categories and click New.
Page 15 of 45 http://www.javascriptkit.com/howto/htaccess.shtml

And enter new category.

Note that uploaded images will be stored in images/stories/
Your item will not show up on the website unless you have at least one item in it.
Moving Item to New Category
To move an item from one category to another, simply go back to the item and change category.
Page 16 of 45 http://www.javascriptkit.com/howto/htaccess.shtml

Adding to Menu
If you want your newly created category to show up in the main menu or the top menu, go back to
the category, and click Link to Menu.

Now your category shows up in the menus...
Page 17 of 45 http://www.javascriptkit.com/howto/htaccess.shtml

Removing Menu Items
To remove an item from any of the menus, ...

Page 18 of 45 http://www.javascriptkit.com/howto/htaccess.shtml
Deleting Menu
To delete an unused menu, go to Menu -> Menu Manager, select menu and click Delete.

Next Lesson
Go to next lesson to learn about Assigning Pri vileges.
Assigning Privileges
As an example, let's give the user Guppy authoring privileges.
1. Login as Administrator to the Admin panel. Go to Site -> User Management and click on the
User.

2. Set privileges to Author and Save.
Page 19 of 45 http://www.javascriptkit.com/howto/htaccess.shtml

The privilege levels are ...
Registered: No ability to create content, but may submit links and access privelegded content.
Author: Can create content.
Publisher: Can publish content.
Manager: Has access to administrator panel.
Administrator: Can also change web site layout and templates. Can manage users.
Super Administor: The global all powerful login that was created during setup.
Resetting Passwords
Note that you can reset an user password to your choosing. However, you can never "look up" an
user password (since it is encrypted with an one-way algorithm). If an user forgets his or her
password, they can get an automatic password reset by clicking Lost Password on the front page
of the site.
Page 20 of 45 http://www.javascriptkit.com/howto/htaccess.shtml


Next Lesson
Submitting News
You have learned how to create a new user and assign them pri vileges. We are going to show
you how an user with Author privileges can submit news to the site for publication.
1. The user logs in from the home page of the site and clicks "Submit News" in the user menu. And
start typing...

You can type the entire article into the Intro Text above or split up the article and type the rest
below...
Page 21 of 45 http://www.javascriptkit.com/howto/htaccess.shtml

When the articles gets too long, you can insert a page break and J oomla will paginate the article
with previous and next page links.
Inserting Images
2. What you are seeing above is the TinyMCE editor that comes by default with J oomla 1.0.12. A
better editor that provides bettter support for inserting images is the JCE editor plugin as described
in the Notes. First, we see how to insert images using the TinyMCE editor. Then we'll show you
how to do it using the J CE editor.
If you are using the TinyMCE editor. You can add images to your articles by clicking the "insert
image" button and it will add a {msoimage} markup to your article. You then assign images to the
placeholder markup.
Page 22 of 45 http://www.javascriptkit.com/howto/htaccess.shtml

If you are using the JCE editor, then ...

Page 23 of 45 http://www.javascriptkit.com/howto/htaccess.shtml


Page 24 of 45 http://www.javascriptkit.com/howto/htaccess.shtml

Now you got your image in the story.

After clicking the link icon, enter the link URL and click insert...
Page 25 of 45 http://www.javascriptkit.com/howto/htaccess.shtml

The linkable image will have this blue link border. To get rid of the blue border, add ...
; border: 0px;
to the style property as shown. Make sure you include a semicolon before as well as after your
style.

Now you got your linkable image in your story.
Page 26 of 45 http://www.javascriptkit.com/howto/htaccess.shtml
3. At the bottom of the story editor, you will see the publishing tab...

In the metadata tab enter value to be placed in the <meta>tags of the published page.

Click Save button to submit news for review before it goes to the live site. If you want the user to
be able to submit stories directly to live site, you need to give the person Publisher status. The
Publisher will have an extra State field in the Publishing tab that enables him/her to publish
directly to live site...
Page 27 of 45 http://www.javascriptkit.com/howto/htaccess.shtml

Reviewing Content
An admin or publisher will review the content by clicking on the content item.

The publisher can edit and preview the article, and perform extra settings in the Parameter and
Link to Menu tabs.
Page 28 of 45 http://www.javascriptkit.com/howto/htaccess.shtml

After hitting Save, the publisher can put the article on the front page, publish it, or trash it.

Retrieving from Trash
If an item get accidentally trashed, it can be retrieved by going to Site -> Trash Manager.
Page 29 of 45 http://www.javascriptkit.com/howto/htaccess.shtml

Every once in a while, you might want to permanently delete very old trashed items.
Next Lesson
Go to next lesson to learn about Media Manager.
Adding New Section
The difference betweeen Section and Category is that a section contain categories. News is a
section, for example. Latest News is a category in that section. We are going to create a new
section called Articles.
1. Go to Section Manager and click New.

2. Enter information and click save.
Page 30 of 45 http://www.javascriptkit.com/howto/htaccess.shtml

3. Your new section have been saved. Click again on the section to add it to a menu.

4. Add Articles to each menu you want by clicking on the Link to Menu button...
Page 31 of 45 http://www.javascriptkit.com/howto/htaccess.shtml

5. You got a new section on your site.

Page 32 of 45 http://www.javascriptkit.com/howto/htaccess.shtml
Adding Category
6. Now you can add categories to that section through the Category Manager...

7. And specify which section this category should be in...

8. After clicking save, you see your new category...
Page 33 of 45 http://www.javascriptkit.com/howto/htaccess.shtml

Adding Submit Link in the User Menu
9. Now you want your authors and front-end users to be able to click a menu and add new articles.
Go to Menu -> usermenu and click New.

10. Choose the Submit Link and click Next.
Page 34 of 45 http://www.javascriptkit.com/howto/htaccess.shtml

11. Set the properties of your menu item and click Save.

12. Now you got your new menu item. Re-order as needed.
Page 35 of 45 http://www.javascriptkit.com/howto/htaccess.shtml


Next Lesson
Admin Messages
The top status bar of the Administration Panel will show you how many unread messages you
have.

You can click on the message to read, reply, or delete. Administrator will get notification messages
whenever a new user is created and new content is submitted.
Page 36 of 45 http://www.javascriptkit.com/howto/htaccess.shtml
The default message configuration are shown here.

Go to Messages -> Configuration to change the defaults.
If you lock inbox, then people can not send you messages. You might want to set "Mail me on
new message" so you get an email message whenever you receive a private message on the
site. You might also want to set Auto Purge Messages to a much higher number of days, so that
J oomla don't automatically start deleting your messages without you reading them.
Sending Mass Email
A SuperAdministrator can send mass mail to any group by Components -> Mass Mail.

Next Lesson
Pulling News Feeds
J oomla has a built-in ability to pull in RSS feeds from other sites.
1. Go to Components -> News Feeds -> Manage News Feeds and you will see some same
feeds already set up.
Page 37 of 45 http://www.javascriptkit.com/howto/htaccess.shtml

2. Click on J oomla feed to see its details.

We will show you how to obtain a feed's url later.
3. We can see the results of this feed under the Feeds section of the site...
Page 38 of 45 http://www.javascriptkit.com/howto/htaccess.shtml

These items are exactly the ones shown in the J oomla site which is syndicating the RSS feed...

Page 39 of 45 http://www.javascriptkit.com/howto/htaccess.shtml
If you click on the orange RSS button, you will get the actual feed URL that is to be added to the
feed item properties in the Admin Panel.

Syndicating News Feeds
J oomla can produce a RSS feed of your front page items so that other sites can pull in that
content.
1. Go to Components -> Syndicate.
2. Set syndication settings.
Page 40 of 45 http://www.javascriptkit.com/howto/htaccess.shtml

Because, we had security check turned on, we have to ensure that the Syndicate Module is
published before our feed will be generated.

See our webiste, now has RSS feeds...
Page 41 of 45 http://www.javascriptkit.com/howto/htaccess.shtml

Update the Contact Page
Your website contact page needs to be update with correct information.
Go to Components -> Contacts -> Manage Contacts and click on Name.

Fill in your info...
Page 42 of 45 http://www.javascriptkit.com/howto/htaccess.shtml

Click Save and your info will show up on your contact page.
Page 43 of 45 http://www.javascriptkit.com/howto/htaccess.shtml

Next Lesson
How to Customize Joomla Templates
This lesson, we will be learning how templates work and how to customize a template to match the
look and feel of the site you want.
Before we can customize our template, we have to know how the J oomla templating system
works. In the Administrator panel under Site -> Template Manager you will see that J oomla ships
with two templates. You can get your pages to use whichever template you want by setting that
template as the default by using the Default button. If you want your site to use a mixture of
templates, it can be done as follows. By using the Default and Assign buttons, you can get each of
your page to use the template you want. For example,
Page 44 of 45 http://www.javascriptkit.com/howto/htaccess.shtml

To create a brand new look for you site, you want to duplicate one of the templates and put it on
this list here. Make you new template the default template for all your pages. And then start
altering that new template. That way, you do not alter the templates that shipped with J oomla.
1. Duplicate the template folder in Templates and give the folder the same name as your template
name.
2. Alter the templateDetails.xml.
3. Upload to webhost.
4. You should see your new template in Template Manager. Make that as default with no other
assignment in any other templates.
5. You can edit the HTML and CSS of this template with the Edit HTML and Edit CSS buttons in
the Template Manager.
6. Edit HTML and replace all instance of the old template path with your new template path.
7. Module Manager (Module ->Site Module) will tell you which module will be published in which
position. For the solarflare template, the Template -> Module Position corresponds to this map.

The second parameter indicate display style:
0 =(default display) Modules are displayed in a column table.
1 =display in horizontal table.
Page 45 of 45 http://www.javascriptkit.com/howto/htaccess.shtml
-1 =raw output
-2 =Modules are displayed using div
-3 =Modules are displayed in a format that allows, for example, stretchable rounded corners.
The Function reference will provide more detail.
8. If you want to apply a style only to a particular page or component (say the contact page), you
can do the following at the top of your index.php file.
<?php if ( $_REQUEST['option'] == " com_contact" ) { ?>
<style type=" text/css" >
.contentheading {display: none}
</style>
<?php } ?>
If you don't know the exact name of your request object, you can find out by inserting
<?php echo $_REQUEST['option']; ?>
into your template index.php file or look at the query string.
9. If you want to do something only when you are on the front page, do the following in index.php
<?php if ($option == 'com_frontpage') { ?>
<!-- your stuff to do when on front page-->
<?php } ?>
9. If you want to change the wording of a text string in the user inteferace, you can often find the
define constant in language/english.php.
10. There is difference between modules and forms. For example, the code for the login module is
located in \modules\mod_login.php whereas the code for the login form is located in
\components\com_login\. Do not confuse the two. Otherwise you start changing the code for one
and it doesn't seem to have any effect on the other that you are looking at.
11. If you need to change the body background-color of the design, it is best to use the CSS rule in
the internal CSS style sheet of index.php rather then alter the background color of the external
style sheet. This is because altering the background color of the external style sheet will cause the
story edit panel to have that background color.
12. Whatever you do, don't take out the ...
<?php mosMainBody(); ?>
from the template. This controls the display of the main content.
To learn more about customizing J oomla Templates, take a look at CompassDesigns tutorial.
Next Lesson

Vous aimerez peut-être aussi