- 1
За эту же цену:плохой запрос SELECT * FROM tur_stuff WHERE (razdel like '') AND (nal like 1) AND (price>0) AND (price >= *0.90) AND (price <= *1.1)
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+158
За эту же цену:плохой запрос SELECT * FROM tur_stuff WHERE (razdel like '') AND (nal like 1) AND (price>0) AND (price >= *0.90) AND (price <= *1.1)
Результат, который был пойман по ссылке
http://www.kant.ru/show_good1.php?t=tur_stuff&id=302960&id_ razdel=159
Хотя ссылка может в принципе работать. Радует качественная характеристика запроса ;)
+156
<?php if(isset($_GET["fullVersion"])) $_SESSION["fullVersion"]="on"; ?><?php if($_SESSION["fullVersion"]!='on' && (substr_count($_SERVER["HTTP_USER_AGENT"],'Android') || substr_count($_SERVER["HTTP_USER_AGENT"],'iPhone'))){
header("Location: /m/redirects/?withjs");
exit;
}
else if($_SESSION["fullVersion"]!='on' && substr_count($_SERVER["HTTP_USER_AGENT"],'Opera Mini')){
header("Location: /m/redirects/?operamini");
exit;
}
?><?php if($_GET["ClockId"] && $_GET["str"] && $_GET["frompartnerka"]==1){ header("Location: http://vip-timeclub.ru/catalog/articul/?ClockId=".(int)$_GET["ClockId"]."&str=2");} ?>
<?php if(function_exists('vtPrice')==false){
function vtPrice($price=0,$sale=0,$priceGold=0){
if($priceGold){
$priceOld = $price;
$price = $priceGold;
}
else if($sale){
$priceOld = $price;
$price = ceil(intval($priceOld)-((intval($priceOld)/100)*(intval($sale))));
}
else{
$priceOld = 0;
}
return array('price'=>$price,'priceOld'=>$priceOld);
}
}if(function_exists('vtPriceGood')==false){
function vtPriceGood($price){
if(intval(substr($price,-1)) > 0 && intval(substr($price,-1)) < 5)
$price = intval($price) + (5-intval(substr($price,-1)));
else if(intval(substr($price,-1)) > 5 && intval(substr($price,-1)) <= 9)
$price = intval($price) + (10-intval(substr($price,-1)));
return $price;
}
} ?>
spam, club-viptime DOT RU
+140
VK.callMethod('showPaymentBox', 1);
Есть приложение ВКонтакте (IFRAME), на него через VK.callMethod('showPaymentBox', 1); внесён 1 голос и пользователь его видит как: http://i.imgur.com/2b57c.png, т.е его можно в любой момент снять. Но как на PHP написать полное снятие этого голоса, чтобы его уже было нереально снять? Помогите, пожалуйста :)
+161
wp_list_categories('orderby=order&hide_empty=0&title_li&echo=0&exclude=13,14,19,20,21,36,37,42,43,44,45,46,47,48,70,126,127,167,75,128,129,130,131,132,133,53,68,69,134,135,136,117,118,119,168,146,120,121,122,67,150,123,142,124,54,125,149,66,104,105,144,106,107,108,55,109,110,111,112,57,113,114,115,116,162,175,95,96,97,98,99,100,59,163,49,101,145,102,103,158,153,157,174,169,160,147,148,151,172,152,161,154,165,173,170,171,177,166,176,155,159,156,164,87,180,181,182,183,184,185,186,191,193,22,194,78,16,82,89,88,28,83,73,85,71,72,30,23,58,86,90,26,25,190,41,34,35,39,40,50,51,52,56,74,62,91,92,93,94,178,187,188,192,18,31,33,63,61,65,60,64,29,32,79,80,81');
Как вы заебали..
+153
require_once('adodb/adodb.inc.php');
class adoDbConnector
{
private static $instance = null;
public static function getInstance()
{
if (self::$instance == NULL)
{
self::$instance = new adoDbConnector();
}
return self::$instance;
}
private function __construct() { }
public function __clone()
{
trigger_error('No __clone()!', E_USER_ERROR);
}
public function __wakeup()
{
trigger_error('No __wakeup()!', E_USER_ERROR);
}
public function connect($connectionType, $connectionData)
{
switch($connectionType)
{
case 0:
return self::generalConnect($connectionData);
break;
case 1:
return self::dsnConnect($connectionData);
break;
case 2:
return self::xmlConnect($connectionData);
break;
default:
throw new Exception('Wrong type of connection!');
}
}
private static function generalConnect($connectionData)
{
if(is_array($connectionData))
{
$conn = &ADONewConnection($connectionData[0]);
$conn->PConnect($connectionData[1], $connectionData[2],
$connectionData[3], $connectionData[4]);
return $conn;
}
else throw new Exception('Wrong type of connection data, must be an array!');
}
private static function dsnConnect($connectionData)
{
if(is_string($connectionData))
{
$conn = ADONewConnection($connectionData);
return $conn;
}
else throw new Exception('Wrong type of connection data, must be a string!');
}
private static function xmlConnect($connectionData)
{
if(is_string($connectionData) && file_exists($connectionData))
{
$xml = simplexml_load_file($connectionData);
foreach($xml as $x)
{
$connArr[] = trim($x);
}
$conn = &ADONewConnection($connArr[0]);
$conn->PConnect($connArr[1], $connArr[2], $connArr[3], $connArr[4]);
return $conn;
}
else throw new Exception('Wrong file name or connection type!');
}
}
+28
function _spb_similar_similar_video_html(&$item, $key) {
$item = htmlspecialchars($item, ENT_NOQUOTES);
}
+162
class Program implements ProgramProvider {
public static function getInstance() {
return new Program();
}
}
Гениальная реализация singleton!
+158
$sCmd='$result=$this->'.$aEvent['method'].'();';
$this->Hook_Run("action_event_".strtolower($this->sCurrentAction)."_before",array('event'=>$this->sCurrentEvent,'params'=>$this->GetParams()));
eval($sCmd);
$this->Hook_Run("action_event_".strtolower($this->sCurrentAction)."_after",array('event'=>$this->sCurrentEvent,'params'=>$this->GetParams()));
return $result;
LiveStreet CMS... nuff said...
+153
do
{
$firstDate = ConvertTimeStamp($firstDateSt, "SHORT");
$lastDate = ConvertTimeStamp($lastDateSt, "SHORT");
$arPeriod = Array(
"TITLE" => CSchool::GetDiaryPeriod($firstDate, $lastDate),
"HREF" => $APPLICATION->GetCurPageParam('START_WEEK='.$firstDate.'&END_WEEK='.$lastDate, array("START_WEEK", "END_WEEK"))
);
Битрикс...
do без while? лаконично
+163
//fucking designers
if ( $page->importantshort ) $page->short = true;
if ( $page->importantNOTshort ) $page->short = false; // так то!