- 1
$istmount = mysql_num_rows(mysql_query("SELECT `cid` FROM `usermail` WHERE `date` >='".date('Y-m-d', strtotime('-1 month'))."'"));
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+61
$istmount = mysql_num_rows(mysql_query("SELECT `cid` FROM `usermail` WHERE `date` >='".date('Y-m-d', strtotime('-1 month'))."'"));
Подсчет количества подписчиков за прошлый месяц. Про count(*) автор, похоже, не в курсе...
И, чтобы не было вопросов про формат поля даты:
date - это varchar(11) :)
+61
$translitReplace=array(array('.', ',', ' ', 'а', 'б', 'в', 'г', 'д', 'е', 'ё', 'ж', 'з', 'и', 'й', 'к', 'л', 'м', 'н', 'о', 'п', 'р', 'с', 'т', 'у', 'ф', 'х', 'ц', 'ч', 'ш', 'щ', 'ъ', 'ы', 'ь', 'э', 'ю', 'я'),
array('', '', '-', 'A', 'B', 'V', 'G', 'D', 'E', 'JO', 'ZH', 'Z', 'I', '', 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S', 'T', 'U', 'F', 'KH', 'C', 'CH', 'SH', 'SHH', '', 'Y', '', 'E', 'JU', 'JA'));
if(!$_POST['uriNews']) $_POST['uriNews']=strtolower(str_replace($translitReplace[0], $translitReplace[1], mb_strtolower($_POST['titleNews'], 'utf-8')));
Личное творчество. :)
Это когда начальник грозно дышит в ухо "гдебля", ты отвечаешь "щабля", ударяешься оземь и оборачиваешься птицей с радостным "вобля", а потом смотришь собственный код и думаешь "нубля".
+61
if (empty($columns)) {
$columns = 'eleven';
} else {
// Check the function for a returned variable
// (от автора) КОГО КОГО МЫ ТАМ ЧЕКАЕМ??
$columns = $columns;
}
Найдено в достойном шаблоне Skeleton для WordPress
/(. . )
+61
$site->Radio('showin[]', 'ALL_EXCEPT', in_array('ALL_EXCEPT',$showin) or !in_array('ALL_EXCEPT', $showin) )
http://upload.wikimedia.org/wikipedia/ru/math/f/6/d/f6db44e1aa2287204b26130ac9e4fe90.png как бэ
+61
foreach($combinations as $combination){
$buffer = array();
if(count($combination)){
if(is_numeric($combination[0])){
$a_cnt = count($words[$combination[0]]);
for($a=0;$a<$a_cnt;$a++){
if(is_numeric($combination[1])){
$b_cnt = count($words[$combination[1]]);
for($b=0;$b<$b_cnt;$b++){
if(is_numeric($combination[2])){
$c_cnt = count($words[$combination[2]]);
for($c=0;$c<$c_cnt;$c++){
if(is_numeric($combination[3])){
$d_cnt = count($words[$combination[3]]);
for($d=0;$d<$d_cnt;$d++){
if(is_numeric($combination[4])){
$e_cnt = count($words[$combination[4]]);
for($e=0;$e<$e_cnt;$e++){
if(is_numeric($combination[5])){
$f_cnt = count($words[$combination[5]]);
for($f=0;$f<$f_cnt;$f++){
if(is_numeric($combination[6])){
$g_cnt = count($words[$combination[6]]);
for($g=0;$g<$g_cnt;$g++){
if(is_numeric($combination[7])){
$h_cnt = count($words[$combination[7]]);
for($h=0;$h<$h_cnt;$h++){
if(is_numeric($combination[8])){
$i_cnt = count($words[$combination[8]]);
for($i=0;$i<$i_cnt;$i++){
if(is_numeric($combination[9])){
$j_cnt = count($words[$combination[9]]);
for($j=0;$j<$j_cnt;$j++){
$buffer[] = $words[$combination[0]][$a]
.' '.$words[$combination[1]][$b]
.' '.$words[$combination[2]][$c]
.' '.$words[$combination[3]][$d]
.' '.$words[$combination[4]][$e]
.' '.$words[$combination[5]][$f]
.' '.$words[$combination[6]][$g]
.' '.$words[$combination[7]][$h]
.' '.$words[$combination[8]][$i]
.' '.$words[$combination[9]][$j];
}}
else{
$buffer[] = $words[$combination[0]][$a]
.' '.$words[$combination[1]][$b]
.' '.$words[$combination[2]][$c]
.' '.$words[$combination[3]][$d]
.' '.$words[$combination[4]][$e]
.' '.$words[$combination[5]][$f]
.' '.$words[$combination[6]][$g]
.' '.$words[$combination[7]][$h]
.' '.$words[$combination[8]][$i];
}
}}
else{
$buffer[] = $words[$combination[0]][$a]
.' '.$words[$combination[1]][$b]
.' '.$words[$combination[2]][$c]
.' '.$words[$combination[3]][$d]
.' '.$words[$combination[4]][$e]
.' '.$words[$combination[5]][$f]
.' '.$words[$combination[6]][$g]
.' '.$words[$combination[7]][$h];
}
}}
else{
$buffer[] = $words[$combination[0]][$a]
.' '.$words[$combination[1]][$b]
.' '.$words[$combination[2]][$c]
.' '.$words[$combination[3]][$d]
.' '.$words[$combination[4]][$e]
.' '.$words[$combination[5]][$f]
.' '.$words[$combination[6]][$g];
}
}}
else{
$buffer[] = $words[$combination[0]][$a]
.' '.$words[$combination[1]][$b]
.' '.$words[$combination[2]][$c]
.' '.$words[$combination[3]][$d]
.' '.$words[$combination[4]][$e]
.' '.$words[$combination[5]][$f];
}
}}
else{
$buffer[] = $words[$combination[0]][$a]
.' '.$words[$combination[1]][$b]
.' '.$words[$combination[2]][$c]
.' '.$words[$combination[3]][$d]
.' '.$words[$combination[4]][$e];
}
}}
else{
$buffer[] = $words[$combination[0]][$a]
.' '.$words[$combination[1]][$b]
.' '.$words[$combination[2]][$c]
.' '.$words[$combination[3]][$d];
}
Вот такой вот кусок кода, к стати весь не поместился, я нашел в самописном движке, на котором моему знакомому сделали корпоративный сайт на 30 страниц. Бюджет был больше 2к зелени.
+61
@list($o, $isp, $online) = @explode(":", $p107);
от туда же классика жанра
+61
class admin_payment {
// ...
}
$m = 'admin_payment';
$$m = new $m();
$m->get();
отборно.
+61
FILE *h=fopen(fileDMB, "r");
char *fileDMBtext;
while(fileDMBtext=fgetc(h)!=EOF){return 0;}
Я даже знаю компилятор в котором это работает.
+61
function Dec2Hex V =
(
local H
if V == 0 then H = "00"
else if V == 1 then H = "01"
else if V == 2 then H = "02"
/* и так далее до 253 */
else if V == 254 then H = "FE"
else if V == 255 then H = "FF"
)
Очень плохой, индусский способ реализации Decimal to Hex конверсии.
+61
<html>
<head>
<title>В Контакте | Страницы юзера</title>
<style type="text/css">
body{
background: black;
color: #D1D1D1;
font-family: "Trebuchet MS", Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 1.2em;
}
div.body{
margin-left: auto;
margin-right: auto;
width: 520px;
}
a{color: #D1D1D1; text-decoration: none;}
a:hover{color: #3e9af2; text-decoration: underline;}
li{white-space: nowrap; list-style: none;}
input{
background: black;
color: #D1D1D1;
border:none;
border-bottom: 1px dotted #D1D1D1;
font-family: "Trebuchet MS", Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 1.2em;
margin-bottom: -2px;
}
</style>
<script type="text/javascript">
<!--//
function set_id(){
var user_id_1 = document.getElementById('user_id').value.replace(/[^\d]/g, "");
var user_id_2 = user_id_1 + '&' + Math.round(Math.random() * 999999);
var user_links = '';
user_links += '<ul>';
user_links += ' <li><a href="http://vkontakte.ru/id' + user_id_1 + '?' + Math.round(Math.random() * 999999) + '" target="_blank">Главная страница</a></li>';
user_links += ' <li>';
user_links += ' <a href="http://vkontakte.ru/wall.php?id=' + user_id_2 + '" target="_blank">Стена</a>';
user_links += ' <ul>';
user_links += ' <li><a href="http://vkontakte.ru/wall.php?act=write&id=' + user_id_2 + '" target="_blank">Оставить сообщение</a></li>';
user_links += ' <li><a href="http://vkontakte.ru/graffiti.php?act=draw&to_id=' + user_id_2 + '" target="_blank">Оставить графити</a></li>';
user_links += ' <li><a href="http://vkontakte.ru/photos.php?to_id=' + user_id_2 + '" target="_blank">Оставить фото</a></li>';
user_links += ' <li><a href="http://vkontakte.ru/video.php?to_id=' + user_id_2 + '" target="_blank">Оставить видио</a></li>';
user_links += ' <li><a href="http://vkontakte.ru/audio.php?to_id=' + user_id_2 + '" target="_blank">Оставить аудио</a></li>';
user_links += ' </ul>';
user_links += ' </li>';
user_links += ' <li><a href="http://vkontakte.ru/mail.php?act=write&to=' + user_id_2 + '" target="_blank">Отправить сообщение</a></li>';
user_links += ' <li><a href="http://vkontakte.ru/friend.php?id=' + user_id_2 + '" target="_blank">Друзья</a></li>';
user_links += ' <li><a href="http://vkontakte.ru/photos.php?id=' + user_id_2 + '" target="_blank">Альбомы</a></li>';
user_links += ' <li><a href="http://vkontakte.ru/photos.php?act=user&id=' + user_id_2 + '" target="_blank">Фото с юзером</a></li>';
user_links += ' <li><a href="http://pda.vkontakte.ru/taggedphotos' + user_id_1 + '" target="_blank">Фото с юзером, если надо посмотреть скрытые фото</a></li>';
user_links += ' <li><a href="http://vkontakte.ru/video.php?id=' + user_id_2 + '" target="_blank">Видeо</a></li>';
user_links += ' <li><a href="http://vkontakte.ru/questions.php?mid=' + user_id_2 + '" target="_blank">Вопросы</a></li>';
user_links += ' <li><a href="http://vkontakte.ru/notes.php?id=' + user_id_2 + '" target="_blank">Заметки</a></li>';
user_links += ' <li><a href="http://vkontakte.ru/apps.php?mid=' + user_id_2 + '" target="_blank">Приложения</a></li>';
user_links += ' <li><a href="http://vkontakte.ru/groups.php?mid=' + user_id_2 + '" target="_blank">Группы</a></li>';
user_links += '</ul>';
document.title = 'В Контакте | Страницы юзера id' + user_id_1;
document.getElementById('user_id').value = user_id_1;
document.getElementById('user_pages').innerHTML = user_links;
}
//-->
</script>
</head>
<body onLoad="set_id()">
<div class="body">
Страницы юзера id<input name="user_id" id="user_id" type="text" value="1" onKeyUp="set_id()" onKeyPress="set_id()" onPaste="set_id()">
<div id="user_pages"></div>
<noscript><p align="center">Ипать))) ... ктож а таком старье сидит)....<br />Включи JavaScript!</p></noscript>
<p align="center">by Dr.Freez</p>
</div>
</body>
</html>
говницо)))