- 1
- 2
- 3
- 4
function repl3($val)
{
return ($val=="1")?"0":"1";
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+164
function repl3($val)
{
return ($val=="1")?"0":"1";
}
+164
$(document).ready(function () {
$('.input_control').attr('checked', true);
$('.input_control').click(function () {
if ($('input[name=' + $(this).attr('value') + ']').attr('disabled') == false) {
$('input[name=' + $(this).attr('value') + ']').attr('disabled', true);
} else {
$('input[name=' + $(this).attr('value') + ']').attr('disabled', false);
}
});
});
Переключаем disabled поля по чекбоксу™.
Источник — http://ruseller.com/lessons.php?rub=32&id=600
+164
list::list(FILE*f,FILE*f1){
first=(starosta*)new student;
rea=first;
int i=0,j;
for(j=0;j<5;j++){
if (i) {
rea->next=(starosta*)new student;
rea=rea->next;
}
i=1;
fscanf(f,"%d",&(rea->num));
fscanf(f,"%s",rea->fam);
fscanf(f,"%d",&(rea->stip));
rea->flag=0;
}
cur=(starosta*)rea;
for(j=0;j<3;j++){
cur->next=new starosta;
cur=(starosta*)cur->next;
cur->flag=1;
fscanf(f1,"%d",&(cur->num));
fscanf(f1,"%s",cur->fam);
fscanf(f1,"%d",&(cur->stip));
fscanf(f1,"%d",&(cur->kolvo));
cur->next=NULL;
}
}
классный конструктор... тут много приколов
+164
<?
$mult=$mult+0;
if ($mult<1 and $mult>38) $mult="001";
$mult = substr("00".$mult, 0,3);
//echo "mult=".$mult."<br>";
$title="Мультик №".$mult;
include ('../../novost/l1.htm');
$minmult=1+1;
$maxmult=38-1;
$multa= "00".($mult-1);
$multb= "00".($mult+1);
$multa = substr($multa, -3);
$multb = substr($multb, -3);
if ($mult>$maxmult) $multb="001";
if ($mult<$minmult) $multa="038";
?>
<!-- ********************************************** -->
<SCRIPT SRC="embedFlash.js" LANGUAGE="JavaScript" TYPE="text/javascript"></SCRIPT>
<CENTER>
<SCRIPT LANGUAGE="JavaScript">embedFlash("<? echo $mult; ?>.swf","100%","100%");</SCRIPT>
<br>
<a href="play.php?mult=<? echo $multa; ?>">Предыдущий</a> |
<a href="./">Список</a> |
<a href="play.php?mult=<? echo $multb; ?>">Следующий</a>
</CENTER>
<!-- ********************************************** -->
<?php include ('../../novost/l3.htm'); ?>
код моего друга админа)
+164
foreach($listuserson as $uinfo => $pinfo) {
$class_check = TRUE;
list($oid, $oname) = explode(".", $uinfo, 2);
$sql2 = new db;
$sql2->db_Select("user", "user_id", "user_admin > 0 ");
$row_2 = $sql2->db_Fetch();
$online_location = $pinfo;
$online_location_page = substr(strrchr($online_location, "/"), 1);
if (!strstr($online_location, "forum_") || !strstr($online_location, "content.php") || !strstr($online_location, "comment.php")) {
$online_location_page = str_replace(".php", "", substr(strrchr($online_location, "/"), 1));
}
if ($online_location_page == "log" || $online_location_page == "error") {
$online_location = "news.php";
$online_location_page = NEWS;
}
if ($online_location_page == "request") {
$online_location = "download.php";
}
if ($online_location_page == "article") {
$online_location_page = ARTICLEPAGE;
}
if ($online_location_page == "chat") {
$online_location_page = CHAT;
}
//if($online_location_page == "comment"){$online_location_page = COMMENT;}
if ($online_location_page == "content") {
$online_location_page = CONTENT;
}
if ($online_location_page == "download") {
$online_location_page = DOWNLOAD;
}
if ($online_location_page == "email") {
$online_location_page = EMAIL;
}
if ($online_location_page == "forum") {
$online_location_page = FORUM;
}
if ($online_location_page == "links") {
$online_location_page = LINKS;
}
if ($online_location_page == "news") {
$online_location_page = NEWS;
}
if ($online_location_page == "oldpolls") {
$online_location_page = OLDPOLLS;
}
if ($online_location_page == "print") {
$online_location_page = PRINTPAGE;
}
if ($online_location_page == "login") {
$online_location_page = LOGIN;
}
if ($online_location_page == "search") {
$online_location_page = SEARCH;
}
if ($online_location_page == "stats") {
$online_location_page = STATS;
}
if ($online_location_page == "submitnews") {
$online_location_page = SUBMITNEWS;
}
if ($online_location_page == "upload") {
$online_location_page = UPLOAD;
}
if ($online_location_page == "user") {
$online_location_page = USERPAGE;
}
if ($online_location_page == "usersettings") {
$online_location_page = USERSETTINGS;
}
if ($online_location_page == "new") {
$online_location_page = LISTNEW;
}
if ($online_location_page == "online") {
$online_location_page = ONLINE;
}
if ($online_location_page == "userposts") {
$online_location_page = USERPOSTS;
}
if ($online_location_page == "subcontent") {
$online_location_page = SUBCONTENT;
}
if ($online_location_page == "top") {
$online_location_page = TOP;
}
//commonly used plugin pages
if ($online_location_page == "bugtracker") {
$online_location_page = BUGTRACKER;
}
if ($online_location_page == "event") {
$online_location_page = EVENT;
}
if ($online_location_page == "calendar") {
$online_location_page = CALENDAR;
}
if ($online_location_page == "faq") {
$online_location_page = FAQ;
}
if ($online_location_page == "pm") {
$online_location_page = PM;
Шарился по винту, наткнулся на архив с CMS e107, машинально зашёл в него и открыл первый попавшийся файл...
ROBUST
@
SCALABLE
+164
mysql_query("INSERT INTO `classes` (`name`) VALUES('".$_POST["class_name"]."')");
$Mresult=mysql_query("SELECT MAX(`id`) FROM `classes`");
$row=mysql_fetch_row($Mresult);
$class_num=$row[0];
$date1=$_POST["class_start"];
$date2=$_POST["class_end"];
mysql_query("CREATE TABLE `class_".$class_num."_lessons` (`id` INT, `data` TEXT)");
mysql_query("CREATE TABLE `class_".$class_num."_video` (`id` INT, `data` TEXT)");
mysql_query("CREATE TABLE `class_".$class_num."_ege` (`id` INT, `data` TEXT)");
mysql_query("CREATE TABLE `class_".$class_num."_rasp` (`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, `data` TEXT)");
+164
// set admin mode
switch (true) {
case $nc_core->inside_admin:
$nc_core->admin_mode = true;
break;
case !$passed_thru_404 && isset($posting): // add (edit) action
$nc_core->admin_mode = $admin_mode;
break;
case !$passed_thru_404: //front-office
$nc_core->admin_mode = true;
break;
case $passed_thru_404:
$nc_core->admin_mode = false;
break;
default:
$nc_core->admin_mode = false;
}
/netcat/require/index.php
Что они там курят, что у них настолько извилины выпрямляются?!
+164
/**
* Constructs a URL encoded query string from an array of key/value pairs
*
* @access protected
* @since 2.0
* @param array $array query string key/value pairs
* @return string
*/
protected function _glue( $array )
{
$query_string = '';
foreach( $array as $key => $val ) :
$query_string .= $key . '=' . rawurlencode( $val ) . '&';
endforeach;
return '?' . substr( $query_string, 0, strlen( $query_string )-1 );
}
http://code.google.com/p/php-twitter/
опять велосипеды
+164
o.style.cursor="wait";
document.body.style.cursor="wait";
switch(iCellSelected)
{
case 2:
//задержка .1с
AnyPage("1_2");
break;
case 4:
//задержка .1с
AnyPage("1_3");
break;
case 6:
//задержка .1с
AnyPage("1_4");
break;
case 8:
//задержка .1с
AnyPage("1_5");
break;
case 10:
//задержка .1с
AnyPage("1_6");
break;
case 12:
//задержка .1с
AnyPage("1_7");
break;
} //end switch(iCellSelected)
Это сайт максима прохорова. Посмотревших ждёт батхэт.
http://ee324704-1.hosting.parking.ru/
+164
<?php
$count =300;
define('MAXPROCESS',$count);
$count дальше естественно нигде не используется..