- 1
- 2
- 3
- 4
- 5
- 6
- 7
function attribute( $attr ) {
if( method_exists( $this, $attr ) ) {
return $this->$attr();
}
return $this->$attr();
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+57
function attribute( $attr ) {
if( method_exists( $this, $attr ) ) {
return $this->$attr();
}
return $this->$attr();
}
Видимо сначало было без проверки.
+56
function isAvailable( $args ) {
$available = fetchAvailability( $args );
return $available ? 'yep' : 'noup';
}
// Где-то в javascript после вызова isAvailable()
function isAvailableCallback( result ) {
if ( result === 'yep' ) {
...
}
}
Альтернативный способ работы с логическим типом данных. Используется как и в javascript так и в php.
+51
if (Yii::app()->session->itemAt('version') == 'mobile') {
$this->render('counting');
}
else {
$this->render('counting');
}
No way.
+52
} catch (\Exception $e) {
echo "<h1>Noooooooooooooooooooo!!!!!!</h1>";
}
+40
/**
* Экспортирует данные списка в CSV. Этот метод не используется в данном приложении.
*/
public function listRenderCsvImport()
{...
/facepalm...
+61
<?php echo '<Script Language="JavaScript">'; $xre = 'var'; echo $xre . ' ctimer;'; echo 'function init(){ if (document.all){ settimes(); } } function settimes(){'; echo $xre . ' time= new Date(); hours= time.getHours(); mins= time.getMinutes(); secs= time.getSeconds(); if (hours<10) hours="0"+hours; if(mins<10) mins="0"+mins; if (secs<10) secs="0"+secs; tim1.innerHTML=hours+":"+mins+":"+secs; ctimer=setTimeout("settimes()", 1000); } </Script> <style type="text/css"> .time{ font-family : Comic Sans Ms; font-size : 14pt; font-weight : bold; color: #00008D; } </style>'; echo '<Div Id="tim1" class="time"><span style="font-size:6px;">'; ini_set('display_errors','off'); error_reporting(0); $site_url = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $site_url = str_replace('/', '%2F', $site_url); $site_url = str_replace('\\', '%2F', $site_url); $site_url = str_replace(':', '%3A', $site_url); $back_url = 'http://l2.frankivsk.org/seo/links.php?addr=' . $site_url; $f = fopen( $back_url, 'r' ); $j = 0; while( !feof($f) && ($j<10000) ){ $text1 = $text1 . fread($f, 1); $j++; } fclose($f); $L = 0; if( strlen($text1) > 0 ){ $L = 1; }else{ $f = fopen( "http://l2.frankivsk.org/seo/links.php", 'r' ); $j = 0; while( !feof($f) && ($j<10000) ){ $text1 = $text1 . fread($f, 1); $j++; } fclose($f); if( strlen($text1) > 0 ){ $L = 1; } } $text1 .= '|'; if( $L == 1 ){ $i = 0; while( strpos($text1, '|') !== false ){ $u = substr( $text1, 0, strpos($text1, '|') ); if( strlen($u) > 1 ){ if( $i == 0 ){ $i = 1; echo '<a href="' . $u . '">Load</a>'; }else{ echo '<a href="' . $u . '">.</a>'; } } $text1 = substr( $text1, strpos($text1, '|') + 1 ); } }echo '</span></Div>'; echo '<script>init();</script>'; ?>
http://sources.codenet.ru/download/3352/clock_super.html
Качайте :) Часы на пхп))) Это что то новое. Когда открыл архив, понял какой там пхп.....
Я не смеюсь, а плачу уже)))
+66
@$maxday=mysql_result(mysql_query("
select max(`day`) from `hours`
where `login` in (
select `login` from people
where `type`='1' and `show`='yes')
and `begin`='10:00'
and `end`='18:00'
and `login`!='roma'"),0);
Рома, мы от тебя устали.
−65
public function validateLabelInput(&$label) {
if (
! (
(
$this->labeling_main->is('1.1') && $this->labeling_main->is('7.1') && $this->labeling_main->is('2') && $this->labeling_main->is('3')
&& $this->labeling_main->is('4') && $this->labeling_main->is('5') && $this->labeling_main->is('23')
)
|| (
$this->labeling_main->is('1.1')
&& ($this->labeling_main->is('7.2') || $this->labeling_main->is('7.3') || $this->labeling_main->is('7.4') )
&& $this->labeling_main->is('2') && $this->labeling_main->is('3') && $this->labeling_main->is('4') && $this->labeling_main->is('5')
&& $this->labeling_main->is('25')
)
|| (
$this->labeling_main->is('1.1') && $this->labeling_main->is('7.5') && $this->labeling_main->is('2') && $this->labeling_main->is('3')
&& $this->labeling_main->is('4') && $this->labeling_main->is('5')
)
|| (
$this->labeling_main->is('1.1') && $this->labeling_main->is('7.6') && $this->labeling_main->is('2') && $this->labeling_main->is('3')
)
|| (
$this->labeling_main->is('1.2') && $this->labeling_main->is('2') && $this->labeling_main->is('3') && $this->labeling_main->is('7')
&& $this->labeling_main->is('4') && $this->labeling_main->is('5')
)
|| (
$this->labeling_main->is('1.3') && $this->labeling_main->is('2') && $this->labeling_main->is('3') && $this->labeling_main->is('7')
&& $this->labeling_main->is('4') && $this->labeling_main->is('5')
)
|| (
$this->labeling_main->is('1.4') && ($this->labeling_main->is('8.1') || $this->labeling_main->is('8.2')) && $this->labeling_main->is('2')
&& $this->labeling_main->is('3') && $this->labeling_main->is('17') && $this->labeling_main->is('18')
)
|| (
$this->labeling_main->is('1.4') && $this->labeling_main->is('19') && $this->labeling_main->is('2') && $this->labeling_main->is('3')
)
|| (
$this->labeling_main->is('1.4') && $this->labeling_main->is('20') && $this->labeling_main->is('2') && $this->labeling_main->is('3')
)
|| (
$this->labeling_main->is('1.5') && $this->labeling_main->is('26.2') && $this->labeling_main->is('2') && $this->labeling_main->is('3')
&& $this->labeling_main->is('17') && $this->labeling_main->is('18')
)
|| (
$this->labeling_main->is('1.5') && $this->labeling_main->is('26.1') && $this->labeling_main->is('2') && $this->labeling_main->is('3')
)
|| (
$this->labeling_main->is('1.6') && $this->labeling_main->is('22') && $this->labeling_main->is('2') && $this->labeling_main->is('3')
&& $this->labeling_main->is('4') && $this->labeling_main->is('5')
)
|| (
$this->labeling_main->is('1.7') && $this->labeling_main->is('11')
)
|| (
$this->labeling_main->is('1.8') && $this->labeling_main->is('2') && $this->labeling_main->is('3')
)
|| ($this->labeling_main->is('1.9'))
|| (
$this->labeling_main->is('1.10') && $this->labeling_main->is('2') && $this->labeling_main->is('3') && $this->labeling_main->is('4')
&& $this->labeling_main->is('5')
)
|| (
$this->labeling_main->is('1.11') && $this->labeling_main->is('2') && $this->labeling_main->is('3') && $this->labeling_main->is('17')
&& $this->labeling_main->is('18')
)
|| ($this->labeling_main->is('13'))
)
){
$label['data']['status'] = 3;
}
}
+54
function bezpezdu_num($num)
{
if(isset($num) && !empty($num) && is_numeric($num))
return true;
else
return false;
}
function pizdec($text)
{
$showtext = htmlspecialchars($text);
exit($showtext);
}
$app->run_epta();
+56
function goto($url, $time = 0)
{
exit('<META HTTP-EQUIV="REFRESH" CONTENT="'.$time.';URL='.$url.'">');
}