Thứ Sáu, 31 tháng 5, 2013

CMS Blue

CMS Blue

CMS Blue is a simple responsive theme that offers the basics but you can always use your creativity to modify. This CMS Theme also comes in different colors and style; CMS Grey, CMS Water and CMS White.
CMS Blue

Responsive joomla template Elastica

Elastica

Elastica is both beautiful and well presented responsive, and it can fit to all screen sizes, including extra widescreen. Elastica is built on JAT3 2 Framework and jQuery Masonry script.
Elastica

Joomla 2.5 template Cameleon

Cameleon

Cameleon is a Joomla 2.5 template built with a responsive design to fit into any screen size available out there. The template comes with rtl support, JJ Slider and accordion menu, Google Fonts and more. It’s also compatible with Joomla 1.6.x – 1.7.x and Joomla 2.5.x

Responsive Joomla template Music

Music

Music is a free responsive Joomla template from GavickPro. This Joomla template produces a breathtaking Web site that will catch your visitors’ attention.
Music

Thứ Năm, 23 tháng 5, 2013

Convert a MySQL database to UTF-8

After searching a long time for a solution when I upgraded from MySQL 4.0 to 5.0 I found this,
mysqldump --user=username --password=password --default-character-set=latin1 --skip-set-charset dbname > dump.sql
sed -r 's/latin1/utf8/g' dump.sql > dump_utf.sql
mysql --user=username --password=password --execute="DROP DATABASE dbname; CREATE DATABASE dbname CHARACTER SET utf8 COLLATE utf8_general_ci;"
mysql --user=username --password=password --default-character-set=utf8 dbname < dump_utf.sql
This worked perfectly for me.

Changing multi-column article order in section and category blogs

Problem

Note: The ability to order articles across columns was added as a new feature in version 1.5.7. So this Tip only applies versions 1.5.6 and earlier. Upgrading to 1.5.7 is strongly recommended for security reasons as well.
Section and Category Blog pages with 2 columns put articles in order down the column, as shown below:
article 11 (continued)
article 2article 4
article 3article 5
The Front Page Blog puts articles in order across columns, as shown below:
article 11 (continued)
article 2article 3
article 4article 5
Some Joomla! users prefer the way the Front Page works over the way the other blogs work and want to change the Section and Category Blogs to order articles like the Front Page.

Headline text

Solution

Using the Template Override feature of Joomla! 1.5, we can replace the code for the Section and Category blog ordering with the code from the Front page. Here are the steps:
  1. Create the override directory for the Category Blog as follows: "<your joomla! home>/templates/<your template>/html/com_content/category".
  2. Copy the attached file "blog.txt" to the new directory. Rename it to "blog.php". This file is modified to order articles like the Front Page blog.
  3. Simlarly, for the Section Blog, create a directory called <your joomla home>/templates/<your template>/html/com_content/section".
  4. Copy the attached file "blog.txt" into this directory and rename it "blog.php". This file is modified to order articles like the Front Page blog.
With these files installed and renamed, the Category and Section blogs should order articles across columns, just like the Front Page. If for any reason these files cause problems in your site, you can just delete them and the default files will be used instead. See the links above for details on the edits made for these files.
Note that this solution is for Joomla! version 1.5.x and may not work for 1.6 and later versions.

Auto redirect guests to login

Desired Functionality

Suppose you have some menu choices that require a user to be logged in, like "Submit an Article". You would like all users to be able to see the restricted menu item, whether or not they are logged in.
If the user is logged in, they just go directly to the restricted menu item.
If the user is not logged in
  • they are presented with the login form, and
  • once they log in successfully, they continue on to the restricted page.
If they are not registered, they have the option to register or navigate to another page.

Solution

Here is how you do this in Joomla!.
  1. Create a new menu from menu manager, say it is named "hidden menu".
  2. Add any menu items that will be accessible only to registered users (for example, "Submit an Article"). Set the required access levels of these menu items ("Special" in this example, but it could also be "Registered").
  3. Do NOT create a module for the "hidden menu". It will not be displayed on any page, so it doesn't need a module.
  4. Create your "real" menu (for example, "main menu") and the menu item that will display for all users (for example "Submit an Article").
    • The menu item will have a menu item type of "Alias".
    • It's "Menu Item" parameter will be the "Submit an Article" menu item on the "hidden menu".
    • The Access Level for this menu item will be "Public", since we want everyone to be able to see and use it.
  5. Create a module of type "mod_mainmenu" for this menu, just like you do for any menu.
  6. If you want sub-menus, make sure you've added the sub-menu items in the "main menu" and not the "hidden menu".
Now, when a guest (non-logged-in user) accesses the "Submit an Article" menu choice, it redirects them to the login page. If they log in successfully, they are taken to the desired page (in this case, "Submit an Article"). If there were already logged in, they go there directly.

Example

In my case, I've added the following menu items:
  1. HOME
  2. BLOG (IDOBlog)
  3. WIKI (A Wiki)
  4. DIRECTORY (SOBI2)
  5. CLASSIFIEDS (ads)
  6. FAQS (Articles section)
  7. SHOP (VirtueMart)
  8. Contact US (contacts)
I wanted that ALL the menu items are viewable by public (non-registered users included) at the front end. But I want that menu items 3,4,5,6 & 7 are accesible by REGISTERED users only. In other words if anyone clicks on menu item 3/4/5/6/7 they'll be lead to the login modules.
So, I created a "hidden menu" with the menu items for 3 - 7, using the restricted access level. Then, when I created the "real" menu, I used the menu type "Alias" for these items and set the "Menu Item" Parameter to the corresponding menu item in the "hidden menu".
As far as I know, this method is applicable to all menus in the menu manager. In case of any help or suggestion please contact me on forums.joomla.org my username is ziggy03. In case of a better or alternate method please feel free to edit this page. Thanks.