Tuesday, December 15, 2009
How To Embed WMV/MOV video file for multiple browsers
{DIV align="center"}{OBJECT ID="MediaPlayer" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" standby="Loading Microsoft Windows Media Player components..." TYPE="application/x-oleobject" width="425" height="355"}{PARAM NAME="FileName" VALUE="XXXXXXX"}{PARAM NAME="AnimationatStart" VALUE="false"}{PARAM NAME="TransparentatStart" VALUE="true"}{PARAM NAME="AutoStart" VALUE="true"}{PARAM NAME="ShowControls" VALUE="0"}{PARAM NAME="ShowDisplay" VALUE="0"}{PARAM NAME="ShowStatusBar" VALUE="0"}{PARAM NAME="AutoSize" VALUE="0"}{PARAM NAME="EnableContextMenu" VALUE="false"}{embed TYPE="application/x-mplayer2" pluginspage="http://www.microsoft.com/isapi/redir.dll?prd=windows&sbp=mediaplayer&ar=Media&sba=Plugin&" SRC="XXXXXXX" HEIGHT="355" WIDTH="425" Name="MediaPlayer" AUTOSTART="1" SHOWCONTROLS="0" EnableContextMenu="0"}{/embed}{/OBJECT}{/div}
QUICK TIME CODE
{DIV align="center"}{object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="425" height="355" codebase="http://www.apple.com/qtactivex/qtplugin.cab"}{param name="src" value="XXXXXX"}{param name="autoplay" value="true"}{param name="controller" value="false"}{embed src="XXXXXX[code]" width="425" height="355" autoplay="true" controller="false" pluginspage="http://www.apple.com/quicktime/download/"}{/embed}{/object}{/div}
.
Tuesday, December 8, 2009
FPDF - Free PDF Generator
What is FPDF?
FPDF is a PHP class which allows to generate PDF files with pure PHP, that is to say without using the PDFlib library. F from FPDF stands for Free: you may use it for any kind of usage and modify it to suit your needs.
FPDF has other advantages: high level functions. Here is a list of its main features:
* Choice of measure unit, page format and margins
* Page header and footer management
* Automatic page break
* Automatic line break and text justification
* Image support (JPEG, PNG and GIF)
* Colors
* Links
* TrueType, Type1 and encoding support
* Page compression
The tutorials will give you a quick start. The complete online documentation is here and download area is there. It is strongly advised to read the FAQ which lists the most common questions and issues.
What languages can I use?
What about performance?
Thursday, December 3, 2009
How to patch Drupal 6.x to 6.y?
Notes:
- It is best practice to back up your Drupal files and database(s) before upgrading.
- Two major versions of Drupal are supported at a time. 6.x is the current version. 5.x is the prior version and is still supported. Drupal 4.x is unsupported.
- Knowing what version to upgrade to:
- If upgrading from one minor release to another, such as 6.3 to 6.14, jump straight to the latest release within that major version.
- If upgrading from one major version to another, such as from 4.6 to 6.14, you must upgrade to the latest release within the major version (4.7), then the latest release within the next major version (5.20), etc. until you're at the latest release of the final major version
- More upgrade information is available at:
- The UPGRADE.txt file packaged with your Drupal files.
- Release announcements for the version to which you're upgrading (e.g. http://drupal.org/drupal-6.2 for Drupal 6.2). Check the release pages of earlier versions if you must upgrade to them first (e.g., upgrading from 4.6 to 6.20--see above).
- Other pages of this handbook section.
References:
- Backup of The Database and Existing Files
- Screencast: Upgrading from Drupal 5.x to 6.x
- Screencast: Drupal Upgrade Tutorial for upgrading from one version of 6.x to another
UPGRADE DRUPAL 6.9 to 6.14
~~~~~~~~~~~~~~~~~~~~~~~~
Let's begin!
directory which contains your configuration file and added modules and
themes, any contributed or custom modules in your "modules" directory,
backed up as well.
Note: for a single site setup, the configuration file is the "settings.php"
file located at sites/default/settings.php. The default.settings.php file
contains a clean copy for restoration purposes, if required.
For multisite configurations, the configuration file is located in a
structure like the following:
sites/default/settings.php
sites/example.com/settings.php
sites/sub.example.com/settings.php
sites/sub.example.com.path/settings.php
More information on multisite configuration is located in INSTALL.txt.
2. If possible, log on as the user with user ID 1, which is the first account
created and the main administrator account. User ID 1 will be able to
automatically access update.php in step #10. There are special instructions
in step #10 if you are unable to log on as user ID 1. Do not close your
browser until the final step is complete.
3. Place the site in "Off-line" mode, to let the database updates run without
interruption and avoid displaying errors to end users of the site. This
option is at http://www.example.com/?q=admin/settings/site-maintenance
(replace www.example.com with your installation's domain name and path).
4. If using a custom or contributed theme, switch
to a core theme, such as Garland or Bluemarine.
5. Disable all custom and contributed modules.
6. Remove all old files and directories from the Drupal installation directory.
7. Unpack the new files and directories into the Drupal installation directory.
8. Copy your backed up "files" and "sites" directories to the Drupal
installation directory. If other system files such as .htaccess or
robots.txt were customized, re-create the modifications in the new
versions of the files using the backups taken in step #1.
9. Verify the new configuration file to make sure it has correct information.
10. Run update.php by visiting http://www.example.com/update.php (replace
www.example.com with your Drupal installation's domain name and path). This
step will update the core database tables to the new Drupal installation.
Note: if you are unable to access update.php do the following:
- Open your settings.php with a text editor.
- There is a line that says $update_free_access = FALSE;
Change it to $update_free_access = TRUE;
- Once update.php is done, you must change the settings.php file
back to its original form with $update_free_access = FALSE;
11. Ensure that the versions of all custom and contributed modules match the
new Drupal version to which you have updated. For a major update, such as
from 5.x to 6.x, modules from previous versions will not be compatible
and updated versions will be required.
- For contributed modules, check http://drupal.org/project/modules
for the version of a module matching your version of Drupal.
- For custom modules, review http://drupal.org/update/modules to
ensure that a custom module is compatible with the current version.
12. Re-enable custom and contributed modules and re-run update.php
to update custom and contributed database tables.
13. Return the site to its original theme (if you switched to a core
theme like Garland or Bluemarine in step #4). If your site uses a
custom or contributed theme, make sure it is compatible with your
version of Drupal.
- For contributed themes, check http://drupal.org/project/themes
for the version of a theme matching your version of Drupal.
- For custom themes, review http://drupal.org/update/theme to ensure
that a custom theme is compatible with the current version.
14. Finally, return your site to "Online" mode so your visitors may resume
browsing. As in step #3, this option is available in your administration
screens at http://www.example.com/?q=admin/settings/site-maintenance
(replace www.example.com with your installation's domain name and path).
For more information on upgrading visit
the Drupal handbook at http://drupal.org/upgrade
See the tutorial video here.
.
Tuesday, October 20, 2009
Install New Blog Template
How to install a Template?
1. Download a template and unzipp.
2. Go to the Layout section in your blog (Dashboard → Layout → Edit HTML ).
3. Supports your previous template (Download full Template).
4. Find and upload your template.
5. Enjoy your new blog design.
Why I can not install templates blogger? Blogger throws an error.
There are several possible factors that cause an error Bx-xxxx:
- The code is directly copied, and Blogger did not interpret it.
- Temporarily not accepting Blogger templates with certain codes or gadgets.
Possible solutions:
- Remove widgets or gadgets that come with the template downloaded.
- Clear your browser’s cookies.
- Trying to upload the template with a different browser (Opera, Firefox, Chrome, etc).
- No copy and paste the code directly, upload the xml file.
- Wait 24 hours and try again.
How do I customize my template?
For color and the font size, some Blogger templates offer an option to change it from the Dashboard (Dashboard → Layout → Fonts and Colors).
Major changes in the templates needed to know at least a little CSS and HTML. A quick way to modify a template is change the images in the CSS code. That is the process to change the header of a design, for example.
Additionally, some templates have their own settings instructions and customization, refer to the same download page of your template.
How can I edit the menu of my template?
1. Most templates have a menu that can only be changed from the HTML (Dashboard → Layout → Edit HTML). In many cases the code to look for is:
There you can change the expr:href=’…’ with your own links: href=’mylink’. Also see the instructions in your template for more information.
2. Some templates include a gadget to edit the menu directly from the Dashboard (Dashboard → Layout → Page Elements).
Thursday, October 1, 2009
PHP: How to Get the Current Page URL
Add the following code to a page:
function curPageURL()
{
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on")
{
$pageURL .= "s";
}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80")
{ $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
}
else
{
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;}
?>
You can now get the current page URL using the line:
echo curPageURL();
Sometimes it is needed to get the page name only. The following example shows how to do it:
{
return substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);
}
echo "The current page name is ".curPageName();?>
Reference site
..
Thursday, July 23, 2009
PHP: Past ValueThrough Link
1. $prop_id = '$_GET[prop_id]';
2. In a href tags >> =\"submit_docs.php?prop_id=".$prop_id."\"
Then close the a tag.
..
Tuesday, July 14, 2009
Wordpress: Move Site To New Server Issue
We plan to migrate our local www to outside server .. all related files transfered successfully.. and we decide to seperate between files(www) directory and the database(mysql).. all transfered and dump successfully to their own server.
After edit the configuration file(wp-config.php).. the main page can display well.. but all the created menu links does not go to the right url. The WordPress address (URL) not change as is the url setting in vhost.
Problems:
1.Page wp-admin page cannot appear
2. WordPress address (URL) not change as is the url setting in vhost.
3. The home page looked fine but all permalinks returned a ‘404 Not Found’ error.
Solution and action taken:
For problem no.1 and 2; the problems come from the General Setting that store in the database. Because of the admin page cannot be open, we need to edit the url setting through mysql wether using command or phpmyadmin...The url edited in table wp-options.
Make sure the grant permission is right. After settle that, the admin page can be appeared and the created menu links corrected to specify new url.. but the no. 3 problem still not solve.
Solution No. 3:
WordPress 404 Not Found Problem
In my case after a move of my site, I checked and double checked and it was NOT the .htaccess problem instead, the new apache httpd.conf had:AllowOverride None
I changed it to:
AllowOverride All
and did an apache stop/start. Problem solved, and the .htaccess started applying again.
The problem successfully solve!!.. I'm happy now... :)
..
Thursday, July 9, 2009
Drupal: Multilanguage
http://drupal.org/handbook/modules/translation
Local: Multilanguage Support
http://drupal.org/handbook/modules/locale
Translation for Download
http://drupal.org/project/Translations
Localization Server
http://drupal.org/project/l10n_server
Internationalization
http://drupal.org/project/i18n
Menu Translation
http://drupal.org/project/menutranslation
Active Translation Module
http://ftp.drupal.org/files/projects/active_translation-6.x-1.3.tar.gz
Consistent Language Interface
http://drupal.org/project/languageinterface
Module:
http://ftp.drupal.org/files/projects/languageinterface-6.x-2.1.tar.gz
This module provides a language switching block that is very similar to that provided by the core locale module, however its behavior differs from the locale block in several ways:
1. The visibility of language links in the block is consistent and independent from the existence of translations for the page that you are viewing. The logic here is that the user should be able to change the language of the interface at all times. This is important because often there are menus and blocks that are language specific and the user should always be able to find the link back to their language.
*** For those who would like to have it so that languages which are not translated also do not have language links you should use the Language Icons module in conjunction with the core Locale module. ***
..
Friday, June 12, 2009
5 Ways to Use Google Docs as a Freelance Web Designer
Writing Blog Posts
If I want to write a new article that I'm unlikely to finish in one sitting, I'll create a new document in Google and get to work.Sharing Quotes With Agencies or Other Designers
Create a new Google spreadsheet, get all the numbers and line items in there with a total, and then share it via email. They're free to modify it so that I can see the changes, and also to copy and paste the data into their own format. This allows the quoting process to be more collaborative and not so one sided.Maintaining an Ongoing List of Projects
I'm current writing a web app to replace this useful task, but a simple spreadsheet nails it pretty well in the meantime. Whenever I create a quote, I'll add that project and it's expected value to a Google spreadsheet that maintains an ongoing history of projects month by month.This allows me to see a total of potential income for each month, compare it to previous months, and also to see after every month what percentage of potential jobs and payments actually came into fruition. This is helpful in determining how much I need to sell on a month to month basis to maintain a regular income.
Personal Budgeting
This is closely related to the last item. I keep a list of my recurring bills in a Google spreadsheet, with totals that need to be paid from each account. For example, I use my Mastercard to pay for things like hosting, telephones, internet, and other automated payments, so my spreadsheet lets me know a minimum balance I need to maintain. I use my bank account to pay my rent, gas, food and other bills and my spreadsheet gives me an idea of how much I need to live on.
As an added note, I also use Wesabe to maintain a historical record of my spending on everything by tag. So I can add stuff like lattes, or movies to my Google spreadsheet to get an idea of what I'm likely to be spending the next month!
Miscellaneous Spreadsheets
Whenever I want to add anything and keep track of it, I create a new Google spreadsheet. It's become invaluable to me! For example, this month I've been planning to launch a creative shared space for tech freelancers in my city (Nanaimo), and I've kept a list of potential expenses, who wants to be involved, how much everyone will pay, and how much is left over.Wrapping Up
This is how I use Google docs to run much of my freelance business. Let me know if you have any other clever ideas by commenting below.
Tips by: shawn@nerdburn.com
Tuesday, June 2, 2009
Drupal: How to hide/delete/display Page Title
I need to hide/delete title Announcement .... in list of announcement page.
Solution:
- Go to sites/all/theme/yourtheme/views-view-unformatted.tpl.php
- Edit the php script.
- Save and refresh the page.
- See the changes.
Second Case:
I want to remain display page title in any particular page.
Solution:
- Go to sites/all/theme/yourtheme/page.tpl.php
- Edit the php script.
- Save and refresh the page.
- See the changes.
Drupal: Where to edit frontpage script
I want to add google analytic script in my main page in drupal.
Solution:
- Copy the google analytic script.
- Go to sites/all/theme/yourtheme/page-front.tpl.php
- Past the script before "close body" tag.
- Save and refresh the drupal main page.
- Right Click to see view source.
- Check that the google analytic script appear in the source page before "close body" tag.
- Finish.(Wait after 6 -24 hours to see the report)
Tuesday, May 12, 2009
Web Service Example
<%@ WebService Language="VBScript" Class="TempConvert" %> Imports System Imports System.Web.Services Public Class TempConvert :Inherits WebService (ByVal Fahrenheit As String) As String dim fahr fahr=trim(replace(Fahrenheit,",",".")) if fahr="" or IsNumeric(fahr)=false then return "Error" return ((((fahr) - 32) / 9) * 5) end function (ByVal Celsius As String) As String dim cel cel=trim(replace(Celsius,",",".")) if cel="" or IsNumeric(cel)=false then return "Error" return ((((cel) * 9) / 5) + 32) end function end class |
This document is saved as an .asmx file. This is the ASP.NET file extension for XML Web Services.
Explained about example
The first line in the example states that this is a Web Service, written in VBScript, and has the class name "TempConvert":<%@ WebService Language="VBScript" Class="TempConvert" %> |
The next lines import the namespace "System.Web.Services" from the .NET framework:
Imports System Imports System.Web.Services |
The next line defines that the "TempConvert" class is a WebService class type:
Public Class TempConvert :Inherits WebService |
The next steps are basic VB programming. This application has two functions. One to convert from Fahrenheit to Celsius, and one to convert from Celsius to Fahrenheit. The only difference from a normal application is that this function is defined as a "WebMethod()".
Use "WebMethod()" to convert the functions in your application into web services: (ByVal Fahrenheit As String) As String dim fahr fahr=trim(replace(Fahrenheit,",",".")) if fahr="" or IsNumeric(fahr)=false then return "Error" return ((((fahr) - 32) / 9) * 5) end function (ByVal Celsius As String) As String dim cel cel=trim(replace(Celsius,",",".")) if cel="" or IsNumeric(cel)=false then return "Error" return ((((cel) * 9) / 5) + 32) end function |
Then, end the class:
end class |
**Publish the .asmx file on a server with .NET support, and you will have your first working Web Service.
Learn more How To Use Web Service at http://www.w3schools.com/webservices/ws_use.asp
Learn SOAP Now!
Before study SOAP, I should have a basic understanding of XML and XML Namespaces.
I need to study these subjects first from XML Tutorial.
What is SOAP?
- SOAP stands for Simple Object Access Protocol
- SOAP is a communication protocol
- SOAP is for communication between applications
- SOAP is a format for sending messages
- SOAP communicates via Internet
- SOAP is platform independent
- SOAP is language independent
- SOAP is based on XML
- SOAP is simple and extensible
- SOAP allows you to get around firewalls
- SOAP is a W3C recommendation
Why SOAP?
Today's applications communicate using Remote Procedure Calls (RPC) between objects like DCOM and CORBA, but HTTP was not designed for this. RPC represents a compatibility and security problem; firewalls and proxy servers will normally block this kind of traffic.A better way to communicate between applications is over HTTP, because HTTP is supported by all Internet browsers and servers. SOAP was created to accomplish this.
SOAP provides a way to communicate between applications running on different operating systems, with different technologies and programming languages.
Web Service
What are Web Services?
- Web services are application components
- Web services communicate using open protocols
- Web services are self-contained and self-describing
- Web services can be discovered using UDDI
- Web services can be used by other applications
- XML is the basis for Web services
How Does it Work?
The basic Web services platform is XML + HTTP.
XML provides a language which can be used between different platforms and programming languages and still express complex messages and functions.
The HTTP protocol is the most used Internet protocol.
Web services platform elements:
- SOAP (Simple Object Access Protocol)
- UDDI (Universal Description, Discovery and Integration)
- WSDL (Web Services Description Language)
Web Services take Web-applications to the Next Level
By using Web services, your application can publish its function or message to the rest of the world.
Web services use XML to code and to decode data, and SOAP to transport it (using open protocols).
Two Types of Uses
Reusable application-components.
There are things applications need very often. So why make these over and over again?
Web services can offer application-components like: currency conversion, weather reports, or even language translation as services.
Connect existing software.
Web services can help to solve the interoperability problem by giving different applications a way to link their data.
With Web services you can exchange data between different applications and different platforms.
Learn more Web Service tutorial from http://www.w3schools.com/default.asp
Sunday, May 10, 2009
MS Word: Where to edit cut,copy and paste option
- Go to Office button
- Click on Word Option
- Click Advanced
- Go to cut, copy and paste section..
- Setting what you want
- Click Ok. Done.
It should be ok.
How to setup Drupal site in localhost?
Creating a test site on a local computer
It is considered a good practice to do all development work on a separate test site before making changes to a production site. A test site allows you to evaluate the impact of upgrades, new modules, modifications to themes etc. without causing disruption to your live site. For information about setting up a web server on a local computer, see the Local Server Setup section of the Developing for Drupal guide.
- Download Drupal.
Drupal files, and associated modules, are compressed in the
.tar.gz
format and can be extracted using most compression tools.On a typical Unix command line, use:
wget http://drupal.org/files/projects/drupal-x.x.tar.gz
tar -zxvpf drupal-x.x.tar.gz
This will create a new directory drupal-x.x/ containing all Drupal files and directories and will preserve all of Drupal's file and directory permissions. Move the contents of that directory into a directory within your web server's document root or your public HTML directory.
mv drupal-x.x/* drupal-x.x/.htaccess /var/www/html
The base URL for your Drupal installation will be set in your Web server's configuration file. You will need to know this URL before proceeding to the next step of the installation. If you are installing Drupal on your local machine the base URL may be: http://localhost. If you are installing Drupal onto a Web server your base URL may be a specific domain name (such as http://example.com).
Note for Windows users
A number of compression programs, such as 7-Zip, allow you to extract.tar.gz
files. To use 7-Zip, right-click on the .tar.gz file and, in the menu that appears, select 7-Zip -> Extract Here. A .tar file will appear. Right-click on the .tar file and again select 7-Zip -> Extract Here. In a few moments, the final Drupal folder will appear. - Grant write permissions on the configuration file
Your Drupal download comes with a default configuration file at
drupal/sites/default/default.settings.php
which needs to be prepared so that the installer can edit it.- Copy the
default.settings.php
tosettings.php
. You can do this from the command line usingcp default.settings.php settings.php
.
NOTE: Do not simply rename the file. The Drupal installer will need both files. - You should now have both a default.settings.php and settings.php file in your
drupal/sites/default
directory. - Make the settings file writeable, so that the installer can edit it
chmod a+w sites/default/settings.php
orchmod 666 sites/default/settings.php
Both commands have the same effect.
Several FTP tools like Filezilla, Transmit, and Fetch allow you to change file permissions, using a 'file attribute' or 'get info' command. In this case the octal or numeric value file permission should be set to 666. - Drupal should set the file permissions back to read-only once the installation is done. You should make sure this is the case and manually change it yourself if it didn't happen. You can use the same command, slightly modified, to remove write permission:
chmod a-w sites/default/settings.php
orchmod 555 sites/default/settings.php
.
If you are using a FTP tool the permission should be set to 555.
- Copy the
- Windows note
On a Windows system this would be Change permission and make sure the file is not marked Read Only before running the installer and then set it back to Read Only after. For more information about modifying Windows file permissions, see the Troubleshooting FAQ Create database
Create database with MySQL
This step is only necessary if you don't already have a database set-up
(e.g. By your host). In the following examples, 'username' is an example MySQL user which has the CREATE and GRANT privileges. Use the appropriate user name for your system.First, you must create a new database for your Drupal site here, 'databasename' is the name of the new database):
mysqladmin -u username -p create databasename
Next you must login and set the access database rights:
mysql -u username -p
You will be asked for the 'username' database password. At the MySQL prompt, enter following command:
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON databasename.* TO 'username'@'localhost' IDENTIFIED BY 'password';
where
'databasename' is the name of your database 'username@localhost' is the username of your MySQL account 'password' is the password required for that username FLUSH PRIVILEGES;
the database should be created with UTF-8 (Unicode) encoding
- Run The Installation Script
To run the install script point your browser to the base URL of your website.
The base URL is defined in your Web server configuration file and is specific to the document root where you placed your Drupal files. If you have installed Drupal on your desktop machine this URL might be http://localhost.
You will be guided through several screens to set up the database, create tables,
add the first user account and provide basic web site settings.
Drupal Installation: System Requirements
Webserver
Apache (Recommended)
- Drupal will work on Apache 1.3 or Apache 2.x hosted on UNIX/Linux, OS X, or Windows. The majority of Drupal development and deployment is done on Apache so there is more community experience and testing performed.
- You can use the Apache 'mod_rewrite' extension to allow for clean URLs.
PHP
Recommended: PHP 5.2 or higher
Required: PHP version 4.3.5 or higher
- PHP 5.2 or higher will be a requirement for Drupal 7.
- PHP memory requirements can vary significantly depending on your use of modules. While 16 MB may be sufficient for a default Drupal 6 installation, a production site with a number of commonly used modules enabled (CCK, Views etc.) could require 64 MB and some installations may require much more, especially with media-rich implementations. If you are using a hosting service it is important to verify that your host can provide sufficient memory for the set of modules you are deploying or may deploy in the future. (See the Increase PHP memory limit page in the Troubleshooting FAQ for additional information on modifying the PHP memory limit.)
- The PHP extension for connecting to your chosen database must be installed and enabled. Drupal's currently supported database connectors are: mysql (the original MySQL extension), mysqli (an improved connector for newer MySQL installations), and pgsql (for PostgreSQL). Note: PHP 5.x no longer enables the mysql extension by default. Please read the links above for installing and enabling your chosen connector. Additionally, Drupal 6.x does not provide the option to select the mysql connector if mysqli is enabled in your PHP configuration.
- PHP XML extension (for blogapi, drupal, and ping modules). This extension is enabled by default in a standard PHP installation; the Windows version of PHP has built-in support for this extension.
- An image library for PHP such as the GD library is needed for image manipulation (resizing user pictures, image and imagecache modules). GD is included with PHP 4.3 and higher and enabled by default. ImageMagick is also supported for basic image manipulations in Drupal core but there is much less support from contribute modules.
- PHP needs the following configuration directives for Drupal to work (only directives that differ from the default php.ini-dist / php.ini-recommended):
- register_globals: off; this is the default value, but some hosts have it enabled
- session.save_handler: user
- error_reporting set to E_ALL & ~E_NOTICE. Work is ongoing to change this to E_ALL for Drupal 6.
- safe_mode: off. Safe mode may interfere with file and image uploads.
- In addition, we recommend the following setting: session.cache_limiter: nocache
- Some of these settings are contained in the default .htaccess file that ships with Drupal, so you shouldn't need to set them explicitly. Note, however, that setting PHP configuration options from .htaccess only works under the following conditions:
- With Apache (or a compatible web server)
- If the .htaccess file is actually read, i.e. AllowOverride is not None
- If PHP is installed as an Apache module
- See the PHP manual for how to change configuration settings for other interfaces to PHP.
- In some shared hosting environments, access to these settings is restricted. If you cannot make these changes yourself, please ask your hosting provider to adjust them for you.
Database
Recommended: MySQL 4.1 or MySQL 5.0
- Drupal 6 supports MySQL 4.1 or higher.
- Drupal 5.x and earlier supports MySQL 3.23.17 or higher. MySQL 4.1 or higher is strongly recommended.
- Drupal 7 will only support MySQL 5.0 or higher.
-
NOTE: Drupal makes use of some features not available on some inexpensive hosting plans so please check that your host allows database accounts with the following rights:
SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER.
These rights are sufficient to run Drupal core 6.x.Some contributed modules, and also Drupal core 5.x, additionally require the following rights:
CREATE TEMPORARY TABLES, LOCK TABLES. - Note: If your system/host is running MySQL 4.1 or newer and you receive the error "Client does not support authentication protocol requested by server", address the problem by following the instructions provided by MySQL AB. There is a minor OS issue with some MySQL 5+ installations primarily on Windows but affecting some versions of Unix/Linux as well.
- Note:When using Drupal 5.x or later, particularly with contributed modules, it may be necessary to set the system variable max_allowed_packet to at least 16M. Some inexpensive hosting plans set this value too low (the MySQL default is only 1M). In that case, you may need to choose a better hosting plan. A value of 1M may be sufficient for 5.x.
Thursday, May 7, 2009
Drupal: Issue: Redirect page in Drupal
- Go to Home> Administer> User Management> Cas Setting
- Go to Redirection Setting
- Edit atEnter one page per line as Drupal paths. The '*' character is a wildcard. Example paths are 'blog' for the blog page and 'blog/*' for every personal blog. '
' is the front page. The message displayed to a user when he successfully logs in via CAS. You may specify '%cas_username', the username of the user.Activate this option if you want a user to be directed to the following page after logging out of CAS. The logout destination must be specified below.URL. An example URL is 'http://www.example.com'. - ** In the website, remain link to the default portal url .
- Refresh and test the changes. The link to the portal will redirect to cas login page.
- Done.
Drupal: How to upload/ change admin/user gravatar icon
- First you must prepare your new gravatar icon.
(48x48 pixel and the maximum size is 30 kB) - Go to Home> Administer> User Management > Users
- Find user that you want to edit. Click Edit.
- Delete current picture & Upload new picture.
- Save changes.
- Refresh the page and see the changes.
Drupal 6.x: Where To Edit Title Text Size/Style In Posting Pages
- Log into freeBSD server/ web server.(use root password)
- Go to :
# cd /usr/local/www/apache22/data/sites/all/
themes/theme_name
# ee style.css - Search h2 in the style.css file
- Click ctrl +y
Search for: h2 - Edit font size or other style
- Press esc + enter 2X - Save setting
- Click ctrl +y
- Refresh page in browser & see the changes.
Wednesday, May 6, 2009
phpCAS
What is phpCAS?
phpCAS is a library which allows clients written in PHP to
authenticate to a CAS (Central Authentication Service) server.
* Package name : libcas-php (not sure, needs policy)
Upstream Author : Pascal Aubry
* URL : http://www.ja-sig.org/wiki/display/CASC/phpCAS
* License : BSD
Programming Lang: PHP
Description : CAS client library for PHP
User documentation
- phpCAS examples
- phpCAS logout
- phpCAS troubleshooting
- phpCAS mailing lists
- phpCAS bug reports
- Applications CASified with phpCAS
- phpCAS acknowledgements
Applications CASified with phpCAS
Developing phpCAS
phpCAS acknowledgements
phpCAS bug reports
phpCAS ChangeLog
phpCAS examples
phpCAS i18n
phpCAS installation guide
phpCAS Issues
phpCAS logout
phpCAS mailing lists
phpCAS requirements
phpCAS source documentation
phpCAS troubleshooting
Drupal 6.x: How to hide submitted by and date in posting page/story
- Make sure the sites folder are in writable mode.(In my case I use FreeBSD server).
If not, firstly I must edit chmod permission to 775 at least.. or 777 for a while.
(**Make sure after finish, change back to normal mode:755) - Go to admin page Home > Administer > Site building> Themes
- Click on Configure or Global Setting
- Go to this section:
- Uncheck page box or any box which you done want the submitted by and date to be displayed.
- Save Configuration.
- Refresh the page and see the submitted by and date are not displayed anymore.
- **Make sure after finish, change back the sites folder to normal mode:755
- All done.
Tuesday, May 5, 2009
Drupal: Installing a Custom Drupal Theme
1. Download a free custom theme from Drupal.org
2. Buy a custom theme on the internet from a site such as Template Monster
3. Hire a designer to create one for you
4. Design your own
Step 1: Download the Custom Theme
For this example we are going to pick a free theme from Drupal.org. Once you are on Drupal.org, click Themes – located in the top right column.
If you installed under the 6.x version, so click on 6.x to filter out other versions.
You have checked out all the themes, navigated to the demo pages, and found a theme to download – click “Download” making sure that you've clicked the corresponding version.
Step 2: Uploading Files to the Server
1. Open root path in www(webserver)
2. Go to theme folder.... root path/sites/all/themes/
Drupal: Manually Installing Drupal
Step 1: Setting up your Database
Log into the cPanel (control panel) of your hosting account. Once you are logged in you will want to find the MySQL link.
The one for Bluehost looks like this:
Next, you will be prompted to give your database a name - for this example I picked "testsite".
Now, you must create a user and password for the database - for this example I picked "test" as my username.
After you are done adding a new user, you will have to assign the new user to the database that you just created. In Bluehost the assignment box is just below the "Add User" box.
(The only reason you are seeing "xseeddes_" is because that is the root name associated with my hosting account. You will have something different, it all depends on your host.)
The last step in setting up the database is assigning user privileges.
1. Make sure that you have the correct user and database.
2. Click the check all box - Drupal will need access to the database.
3. Click "Make Changes".
Step 2: Download Drupal
Go to Drupal.org and click the Download tab.
On the next page, click Drupal Project. Then click the download link for the corresponding version of Drupal you wish to download. (At the time of this writing Drupal 6.9 is the most current. Just make sure you do NOT download any version highlighted in red - that would be bad.)
Step 3: Uploading Drupal to Your Site
The next phase of installing Drupal is moving it from your computer to your website's server. The first thing you will need to do is log back into your control panel and open your file manager.
Inside of the File Manager you need to do the following:
1. Click on your Public_html folder.
2. Ensure that you have clicked on the correct folder by viewing that path as shown below.
3. Click Upload.
Once again, check the path to ensure that you are uploading to "Public_html" folder. Click the browse button to find the Drupal file located on your computer and upload.
Now, it is time to extract the files from the zipped (compressed) Drupal file.
1. Check the Drupal file.
2. Click Extract.
Once the compressed file is unzipped, it will still be in a folder called Drupal-6.9. You will need to take all the contents out of that folder. To do so, open the Drupal folder.
Inside of the Drupal folder you will see several folders and files. Check all files and folders and click "Move Files"
Ensure that you are moving them into the Public_html folder.
*NOTE: After moving the files and folders, make sure that you have successfully moved the .htaccess file as shown below.
Step 4: Configuring the settings.php file
Inside of the File Manager open the Public_html tree and navigate to the Default folder as shown below. Click to open the Default folder.
Inside of the Default folder there is a "default.settings.php" file. You will need to make a copy of that file and rename it settings.php - as shown below.
The next step in your journey - which is almost over by the way - is to open the "settings.php" file with your code editor. In Bluehost, you can open the file in code editor by right clicking on the file. (Each host is different but either way you need to be able to edit the code.)
Once inside the file, scroll down to line 92. Edit line 92 to reflect your database username, password, and databasename.
*NOTE: Leave the "@localhost" - Do NOT erase.
In the beginning of this example, I set my database username to: xseeddes_test
I set my database name to: xseeddes_testsite
And lets say my password is 1234
A proper code edit of line 92 would look like the example below.
Now, save your changes to the settings.php file and get ready for the final step!
Step 5: Logging into your new Drupal Website
If you were successful in the first four steps, the picture below is what you should see in your web browser.
We are reading English right now, so I'm guessing that is what you are going to pick. But maybe not :)
After choosing your language you should see all green checks. If by chance you get a red box don't freak out - you missed one of the steps above. Most likely, you didn't give the web server enough permission to write or the settings.php file was not configured properly.
But a good install looks like the screenshot below. If you received all green checks, give yourself a big hug. Now, you can fill in your site information.
Almost done, next up is your website username and password - this will be the top administrators name and password.
Last but not least is the Time and Date setting - this should already be set to your local time. If your server is set up for Clean URL's you can enable them now. If not, it can be set up at a later time.
Drum roll please.
Congrats! And Welcome to Drupal! If you made it this far you have just successfully finished your first Drupal installation.
Drupal: Configuring Your Drupal Theme
Changing Basic Theme Settings:
Let's go to the Theme Configuration page.
1. Click Administer
2. Click Site Building
3. Click on Themes
By default, the Garland theme is enabled and set to default in Drupal. For this example we are going to leave it set at Garland.
Enabling more than one theme allows users (if you have multiple site members) to select there own theme settings.
NOTE: If you are going to be using a custom theme or want control of how your content is displayed, it is best to leave one theme enabled and set to default.
The picture below is what you should have selected for this example. Next, click on the "configure" link.
Changing Colors:
The first thing we are going to do is change the base color.
Ensure that base is selected as shown below.
The base color is your website's background color. The numbers and letters you see next to the # sign are all apart of the hexadecimal numeral system. It is what browsers use to interpret the color output.
Enter #000000 into the base color field (those are zeros not O's by the way.) and then click save configuration.
The picture below highlights the change in the background color. Although, the hexadecimal code #000000 is black, Drupal does not output the color black because of CSS styling. The color is set to fade from top to bottom. We will get more into custom theme design later.
Next, you should play with the color wheel on the right. The outer wheel will allow you to select a color range, while the block in the middle will let you pick your saturation and value.
Experiment with it as I did in the example below. Remember, your site is off-line.
Display Settings:
Next, we are going to cover display settings. On the bottom of the current page, there are two sections, let's edit the "Toggle Display" and "Logo image settings" sections.
Uncheck Logo, Site Name, Mission Statement, and Shortcut Icon, as shown below. Click save configuration.
In the picture below, notice how the Drupal logo and the site name have disappeared. We have unchecked mission statement for processing reasons only, since we have no mission statement to post, there is no need to process it.
We also unchecked an item called, "Shortcut Icon". The shortcut icon refers to what is commonly called a favicon or the really tiny logo you see next to a website name in the address bar or on the window tab.
If you have your own custom logo or favicon you can also upload it on this page as well. To upload your logo or favicon, use the browse button to search for the file on your computer, then click save configuration. Drupal will automatically define a path for your logo and check "logo" in toggle display.
Now that you know what all this theme stuff does, enable some different themes and play around with the settings.