GPix 1.3.5 released

version 1.3.5 contain next updates:

  • Allow users to add pixel ads together with keywords for their sites. It makes sense only if you implement an additional page that is optimized for user’s pixel ad. A Victor clicks pixel ad on home page and it will be redirected to this page. Users’ keywords will replace pixel site keywords on this page. Than, Visitor may click again on pixel ad and it will be redirected to the advertising site. - translation for title and description header tags.
  • categories for grids and regions
Tags:

new GLink release

As usually GLink release come after GPix release.

At this moment, I prepare new options functionality, which is developed for GPix.

Tags:

GPix 1.3.4

Thanks for all how help for this release. I hope we remove most of bugs (software have bugs by definition, he-he).

This release contain next changes:

  • german and french translation updated
  • multi get fixes
  • pixel list in admin area(such as in GLink)
  • "maintain settings" beatified
  • fix admin and user side update for original image
  • front-end link in admin toolbar
  • 'timezone set' functionality added. Affect web and mysql servers
  • original image functinality improved
  • original image from admin side
  • add 'settings' functionality, which use options table, with option per row functionality
  • add to Gpix an additional field in order to allow admin putting some additional meta tags (robots, keywords, description, author, copyright).
  • search for several words
  • improved "htmlyesno" smarty plugin functionality. Added new options "default" and "value". Labels used for radios, now you to select user can click to strings "yes" or "no".
  • pending status (waiting for an administration approval after user side update)

    if Admin enables "Yes". An approved User may change later (after approval it's content) the content of the linked site to show offensive/obscene/adult material and Admin may not dicovered it

As usually I help to update customized templates for free if you help for this release. Be free to request my help if you need it.

Tags:

Settings optimization.

GPix design implement cell per option philosophy and this require to run database each time when I add new option.

So, today I finish to test philosophy 'row per option'. I just tested code which use actively options table with new option 'timezone'. So, to add new options I will need to add html code only. This mean that alter table query will not be required.

Tags:

You Tube mod

Release for YouTube mod can be accessible via phpLD official site only.

This release contains fixes for problem with empty video items.

I am sure phpLD core team will update file on official forums.

Tags:

optimization with memcached - is it simple to implement?

memcached is service which provide memory cache storage. It can provide access to cached object via network and it is extrimly fast!

memcashed pecl module is a way which can be used to access cache storage. How it work? It more complicated instead Cache_Lite, but it is fastest. This fact can be explain: Cache_Lite use file system to store cache objects.

So, how PHP developer can use memcached module?
First memcached service need to be installed and configured. It can be done for Unix/Linux systems and for Windows NT/XP/Vista.
Second implement memcached usage to cache functionality like this:

<?php
$memcache = new Memcache;
$memcache->connect($memcached_host, $memcached_port) or die("Can not connect to memcached server");

if ($content = $memcache->get('content_key')) {
$content = generated_complicated_content($params);
$memcache->set('content_key', $content, 0, 30);
}

echo $content;
?>

look really simple and very useful.

PEAR::Cache_lite - speed, simplicity, security

One way to speed up web application is to lower database usage. Databases designed to provide very fast manipulation with data in files. Often developer use databases for everything and store session data, user files. This action make tables big and database server work slowly... As result an simple file based cache will speed up application very quick.

An simple example what we can do with Cache_lite:

<?php
// Include the package
require_once('Cache/Lite.php');
$id = 'example_id';

$options = array(
'cacheDir' => '/tmp/', // directory where cache files will be stored
'lifeTime' => 3600 // expired time
);

$Cache_Lite = new Cache_Lite($options);

// Test if there is a valid cache for this id
if (!$data = $Cache_Lite->get($id)) {
// Cache miss !
// multiple sql queries or high load functionality put generated content to data
$data = get_generated_content();
// save generated content
$Cache_Lite->save($data);

}

echo $data;

?>

Simple and efficient. Variable data will contain string, so if you need to store objects just use serialize

site optimization cases

Ever site have content for cache or pregenerate.

Why cache need to be part of optimization? - if you know what you do and how it is very fast way to lower server load. So, after load is lowered you will have time to think about logical optimization ;)

What we can cache?

  • content
  • sql results
  • functions results
  • logical results(which isn't design as separate functions)
  • As example, if site have visitors counter its results can be cache for several minutes and this will save little time for executions. Here I need to notice - it very important to cache something which take more time than fetch from cache! of course for our case we need to know how many time/cpu/memory take counter and same values for cache fetch function. There are no sense to cache if we do not save or convert server resources.

Tags:

GPix 1.3.3

next features implement for this release.

  • "Remember me on this computer" option for admin
  • order continue functionality after user register/login
  • back link checker http://forum.tufat.com/showthread.php?t=50238
  • multi get/bill, get more that one region per grid functionality

I get more requests for "back link checker", this improvements will be implemented in next version.
Thanks for who help for this release.

Tags:

Fast file transfer with pseudo HTTP server

Time to time I need to transfer site from server to server very quickly and have not common solution for this, because I have permissios.

Solution is to use http server if you have this one of server with backups or use netcat.
On server side I run

nc -l -p 8080 < mybackup.tar.gz

or

netcat -l -p 8080 < mybackup.tar.gz

and now can use wget, curl or browser for this url:
http://serveradress:8080

if you sent link to client it will best to do little more:

(echo -e "HTTP/1.1 200\nContent-Disposition: attachment, filename=mybackup.tar.gz\n
Content-Type: application/octet-stream\nConnection: close\n", cat mybackup.tar.gz )
| nc -vv -l -p 8080