- 1
VK.callMethod('showPaymentBox', 1);
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+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; // так то!
+157
while(true)
{
if ($i==0)
{
$new_form_name = $form_res[0]['frm_name'] . ' ( Copy )';
} else
{
$new_form_name = $form_res[0]['frm_name'] . ' ( Copy '.$i.' )';
}
if(!in_array($new_form_name, $formaNames))
{
break;
}
$i++;
}
Есть имя формы $form_res[0]['frm_name'] , напр "FORMNAME".
нужно получить новое имя вида "FORMNAME ( Copy 1)"
+151
$now = date(date('Y-m-d H:i:s'));