-
+128
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
<a href="#" id="foo" onclick="this.nextSibling.style.display=''; return!1;">Click here for view</a><p style="display: none;">
<noscript>
</p>
<style type="text/css"> a#foo { display:none; } </style>
<p>
</noscript>
/*... some info ...*/
</p>
Баян, не? Вот. Наговнокодилось. captcha=5555
istem,
18 Сентября 2014
-
+158
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
$rand = rand(1,100);
if (($rand => 1) && ($rand <= 50)) {
include 'код баннера 1';
}
elseif (($rand => 51) && ($rand <= 80)) {
include 'код баннера 2';
}
else {
include 'код баннера 3';
}
50% - баннер 1, 30% - баннер 2, остальное (20%) - баннер 3.
Хотели сделать "ротацию с весом" для X баннеров :)
SVP,
18 Сентября 2014
-
+143
- 1
- 2
- 3
if (typeof window.$lab === 'undefined') {
document.write('<script type="text/javascript">var $lab = jQuery.noConflict(true);\x3C/script>');
}
потому что eval - зло
P.s. \x3C/script> - такая запись ибо впилено тегом скрипт в head
RedMonkey,
18 Сентября 2014
-
+158
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
if ($qproizv_r->s > 0 && $qpriem_n > 0) {
if ($qproizv_r->s >= $row->Kol) {
$Status = 6;
}
} else {
if ($qpriem_n > 0) {
$Status = 6;
}
}
Так и живем.
Khvorostin,
18 Сентября 2014
-
+82
- 1
Boolean hasRefId = !node.getAttributes().getNamedItem("refid").equals(null);
equals(null)
roman-kashitsyn,
18 Сентября 2014
-
+76
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
function returnUserId() {
if (document.getElementById('userstap') != null ) {
var obj = document.getElementById('userstap');
<% if ((sUserIdForPrint != null) && !sUserIdForPrint.equals("")) {%>
if (obj.options[obj.selectedIndex].value == 0) {
return "<%=sUserIdForPrint%>";
<% } %>
<% if (((sAccGrpUserIdForPrint != null) && !sAccGrpUserIdForPrint.equals("")) && ((sUserIdForPrint != null) && !sUserIdForPrint.equals(""))) {%>
} else if (obj.options[obj.selectedIndex].value == 1 ) {
return "<%=sAccGrpUserIdForPrint%>";
<% } else if ((sAccGrpUserIdForPrint != null) && !sAccGrpUserIdForPrint.equals("")){%>
if (obj.options[obj.selectedIndex].value == 1 ) {
return "<%=sAccGrpUserIdForPrint%>";
<% } %>
<% if (((sAccGrpUserIdForPrint != null) && !sAccGrpUserIdForPrint.equals("")) || ((sUserIdForPrint != null) && !sUserIdForPrint.equals(""))) {%>
} else if (obj.options[obj.selectedIndex].value == 2) {
return "<%=userId%>";
}
<% } else {%>
if (obj.options[obj.selectedIndex].value == 2) {
return "<%=userId%>";
}
<% } %>
} else {
return "<%=userId%>";
}
}
Любите ли вы JSP так, как люблю его я?
codingHorror,
18 Сентября 2014
-
+155
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
<?php
/**
* Get category tree.
*
* @param db $db
* @return array
*/
function getCategoryTree ($db) {
$query = $db->query('SELECT * FROM dle_category ORDER BY posi');
if ($query->num_rows <= 0) {
return FALSE;
}
$categories = $query->fetch_all(MYSQLI_ASSOC);
$tree = array();
foreach ($categories as $cat) {
if ($cat['parentid'] == '0') {
$tree[$cat['id']] = $cat;
}
else {
$tree[$cat['parentid']]['subcategories'][] = $cat;
}
}
return $tree;
}
/**
* Display categories.
* Sorry for my french 'echo'.
*
* @param array $category
*/
function displayCategory ($category) {
$html = '';
foreach ($category as $cat) {
$html .= '<li class="lonely "><a href="/">' . $cat['name'] . '</a>';
if ($cat['subcategories']) {
$html .= '<span class="accordion"></span><ul>';
$html .= displayCategory ($cat['subcategories']);
$html .= '</ul>';
}
$html .= '</li>';
}
return $html;
}
// Getting categories
$categories = getCategoryTree($db);
if ($categories) {
echo displayCategory ($categories);
}
else {
echo '<li>Нету категорий</li>';
}
Мой говно модуль для DLE для отображения дерева категорий в меню.
Почему DLE разработчики не могли это из коробки сделать? И почему там куча говнокода внутри? (на Англ. комментарии потому что привык)
volter9,
17 Сентября 2014
-
+140
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
@foreach (var groupTest in Model.Select(t => t.TestType).Distinct())
{
<div class="form-column form-column2">
<div class="static-height">
<p class="content-subblock-title left upper-text">
<label>
@if (@groupTest.GetEnumDescription().Length < 34)
{
<text> </text>
}
@groupTest.GetEnumDescription()
</label>
</p>
@foreach (var item in Model.Where(t => t.TestType == groupTest).OrderBy(t => t.Order))
{
<div class="donation-row">
<label>@item.TestName</label>
<span class="@item.TestClass blood-test-value-don">
@item.TestValue
</span>
</div>
}
</div>
</div>
}
Я пялюсь на этот кусок вот уже полчаса...
amatenkov,
17 Сентября 2014
-
+135
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
if ((Mathf.Abs(_mouseOverX) > 0.2f || Mathf.Abs(_mouseOverY) > 0.2f))
{
switch (selecetedItemIndex)
{
case -1 :
var a = Mathf.Atan2(_mouseOverX, _mouseOverY) * Mathf.Rad2Deg;
a += angle / 2.0f;
if (a < 0) a = a + 360.0f;
index = (int)(a / angle);
break;
case 0:
var a0 = Mathf.Atan2(_mouseOverX, _mouseOverY) * Mathf.Rad2Deg;
a0 += angle / 2.0f;
if (a0 < 0) a0 = a0 + 360.0f;
index = (int)(a0 / angle);
switch (index)
{
case 5 :
index = 7;
break;
case 6:
index = 7;
break;
case 4 :
index = -1;
break;
case 3:
index = 1;
break;
case 2:
index = 1;
break;
}
break;
case 1:
var a1 = Mathf.Atan2(_mouseOverX, _mouseOverY) * Mathf.Rad2Deg;
a1 += angle / 2.0f;
if (a1 < 0) a1 = a1 + 360.0f;
index = (int)(a1 / angle);
switch (index)
{
case 0 :
index = 0;
break;
case 7:
index = 0;
break;
case 6 :
index = -1;
break;
case 5:
index = -1;
break;
case 4:
index = 3;
break;
case 3:
index = 3;
break;
case 2:
index = 2;
break;
}
break;
case 2:
var a2 = Mathf.Atan2(_mouseOverX, _mouseOverY) * Mathf.Rad2Deg;
a2 += angle / 2.0f;
if (a2 < 0) a2 = a2 + 360.0f;
index = (int)(a2 / angle);
switch (index)
{
case 0: index = 1; break;
case 7: index = 1; break;
case 6: index = -1; break;
case 5: index = 3; break;
case 4: index = 3; break;
}
break;
case 3:
var a3 = Mathf.Atan2(_mouseOverX, _mouseOverY) * Mathf.Rad2Deg;
a3 += angle / 2.0f;
if (a3 < 0) a3 = a3 + 360.0f;
index = (int)(a3 / angle);
switch (index)
Radial menu govnokod style
noshitleft,
17 Сентября 2014
-
+135
- 1
function e(id){ return document.getElementById(id); }
Бредогенерации тред.
3.14159265,
17 Сентября 2014