- 1
empty ( $php->p['h']{'p'}{'p'}['h']->p );Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+158
empty ( $php->p['h']{'p'}{'p'}['h']->p );
+158
$result_max = mysql_query("SELECT MAX(id)+1 as max FROM cms_competition;");
$row_max = mysql_fetch_object($result_max);
if(!$row_max->max)
      $row_max->max = 1;Так ведь проще
+158
if (xmasCard.isTablet)
        {
            if (xmasCard.orient === "portrait")
            {
                addPositionItems = 2;
                if (myX === 0)
                {
                    myX = (window.innerWidth - parseInt($("#snowManNaked").css("width").split("px")[0])) / 2;
                }
            }
            else if (xmasCard.orient === "landscape")
            {
                addPositionItems = 1.1933174224343675417661097852029;
                if (myX === 0)
                {
                    myX = (window.innerWidth - parseInt($("#snowManNaked").css("width").split("px")[0])) / 2;
                }
            }
        }Код от колумбийских аутсорсеров. На вопрос "а что это за волшебное число такое" был дан ответ - "more numbers you put more precise it gets on all screens".
+158
public static function getAssoc($constBlock,$const){
        if (defined($constBlock)){
            $arLabels = unserialize($const);
            $assoc = array(
                $arLabels['news_day'] => array(
                    'img' => array(
                        0 => array(
                            'class' => 'sticker infoBlock news_of_day',
                            'big' => '/static/img/labels/news_of_day.png',
                            'small' => '/static/img/labels/news_of_day_s.png'
                        ),
                        /*1 => array(
                            'class' => 'sticker news_of_day_r',
                            'big' => '/static/img/labels/news_of_day_r.png',
                            'small' => '/static/img/labels/news_of_day_s_r.png'
                        ),*/
                    )
                ),
                $arLabels['hot'] => array(
                    'img' => array(
                        0 => array(
                            'class' => 'sticker hot infoBlock',
                            'big' => '/static/img/labels/hot.png',
                            'small' => '/static/img/labels/hot_s.png'
                        )
                    )
                ),
                $arLabels['gossip'] => array(
                    'img' => array(
                        0 => array(
                            'class' => 'sticker infoBlock gossip',
                            'big' => '/static/img/labels/gossip.png',
                            'small' => '/static/img/labels/gossip_s.png'
                        )
                    )
                ),
                $arLabels['thing_of_week'] => array(
                    'img' => array(
                        0 => array(
                            'class' => 'sticker thing_of_week infoBlock',
                            'big' => '/static/img/labels/thing_of_week.png',
                            'small' => '/static/img/labels/thing_of_week_s.png'
                        )
                    )
                ),
                ...
                ...
                ...
                ...
                ...
                $arLabels['new_role'] => array(
                    'img' => array(
                        0 => array(
                            'class' => 'sticker new_role infoBlock',
                            'big' => '/static/img/labels/new_role.png',
                            'small' => '/static/img/labels/new_role_s.png'
                        )
                    )
                )
            );
        }
        return $assoc;
    }Так пишут "грамотные разработчики на битриксе" (они знают неймспейсы). Естественно, что все методы в классах должны быть статическими. Это по-битриксовому, значит правильно. Заполнение массива ChinaStyle, т.е. вручную - это тоже правильно, ибо тоже по-битриксовому. И конечно же, вся эта НЁХ должна храниться в текущем методе. "Циклы? Нет, не слышали... Запросы к базе данных? Битрикс говорит, что это плохо, поэтому мы с уверенностью эти лекции проебали. Зато мы знаем неймспейсы!"
+158
$(document).ready(function () {
		$("#FollowingChoicesWebpart-ProjectsAndCommunities").hide();
		$("#FollowingChoicesWebpart-Sites").hide();
		$("#FollowingChoicesWebpart-News").show();
	});
	$("#FChoices_tab1").click(function () {
		$("#FollowingChoicesWebpart-ProjectsAndCommunities").hide();
		$("#FollowingChoicesWebpart-Sites").hide();
		$("#FollowingChoicesWebpart-News").show();
		$("#FChoices_tab1").addClass("active-button_FChoices");
		$("#FChoices_tab2").removeClass("active-button_FChoices");
		$("#FChoices_tab3").removeClass("active-button_FChoices");
	});
	$("#FChoices_tab2").click(function () {
		$("#FollowingChoicesWebpart-ProjectsAndCommunities").hide();
		$("#FollowingChoicesWebpart-Sites").show();
		$("#FollowingChoicesWebpart-News").hide();
		$("#FChoices_tab1").removeClass("active-button_FChoices");
		$("#FChoices_tab2").addClass("active-button_FChoices");
		$("#FChoices_tab3").removeClass("active-button_FChoices");
	});
	$("#FChoices_tab3").click(function () {
		$("#FollowingChoicesWebpart-ProjectsAndCommunities").show();
		$("#FollowingChoicesWebpart-Sites").hide();
		$("#FollowingChoicesWebpart-News").hide();
		$("#FChoices_tab1").removeClass("active-button_FChoices");
		$("#FChoices_tab2").removeClass("active-button_FChoices");
		$("#FChoices_tab3").addClass("active-button_FChoices");
	});
	$("#FChoices_tab3").click(function () {
		$("#FollowingChoicesWebpart-ProjectsAndCommunities").hide();
		$("#FollowingChoicesWebpart-Sites").hide();
		$("#FollowingChoicesWebpart-News").hide();
		$("#FChoices_tab1").removeClass("active-button_FChoices");
		$("#FChoices_tab2").removeClass("active-button_FChoices");
		$("#FChoices_tab3").addClass("active-button_FChoices");
	});Голландский джаваскриптик для реализации функционала Tabs. Видимо, написано под кумаром)))
+158
try {
...
} catch ( Exception $e ) {
    throw new Exception( $e->getMessage() );
}Словили исключение и послали его дальше.
+158
function addGetParam($key,$value){
    $_GET[$key]=$value;
}В аду найдется специальное место для таких :-)
+158
if ($showwindows*1 == 0) { $content->set('hidden','hidden'); }
+158
this.startAdLoading = function(callback) {
this.adCallback = callback;
Array.prototype.remove = function(from, to) {
  var rest = this.slice((to || from) + 1 || this.length);
  this.length = from < 0 ? this.length + from : from;
  return this.push.apply(this, rest);
};
...
}Очень полезный метод добавили массивам. Все тот же источник.
+158
<?php
class Digits {
  //Convert digits to negative
  public static function toNegative($num) {
    return '-' . $num;
  }
}
            CRM система, очень дорогая
ПХП хоть само по себе стремное, но я бы даже до такого не додумался
Основная функция системы: анализ и рассчеты
Они еще жалуются что оно плохо считает
Интересно а что же будет если ему передать -10 например ? --10 :)
Чем не устраивает: 
function toNegative($num) {
	return ($num > 0) ? -1 * $num : $num;
}