extContent in action (part1)
Basic templates management. In the following video you will see how to split and organize the template of your future site
Content adding and editing:
Menus (templates, structure, usage)
Content Indexing and php tags options
Here you can find the final result : http://dev.ajaxinside.de/projects/extcontent/
extContent concept
Application Environment (XFCE like TaskBar and Custom WindowManager)
Content Management
Menu’s Structures
Indexing of Content Tables
This is just a technology preview developed with extJS 3.0
You can find more detailed videos here
I am not planning a release in the near future.
SDB pre-release
Used Technologie:
the ExtJS framework,
custom php to handle the server-side stuff,
a lot of patience and sleepless nights
Eclipse for web development
Here a small list of everything extra added :
- The Mighty Eclipse Platform 3.4.1
- Aptana JavaScript Editor 1.2.1.020234
- Aptana Support for EXT 2.2.004 (other framewords can be added via Aptana Update Manager)
- Aptana Web Development Tools 1.2.1.020234
- Subversive SVN Connectors 2.0.4
- SVNKit 1.2
- Zend Debugger 5.2.14
- PDT Runtime Feature 2.0.0
- RSE FTP Service 3.0.1
- RSE SSH Service 2.1.1
JRE is included but you can replace it with another one to match your arhitechture (jre folder). Currently there is a version for Windows. If i have some time i will added and one for Linux and OSX. Basically you can use the configuration and features folders and copy them over another eclipse build, but i never tried it.
I am not the author of anything ! I just combined some free plugins and features. If you care about licenses and etc., please take a look on the vendor’s sites. It’s all free software, but you never know …
This software comes with absolute no guarantee, so please use on your own risk.
Installation:
Unpack and start.
OC – beta 1 (preview)
OC – Operatives Controlling Application
Developed with extjs 2.2 framework + custom php framework
Current status – Development + bugfixing
How a little server-side coder became a desktop application developer
I always know that one day i will write cool desktop application. After some researching i start using the extjs framework for AJAX. If you don’t know it, don’t waste time and give it a try!
Now… take a look on the uploaded pictures. This + Adobe AIR = native platform independent desktop application…
How cool can this be ?!
My Common class for JSON & php
I always wanted to share some source, so i will do it now. It’s a very basic Common class in php for connecting to database and executing queries. Nothing special but may help to somebody new to php.
This Class provides a easy way to get a JSON formated output from your mysql queries and update the records back to the database.
Works only with php 5.2 or higher !
-
class Common {
-
-
function json2query($table_name, $primary_key=null, $output) {
-
$output = str_replace('\\','',$output);
-
$counter = 0;
-
$array = json_decode($output, true);
-
foreach ($array as $key=>$value) {
-
$query = array();
-
foreach ($value as $field_name=>$field_value) {
-
if ($primary_key==$field_name) {
-
$where_clause = $field_name.'='.$field_value;
-
} else {
-
array_push($query,'`'.$field_name.'`='.SQLFiendly($field_value));
-
}
-
}
-
-
$array_query[$counter++] = sprintf('UPDATE %s SET %s WHERE %s',$table_name, implode(",",$query), $where_clause);
-
-
}
-
return $array_query;
-
}
-
/**
-
* Enter description here…
-
*
-
* @param unknown_type $search
-
* @param unknown_type $replace
-
* @param unknown_type $subject
-
* @return unknown
-
*/
-
function StrReplaceFirst($search, $replace, $subject) {
-
// replaces the first occurance of $search in $subject with $replace;
-
// returns $subject unchanged if no match
-
// may be rewritten with regexpressions if there are volunteers
-
if ((!$subject) or (!$search)) return $subject;
-
$sp = strpos($subject, $search);
-
if ($sp!==false) {
-
return (substr($subject, 0, $sp) . $replace . substr($subject, $sp+strlen($search)));
-
} else {
-
return $subject;
-
}
-
-
}
-
-
/**
-
* Enter description here…
-
*
-
* @param unknown_type $theValue
-
* @param unknown_type $theType
-
* @param unknown_type $theDefinedValue
-
* @param unknown_type $theNotDefinedValue
-
* @return unknown
-
*/
-
function sqlValue($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") {
-
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
-
switch ($theType) {
-
case "text":
-
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
-
break;
-
case "int":
-
$theValue = ($theValue !== "") ? intval($theValue) : "NULL";
-
break;
-
}
-
-
return $theValue;
-
}
-
-
function dbconnect() {
-
global $config;
-
$link = mysql_pconnect($config['host'], $config['username'], $config['password'])
-
or exit(mysql_error());
-
mysql_select_db($config['database'], $link);
-
return true;
-
}
-
-
/**
-
* Enter description here…
-
*
-
* @param unknown_type $result
-
* @param unknown_type $total
-
* @return unknown
-
*/
-
function mysqlresult2array($result, $total = true) {
-
$array=array();
-
$total = mysql_num_rows($result);
-
//$array['total'] = $total;
-
while ($row=mysql_fetch_assoc($result)) {
-
//var_dump($row);
-
$array[]=$row;
-
}
-
-
mysql_free_result($result);
-
return '{"data":'.json_encode($array).'}';
-
}
-
-
/**
-
* Enter description here…
-
*
-
* @param unknown_type $query
-
* @param unknown_type $values
-
* @return unknown
-
*/
-
function query($query, $values=NULL) {
-
$this->dbconnect();
-
if (is_array($values)) {
-
foreach ($values as $value=>$type) {
-
$query = $this->StrReplaceFirst('%s', $this->sqlValue($value, $type), $query);
-
}
-
}
-
-
$execute = mysql_query($query) or print mysql_error()."\n
-
<h1>".$query."</h1>
-
";
-
-
if (preg_match('/SELECT/', $query)) {
-
return $this->mysqlresult2array($execute);
-
} else {
-
return true;
-
}
-
-
}
-
-
/**
-
* Enter description here…
-
*
-
* @param unknown_type $url
-
*/
-
function goto($url=null) {
-
if (!empty($url)) {
-
header('Location: '.$url);
-
} else {
-
-
}
-
}
-
}
And a really simple usage:
-
$a = new Common();
-
$json_output = $a->query('SELECT * FROM table WHERE 1');
-
echo $json_output;
It’s time for php 5.2 or higher !
I was wondering, when i will switch to php 5.x ?! So now i will tell you the reason, it’s called JSON !
After starting working with extjs, i was searching for a faster way to develop a stable solution, without writing 18 hours / day. Here it is, it’s called JSON and it’s a way to transfer data between php arrays (from example) and a browser-side ajax objects.
The miracle functions are called : json_encode and json_decode
- json_decode — Decodes a JSON string
- json_encode — Returns the JSON representation of a value
I will write some simple code when i get some free time.




