<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Cristian Tantar</title>
	<atom:link href="http://www.tantar.info/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tantar.info</link>
	<description>Freelancer, Web Developer, PHP, MySQL, OSCommerce</description>
	<lastBuildDate>Tue, 02 Aug 2011 18:02:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Adobe Edge Preview</title>
		<link>http://www.tantar.info/2011/08/02/adobe-edge-preview/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=adobe-edge-preview</link>
		<comments>http://www.tantar.info/2011/08/02/adobe-edge-preview/#comments</comments>
		<pubDate>Tue, 02 Aug 2011 17:58:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.tantar.info/?p=144</guid>
		<description><![CDATA[Nice tool from Adobe: Edge. Forget about Flash in HTML 5:]]></description>
			<content:encoded><![CDATA[<p>Nice tool from Adobe: Edge. Forget about Flash in HTML 5:<br />
<iframe src="http://www.tantar.info/edge/Test.html" width="600" height="500"></iframe></p>
<g:plusone href="http://www.tantar.info/2011/08/02/adobe-edge-preview/"  size="standard"   annotation="none"  ></g:plusone>]]></content:encoded>
			<wfw:commentRss>http://www.tantar.info/2011/08/02/adobe-edge-preview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New site up</title>
		<link>http://www.tantar.info/2011/06/20/new-site-up/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=new-site-up</link>
		<comments>http://www.tantar.info/2011/06/20/new-site-up/#comments</comments>
		<pubDate>Mon, 20 Jun 2011 20:39:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.tantar.info/?p=126</guid>
		<description><![CDATA[We&#8217;ve just lunched this new site: http://www.bcropen.ro . Build with latest PHP technology, this site presents the Romanian Open Tenis for Ladies. Take a look and give me your feedback.]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve just lunched this new site: <a href="http://www.bcropen.ro">http://www.bcropen.ro</a> .<br />
Build with latest PHP technology, this site presents the Romanian Open Tenis for Ladies.<br />
Take a look and give me your feedback.</p>
<g:plusone href="http://www.tantar.info/2011/06/20/new-site-up/"  size="standard"   annotation="none"  ></g:plusone>]]></content:encoded>
			<wfw:commentRss>http://www.tantar.info/2011/06/20/new-site-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Codeigniter and image transparency</title>
		<link>http://www.tantar.info/2011/06/16/119/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=119</link>
		<comments>http://www.tantar.info/2011/06/16/119/#comments</comments>
		<pubDate>Thu, 16 Jun 2011 19:37:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Codeigniter]]></category>

		<guid isPermaLink="false">http://www.tantar.info/?p=119</guid>
		<description><![CDATA[If you want to maintain transparency of your PNG images when you use Codeigniter image library, you need to make some tweak on Codeigniter image library: 1. file path: system/libraries/image_lib.php 2. find: $dst_img = $create($this->width, $this->height); 3. insert after: $transparencyIndex = imagecolortransparent($src_img); $transparencyColor = array('red' => 255, 'green' => 255, 'blue' => 255); if ($transparencyIndex<a href="http://www.tantar.info/2011/06/16/119/"><br/> read more..</a>]]></description>
			<content:encoded><![CDATA[<p>If you want to maintain transparency of your PNG images when you use Codeigniter image library, you need to make some tweak on Codeigniter image library:<br />
1. file path: system/libraries/image_lib.php<br />
2. find: <code>$dst_img = $create($this->width, $this->height); </code><br />
3. insert after:<br />
<code>$transparencyIndex = imagecolortransparent($src_img);<br />
$transparencyColor = array('red' => 255, 'green' => 255, 'blue' => 255);</p>
<p>if ($transparencyIndex >= 0) {<br />
    $transparencyColor    = imagecolorsforindex($src_img, $transparencyIndex);<br />
}</p>
<p>$transparencyIndex    = imagecolorallocate($dst_img, $transparencyColor['red'], $transparencyColor['green'], $transparencyColor['blue']);<br />
imagefill($dst_img, 0, 0, $transparencyIndex);<br />
imagecolortransparent($dst_img, $transparencyIndex); </code></p>
<p>4. This is not anymore necessari if you upgrade at 2.0.2</p>
<g:plusone href="http://www.tantar.info/2011/06/16/119/"  size="standard"   annotation="none"  ></g:plusone>]]></content:encoded>
			<wfw:commentRss>http://www.tantar.info/2011/06/16/119/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Win PHP Challenge 2010 &#8211; Beginning</title>
		<link>http://www.tantar.info/2010/04/07/win-php-challenge-2010-beginning/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=win-php-challenge-2010-beginning</link>
		<comments>http://www.tantar.info/2010/04/07/win-php-challenge-2010-beginning/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 20:10:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Win PHP Challenge]]></category>
		<category><![CDATA[PHP Contest]]></category>
		<category><![CDATA[WinPHP 2010]]></category>

		<guid isPermaLink="false">http://www.tantar.info/?p=108</guid>
		<description><![CDATA[I-am registered now in Win PHP Challenge for 2010. I&#8217;am trying to make my best on PHP programming in Windows environment. PHP + mSql. I need to decide between 2 projects I have in mind: 1. phpMyCat &#8211; this will be an online solution for store of CD/DVD/Computer content: folder and filenames, with/without description 2.<a href="http://www.tantar.info/2010/04/07/win-php-challenge-2010-beginning/"><br/> read more..</a>]]></description>
			<content:encoded><![CDATA[<p>I-am registered now in<a href="http://www.eurowinphp.com/"> Win PHP Challenge for 2010</a>. I&#8217;am trying to make my best on PHP programming in Windows environment. PHP + mSql.</p>
<p>I need to decide between 2 projects I have in mind:</p>
<p>1. phpMyCat &#8211; this will be an online solution for store of CD/DVD/Computer content: folder and filenames, with/without description</p>
<p>2. tinyURL &#8211; long URL redirect  with short URL &#8211; built on Windows platform, with advanced options, like &#8220;Accounts&#8221;, &#8220;Share&#8221; , etc.</p>
<p>I will decide until 9 April.</p>
<g:plusone href="http://www.tantar.info/2010/04/07/win-php-challenge-2010-beginning/"  size="standard"   annotation="none"  ></g:plusone>]]></content:encoded>
			<wfw:commentRss>http://www.tantar.info/2010/04/07/win-php-challenge-2010-beginning/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title></title>
		<link>http://www.tantar.info/2009/11/17/103/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=103</link>
		<comments>http://www.tantar.info/2009/11/17/103/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 19:53:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.tantar.info/?p=103</guid>
		<description><![CDATA[New mobile site, made on my new mobileCMS: m.siteconcept.ro]]></description>
			<content:encoded><![CDATA[<p>New mobile site, made on my new mobileCMS:</p>
<p><a href="http://m.siteconcept.ro" target="_blank">m.siteconcept.ro</a></p>
<g:plusone href="http://www.tantar.info/2009/11/17/103/"  size="standard"   annotation="none"  ></g:plusone>]]></content:encoded>
			<wfw:commentRss>http://www.tantar.info/2009/11/17/103/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title></title>
		<link>http://www.tantar.info/2009/09/07/53/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=53</link>
		<comments>http://www.tantar.info/2009/09/07/53/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 20:46:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://www.tantar.info/?p=53</guid>
		<description><![CDATA[I&#8217;ve just finished an small project for one company: it&#8217;s about &#8220;Registru de casa&#8221;, some paperwork that all romanian companies needs to mantain on daily basis. I&#8217;ve used PHP, Ajax-JQuery with MySQL database. Fast and clean. See here: www.tantar.info/registrucasa . Here, i-ve build an new PHP Database class to help me: 1. First, how to<a href="http://www.tantar.info/2009/09/07/53/"><br/> read more..</a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just finished an small project for one company: it&#8217;s about &#8220;Registru de casa&#8221;, some paperwork that all romanian companies needs to mantain on daily basis. I&#8217;ve used PHP, Ajax-JQuery with MySQL database. Fast and clean. See here: www.tantar.info/registrucasa .</p>
<p>Here, i-ve build an new PHP Database class to help me:</p>
<p>1. First, how to use</p>
<pre class="brush: php; title: ; notranslate">

$cDB=new tDatabase;
$cDB-&gt;dbConnect(DB_SERVER,DB_SERVER_USERNAME,DB_SERVER_PASSWORD,DB_DATABASE);

// now, to retrieve all tables from database:

$array_of_tables=$cDB-&gt;dbFetchTables();

echo(&quot;&lt;pre&gt;&quot;);print_r($array_of_tables);echo(&quot;&lt;/pre&gt;&quot;);
</pre>
<pre class="brush: php; title: ; notranslate">
&lt;?php

/**
 * @author Cristian Tantar &lt;www.tantar.info&gt; &lt;contact@tantar.info&gt;
 * @copyright 2009
 */

class tDatabase extends tDebug {

  var $connection=false;

  function tDatabase() {
  	// do nothing

  }

  function dbConnect($host, $name, $pass, $db){
  // conect to database
  $connection = @mysql_connect(&quot;$host&quot;,&quot;$name&quot;, &quot;$pass&quot;);
  if(!$connection){
  	$this-&gt;PrintDebug(mysql_errno().&quot;:&quot;.mysql_error().&quot;&lt;BR&gt; LINE &quot;.__LINE__.&quot;, FILE: &quot;.__FILE__,1);
  	die();
  }
  mysql_select_db(&quot;$db&quot;, $connection);

  }//ends the connection function

 function dbClose(){
   // close database connection
  mysql_close($this-&gt;connection);

  }//ends the close function

  function dbFetchRow($query){
  // fetch one row with data from query
  $rows = mysql_fetch_row($this-&gt;dbQuery($query));
  return $rows;
  }

  function dbFetchArray($query){
  // fetch array with data from query
  $array = mysql_fetch_array($this-&gt;dbQuery($query));
  return $array;
  }

function dbFetchArrayResult($result){
  // fetch array from resultset ( this result can be: $result=$db-&gt;query($sql) , or other)
  $array = mysql_fetch_array($result);
  return $array;
  }

  function dbFetchField($query,$field){
  // return only specified field value, or n/a if empty
  $row=$this-&gt;dbFetchArray($query);
  if($row[$field]){
  	$field = $row[$field];
  }else{
$field=&quot;n/a&quot;;
  }
  return $field;
  }

function dbFetchFieldResult($result,$field){
  // return specified field, but from result, instead of sql query
  $row=$this-&gt;dbFetchArrayResult($result);
  if($row[$field]){
  	$field = $row[$field];
  }else{
$field=&quot;n/a&quot;;
  }
  return $field;
  }

  function dbFetchNum($query){
  	/* Get number of rows in query */
  $num = mysql_num_rows($this-&gt;dbQuery($query));
  return $num;
  }

  function dbFetchNumResult($result){
  	/* Get number of rows in result */
  $num = mysql_num_rows($result);
  return $num;
  }

function dbFetchTables(){
// return array of tables in database
  	$result=mysql_list_tables(DB_DATABASE) or die (mysql_error());
  	$tables=array();
  	while($tbl=mysql_fetch_array($result)){
  		$tables[]=$tbl[0];
  	}
  	return $tables;
  }

  function dbLastId(){
// return last id generated from previous operation
  	return mysql_insert_id();
  }

  function dbFetchResultsQuery($sql){
  // return array of results from query: $array[0]=row  0, $array[1]=row 1
  // you can retreive data: $array[0][$field]
    $resultArr=array();
$res=$this-&gt;dbQuery($sql);
while($data=$this-&gt;dbFetchArrayResult($res)){
$resultArr[]=$data;
}
return $resultArr;
  }
function dbQuery($sql){
// return resultset of sql query
  $resultSet=mysql_ query($sql) or die(mysql_error());
return $result;
}

 }//ends the class

?&gt;

&lt;?php

/**
 * simple debug class found on internet. not my property.
 */

class tDebug
{
 var $logfile;
 var $debug;

/*==============================================================================
Constructor
Arguments :- $debug_yesno. If 1 then errors will be logged,else displayed
==============================================================================*/
 function hDebug($debug_yesno=0,$logfile_path=&quot;&quot;)
 {
 $this-&gt;debug=$debug_yesno;
 $this-&gt;printdebug=1;

 //Report only user generated error messages
 error_reporting(0);

 if($this-&gt;debug&gt;=1)
 {
 $this-&gt;logfile=$logfile_path;
 set_error_handler(array($this,&quot;ErrorHandler&quot;));
 }
 else
 {
 restore_error_handler();
 }
 }

/*==============================================================================
Following function logs an error message
==============================================================================*/
 function ErrorHandler($errno,$errstr,$errfile,$errline)
 {
 $errtime=date(&quot;H:i:s - d/m/y&quot;);
 $error_message=&quot;An error occured on &quot;.$errtime.&quot;\n&quot;;
 $error_message .=&quot;Details are as follows\n&quot;;
 $error_message .=&quot;Error Number : $errno\n&quot;;
 $error_message .=$errstr.&quot;\nOccured in &quot;.$errfile.&quot;\n&quot;;
 $error_message .=&quot;On Line $errline \n\n&quot;;
 $error_message .=str_repeat(&quot;-&quot;,50);
 $error_message .=&quot;\n&quot;;
 $fp=fopen($this-&gt;logfile,&quot;a+&quot;);
 fwrite($fp,$error_message);
 fclose($fp);
 }

/*==============================================================================
Following function prints debug messages on the screen
==============================================================================*/
 function PrintDebug($message,$yesno=0)
 {
 if($yesno&gt;0)
 {
 $message=&quot;&lt;font face=\&quot;verdana\&quot; size=\&quot;2\&quot; color=\&quot;red\&quot;&gt;Debug : &quot;.$message.&quot;&lt;/font&gt;&lt;br&gt;&quot;;
 print $message;
 }
 }
}

?&gt;
</pre>
<g:plusone href="http://www.tantar.info/2009/09/07/53/"  size="standard"   annotation="none"  ></g:plusone>]]></content:encoded>
			<wfw:commentRss>http://www.tantar.info/2009/09/07/53/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Verry simple PHP CMS</title>
		<link>http://www.tantar.info/2009/08/04/verry-simple-php-cms/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=verry-simple-php-cms</link>
		<comments>http://www.tantar.info/2009/08/04/verry-simple-php-cms/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 20:04:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[simple php engine]]></category>

		<guid isPermaLink="false">http://www.tantar.info/?p=40</guid>
		<description><![CDATA[I have some clients who wants simple sites, only to show basic info about them. So, i-ve implemented an simple system to be faster on page building. This are the steps: 1. create basic structure of the site (3 dirs) +content +images +includes 2. we have 4 files to write: a. index.php b. config.php Here,<a href="http://www.tantar.info/2009/08/04/verry-simple-php-cms/"><br/> read more..</a>]]></description>
			<content:encoded><![CDATA[<p>I have some clients who wants simple sites, only to show basic info about them. So, i-ve implemented an simple system to be faster on page building. This are the steps:</p>
<p>1. create basic structure of the site (3 dirs)</p>
<p>+content<br />
+images<br />
+includes</p>
<p>2. we have 4 files to write:</p>
<p>a. index.php</p>
<pre class="brush: php; title: ; notranslate">

&lt;?php

/**
 * @author  Cristian Tantar &lt;http://www.tantar.info&gt; &lt;cristian.tantar@gmail.com&gt;
 * @copyright 2009
 */
require(&quot;config.php&quot;);

$parameters=array();

if(MAIN_DIR!=&quot;&quot;){
 $parameters=explode(&quot;/&quot;,str_replace(MAIN_DIR.&quot;/&quot;,&quot;&quot;,$_SERVER['REQUEST_URI']));
}else{
 $parameters=explode(&quot;/&quot;,$_SERVER['REQUEST_URI']);
 if($parameters[0]==&quot;&quot;){$temp=array_shift($parameters);}
}

 if($parameters[0]==&quot;&quot;){$parameters[0]=&quot;engine&quot;;$parameters[1]=&quot;&quot;;}
 if(!isset($parameters[1])){$parameters[1]=&quot;&quot;;}

 if(file_exists($parameters[0].&quot;.php&quot;)){
 require($parameters[0].&quot;.php&quot;);
 }else{
 require(&quot;engine.php&quot;);
 }

?&gt;
</pre>
<p>b. config.php</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

/**
 * @author  Cristian Tantar &lt;http://www.tantar.info&gt; &lt;cristian.tantar@gmail.com&gt;
 * @copyright 2009
 */

define('APP_PATH',dirname(__FILE__).DIRECTORY_SEPARATOR);

 if(isset($_SERVER['SCRIPT_NAME']))
 {
 $main_dir = rtrim(dirname($_SERVER['SCRIPT_NAME']),'/\\');
 }
 else
 {
 die('[config.php] MAIN_DIR error, set manual');
 }

 define('MAIN_DIR', $main_dir);

?&gt;
</pre>
<p>Here, in config.php, if need, we can include the connection to MySQL or other configs.</p>
<p>c. engine.php</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

/**
 * @author Cristian Tantar &lt;http://www.tantar.info&gt; &lt;cristian.tantar@gmail.com&gt;
 * @copyright 2009
 */

function callback($buffer)
{
 Global $tags;
 foreach($tags as $key=&gt;$value){
 $buffer=str_replace($key, $value, $buffer);
 }

 return ($buffer);
}

 ob_start(&quot;callback&quot;);

 require(&quot;includes/header.php&quot;);
 $includefile=&quot;content/default.php&quot;;
 if(isset($parameters[0])){
 if(file_exists(&quot;content/&quot;.$parameters[0].&quot;.php&quot;)){
 $includefile=&quot;content/&quot;.$parameters[0].&quot;.php&quot;;
 }
 }

 require($includefile);

 require(&quot;includes/footer.php&quot;);

 ob_end_flush();
 ?&gt;
</pre>
<p>and finaly<br />
d. .htaccess<br />
This is an important file, so the site can work</p>
<pre class="brush: bash; title: ; notranslate">
# AddType x-mapp-php5 .php
# AddHandler x-mapp-php5 .php
RewriteEngine on
Options +FollowSymlinks
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
ErrorDocument 404 /page-not-found/
&lt;files ~ &quot;\.tpl$&quot;&gt;
order deny,allow
allow from none
deny from all
&lt;/files&gt;
</pre>
<p>3. In [CONTENT] directory, we will put the content pages, offcourse. We need just 1 to begin: default.php<br />
Here is it:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

/**
 * @author Cristian Tantar &lt;http://www.tantar.info&gt; &lt;cristian.tantar@gmail.com&gt;
 * @copyright 2009
 */

$tags=array();
$tags['{title}']=&quot;This is the title of the site&quot;;
$tags['{description}']=&quot;Here is description of the site&quot;;
$tags['{keywords}']=&quot;and off course, the keywords&quot;;
?&gt;
&lt;div id=&quot;content&quot;&gt;
&lt;h1&gt;Home&lt;/h1&gt;
&lt;/div&gt;
</pre>
<p>Some words on this:</p>
<ul>
<li> You can create tags for each page of the site -&gt; useful for SEO</li>
<li> Replace what is between &lt;div id=&#8221;content&#8221;&gt; &#8230; &lt;/div&gt; with your code, HTML or PHP for the page.</li>
</ul>
<p>4. In [INCLUDES] directory, we will put the header.php and footer.php.</p>
<pre>   a. header.php
<pre class="brush: php; title: ; notranslate">
&lt;?php

/**
 * @author Cristian Tantar &lt;http://www.tantar.info&gt; &lt;cristian.tantar@gmail.com&gt;
 * @copyright 2009
 */

?&gt;
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html&gt;

&lt;head&gt;
 &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=iso-8859-1&quot; /&gt;
 &lt;meta name=&quot;author&quot; content=&quot;cristian.tantar@gmail.com&quot; /&gt;
 &lt;meta http-equiv=&quot;Description&quot; content=&quot;{description}&quot; /&gt;
 &lt;meta http-equiv=&quot;Keywords&quot; content=&quot;{keywords}&quot; /&gt;
 &lt;meta http-equiv=&quot;Revisit-after&quot; content=&quot;2 Days&quot; /&gt;

 &lt;link href=&quot;&lt;?=MAIN_DIR;?&gt;/style.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;/&gt;
 &lt;script type=&quot;text/javascript&quot; src=&quot;&lt;?=MAIN_DIR;?&gt;/lightbox.js&quot;&gt;&lt;/script&gt;

 &lt;style&gt;
 &lt;/style&gt;

 &lt;title&gt;{title}&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;div id=&quot;divMain&quot;&gt;
 &lt;div id=&quot;logo&quot;&gt;&lt;a href=&quot;&lt;?=MAIN_DIR;?&gt;&quot;&gt;&lt;img src=&quot;images/logo.jpg&quot; border=&quot;0&quot;/&gt;&lt;/a&gt;&lt;/div&gt;
</pre>
<p>This 2 lines:</p>
<pre class="brush: php; title: ; notranslate">
&lt;link href=&quot;&lt;?=MAIN_DIR;?&gt;/style.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;/&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;&lt;?=MAIN_DIR;?&gt;/lightbox.js&quot;&gt;&lt;/script&gt;
</pre>
<p>I use styles from style.css and <a href="http://www.huddletogether.com/projects/lightbox/" target="_blank">Lightbox</a> script for my images to popup nice.<br />
(of course, other files are included in main dir, all files required by Lightbox script to run)<br />
  b. footer.php</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

/**
 * @author Cristian Tantar &lt;http://www.tantar.info&gt; &lt;cristian.tantar@gmail.com&gt;
 * @copyright 2009
 */

?&gt;
&lt;div id=&quot;footer&quot; &gt;
Copyright info  here
&lt;/div&gt;
&lt;/div&gt; &lt;-- close mainDiv--&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>This is main configuration.<br />
I need only to take care of design, slice it, save images in [IMAGES] folder, and make the header.php,footer.php and content.php pages.<br />
For other content pages, like Services and Contact, you can create "services.php" and "contact.php".<br />
We will rich to them, by http://siteurl/services or http://siteurl/contact .
</pre>
<g:plusone href="http://www.tantar.info/2009/08/04/verry-simple-php-cms/"  size="standard"   annotation="none"  ></g:plusone>]]></content:encoded>
			<wfw:commentRss>http://www.tantar.info/2009/08/04/verry-simple-php-cms/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Improve OSCommerce also_consider.php</title>
		<link>http://www.tantar.info/2009/07/26/improve-oscommerce-also_consider-php/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=improve-oscommerce-also_consider-php</link>
		<comments>http://www.tantar.info/2009/07/26/improve-oscommerce-also_consider-php/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 10:05:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[OSCommerce]]></category>
		<category><![CDATA[also_consider.php]]></category>

		<guid isPermaLink="false">http://www.tantar.info/?p=29</guid>
		<description><![CDATA[After making some mods on oscommerce file also_consider.php, i-ve find out that the results are not so well displayed, i mean, products are taken from the same categoy, or having almost the same price, but this is not enaugh. So, i-ve recreate the SQL script, so the result is displayed by relevance. it&#8217;s an easy<a href="http://www.tantar.info/2009/07/26/improve-oscommerce-also_consider-php/"><br/> read more..</a>]]></description>
			<content:encoded><![CDATA[<p>After making some mods on oscommerce file also_consider.php, i-ve find out that the results are not so well displayed, i mean, products are taken from the same categoy, or having almost the same price, but this is not enaugh. So, i-ve recreate the SQL script, so the result is displayed by relevance.</p>
<p>it&#8217;s an easy mod:</p>
<p>file to change: includes/modules/also_consider.php</p>
<p>find:</p>
<pre class="brush: php; title: ; notranslate">if (mysql_num_rows($prod_query) &gt; 0) { </pre>
<p>above this, change what is between {</p>
<p><em>$sql=&#8221;select p.products_id, p.products_image, p.products_price, p.products_model, pd.products_name, p.products_tax_class_id from &#8221; . TABLE_PRODUCTS . &#8221; p, &#8221; . TABLE_PRODUCTS_DESCRIPTION . &#8230;</em></p>
<p>}</p>
<p>with:</p>
<pre class="brush: php; title: ; notranslate">

{

$cuvant=$product_info['products_name'];
$split_stemmed=explode(&quot; &quot;,trim($cuvant));
$split_stemmed=array_unique($split_stemmed);
$temp=array();
foreach($split_stemmed as $cuvant){
if(strlen(trim($cuvant))&gt;2){
$cuvant=trim(ereg_replace(&quot;[^A-Za-z0-9]&quot;, &quot;&quot;, $cuvant ));
if(strlen($cuvant)==3){$cuvant.=&quot;*&quot;;}
$temp[]=$cuvant;
}
}
$split_stemmed=$temp;

$string=&quot;&quot;;
$f=0;
while(list($key,$val)=each($split_stemmed)){
if($f&gt;1){
$string.=$val.',';
}else{
$string.=''.$val.',';
}
$f++;
}

$string=substr($string,0,strlen($string)-1);

$sql = &quot;SELECT
p.products_id, p.products_image, p.products_price, p.products_model, pd.products_name, p.products_tax_class_id,
( (90 * (MATCH(pd.products_name) AGAINST ('&quot;.$string.&quot;' ))) + (10 * (MATCH(pd.products_description) AGAINST ('&quot;.$string.&quot;' ))) ) AS relevance

from &quot; . TABLE_PRODUCTS . &quot; p, &quot; . TABLE_PRODUCTS_DESCRIPTION . &quot; pd, &quot; . TABLE_PRODUCTS_TO_CATEGORIES . &quot; pc
WHERE
( (0.9 * (MATCH(pd.products_name) AGAINST ('&quot;.$string.&quot;' IN BOOLEAN MODE))) + (0.1 * (MATCH(pd.products_description) AGAINST ('&quot;.$string.&quot;' IN BOOLEAN MODE))) )
and   p.products_status = '1' and p.products_id = pc.products_id and p.products_id = pd.products_id and p.products_id != '&quot; . (int)$HTTP_GET_VARS['products_id'] . &quot;'  and pd.language_id = '&quot; . (int)$languages_id . &quot;'
GROUP BY p.products_id ORDER BY relevance DESC LIMIT &quot; . (MAX_ALSO_CONSIDER);
$prod_query = tep_db_query($sql);

}
</pre>
<g:plusone href="http://www.tantar.info/2009/07/26/improve-oscommerce-also_consider-php/"  size="standard"   annotation="none"  ></g:plusone>]]></content:encoded>
			<wfw:commentRss>http://www.tantar.info/2009/07/26/improve-oscommerce-also_consider-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

