"PHP" / Говнокод #169 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
echo '
Путина - в волгу!
Зубкова - на ВАЗ!
Только потом 
Принимайтесь за нас!';

print'<a href="http://news.drom.ru/11803.html">ВВП в ОКУ!</a>';

Страна идиотов! Да кому усрался этот отечественный автопром! На нем ездить страшно!

guest guest, (Updated )

Комментарии (21, +21)

"PHP" / Говнокод #168 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
// country
if($user_country) {
	$where .= '(tbl_publications.id_country = '.$user_country;
	// city
	if($user_city) {
		$where .= ' OR tbl_publications.id_city = '.$user_city;
	}
	$where .= ')';
}else{
	$where .= ' 1=1'; // black magic
}

черная магия.

guest guest, (Updated )

Комментарии (4, +4)

ЙажаСценарий / Говнокод #163 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
if ('Down' == 'Down')
	{
		//currentSeconds--;
		currentSeconds = PromptTimer_StartCounter - correctionTime;
		needTick = currentSeconds > 0;
		if (!needTick)
			currentSeconds = 0;
	}
	else
	{
		currentSeconds = PromptTimer_StartCounter + correctionTime;	
		
		if ('True' == 'False')
		{
			if (GetGMTOffsetInfo()[0] == "-")
				currentSeconds += -(GetGMTOffsetInfo()[1] * 3600);
			else 
				currentSeconds += GetGMTOffsetInfo()[1] * 3600;
		}
		//currentSeconds++; 
	}

Код таймера на странице задания, проект "Энкаунтер" (http://en.cx)

Posted by zerkms

zerkms zerkms, (Updated )

Комментарии (6, +6)

ЙажаСценарий / Говнокод #162 Ссылка на оригинал

0

  1. 1
<html> <head> <style type="text/css"> html, body { background-color:#000; font-family:Segoe UI, Tahoma, Arial, sans-serif; font-size:11px; color:#FFF; margin:0px; padding:0px; width:100%; height:100%; overflow:hidden; } a:link, a:visited, a:active { color:#CCC; text-decoration:underline; } a:hover { color:#F00; text-decoration:none; } #progressbar_block { width:100%; height:100%; padding-left:50%; padding-top:50%; overflow:hidden; } ul.progressbar { width:400px; height:50px; padding:0px; margin:0px; margin-left:-200px; margin-top:-25px; clear:both; list-style-type:none; } ul.progressbar li { padding:0px; margin:0px; float:left; } li.left { background-image:url(img/l_bg_n.png); background-repeat:no-repeat; width:20px; height:50px; } li.middle { background-image:url(img/m_bg_n.png); background-repeat:repeat-x; width:360px; height:50px; } li.right { background-image:url(img/r_bg_n.png); background-repeat:no-repeat; width:20px; height:50px; } </style> <script language="javascript"> function func() { var max = 400 - 16; var pixels = 400 - 16; var step = pixels/max; next(0); } function next(i) { var max = 400 - 16; var pixels = 400 - 16; var step = pixels/max; var lft = document.getElementById("left_pb"); var mid = document.getElementById("middle_pb"); var rht = document.getElementById("right_pb"); if(i < 12) lft.style.width = String(8 + i) + "px"; else lft.style.width = String(20) + "px"; if(i < pixels - 12 && i > 12) mid.style.width = String(i - 12) + "px"; else if(i > 12) mid.style.width = String(360) + "px"; else mid.style.width = String(0) + "px"; if(i > 372) rht.style.width = String(i - 372) + "px"; else if(i < 372) rht.style.width = String(0) + "px"; setTimeout("next(" + (i + step < pixels ? i + step : 0) + ")", 25); } </script> </head> <body onload="func();"> <div id="progressbar_block"> <ul class="progressbar"> <li class="left"><div id="left_pb" style="background-image:url(img/l_bg_a.png); width:8px; height:50px; overflow:hidden;"> </div></li> <li class="middle"><div id="middle_pb" style="background-image:url(img/m_bg_a.png); width:0px; height:50px; overflow:hidden;"> </div></li> <li class="right"><div id="right_pb" style="background-image:url(img/r_bg_a.png); width:0px; height:50px; overflow:hidden;"> </div></li> </ul> </div> </body> </html>

Вот так мы делаем прогресс-бары

guest guest, (Updated )

Комментарии (2, +2)

"PHP" / Говнокод #161 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
#Определяем Кому/От кого
function komu_ot_kogo($from,$type){
global $cook_login;
if($cook_login==$from){
if($type=="exit"){$komu="Куда";}
elseif($type=="enter"){$komu="Откуда";}
elseif($type=="cart"){$komu="Откуда";}
elseif($type=="back"){$komu="От кого";}
else{$komu="Кому";}}
else{$komu="От кого";}
if($type=="internet" or $type=="mobile"){$komu="Куда";}
return $komu;
}

guest guest, (Updated )

Комментарии (1, +1)

"PHP" / Говнокод #159 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
#Проверка подленности числа
function test_amount($amount)
{
$amount=str_replace(" ","",$amount);
$amount=str_replace(",",".",$amount);
if(is_numeric($amount)!=true){@error_message2("Ошибка ввода суммы!");exit();}
else{$amount=str_replace("-","",$amount);return $amount;}
}

Регулярки для лохов.

guest guest, (Updated )

Комментарии (6, +6)

"PHP" / Говнокод #157 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
#Проверяем тест браузер
function user_brouser(){
global $HTTP_USER_AGENT;
$agent=$HTTP_USER_AGENT;
if(strlen($agent)>2&&!strstr($agent,'MSIE')){$br="Netscape";}
else{if($agent!=str_replace("Opera","",$agent)){$br="Opera";}
else{$br="IE";}}
if($br!="IE"){
echo"Для корректной работы нашего ресурса требуется Internet Explorer версии не ниже 6.0 !";
exit();
}
}

Вот так вот жестко.

guest guest, (Updated )

Комментарии (5, +5)