Friday, July 27, 2012

CSS: Set width and height for "a" tag

To set width and height for "a" tag ==> must declare:
display: block;

Wednesday, July 25, 2012

Learn jQuery Widgets

Some good places for learning  jQuery Widgets:

http://www.erichynds.com/jquery/tips-for-developing-jquery-ui-widgets/
http://jqueryui.com/demos/widget/#default
http://alexmarandon.com/articles/web_widget_jquery/
http://bililite.com/blog/understanding-jquery-ui-widgets-a-tutorial/
http://msdn.microsoft.com/en-us/library/hh404085.aspx

Tuesday, July 24, 2012

Twitter Bootstrap Plugin for Joomla

A product from phproberto: https://github.com/digitaldisseny/plg_sys_twbootstrap

If you need to use overrides:
1. In your template create the folder
templates/YOURTEMPLATE/plg_system_twbootstrap
2. Copy the js & css folders from
plugins/system/twbootstrap
to:
templates/YOURTEMPLATE/html/plg_system_twbootstrap
3. You are done! The plugin will detect any file overriden and load it instead of plugin's default version


Joomla! 2.5: modify meta tag to guide robots


By default Joomla 2.5 does not add the robots meta tag in the header and you have no handy tool by default to do it in one place, unless you don't use some add-on which let you do this easily.

But what if you prefer to do it yourself, bare-handed, without seeing even some code? You might be surprised, but in fact in Joomla 2.5 it's very easy to set up meta tag robots for your home page and content articles.

Tweaking these settings might add you an edge over your competition in the race for better ranking in Google and Bing searches - to name only the biggest players. You can do this in two easy to follow steps:

Step 1. Go to Content >> Category Manager and open the category you need to change
Open the parameters tab "Metadata Options" and set the value of Robots for example to "noindex, follow" to prevent indexing of category blog pages, but invite search-engine bots to follow the links in the page to discover all content items linked to them.

Step 2. Go to Menus >> Menu Manager and open the menu containing the menu item to the category blog you need to change. Open the menu item, then open the parameters tab "Metadata Options" and set the value of Robots to "Index, Follow".

Done! The web bots now are properly instructed how to discover and index your site. Using these settings the category pages will have lower ranks/importance as the content pages, this way facilitating the "concentration" of Page Rank to your content pages - at least this is the SEO guys out there are claiming.

If you use still Joomla 1.5, to change the value of meta tag robots in Joomla! 1.5 for content category pages you have to add some code in your template.

// Set robots for category pages
$document =& JFactory::getDocument();
$view = JRequest::getVar('view');
if ($view == 'category') { $document->setMetaData('robots','noindex,follow'); }

Saturday, July 21, 2012

Major updates for Google Apps Script

Update from Google I/O:


1. Script.google.com as a new destination for Apps Script developers. You can now create scripts from script.google.com  or from Google Drive. Your projects are now stored in Google Drive, and you can share them just like a Google document or spreadsheet.


2. HtmlService can help you create beautiful interfaces using Apps Script. HtmlService allows you to create web apps using HTML, client-side JavaScript, and CSS. You can also use jQuery to build web apps. HtmlService uses Google Caja  to ensure that the HTML content served by your web apps is safer for you and your users.


3. ScriptDb is a better way to store your application's data. Every script now has an embedded JSON database. You no longer have to rely on a spreadsheet to store the data. Using ScriptDb, you can store a larger volume of data and search easily. We designed ScriptDb to be easy to use. It doesn't need connection strings or special passwords, and you can directly store and search your JavaScript objects without the need to convert them to a different format. You can learn more about ScriptDb on the Google Apps Script Developers page.


4. You can now publish your apps in the Chrome Web Store . Register and package your app directly from the Publish menu in Google Apps Script. Then customize your listing from the Chrome Web Store and publish your app to the world.


5.  New developer reference documentation , new user guide, reach GAS team on Stack Overflowmake feature requests and report issues on the Apps Script page on Google Code.

Tuesday, July 17, 2012

Joomla 2.5: set session inside & get session outside


We have a need to set a session in joomla extension (e.g. component) and get (read) session in a external file  (outside joomla).

Here is the sample code:

//set session in a joomla extension
$session =& JFactory::getSession();
$session->set('asession', 'avalue');


//get session in a external file (outside joomla)

define( '_JEXEC', 1 );
define( 'DS', DIRECTORY_SEPARATOR );
define( 'JPATH_BASE', realpath(dirname(__FILE__).'/..' )); //should change to match to your file directory
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );

$mainframe = JFactory::getApplication('site');
$mainframe->initialise();
$session =& JFactory::getSession();
$asessionvalue = $session->get(' asession ');

Monday, July 9, 2012

Google Apps Script: get url request parameter

Get it from doGet(e) { e.parameter.ParameterName; //or  e.parameter["param"]; }

E.g. URL: https://sites.google.com/macros/exec?service=XXXXXXXXXXXXX&test=sample_parameter


Code sample:


function doGet(e) {
  var app = UiApp.createApplication();
  var aLabel = app.createLabel("I love Apps Script!").setStyleAttribute("fontSize","16px");
  var verticalpanel = app.createVerticalPanel();
  var mybutton = app.createButton(e.parameter.test);
  verticalpanel.add(aLabel);
  verticalpanel.add(mybutton);
  app.add(verticalpanel);
  return app;
}

Friday, July 6, 2012

Could not load the DLL xpstar90.dll, or one of the DLLs it references. Reason: 126

Solving:

1. Copy new xpstar90.dll of same MS SQL version to C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\xpstar90.dll

OR

2. Reinstall MS SQL

Thursday, July 5, 2012

jquery week calendar associated with php & mysql

Here is the sample for jquery week calendar associated with php & mysql.
It supports:
+Read events from mysql db
+Save new events to mysql db
Sorry,
I have no time to add more functions.

Download sample here: http://lvhung.googlecode.com/files/calendar.rar

Tuesday, July 3, 2012

Free calendar script


Refer: http://stackoverflow.com/questions/8087537/what-are-some-free-web-based-open-source-calendar-solutions
jquery-week-calendar similar to Google Calendar.
Similer
wdCalendar – jQuery Based Google Calendar Clone, Demo URL
wdCalendar
Monket Calendar coded in HTML, CSS, Javascript, and PHP, Demo Url
Monket Calendar
More open-source calendars can be found in http://www.webappers.com/category/components/calendar, they are more than 35 calendar projects.
Subscribe to RSS Feed Follow me on Twitter!