Categories
Joomla!

How to clear sample data from a Joomla Website

Load Joomla to your site with all the sample data. This is the sequence of steps to remove most of the sample data.

  • Article Manager – Trash All
  • Trash Manager – Delete All
  • Category Manager – Delete All
  • Section Manager – Delete All
  • Menu Manager – Delete those not wanted. I keep the Main and Top ( Joomla requires one )
  • Menu Trash Manager – Delete All
  • The next are Optional if you don't want them:
  • Banner Manager – Delete all Banners, Clients and Categories
  • News Feed Manager – Delete all feeds and categories
  • Poll Manager – Delete all
  • Web Link Manager – Delete all links and categories
  • Module Manager – Delete Admin Welcome and turn off ones you don't want running. Example: banners etc.
  • Template Manager
    At this point, you have a bare bones Joomla without the sample data but with the core modules intact. ( less the optional ones you may have uninstalled.)

Now, if you want to duplicate this bare bones site to other sites without having to go through all the above steps:

1. Export the database (from the above site) and save it. It's used to provide the new site's DB.
2. Load Joomla to a new site, but don't go through the install procedures.
3. Create an empty mysql database on the new site.
4. Import the database created in step 1 into the new DB created in step 3..
5. Copy the configuration.php file from the original site to the new site and make changes to reflect the new site's info. e.g. host name, password, site name etc.
6. Rename the installation directory to something else or delete it.
That's it. You should be able to access the new "cloned" site with the same admin name and password.

Source: PhilOSparta in http://forum.joomla.org/viewtopic.php?f=428&p=1212862

Categories
Web Development

Joomla Must-Have Extensions

Some of the most useful Joomla Extensions:

  • eXtplorer
    • A web-based file manager to manage files on your server.
Categories
Web Development

AJAX Form Validation

A pair of good articles on using AJAX for a highly responsive form validation that mixes the best attributes of server-side and client-side validation.

http://www.packtpub.com/article/ajax-form-validation-part1
http://www.packtpub.com/article/ajax-form-validation-part2

Categories
MySQL PHP

Loading configuration data from a MySQL into PHP constants

The following code will take the contents of the first row of a configuration table and create a constant for each attribute stored in it.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// ----------------------------- LOAD CONFIGURATION DATA FROM DATABASE -----------------------------
// Each data element in first row is placed in a constant using attribute name as constant name
// The array_slice function eliminates the first attribute in the row, 'id', which is the primary
//   key and not relevant for our purposes.
$result = mysql_query("SELECT * FROM configuration WHERE id = '1'") or die(__LINE__." SELECT Error: ".mysql_error());
if($result != false and mysql_num_rows($result)) {
    foreach(array_slice(mysql_fetch_assoc($result), 1) as $key => $val) {
        if(!defined($key)) {
            define(strtoupper($key), $val);
        } else {
            user_error("'$key' already defined.");
        }
    }
}
// ---------------------------- /load configuration data from database -----------------------------
Categories
DOS & DOS Scripting

Creating a folder named for the current date

When automating a backup script, you may want to be able to create a folder named with the current date.

This quick line will accomplish that;

1
2
@echo off
md %date:~-4,4%-%date:~-10,2%-%date:~-7,2%