href and javascript function()

0 comments
Today was a nice challenge day, as you all well know javascript is not logic, is pure imagination. I had problems in putting a javascript code into the href instead of using onclick because sometimes sharepoint overwrite it, just because it doesn't make sense. Here is why: you need to put brackets everywhere.
javascript:(function(){alert('test')})()
So in real life it will be:
 alert 

FCKeditor, JQuery, PHP and MySQL

1 comments
This is a quick dirty tutorial in how to integrate FCKeditor, JQuery and PHP, I'm leaving MySQL outside because it will be simple to implement and I would like to keep the tutorial simple as possible. For this tutorial you will need to have PHP-Json installed, FCKeditor and JQuery.


At the time the document load you will need to create a FCKeditor API instance and store in a global variable oEditor
// global variable for FCKeditor API
var oEditor;

$(window).load(function () {
  oEditor = FCKeditorAPI.GetInstance('FCKeditor1') ;
});
This javascript function will be responsible to query the PHP "text_load.php", and oEditor.SetHTML will store the text receive via jason into the FCKeditor
function text_load(){
  $.getJSON("text_load.php,
  function(data){
     oEditor.SetHTML(data.text);
     $("#editor").show();
  });
}
To save the text you should call this function, the oEditor.GetXHTML will retrieve the text in the FCKeditor and store in the variable text.
function text_save(){
var text = oEditor.GetXHTML();
$.getJSON("text_save.php?text="+ text,
function(data){
 $("#editor").hide();
});
}
The HTML code is very simple, the Load href will trigger the text_load function and load the text into the FCKeditor. The Save href will trigger the text_save() that will be responsible to send the text to the php page to save.

Load

Here is the load and save page in PHP that will interact with the Ajax/Json javascript. The trick is use urldecode and urlencode to load and save from the database. This is the text_load.php to load the text and send to the javascript
$output = array();

mysql code
...
...

// the rows will be stored
// in the $row[] variable

$output['text']= urldecode($row['text']);
echo json_encode($output);

exit;
This is the text_save.php to get the text from javascript and save in the mysql table. The text from FCKeditor will be stored in $text.
// get the query string
$text = urlencode($_REQUEST["text"]);

mysql code
...
...

Cisco Wireless - Validate server certificate

2 comments
It is a pain to uncheck the "Validate server certificate" box everytime. Seems easy to add a server cert to Cisco wireless network (ie ACS), from Cisco ACS This guide describes certificates created with a Microsoft CA and also contains steps for when you use a self-signing certificate, which is supported as of Cisco Secure Access Control Server (ACS) 3.3. The use of a self-signing certificate streamlines the initial Protected Extensible Authentication Protocol (PEAP) installation considerably since no external CA is required. But, at this time, the default expiration period of the self-signing certificate is only one year and cannot be changed. This is standard when it comes to server certificates. But since the self-signed certificate also acts as the root CA certificate, this can mean the installation of the new certificate on every client every year when you use the Microsoft supplicant unless you do not check the Validate Server Certificate option. Cisco recommends that you use self-signing certificates only as a temporary measure until you can use a traditional CA. If you wish to use a self-signing certificate, proceed to the self-signing certificates section.

Opera Mini - Browser for Blackberry and smartphones

0 comments
if you are looking for a good browser for your smart phone or blackberry take a look into Opera Mini

Toribash video DAT clan

0 comments
This is a very nice video from the DAT clan