- 1
ObjectUtils.deleteFromDictionary(showTweens, slideView);
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−122
ObjectUtils.deleteFromDictionary(showTweens, slideView);
Для тех, кто не в курсе:
delete dictionary[key];
+155
function compileStr($arrStrings) {
if (is_array($arrStrings)) {
$part1 = 'a:2:{s:5:"VALUE";a:';
$part2 = 's:11:"DESCRIPTION";a:';
$part3 = '}';
$ornums = array();
foreach ($arrStrings as $str) {
$exp = explode(",", str_replace(" ", "", $str));
$ornums = array_merge($ornums, $exp);
}
$ecount = count($ornums);
$s1 = $ecount.':{';
$s2 = $ecount.':{';
for ($i = 0; $i < $ecount; $i++) {
$s1 .= 'i:'.$i.';s:'.strlen($ornums[$i]).':"'.$ornums[$i].'";';
$s2 .= 'i:'.$i.';s:0:"";';
}
$s1 .= '}';
$s2 .= '}';
$result = $part1.$s1.$part2.$s2.$part3;
return $result;
}
}
Нашел в дебрях проекта. Писать php-сериализатор на php - это концептуально )))
если кто не понял функция делает вот это:
if (is_array($arrStrings)) {
$ornums = explode(',', implode(',', str_replace(' ', '', $arrStrings)));
return serialize(array("VALUE" => $ornums, "DESCRIPTION" => array_fill(0, count($ornums), '')));
}
−151
if( my $row = &dbselectrow( $sql ) )
{
if( $row -> { 'ofid' } == 9782 ) # moscow
{
if( $row -> { 'jt' } =~ /Начальник /i )
{
&subscribe_to_management( $row -> { 'email' } );
}
}
}
Автоматическая подписка сотрудника руководящей должности на список рассылки для руководителей.
+142
public function GetSubscriptions()
{
return $this->repaymentPay->check();
}
А я сказал горбатый!
+149
array_unshift($available, $noSize);
if (is_null($noSize))
unset($available[0]);
+142
string"==typeof a[d]||"number"==typeof a[d]||"boolean"==typeof a[d])&&bk_addPageCtx(d,a[d]);}}},doTag:function(i,j,k,l,m,n,o,p,q){var r={site:i,limit:j,excludeBkParams:k,partnerID:l,allowMultipleCalls:m,callback:n,allData:o,timeOut:p,ignoreOutsideIframe:q};for(var s in g){g.hasOwnProperty(s)&&"undefined"!=typeof window["bk_"+g[s]]&&(r[s]=window["bk_"+g[s]]);}if("object"==typeof i){for(var t in g){g.hasOwnProperty(t)&&"undefined"!=typeof i[g[t]]&&(r[t]=i[g[t]]);}}if(!(r.suppressMultipleCalls===!0||"undefined"!=typeof f&&f&&r.allowMultipleCalls!==!0)){f=!0,void 0===r.timeOut&&(r.timeOut=1000),e.unshift("ret="+(r.callback?"js":"html"));var u="undefined"!=typeof r.partnerID&&null!==r.partnerID;u&&e.unshift("partner="+encodeURIComponent(r.partnerID));var v={2607:1,2834:1,2894:1,3316:1,3317:1,3318:1,3319:1,3321:1,3322:1,3323:1,3324:1,3325:1,3326:1,3327:1,3328:1,3329:1,3330:1,3331:1,3332:1,3333:1,3334:1,3338:1,3339:1,3340:1,3341:1,3344:1,3345:1,3346:1,3348:1};if(!r.excludeBkParams&&!r.excludeTitle&&""!==document.title&&h.addBkParam("t",document.title),!r.excludeBkParams&&!r.excludeKeywords&&h.addBkParam("k",b.getKwds()),!r.excludeBkParams&&!r.excludeReferrer&&"referrer" in document&&""!==document.referrer&&h.addBkParam("pr",document.referrer),!r.excludeBkParams&&!r.excludeLocation&&h.addBkParam("l",window.location.toString()),r.callback?h.addParam("jscb",encodeURIComponent(r.callback)):"undefined"!=typeof r.limit&&h.addParam("limit",encodeURIComponent(r.limit)),r.allData===!0&&h.addParam("data","all"),r.disableMobile!==!0&&r.suppressStatidPayload!==!0&&(b.isMobile()||c>d||r.sendStatidPayload||-1!==window.location.search.indexOf("force=bkfpd"))&&"undefined"!=typeof fortyone&&"undefined"!=typeof numis&&(h.addParam("bkfpd",fortyone.collect()),h.addParam("bknms",numis.collect())),r.suppressEventScheduling!==!0&&r.eventScheduling===!0&&b.addEvent("message",function(a){if("http://tags.bluekai.com"===a.origin){var b=document.getElementById("__bkframe"),c=function(a){return function(){b.contentWindow.postMessage(JSON.stringify({event:a}),"*"),b.contentWindow.postMessage(JSON.stringify({schedule:"run"}),"*");};},d=JSON.parse(a.data);if(d.status&&"loaded"===d.status&&b.contentWindow.postMessage(JSON.stringify({get:"events"}),"*"),d.scheduled){var e=JSON.parse(d.scheduled);for(var f in e){var g="window"===e[f]?window:document.getElementById(e[f]);g.addEventListener(f,c(f),!1);}}d.status&&"complete"===d.status&&b.contentWindow.postMessage(JSON.stringify({status:"ack"}),"*");}},!1),r.suppressFirstParty!==!0&&r.useFirstParty&&(readCookie("bkrid")||createCookie("bkrid",Math.floor(Math.random()*Math.pow(2,31)),180),readCookie("bkrid")&&h.addParam("bkrid",encodeURIComponent(readCookie("bkrid")))),(b.isDebug()||r.isDebug)&&h.addParam("debug","1"),!r.excludeBkParams&&"undefined"!=typeof r.paramList&&h.getGlobals(r.paramList),!r.excludeBkParams&&"undefined"!=typeof r.jsList&&h.getGlobals(r.jsList),!r.excludeBkParams&&"undefined"!=typeof r.metaVars){for(var w=0;w<r.metaVars.length;w++){var x=b.getMeta(r.metaVars[w]);null!==x&&h.addBkParam(r.metaVars[w],x);}}r.suppressCacheBusting!==!0&&h.addParam("r",parseInt(99999999*Math.random(),10));var y="https://stags.bluekai.com/",z="http://tags.bluekai.com/",A=("https:"===document.location.protocol?r.pixelSecure?r.pixelSecure:y:r.pixelUrl?r.pixelUrl:z)+(u?"psite":"site")+"/"+r.site,B=A+"?"+e.join("&");if(r.limitGetLength&&(B=B.substr(0,2000)),BKTAG._dest=h._dest=B,r.callback){if(r.useImage){var C=document.createElement("span");C.style.display="none";var D=document.getElementsByTagName("body")[0];D.appendChild(C);var E=document.createElement("img");E.src=h._dest,C.appendChild(E);}else{var F=document.createElement("script");F.type="text/javascript",F.src=h._dest,F.id="__bk_script__",v[""+i]&&setTimeout(function(){var a=document.getElementById("__bk_script__");a&&(a.removeNode?a.removeNode(!0):a.parentNode.removeChild(a));},r.timeOut),document.getElementsByTagName("head")[0].appendChild(F);}}else{if(a.checkFrame(function(){if(r.useMultipleIframes){var b=a.createFrame("__bkframe_"+r.site+"_"+(new Date).valueOf());b.className="__bkframe_site_"+r.site,b.src=B,document.getElementsByTagName("body")[0].appendChild(b);}else{if(frames&&frames.__bkframe){frames.__bkframe.location.replace(B);}else{var c=a.createFrame("__bkframe");document.
...
+116
"{7790769C-0471-11D2-AF11-00C04FA35D02}");},function(a){return a.b("{89820200-ECBD-11CF-8B85-00AA005B4340}");},function(a){return a.b("{283807B5-2C60-11D0-A31D-00AA00B92C03}");},function(a){return a.b("{4F216970-C90C-11D1-B5C7-0000F8051515}");},function(a){return a.b("{44BBA848-CC51-11CF-AAFA-00AA00B6015C}");},function(a){return a.b("{9381D8F2-0288-11D0-9501-00AA00B911A5}");},function(a){return a.b("{4F216970-C90C-11D1-B5C7-0000F8051515}");},function(a){return a.b("{5A8D6EE0-3E18-11D0-821E-444553540000}");},function(a){return a.b("{89820200-ECBD-11CF-8B85-00AA005B4383}");},function(a){return a.b("{08B0E5C0-4FCB-11CF-AAA5-00401C608555}");},function(a){return a.b("{45EA75A0-A269-11D1-B5BF-0000F8051515}");},function(a){return a.b("{DE5AED00-A4BF-11D1-9948-00C04F98BBC9}");},function(a){return a.b("{22D6F312-B0F6-11D0-94AB-0080C74C7E95}");},function(a){return a.b("{44BBA842-CC51-11CF-AAFA-00AA00B6015B}");},function(a){return a.b("{3AF36230-A269-11D1-B5BF-0000F8051515}");},function(a){return a.b("{44BBA840-CC51-11CF-AAFA-00AA00B6015C}");},function(a){return a.b("{CC2A9BA0-3BDD-11D0-821E-444553540000}");},function(a){return a.b("{08B0E5C0-4FCB-11CF-AAA5-00401C608500}");},function(){return eval("navigator.appCodeName");},function(){return eval("navigator.appName");},function(){return eval("navigator.appVersion");},function(a){return a.exec(["navigator.productSub","navigator.appMinorVersion"]);},function(){return eval("navigator.browserLanguage");},function(){return eval("navigator.cookieEnabled");},function(a){return a.exec(["navigator.oscpu","navigator.cpuClass"]);},function(){return eval("navigator.onLine");},function(){return eval("navigator.platform");},function(){return eval("navigator.systemLanguage");},function(){return eval("navigator.userAgent");},function(a){return a.exec(["navigator.language","navigator.userLanguage"]);},function(){return eval("document.defaultCharset");},function(){return eval("document.domain");},function(){return eval("screen.deviceXDPI");},function(){return eval("screen.deviceYDPI");},function(){return eval("screen.fontSmoothingEnabled");},function(){return eval("screen.updateInterval");},function(a){return a.h();},function(a){return a.i(c);},function(){return"@UTC@";},function(a){return a.n(c);},function(a){return a.m();},function(){return eval("screen.width");},function(){return eval("screen.height");},function(a){return a.plugins.Acrobat;},function(a){return a.plugins.Flash;},function(a){return a.plugins.QuickTime;},function(a){return a.plugins["Java Plug-in"];},function(a){return a.plugins.Director;},function(a){return a.plugins.Office;},function(){return(new Date).getTime()-c.getTime();},function(a){return a.e;},function(a){return a.f;},function(){return c.toLocaleString();},function(){return eval("screen.colorDepth");},function(){return eval("window.screen.availWidth");},function(){return eval("window.screen.availHeight");},function(){return eval("window.screen.availLeft");},function(){return eval("window.screen.availTop");},function(a){return a.a("Acrobat");},function(a){return a.a("Adobe SVG");},function(a){return a.a("Authorware");},function(a){return a.a("Citrix ICA");},function(a){return a.a("Director");},function(a){return a.a("Flash");},function(a){return a.a("MapGuide");},function(a){return a.a("MetaStream");},function(a){return a.a("PDFViewer");},function(a){return a.a("QuickTime");},function(a){return a.a("RealOne");},function(a){return a.a("RealPlayer Enterprise");},function(a){return a.a("RealPlayer Plugin");},function(a){return a.a("Seagate Software Report");},function(a){return a.a("Silverlight");},function(a){return a.a("Windows Media");},function(a){return a.a("iPIX");},function(a){return a.a("nppdf.so");},function(a){return a.o();}];this.q();for(var e="",f=0;f<d.length;f++){b&&(e+=this.j(d[f].toString(),'"',"'",!0),e+="=");var g;try{g=d[f](this);}catch(h){g="";}e+=b?g:escape(g),e+=";",b&&(e+="\\n");}return e=this.j(e,escape("@UTC@"),(new Date).getTime());},this.l=function(a){try{if(!a){return this.k();}var b;if(b=this.r(a),null!==b){try{b.value=this.k();}catch(c){b.value=escape(c.message);}}}catch(d){}},this.a=function(a){try{if(navigator.plugins&&navigator.plugins.length){for(var b=0;b<navigator.plugins.length;b++){var c=navigator.plugins[b];if(c.name.indexOf(a)>=0){return c.name+(c.description?"|"+c.description:"");}}}}catch(d){}return"";},this.o=function(){var a=document.createElement("span");a.innerHTML=" ",a.style.position="absolute",a.style.left="-9999px",document.body.appendChild(a);var b=a.offsetHeight;return document.body.removeChild(a),b;};};try{fortyone.c=document.createElement("span"),"undefined"!=typeof fortyone.c.addBehavior&&fortyone.c.addBehavior("#default#clientCaps");}catch(i){}window.fortyone=fortyone,window.fortyone.collect=fortyone.l,define("../vendor/fortyone",function(){}),"object"!=typeof JSON&&(JSON={}),function(){function f(a){return 10>a?"0"+a:a;}function quote(a){return escapable.lastIndex=0,escapable.test(a)?'"'+a.replace(escapable,function(a){var b=meta[a];return"string"==typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+a+'"';}function str(a,b){var c,d,e,f,g,h=gap,i=b[a];switch(i&&"object"==typeof i&&"function"==typeof i.toJSON&&(i=i.toJSON(a)),
...
+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, т.е. вручную - это тоже правильно, ибо тоже по-битриксовому. И конечно же, вся эта НЁХ должна храниться в текущем методе. "Циклы? Нет, не слышали... Запросы к базе данных? Битрикс говорит, что это плохо, поэтому мы с уверенностью эти лекции проебали. Зато мы знаем неймспейсы!"
+129
<ul>
<li data-stage="details"><span>1. Details</span></li>
<li data-stage="adscreate"><span>2. Creatives</span></li>
<li data-stage="targets"><span>3. Targeting</span></li>
<li data-stage="pricing_scheduling" style="width:245px;"><span>4. Pricing & Scheduling</span></li>
<li data-stage="preview"><span>5. Preview</span></li>
</ul>
Ul over Ol!
+153
<?php
sfConfig::set('show_counters', true);
/**
* Lite
*
* @category Symfony
* @package Plugins
* @subpackage liteSearchsite
* @author
* @since 12.11.2008
* @version $Id: actions.class.php 28664 2011-03-15 13:14:49Z ringtail $
*/
/**
* class liteSearchsiteActions. Функции для работы с поиском
*
* @category Symfony
* @package Plugins
* @subpackage liteSearchsite
* @author Tretyakov Ilya <[email protected]>
* @version $Id: actions.class.php 28664 2011-03-15 13:14:49Z ringtail $
*/
class liteSearchsiteActions extends sfActions
{
protected $searchsite;
protected $search_server = 'http://217.148.52.134:17000/';
/**
* конструктор
*
* @see sfComponent
*/
public function __construct($context, $moduleName, $actionName)
{
$this->searchsite = new liteSearchsite();
parent::__construct($context, $moduleName, $actionName);
}
/**
* Поиск. главная
*
* @param unknown_type $request
*/
public function executeIndex($request)
{
if ($request) {
$page = $request->getParameter('id');
$this->text = htmlspecialchars($request->getParameter('search_text'));
$reqid = $request->getParameter('reqid');
$page = $request->getParameter('p');
$numdoc = $request->getParameter('numdoc');
}
if (!$page) $page = 0;
if (!$this->searchsite->checkServer($this->search_server)) { throw new sfException('Ахтунг!'); }
if (!1) {
$this->search_work = 0;
} else
if ($this->searchsite->uploadXml($this->search_server, $this->text, $reqid, $page, $numdoc)) {
$this->pages_found = $this->searchsite->getCountItem();
$this->start_page = $this->searchsite->getStartPage();
$this->pages_found_word = $this->searchsite->getWordLinks();
$this->reqid = $this->searchsite->getRegId();
$this->pages = $this->searchsite->getPages();
$this->count_results = $this->searchsite->getDifPages();
if ($this->pages) {
$this->nextpagelink = $this->searchsite->getLinkNextPage();
$this->prepagelink = $this->searchsite->getLinkPrePage();
}
$this->search_work = 1;
if (!$this->pages_found) {
$this->no_result = 1;
$this->pages_found = 0;
} else {
$this->no_result = 0;
$this->list = $this->searchsite->getList($page);
//пересчитаем
//$this->pages_found = $this->searchsite->getCountItem();
//$this->searchsite->setCountPages();
//$this->pages_found_word = $this->searchsite->getWordLinks();
//$this->pages = $this->searchsite->getPages();
//$this->count_results = $this->searchsite->getDifPages();
if ($this->pages) {
$this->nextpagelink = $this->searchsite->getLinkNextPage();
$this->prepagelink = $this->searchsite->getLinkPrePage();
}
}
} else {
$this->search_work = 0;
}
}