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!