Browsing articles in "CMS"

Reduce time in Uploading and Deleting when managing files through ftp! Making a full directory into .zip and unzipping it on server!

Nov 1, 2009   //   by nuhil   //   CMS, Joomla, PHP, Tips for the New  //  2 Comments

Suppose you are going to upload a big size folder containing a huge number of files on it. Think about joomla. Then if you use ftp client software such as filezilla, it will take about 2 hours if you have internet connection that has avg. speed of 15kbps.

Again if you want to delete such files or directory from that hosting place then it will take 1 hour on that speed configuration.

This is happened because filezilla checks the permission and additional facts of each file by some commands every time it uploads or deletes a file.

We will just give a single file to filzilla to upload and will make several files into a single file when deleting. Thus we can reduce the time that filzilla takes for several files.

Here we go:

First make the desired directory to be uploaded into .zip file on your pc. For example Joomla.zip

The simply upload it to the server by Filezilla. It will take no more than 15 mins in a speed of 15kbps.

Then create a php file:

<?php
  1. // Write an URL on the browser like
  2. // http://www.example.com/project/unzip.php?archive=Joomla.zip
  3.  
  4. $filename = $_GET['archive'];
  5. $zip = new ZipArchive;
  6. if ($zip-&gt;open($filename) === TRUE) {
  7.         $zip-&gt;extractTo('./');
  8.         $zip-&gt;close();
  9.         echo 'The file <strong>'.$filename.'</strong> Extracted successfully';
  10.     }    else {
  11.         echo 'failed';
  12.         }
  13. ?&gt;

Run this script on that same directory and follow the instruction above the code. It will extract that Joomla.zip into Joomla. Then Delete the Joomla.zip in a sec. Thats it.

Now guess, you have uploaded a wrong folder wasting a huge time or you need to replace that directories with your customized files and folders. Now here we talk when deleting such a big directory. We dont know how big and recursive it is.

Create this file:

<?php
  1. function removedir($dirname)
  2.     {
  3.         if (is_dir($dirname))
  4.         $dir_handle = opendir($dirname);
  5.         if (!$dir_handle)
  6.         return false;
  7.         while($file = readdir($dir_handle)) {
  8.             if ($file != "." &amp;&amp; $file != "..") {
  9.                 if (!is_dir($dirname."/".$file))
  10.                 unlink($dirname."/".$file);
  11.                 else
  12.                 {
  13.                     $a=$dirname.'/'.$file;
  14.                     removedir($a);
  15.                 }
  16.             }
  17.         }
  18.         closedir($dir_handle);
  19.         rmdir($dirname);
  20.         return true;
  21.     }
  22.  
  23. $dirname='Joomla';
  24. removedir($dirname);
  25. ?&gt;

This will delete that whole directory whether it is empty or not.

Here is a bonus function that will make a directory into a .zip file. You better know its usage. Just run it on the server and make a .zip copy of a desired directory.

<?php
  1. // increase script timeout value
  2. ini_set('max_execution_time', 300);
  3.  
  4.  // create object
  5. $zip = new ZipArchive();
  6.  
  7. // open archive
  8. if ($zip-&gt;open('file.zip', ZIPARCHIVE::CREATE) !== TRUE)
  9.  {
  10.  die ("Could not open archive");
  11.  
  12.  }
  13.  
  14. // initialize an iterator
  15. // pass it the directory to be processed
  16. $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator("Joomla/"));
  17.  
  18.  // iterate over the directory
  19. // add each file found to the archive
  20. foreach ($iterator as $key=&gt;$value) {
  21. $zip-&gt;addFile(realpath($key), $key) or die ("ERROR: Could not add file: $key");
  22.          }
  23. // close and save archive
  24. $zip-&gt;close();
  25. echo "Archive created successfully Named file.zip";
  26. ?&gt;

My First WordPress Theme!

Nov 24, 2008   //   by nuhil   //   CMS, CSS, HTML, PHP, Wordpress  //  4 Comments

Yesterday i made a wordpress theme which is my first work in theme based works. The theme is 100% widgets supported. It is two columns based and has fixed width. I named it RedHat because i used a redhat logo and Black+Red color in major in that theme.
You can see this theme in work.
Click the screenshot below.screenshot

Please don’t forget to comment about my silly job.

Q: Why Joomla? Ans: Why not Joomla?

Mar 12, 2008   //   by nuhil   //   CSS, HTML, JS, Joomla, PHP, XML  //  6 Comments

               In my current semester we have a course that includes PHP project. We will have to submit this within a month.
I think most of our students in our class room are trying to do best with their project. But time is not enough. So, they will not be able to include maximum features on their project site.
joomla_logo_black.jpg

Here comes the necessity of using a CMS (Content Management System) like Joomla. This CMS offers you to utilize your expectation. Youhave full independence of coding with your choice. Joomla uses most effective features on it and it has high quality security on its contents. most important factor is that, it is Open Source. So, any body can configure it and use it’s capability of wellperforming.

Starting Joomla:
Choose a beautiful Joomla template and install it. Then Manage the articles, Edit the HTML,CSS files, Add new Component using PHP or Other
database connectivity language,Even make a new template.

joomla will give many builtin features that will make your Website Effective and Modern.
Joomla! Features:
The power and simplicity of the Joomla application may be difficult to understand if you
don’t have previous experience with a CMS. However, any webmaster can see that the
included administrative featuresare compelling:
• Complete management possible via a robust web interface
• Web-based management of site assets such as graphics, files, and other media
• Content approval features allow moderating of remote author postings
• Hierarchical user group management
• Automated menu management
• Content publication scheduling for automatic publishing and deletion of articles
• User security and contact management
Even more impressive is Joomla’s ability to handle content and provide interaction
with site visitors. Joomla’s content capabilitiesinclude the following:
• Multiple built-in “What You See Is What You Get” (WYSIWYG) editors
• Automatic full text search of site content
• Full support for newsfeeds in RSS or Atom format
• Built-in user polling
• Banner advertising management
• Plug-ins for e-commerce solutions,including shopping cart, picture gallery, inven-
torymanagement, and point of sale
• Multilingual internationalization features
• Accessibility options for the disabled
Finally, Joomla offers a good number of system advantages, including the following:
• Full open source license with free download of the application and source code
• Availability on all major operating systems (Windows, Mac OS, Linux)
• Page caching for improved performance

So, dont waste time and begin to get concept about it!

Building Component for Joomla is Easy! Try it!

Mar 8, 2008   //   by nuhil   //   Joomla, PHP, XML  //  6 Comments

Component is similar to a module. The primary difference comes
from the user interface portions of the extension. A component can have a complete
Administrator interface, whereas a module is limited to simple parameter settings. The
interface for a component is accessible through the Components menu of the Adminis-
trator interface.

Requirements:
 1.XML file
 2.PHP/Other File

Create com_suggestionbox any where.
 In the \com_suggestionbox folder, create a file named suggestionbox.xmland enter the
following code:

XML Descriptor File:
This file contains neccessary information to give Joomla.

Read more >>