XLT blogas

2009-06-06

Katalogo ištrynimas su visais failais (PHP)

Įrašyta kategorijoje: hostingas, php — dainos @ 09:04
Tags: , , ,

PHP skriptas, ištrinantis visą katalogą, net jei jame yra failų, kurie neišsitrina per FTP (pvz., dėl netinkamų pavadinimų su \):

<?php
function trinam($katalogas){
if ($ab = opendir($katalogas)) {
$old_cwd = getcwd();
chdir($katalogas);
while ($file = readdir($ab)){
if ($file == ‘.’ || $file == ‘..’) continue;
if (is_dir($file)) {
if (!trinam($file)) return false;
}
else {
if (!unlink($file)) return false;
}
}
closedir($ab);
chdir($old_cwd);
if (!rmdir($katalogas)) return false;
return true;
}
else {
return false;
}
}

trinam(“katalogopavadinimas”);

?>

Panašus skriptas – senų failų ištrynimas

2008-07-29

Strtolower su UTF-8: pavertimas mažosiomis raidėmis

Įrašyta kategorijoje: Uncategorized — dainos @ 12:19
Tags: , , , , ,

UTF-8 koduote koduoti tekstai dažnai sukelia daug kvailų problemų, nes su jais neveikia kai kurios elementarios funkcijos. Pvz., paprasta pavertimo mažosiomis raidėmis PHP funkcija strtolower Unikodu koduotą tekstą paverčia nelemtais kvadratais. Tenka naudoti specialią funkciją, pvz.:

function konvert($text, $from, $to)
{
        return iconv($from, $to, $text);
}
function utf_strtolower($s)
{
    $t = “windows-1251″;
    $d = “UTF-8″;
    return konvert(strtolower(konvert($s, $d, $t)), $t, $d);
}

$tekstas=”РУССКИЙ текст”;

$keiciam=utf_strtolower($tekstas);

echo $keiciam;

Rezultatas: “русский текст”.

2008-07-25

Backlinkai – Pozicijų gerinimas Google paieškos rezultatuose

Įrašyta kategorijoje: Uždarbis, reklama — dainos @ 09:35
Tags: , , , , , ,

Dar šiek tiek idėjų, kaip gauti vienpusių backlink’ų (nuorodų kitose svetainėse, nukreipiančiose į jūsų svetainę), padedančių pagerinti savo svetainės pozicijas pagal įvairius raktažodžius Google paieškos rezultatuose ir taip prisidedančių prie lankomumo augimo, didesnės naudos iš svetainės ir t.t.

Pirmoji straipsnio dalis su kai kuriomis SEO idėjomis paskelbta čia. Tiesa, daug kas kartojasi, bet iš esmės pakanka nusitverti bent vieną kitą idėją ir ją įgyvendinti.

- Submit your free ebooks to ebook directories.

- Submit your downloadable software to software directories, such as Download.com

- Locate a popular site in your niche which would appreciate having you as a regular columnist. Write tips, lively commentary, product reviews, or whatever topics suit your niche.

- Syndicate your material to other sites. Create a content syndication feed (RSS feed) and include a link to your site. Use PHP rather than Javascript to ensure search engines parse your headings and links.

- Do something funny or outrageous or brilliant and people will link to your site without being asked.

- Build a useful tool

- Write an interesting article

- Run a newsworthy ‘event’ such as a contest

- Test something new that has not been done before

- Be the first in doing something on the internet

- Write something controversial

- Be the first to write the latest news in your niche

- Be the first to expose a scammer

- Disagree with an authority

- Write some funny humor

- Make an interesting picture

- Hunt for sites that complement yours and ask them to publish your articles.

- Participate helpfully in forums which allow a text link to your site in a signature. Start with the friendly, helpful AssociatePrograms.com affiliate forum. Read the forum instructions first, or you risk making an ass of yourself.

- Consider buying text link ads on other sites, for example from Linkadage or Text Link Ads. (Remember that Matt Cutts has written unfavorably about buying links.) Better still, arrange for articles to be published on other sites with a link to your site in them. You may have to use some innovative thinking to achieve this. The results make the effort worth while.

- Create simple web-based free software. Tell other sites, newsletters and forums about it and ask for a link to it.

- Create downloadable software which contains links to your site.

- Get listed in business directories.

- Make a valuable resource (lists, special reports, history of, how to, etc.)

- Write an outrageous theory and back it up with logics

- Write useful comments on something that is happening

- Give something valuable for free

- Coin a new acronym in your niche and get people to talk about it

- Become an expert in your niche and write valuable information

- Interview (e-mail/phone) prominent people and publish it.

- Be the first to research and document something

- Make a theme, plugin or piece of software

- Make a tool that others can put on their sites but that links to you

- Make a joke about a known person

- Make a resource that is just in time for a major event

- Buy ads in newsletters on your topic which are archived online.

- Locate industry-specific directories and submit your site to them. For example, if your site is on a health topic, look for health-related directories.

Reklama, backlinkai, SEO, gera pozicija Google paieškoje

Įrašyta kategorijoje: Uždarbis, reklama — dainos @ 09:27
Tags: , , , , ,

Sukūrus interneto svetainę, iškyla problema, kaip ją išreklamuoti. Jei svetainė nekomercinė ir nežada didelių pelnų, pirkti reklamą dažniausiai nėra prasmės. Pigiausias (ar net išvis 100% nemokamas ir efektyviausias būdas gauti lankytojų ir palaipsniui kurti pastovų lankomumą – prasimušti į kuo geresnes pozicijas paieškos sistemose, visų pirma Google.

Norint to pasiekti, reikia, kad kitose svetainėse būtų kuo daugiau nuorodų į tavo svetainę (tiek į jos pagrindinį puslapį, tiek į vidinius puslapius). Idealiu atveju, jei jūsų svetainė yra kažkuo labai išskirtinė ir naudinga, ją reklamuos patys lankytojai, rekomenduodami ją įvairiuose forumuose, savo tinklaraščiuose, puslapiuose ir kt. Tačiau daugeliu atvejų savireklama (nuorodų palikimu) tenka užsiimti pačiam. Šiame straipsnyje apžvelgiamos galimybės, kaip kurti kokybiškas „atgalines nuorodas“ („backlink‘us“) į savo svetainę.

Panaudota medžiaga iš: submithelper.com/User/User_ArticlesShow.aspx?SubjectID=570, nemažai naudingos informacijos galima rasti webmaster-talk.com forume ir daugybėje kitų šaltinių šia tema.

- Submit brief, useful hints to newsletters for the same reason.

- Submit articles to article directories. You can speed up this tedious work by using ArticleAnnouncer, the tool professionals use.

- Publish articles on your site and invite other sites to publish them on their sites, with a link to you.

- Write testimonials for products you love. Companies often post testimonials on their site with a link to the submitting site. Joe Vitale has taken this tactic to extraordinary lengths. For examples, trying doing a search on Google for “joe vitale +testimonial”.

- Create a blog and get it listed in blog directories.

- Join business associations which list their members’ sites online.

- Write regular news releases and submit them to topic-related web sites and Internet news wires such as PRWeb and Business Wire.

- Make arrangements for other sites to archive your newsletters on their sites.

- Get your white papers published on other web sites.

- Create a useful, interesting web site and other sites will naturally link to it. The vast majority of the thousands of links to THIS site were not requested.

- Go on with the basic SEO like Directory Submission, to submit your site to major directories, such as Yahoo! and DMOZ.org, in the appropriate category.

- Write articles and submit them to newsletters which are then archived online.

Daugiau…

Blog at WordPress.com.