- 1
- 2
Вообще-то HTML и CSS, но вот на это ругается валидатор:
<b class="r10"></b><b class="r7"></b><b class="r5"></b><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r2"></b><b class="r1"></b><b class="r1"></b><b class="r1"></b>
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+23
Вообще-то HTML и CSS, но вот на это ругается валидатор:
<b class="r10"></b><b class="r7"></b><b class="r5"></b><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r2"></b><b class="r1"></b><b class="r1"></b><b class="r1"></b>
Дизайн - базарунет, но повтыкайте там хотя б пробелы
+23
<?php
class Admin_ClientsController extends Page_Controller_Admin
{
protected $_idMenu = 20;
public function init()
{
parent::init();
}
public function indexAction()
{
$this->view->scripts[] = 'jquery';
$this->view->scripts[] = 'jquery.center';
$tClients = new Db_Table_Clients();
$this->view->clients = $tClients->fetchAll('confirm = 0', 'name ASC');
$this->view->countConfirmedClients = $tClients->fetchAll('confirm = 1')->count();
$this->renderScript('body.phtml');
}
public function actionAction()
{
if ($this->_request->isPost()) {
$clientId = $this->_request->getPost();
$action = $clientId['action'];
$tClients = new Db_Table_Clients();
unset($clientId['action']);
foreach($clientId as $key => $value) {
echo $value;
if ($action == 'confirm') {
$tClients->update(array('confirm' => 1), 'id = ' . $value);
$client = $tClients->fetchRow('id = ' . $value);
$this->view->dealer = new Zend_Mail('windows-1251');
$mail = new Zend_Mail('windows-1251');
$mail->addTo($this->view->dealer->email);
$mail->setFrom('[email protected]', '');
$mail->setSubject('Регистрация нового дилера на сайте компании Оконные технологии');
$mail->setBodyHtml($this->view->render('clients/email.phtml'), 'windows-1251', Zend_Mime::ENCODING_8BIT);
//$tr = new Zend_Mail_Transport_Smtp('mail.hostland.ru');
//Zend_Mail::setDefaultTransport($tr);
try {
$mail->send();
} catch (Exception $e)
{
}
} elseif ($action == 'delete') {
$tClients->delete('id = ' . $value);
} elseif ($action == 'allow') {
$tClients->update(array('access' => 1), 'id = ' . $value);
} elseif ($action == 'denied') {
$tClients->update(array('access' => 0), 'id = ' . $value);
}
}
$this->_redirect($_SERVER['HTTP_REFERER']);
}
$this->_redirect('/admin/clients/');
}
public function confirmAction()
{
if ($this->_request->isPost()) {
$clientId = $this->_request->getPost();
var_dump($clientId);
$tClients = new Db_Table_Clients();
foreach($tClients as $key => $value) {
$tClients->update(array('confirm' => 1), 'id = ' . $value);
}
}
//$this->_redirect('/admin/clients/');
}
public function editAction()
{
$id = $this->_request->getParam('id');
if ($id == null) {
return $this->_redirect('/admin/clients/');
}
$tClients = new Db_Table_Clients();
if ($this->_request->isXmlHttpRequest()) {
$this->view->client = $tClients->fetchRow('id = ' . $id);
} elseif ($this->_request->isPost()) {
$name = $this->_request->getPost('name', '');
$login = $this->_request->getPost('login', '');
$password = $this->_request->getPost('password', '');
$description = $this->_request->getPost('description');
$email = $this->_request->getPost('email');
$access = $this->_request->getPost('access', 0);
if ($name == null or $password == null) {
$messager = new Zend_Session_Namespace('messager');
$messager->error = 'Поле «Имя» и «Пароль» должны быть заполнены';
} else {
+23
if not MultiThread then
begin
GetName(@rec);
result:=rec.fname;
end
else
begin
hThread:=CreateThread(0,0,@GetName,@rec,0,tmp);
if WaitForSingleObject(hThread,100)=WAIT_TIMEOUT then
TerminateThread(hThread,0)
else
result:=rec.fname;
CloseHandle(hThread);
end;
Дельфисты - ущербные люди......
+23
long gr, ri, r1, r2, y, z, z_rev;
for (i = 2; i < qr_count; i++) {
step = 0;
ri = r[i];
gr = - mpz_fdiv_ui(lowM, pm[i][step]);
r1 = gr + ri;
r2 = gr + pm[i][step] - ri;
if (r1 < 0) {
r1 += pm[i][step];
}
if (r2 < 0) {
r2 += pm[i][step];
}
while (r1 < (long) Ml2) {
sieve[r1][i] += 1;
r1 += pm[i][step];
}
while (r2 < (long) Ml2) {
sieve[r2][i] += 1;
r2 += pm[i][step];
}
for (step = 1; step < degr[i]; step++) {
gr = - mpz_fdiv_ui(lowM, pm[i][step]);
y = ri*ri;
y -= Npm[i][step];
y = y/( (long) pm[i][step-1]);
if (y < 0) { y += pm[i][step]; }
z_rev = (ri<<1) % QR[i];
//?IOOA?EOO ?OI?AOEO IA UAAEEIE?AIEA
if (z_rev == 0) { y = 0; }
else {
z = 1;
while ((z_rev*z % QR[i]) != 1) { z++;}
y *= z*pm[i][step-1];
y = y % pm[i][step];
}
ri -= y;
if (ri < 0) { ri += pm[i][step]; }
r1 = gr+ri;
r2 = gr+pm[i][step]-ri;
if (r1 < 0) { r1 += pm[i][step]; }
if (r2 < 0) { r2 += pm[i][step]; }
while (r1 < (long) Ml2) {
sieve[r1][i] += 1;
r1 += pm[i][step];
}
while (r2 < (long) Ml2) {
sieve[r2][i] += 1;
r2 +=pm[i][step];
}
}
}
Когда лучше, чтобы кода не было, чем, чтобы он был...
+22.9
$ot=$_GET['ot'];
$do=$_GET['do'];
if (($ot == "") OR ($do == ""))
{
$ot = $ot+1-1; $do = $do+1-1;
if ($do < $ot) { die("Условие задано не верно!");}
}
Ещё один говнокод от nod'а
+22.9
$result = mysql_query("SELECT * FROM `Wallpapers` WHERE `Title` = '".$Title."'");
$row = mysql_fetch_assoc($result);
$wID=$row['ID'];
$Wallpaper1=$row['Wallpaper1'];
$Wallpaper2=$row['Wallpaper2'];
$Wallpaper3=$row['Wallpaper3'];
$Wallpaper4=$row['Wallpaper4'];
$Wallpaper5=$row['Wallpaper5'];
if ( $_SESSION['userid'] )
{
if ($Wallpaper1 != NULL) {
$size='';
$size=getimagesize("images/wallpapers/".$Wallpaper1);
$dHTML .= '<a class="preview" href="'.$image_path.'show/'.$Title.'/?w=1" style="text-decoration: underline;" onClick="alerts('.$wID.'); countIp();">'.$size[0].'x'.$size[1].'</a> ';
}
if ($Wallpaper2 != NULL) {
$size='';
$size=getimagesize("images/wallpapers/".$Wallpaper2);
$dHTML .= '<a class="preview" href="'.$image_path.'show/'.$Title.'/?w=2" style="text-decoration: underline;" onClick="alerts('.$wID.'); countIp();">'.$size[0].'x'.$size[1].'</a> ';
}
if ($Wallpaper3 != NULL) {
$size='';
$size=getimagesize("images/wallpapers/".$Wallpaper3);
$dHTML .= '<a class="preview" href="'.$image_path.'show/'.$Title.'/?w=3" style="text-decoration: underline;" onClick="alerts('.$wID.'); countIp();">'.$size[0].'x'.$size[1].'</a> ';
}
if ($Wallpaper4 != NULL) {
$size='';
$size=getimagesize("images/wallpapers/".$Wallpaper4);
$dHTML .= '<a class="preview" href="'.$image_path.'show/'.$Title.'/?w=4" style="text-decoration: underline;" onClick="alerts('.$wID.'); countIp();">'.$size[0].'x'.$size[1].'</a> ';
}
if ($Wallpaper5 != NULL) {
$size='';
$size=getimagesize("images/wallpapers/".$Wallpaper5);
$dHTML .= '<a class="preview" href="'.$image_path.'show/'.$Title.'/?w=5" style="text-decoration: underline;" onClick="alerts('.$wID.'); countIp();">'.$size[0].'x'.$size[1].'</a> ';
}
}
+22.8
$year=date('y');
$y=date('Y');
$month=date('M');
$day=date('d');
$dayofmonth=date('D');
print "Today is $day $month $y, $dayofmonth.";
if($month=="Apr" || $month=="Jun" || $month=="Sep" || $month=="Nov")
{ $maxday=30; }
else if($month=="Feb")
{ if($year % 4) { $maxday=28; } else { $maxday=29; } }
else
{ $maxday=31; }
#print "Current month consist of $maxday days.\n";
#Для высокосных годов
if($year=="04" || $year=="32" | $year=="60" || $year=="88")
{ if($month=="Jan" || $month=="Apr" || $month=="Jul")
{ $fd=4; }
else if($month=="Feb" || $month=="Avg")
{ $fd=0; }
else if($month=="Mar" || $month=="Nov")
{ $fd=1; }
else if($month=="May")
{ $fd=6; }
else if($month=="Jul")
{ $fd=2; }
else if($month=="Sep" || $month=="Dec")
{ $fd=3; }
else if($month=="Oct")
{ $fd=5; }
}
// и так далее :)
Реализация календаря :)
+22.6
var newstr = null;
var lastnewstr = null;
var newclass = null;
var lastclass = null;
var newstr2 = null;
var lastnewstr2 = null;
var newclass2 = null;
var lastclass2 = null;
var newstr3 = null;
var lastnewstr3 = null;
var newclass3 = null;
var lastclass3 = null;
function check(s, i)
{
p1 = document.getElementById("id_1_"+i);
p2 = document.getElementById("id_2_"+i);
if (s!=lastnewstr)
{
newclass2 = p1.className;
newclass3 = p2.className;
newclass = s.className;
s.className="check";
p1.className="viz";
p2.className="viz";
if (lastnewstr!=null)
{
lastnewstr.className=lastclass;
lastnewstr2.className=lastclass2;
lastnewstr3.className=lastclass3;
}
}
lastnewstr = s;
lastnewstr2 = p1;
lastnewstr3 = p2;
lastclass = newclass;
lastclass2 = newclass2;
lastclass3 = newclass3;
}
Убожество которое на одной строке меняет у <tr> стиль и еще у двух элементов...
+22.5
<?
echo "<title>NNtime Proxy List</title>";
function proxylist($site){
$source=file_get_contents($site);
preg_match_all("/[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}:[0-9]{2,4}/",$source,$matched);
return $matched[0];
}
$array=proxylist("http://www.nntime.com");
foreach($array as $tek){
$tek=str_replace("
","",$tek);
print $tek."<br>";
}
?>
+22.3
if ($_POST['id']) {
$id = $_POST['id'];
} elseif ($_GET['id']) {
$id = $_GET['id'];
}
if (isset($_POST['password'])) {
$password = md5($_POST['password']);
} elseif (isset($_GET['password'])) {
$password = md5($_GET['password']);
}