- 1
- 2
nPosition = !bInvert ? data->pos_back
: data->pos_front;
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+150
nPosition = !bInvert ? data->pos_back
: data->pos_front;
+150
<?php
function test_menu() {
$menu['test'] = array(
'page callback' => 'test_page',
'access callback' => TRUE,
);
$menu['test/%user'] = array(
'page callback' => 'test_view',
'page arguments' => array(1),
'access callback' => TRUE,
);
$menu['test/%user/view'] = array(
'title' => 'View',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10,
);
$menu['test/%user/edit'] = array(
'title' => 'Edit',
'page callback' => 'test_edit',
'page arguments' => array(1),
'access callback' => TRUE,
'type' => MENU_LOCAL_TASK,
);
return $menu;
}
function test_page() {
global $user;
if ($user->uid) {
menu_set_active_item("test/$user->uid");
return menu_execute_active_handler();
}
else {
drupal_goto('user/login');
}
}
function test_view($account) {
module_load_include('pages.inc', 'user');
return user_view($account);
}
function test_edit($account) {
module_load_include('pages.inc', 'user');
return user_edit($account);
}
+150
<?php
function test_menu() {
$menu['test'] = array(
'page callback' => 'test_page',
'access callback' => TRUE,
);
$menu['test/%user'] = array(
'page callback' => 'test_view',
'page arguments' => array(1),
'access callback' => TRUE,
);
return $menu;
}
function test_page() {
global $user;
if ($user->uid) {
menu_set_active_item("test/$user->uid");
return menu_execute_active_handler();
}
else {
drupal_goto('user/login');
}
}
function test_view($account) {
module_load_include('pages.inc', 'user');
return user_view($account);
}
+150
for($i = 1;; $i++){if ($i > $r) break; echo $i;}
+150
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Scouting table</title>
</head>
<?php
$t=floor((time()-1286582400)/86400);
$a=17+floor($t/112);
$b=(($t/112)-(floor($t/112)))*112;
$c=17+floor(($t+1)/112);
$d=((($t+1)/112)-(floor(($t+1)/112)))*112;
$e=$a+1;
$f=$e+1;
{echo
("<table align=\"center\" border=\"1\">
<tr align=\"center\">
<td>Scouting table</td><td colspan=\"3\"> Scout by age</td>
</tr>
<tr align=\"center\">
<td>Position</td><td>WC17 - 17 years 0 days - $a years $b days</td><td>WC16 - $c years $d days - $e years $b days</td><td>WC15 - $f years $d days - 20 years 111 days</td>
</tr>
<tr align=\"center\">
<td>Goalkeepers</td><td>***** <a href=\"http://www.hattrick.org/Club/?TeamID=*****\">(*****)</a></td><td>*****<a href=\"http://www.hattrick.org/Club/?TeamID=*****\">(*****)</a></td><td>*****<a href=\"http://www.hattrick.org/Club/?TeamID=*****\">(*****)</a></td>
</tr>
<tr align=\"center\">
<td>Defenders</td><td>***** <a href=\"http://www.hattrick.org/Club/?TeamID=*****\">(*****)</a></td><td>*****<a href=\"http://www.hattrick.org/Club/?TeamID=*****\">(*****)</a></td><td>*****<a href=\"http://www.hattrick.org/Club/?TeamID=*****\">(*****)</a></td>
</tr>
<tr align=\"center\">
<td>Playmakers</td><td>*****<a href=\"http://www.hattrick.org/Club/?TeamID=*****\">(*****)</a></td><td>*****<a href=\"http://www.hattrick.org/Club/?TeamID=*****\">(*****)</a></td><td>*****<a href=\"http://www.hattrick.org/Club/?TeamID=*****\">(*****)</a></td>
</tr>
<tr align=\"center\">
<td>Wingers</td><td>*****<a href=\"http://www.hattrick.org/Club/?TeamID=*****\">(*****)</a></td><td>*****<a href=\"http://www.hattrick.org/Club/?TeamID=*****\">(*****)</a></td><td>***** <a href=\"http://www.hattrick.org/Club/?TeamID=*****\">(*****)</a></td>
</tr>
<tr align=\"center\">
<td>Forwards</td><td>*****<a href=\"http://www.hattrick.org/Club/?TeamID=*****\">(*****)</a></td><td>*****<a href=\"http://www.hattrick.org/Club/?TeamID=*****\">(*****)</a></td><td>*****<a href=\"http://www.hattrick.org/Club/?TeamID=*****\">(*****)</a></td>
</tr>
</table>
<table align=\"center\">
<tr align=\"center\">
<td>Chief Scout: *****<a href=\"http://www.hattrick.org/Club/?TeamID=*****\">(*****)</a></td>
</tr>
</table>");}
?>
<body>
</body>
</html>
Вместо звездочек строки html) Замазал)
+150
$stat_connect = @mysql_connect("stats.amxbans.de","amxbstats","");
*skipped…*
@mysql_close($stat_connect) or die(mysql_error());
+150
/* That revolting regular expression explained
/^(\w+)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/
\---/ \---/\-------------/ \-------/
| | | |
| | | The value
| | ~,|,^,$,* or =
| Attribute
Tag
*/
Это НЕ говонокод, просто коммент к регулярке, просто очень понравился и хотел показать...
Иногда регулярки очен запутанами бывает, и редактировать их турдно без нормальной комментов.
Нашел в shop-script
+150
<?php
function DaysDiff($d1,$d2){
$d2=1+strtotime($d2);
$d1=1+strtotime($d1);
return floor(($d2-$d1)/86400);
}
?>
а надо бы:
<?php
function DaysDiff($d1,$d2){
return bcdiv(strtotime($d2)-strtotime($d1),86400);
}
?>
+150
private function sape()
{
$sapelinks = array('Ваша реклама <a href="http://www.remont-pr0.ru">будет</a> здесь!');
if ($this->sape_on)
{
if (!defined('_SAPE_USER')) define('_SAPE_USER', '3a2a5sd5a1dfas1fas154as3dd19391c');
require_once(_SAPE_USER.'/sape.php');
$fierce['charset'] = 'UTF-8';
$sape = new SAPE_client($fierce);
for ($i = 0; $i<16; $i++)
{
$item = $sape->return_links(1);
$sure = str_replace(' ', '', $sape->return_links(1));
//$sape->return_links(1) заменить на $item выше
if ($sure <> '') $sapelinks[] = $item;
}
}
return $sapelinks;
}
Подключил сапу к своей модной CMS. По желанию я зделал динамический вывод блока если ссылка существует. Но ошибся, в итоге вместо 3 ссылок выводилась одна. Сразу нашел ошибку, у меня чутье как у собак. Можете полюбоваться как красиво выводит в стиле вэб-2,0. Не то что ГЛУПЫЕ_И_ТУПЫЕ вэб мастера выводять комком снизу старницы. И разве я после этого не гений?
Ссылка на страницу моего сайта с рекламой сапы: http://bit.ly/cl9sHP
+150
<?session_start();
require_once "../Source/connect.php";
require_once "../Models/Comment(class).php"?>
<link rel="stylesheet" href="../Source/style.css" type="text/css" />
<a href="../Forms/Register_form.php">Регистрация</a> <br/><br/>
<form name="login" action="../Controller/Controller.php" method="post">
<input name="login" type="text" value=""> Логин <br/>
<input name="password" type="password" value=""> Пароль <br/>
Введите данные:<br/><br/>
<input name="do" type="submit" value="Войти">
<?session_destroy();?>
</form>
<?
$comment = new Comm();
$comment->Menu();
$comment->Coments();
?>
Хочется назвать сие творение: "Очень быстрая сессия".
Это весь код главной страницы простенького сайта-блога. Автор даже не подозревает о существовании тегов <html>, <head> и <body>. Вначале можно было подумать, что он засунул их в один из подключаемых файлов, а нет. Просто не нужны они ему и все.