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... :)
..