How to cat text in PHP with HTML?

June 2nd, 2009

How to cat text in PHP?

function cut($x) {
    if(strlen($x) > 40) {
        $x = substr($x, 0, 40);
        $y = strrpos($x, ' ');
        $x = substr($x, 0, $y);
    }
    return $x;
}

How to code url text (links) in PHP and run on JavaScript?

May 22nd, 2009

How to code url text (links) in PHP and run on JavaScript? Read the rest of this entry »

apachectl configtest -bash: apachectl: command not found

May 14th, 2009

apachectl configtest -bash: apachectl: command not found

HOW TO FIX apachectl on debian

Just run some commands Read the rest of this entry »

Dle - how to disable all posts shown on main page

April 3rd, 2009

You need just run in database in phpmyadmin

update `dle_post` SET allow_main=0 WHERE 1

and all posts would tot beeeing shoen on main page

SEO description for wordpress categories

April 2nd, 2009

please open header php in template
and replace title

<title>
<?php if (is_category()) { echo strip_tags(category_description());   }
else{
wp_title(’&laquo;’, true, ‘right’); ?> <?php bloginfo(’name’);
}
?></title>

How to convert .odt fileas a .txt file or similar windows ward 2007

March 6th, 2009

You could use OpenOffice.Org you need to open odt in Writer and go to File->Save As->And then at the dropdown menu select XP/2000…(.doc) or (.txt).
Or also you could use this website: http://media-convert.com/
Or: http://www.zamzar.com/
You can also view it in this: http://viewer.zoho.com/, if you’re not interested in a long term solution

PHP online proxy check script on web server!

February 18th, 2009

So let I am introduce for you updated

PHP script for online proxy checking

on web server!

<?
// Fresh proxy list takes from http://proxy-list.org/ru/index.php
set_time_limit(10000);
 
$list = "
60.247.2.241:8080
123.176.47.203:6588 - fine - fine
";

Read the rest of this entry »

How to FAST inslall coomands WordPress Lecactus Edition

February 6th, 2009
wget http://lecactus.ru/download-manager.php?id=467
unzip wordpress*
rm wordpress*.zip
rm *.html
rm *.txt
cp -r wordpress/. public_html/
rm -r wordpress/
chmod g+w ./public_html/
chmod g+w ./public_html/wp-content/uploads/

also upgrade /wp-admin/options-privacy.php?updated=true

How to define search engine bot on website (using PHP)?

January 27th, 2009

Add to root folder of websitefile  bot.php

<?
if (strstr($_SERVER['HTTP_USER_AGENT'], 'Yandex')){ $bot='Yandex';}
else if (strstr($_SERVER['HTTP_USER_AGENT'], 'Googlebot')){$bot='Google';}
else if (strstr($_SERVER['HTTP_USER_AGENT'], 'Mediapartners-Google')){$bot='Mediapartners-Google (Adsense)';}
else if (strstr($_SERVER['HTTP_USER_AGENT'], 'Slurp')){$bot='Hot&nbsp;Bot&nbsp;search';}
else if (strstr($_SERVER['HTTP_USER_AGENT'], 'WebCrawler')){$bot='WebCrawler&nbsp;search';}
else if (strstr($_SERVER['HTTP_USER_AGENT'], 'ZyBorg')){$bot='Wisenut&nbsp;search';}
else if (strstr($_SERVER['HTTP_USER_AGENT'], 'scooter')){$bot='AltaVista';}  
else if (strstr($_SERVER['HTTP_USER_AGENT'], 'StackRambler')){$bot='Rambler';}  
else if (strstr($_SERVER['HTTP_USER_AGENT'], 'Aport')){$bot='Aport';}  
else if (strstr($_SERVER['HTTP_USER_AGENT'], 'lycos')){$bot='Lycos';}  
else if (strstr($_SERVER['HTTP_USER_AGENT'], 'WebAlta')){$bot='WebAlta';}
else if (strstr($_SERVER['HTTP_USER_AGENT'], 'yahoo')){$bot='Yahoo';}
else if (strstr($_SERVER['HTTP_USER_AGENT'], 'msnbot')){$bot='msnbot/1.0';}
else if (strstr($_SERVER['HTTP_USER_AGENT'], 'ia_archiver')){$bot='Alexa search engine';}
else if (strstr($_SERVER['HTTP_USER_AGENT'], 'FAST')){$bot='AllTheWeb';}

Read the rest of this entry »

How to change chmod for folders and files recursively?

December 9th, 2008

chmod for all sub folders 4770, also for siles 660 …

1
2
find /path -type f -exec chmod 660 {} \;
find /path -type d -exec chmod 4770 {} \;