Webdesign la cel mai mic pret…

8.04.2010 prin byVasilescu 0 comentarii »


Aveti nevoie de un program de gestiune? Doriti un website, magazin online, blog, mini site de prezentare?

Sunati la 0745.36.46.97!

Vasilescu Valentin

Programator independent, preturi bune.

Va invit sa urmariti sectiunea Modele Website, pentru a va inspira in alegerea dumneavoastra.

Cron job for Mysql Database Backup

20.07.2010 prin byVasilescu 0 comentarii »
This script is taken from the Internet. But only after many attempts I managed to make it functional. This is because% can be used only with \ before.

date=`date +\%y-\%m-\%d-\%H-\%M-\%S`; mysqldump -u USERNAME -pPASSWORD --databases DATABASE > /home/CAPNELUSER/backups-mysql/xbackup_$date.sql; gzip /home/CPANELUSER/backups-mysql/xbackup_$date.sql

PHP Script to check Yahoo Status

29.05.2010 prin byVasilescu 0 comentarii »

This script is checking if two users are online. If the main user is online it shows his pingbox, else it shows the second user pingbox.

A very simple and effective script.
class Yahoo {

/**
* Function that checks online status based on the given Yahoo ID.
* Returns true if the Yahoo ID is online and false if otherwise.
*
* @param $yahooid
* @return boolean $status
*/
function Get_status($yahooid){

$status = file_get_contents(“http://opi.yahoo.com/online?u=$yahooid&m=a&t=1″);
if ($status === ‘00′)
return false;
elseif ($status === ‘01′)
return true;
}

}

$ys = new Yahoo();
$id1 = ‘yyyyyyyyyyyy’;
$id2 = ‘xxxxxxxxxxxx’;
$status1 = $ys->Get_status($id1);
$status2 = $ys->Get_status($id2);
if ($status1 == true){?>

<object id=”pingbox5jqcq7ih9fo×ၗ” type=”application/x-shockwave-flash” data=”http://wgweb.msg.yahoo.com/badge/Pingbox.swf” width=”160″ height=”320″><param name=”movie” value=”http://wgweb.msg.yahoo.com/badge/Pingbox.swf” /><param name=”allowScriptAccess” value=”always” /><param name=”flashvars” value=”wid=w6XkW5StQnHMU3w3h4p7zakA88uP53FegDE-” /></object>
<?php ;}
elseif($status2 == true){?>

<object id=”pingboxigv6yof4jlo0䁗” type=”application/x-shockwave-flash” data=”http://wgweb.msg.yahoo.com/badge/Pingbox.swf” width=”160″ height=”320″><param name=”movie” value=”http://wgweb.msg.yahoo.com/badge/Pingbox.swf” /><param name=”allowScriptAccess” value=”always” /><param name=”flashvars” value=”wid=wTLP0xipVmAKh7qg5JDtA4Jo0A–” /></object>
<?php;};

unset($status);?>

Magento – PHP Script to extract categories informations

28.05.2010 prin byVasilescu 0 comentarii »

I needed a way to extract category informations from a magento store, and after spending more than 12 hours I came with this.

The best part of this script is that you can directly get all the information needed from the $cat array by calling the array element (name, url, image). You can obtain all the array values with a simple print_r($cat);

This particular example create the .xml needed for the coverflow flash gallery.

<?php
$myFile = “xml/data.xml”;
$fh = fopen($myFile, ‘w’) or die(“can’t open file”);
echo $stringData = ‘<?xml version=”1.0″ encoding=”utf-8″?>
<coverflow
imageWidth=”310″
imageHeight=”200″
imagePadding=”1″
coverflowSpacing=”50″
startIndex=”0″
startIndexInCenter=”yes”
coverLabelPositionY=”328″
coverSlidePositionY=”0″
transitionTime=”0.5″
centerCoverflowZPosition=”40″
target=”_blank”
reflectionAlpha=”35″
reflectionRatio=”50″
reflectionDistance=”0″
reflectionUpdateTime=”-1″
reflectionDropoff=”0.75″
>
‘;
fwrite($fh, $stringData);

$category = Mage::getModel(‘catalog/category’);
$tree = $category->getTreeModel();
$tree->load();
$ids = $tree->getCollection()->getAllIds();
$arr = array();
$img = array();$name = array();$url = array();
if ($ids){
foreach ($ids as $id){
$cat = Mage::getModel(‘catalog/category’);
$cat->load($id);

$stringData =  ‘<cover img=”media/catalog/category/’.$cat["image"].’” title=”‘.$cat["name"].’” link=”http://xxxxxx.com/’.$cat["url_key"].’.html” />’;
if($cat["image"]){
fwrite($fh, $stringData);}
}
}
$stringData =  ‘</coverflow>’;
fwrite($fh, $stringData);
fclose($fh);
?>

PHP Free Google Translate script

30.04.2010 prin byVasilescu 0 comentarii »

Google Translate is probably one of the best online translators around. Here’s how to integrate it into your scripts.

Google Translate: PHP API

AJAX API… What about PHP?

Google offers an AJAX API for translating, but (sadly enough) they don’t offer any options for PHP. We can get around that, though.

Since Google isn’t providing you with their whole language database and algorithms, you know that somewhere in their AJAX script they are requesting data from their server. Using the location that the script requests the data, we can request the data ourselves.

Translation Function

Here’s a function that will translate from one language to another. I’ll explain everything after.

<?php

function translate( $text, $destLang = 'es', $srcLang = 'en' ) {

$text = urlencode( $text );
$destLang = urlencode( $destLang );
$srcLang = urlencode( $srcLang );

$trans = @file_get_contents( "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q={$text}&langpair={$srcLang}|{$destLang}" );
$json = json_decode( $trans, true );

if( $json['responseStatus'] != '200' ) return false; else return $json['responseData']['translatedText'];

}
?>

The function is pretty straight forward. It just downloads the translation and then parses it. It will return false if the request fails.

I’m not sure if Google has any API limits on this – I doubt it. The API is designed for websites that want to have their content available in multiple languages. I don’t think that Google would limit the API and potentially hurt anyone who depends on them for translations.

You can find a list of all of the supported languages here. To use any language, you would have to convert the language name (such as ‘English’) to the language code (such as ‘en’). You can use this list to do so. Google uses the ISO 639-1 code.

Lista orase pe judete

21.03.2010 prin byVasilescu 0 comentarii »

Am avut nevoie pentru un proiect de un tabel cu toate localitatile din Romania. Ideala ar fi fost o lista in care sa existe si codul postal.
Totusi, daca fiecarei localitati i se asigneaza automat un cod unic, lista poate fi folosita ca atare.
Cei interesati de cele mai importante 9600 localitati din Romania, impartite pe judete sa ma contacteze.
Mai jos este un extras cu o parte din acestea, pentru a observa gradul de acoperire.

AB Abrud
AB Abrud Sat
AB Aiud
AB Aiudul De Sus
AB Alba Iulia
AB Albac
AB Almasu De Mijloc
AB Almasu Mare
AB Ampoita
» Citeşte continuarea:Lista orase pe judete

Unelte gratuite pentru un SEO eficient

14.03.2010 prin byVasilescu 0 comentarii »

Am primit acest newsletter de curand. Am testat site-ul si mi se pare foarte reusit. Ofera gratuit toate uneltele necesare pentru optimizarea unui website. Nu am mai vazut o aplicatie similara atat de completa si gratuita.
Exista cateva probleme cu incarcarea paginilor, dar sunt pe drumul cel bun.
Succes!

NOU de la Gazduire.Com.Ro
DespreTrafic.Ro – Statistici online pentru site-ul tau:
In data de 1 Martie 2010 Grupul Media Pagini Europene a lansat un nou proiect pe piata online din Romania. DespreTrafic.Ro aduce cel mai bun script de statistici online impreuna cu toate uneltele necesare masurarii si estimarii tenditelor de vizitare si cautare a vizitatorilor site-ului tau.
» Citeşte continuarea:Unelte gratuite pentru un SEO eficient

Script mai rapid pt google analytics

3.03.2010 prin byVasilescu 0 comentarii »

Google Analytics goes async

December 1, 2009 4:36 PM

Today’s announcement that Google Analytics Launches Asynchronous Tracking is music to my ears. Not only does it make web sites faster, switching over to this async pattern improves uptime and increases the amount of analytics data gathered. I’ll touch on each of these three benefits, and wrap-up with an overview of the new code snippet.
Faster
» Citeşte continuarea:Script mai rapid pt google analytics

Model NIR – Nota Intrare-Receptie

3.03.2010 prin byVasilescu 0 comentarii »

Am avut nevoie de un model de NIR pentru o aplicatie de evidenta.
Acesta ar fi cel mai bun pe care l-am gasit.
Este in Excell, se poate utiliza pentru a tine evidenta , are formulele create.

http://www.contacafe.ro/download/file.php?id=71

Despre SERP, conţinutul duplicat şi importanţa Friendly URL

3.03.2010 prin byVasilescu 0 comentarii »

Acest articol a fost preluat de pe ccraciun.wordpress.com.

Prezentul articol nu se doreşte un tutorial, ci doar o constatare.
Despre Google, despre cum tratează uneori conţinutul duplicat şi despre ce factori favorizează o poziţionare mai bună în căutările Google (SERP = Search Engine Results Page).

Astăzi, printre multele e-mailuri primite, găsesc şi unul în care erau detaliate zilele libere de anul următor şi motivul pentru care sunt aşa de puţine. Curios din fire ca să găsesc sursa, caut pe google după “Sa va relaxati anul acesta, pentru ca in 2010” şi mă uit printre rezultate:
1. Pe primul loc, un blog pe platformă blogspot (unul din serviciile Google), cu articolul publicat în data de 20 mai 2009; are PR 0 şi vechime din Octombrie 2008.
2. Pe locul doi un forum, unde mesajul a fost publicat în data de 11 aprilie 2009; are PR 2 şi vechime din Iulie 2006.
3. Pe locul 3, un alt blog (al unui braşovean de-al meu :) ), unde pot doar să bănuiesc că articolul a fost publicat pe 22 sau pe 23 aprilie (conform arhivei); are PR 4 şi vechime din Octombrie 2007.
» Citeşte continuarea:Despre SERP, conţinutul duplicat şi importanţa Friendly URL

byVasilescu