forked from JavierGonzalez/POL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
notas.php
executable file
·113 lines (85 loc) · 4 KB
/
notas.php
1
2
3
4
5
6
7
8
9
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?php # POL.VirtualPol.com — Copyright (c) 2008 Javier González González <[email protected]> — MIT License
if ($_GET[1] == 'mmm') {
} else { // NOTAS HOME
$txt_title = _('Notas');
$txt_nav = array('/notas'=>_('Notas'));
$notame_max = 160; // Restaurados los 160 caracteres
$result = mysql_query_old("SELECT COUNT(ID) AS num FROM ".SQL."foros_msg WHERE hilo_ID = '-1'", $link);
while($row = mysqli_fetch_array($result)) { $notas_num = $row['num']; }
echo '<h1>'._('Notas').' '.$notas_num.' (<a href="/notas">'._('Actualizar').'</a>)</h1>
<br />
<table border="0" cellpadding="0" width="700" cellspacing="5" class="pol_table">';
if ($pol['estado'] == 'ciudadano') { //eliminada limitacion a extranjeros
echo '
<form action="/accion/foro/reply" method="post">
<input type="hidden" name="subforo" value="-1" />
<input type="hidden" name="hilo" value="-1" />
<input type="hidden" name="return_url" value="notas/" />
<input type="hidden" name="encalidad" value="0" />
<tr>
<td valign="top" align="right"><input id="notas_boton" value="'._('Enviar').'" disabled="disabled" type="submit" style="padding:5px;" /><br /><span id="notas_limit" style="font-weight:bold;font-size:24px;"><span style="color:blue;">' . $notame_max . '</span></span></td>
<td class="amarillo" colspan="2">
<input type="text" id="notas_msg" name="text" autocomplete="off" style="color:green;font-weight:bold;padding:15px 0 15px 0;width:700px;" />
</td>
</tr>
</form>
';
}
$result = mysql_query_old("SELECT ID, user_ID, time, text,
(SELECT nick FROM users WHERE ID = ".SQL."foros_msg.user_ID LIMIT 1) AS nick,
(SELECT avatar FROM users WHERE ID = ".SQL."foros_msg.user_ID LIMIT 1) AS avatar
FROM ".SQL."foros_msg
WHERE hilo_ID = '-1'
ORDER BY time DESC
LIMIT 50", $link);
$num_id=0;
while($row = mysqli_fetch_array($result)){
if ($row['user_ID'] == $pol['user_ID']) {
$boton = boton('X', '/accion/foro/eliminarreply?ID=' . $row['ID'] . '&hilo_ID=-1', '¿Estás seguro de querer ELIMINAR esta NOTA?') . '</span>';
} else { $boton = ''; }
if ($row['avatar'] == 'true') { $avatar = '<span class="navatar">' . avatar($row['user_ID'], 40) . '</span>'; } else { $avatar = ''; }
echo '<tr onmouseover="show(\'div'.$num_id.'\')" onmouseout="hide(\'div'.$num_id.'\')"><td align="right"><b class="big">' . crear_link($row['nick']) . '</b><br /><acronym title="' . $row['time'] . '">' . duracion(time() - strtotime($row['time'])) . '</acronym></td><td valign="top" class="amarillo">' . $avatar . $row['text'] . '</td><td width="1">' . $boton . '</td>
<td><div id="div'.$num_id.'"style="display: inline; visibility: hidden"><a href="http://twitter.com/share" class="twitter-share-button" data-url="/notas/" data-text="'.$row['text'].' #'.DOMAIN.'" data-count="none" data-lang="es">
Tweet</a></div></td></tr>' . "\n";
$num_id++;
}
echo '</table>';
}
$txt_header .= '<style type="text/css">
h1 a { color:#4BB000; }
#enviar { background:#FFFFB7; padding:20px 0 20px 50px; }
.navatar { float:left; margin:-4px 10px -4px 0; }
</style>
<script language="javascript">
function limitChars(textid, limit, infodiv) {
var text = $("#"+textid).val();
var textlength = text.length;
if(textlength >= limit) {
$("#" + infodiv).html("<span style=\"color:red;\">0</span>");
$("#" + textid).val(text.substr(0,limit));
return false;
} else {
$("#" + infodiv).html("<span style=\"color:blue;\">"+ (limit - textlength) +"</span>");
return true;
}
}
function show(id) {
document.getElementById(id).style.visibility = "visible";
}
function hide(id) {
document.getElementById(id).style.visibility = "hidden";
}
window.onload = function(){
setTimeout(function(){ $("#notas_boton").removeAttr("disabled"); }, 5000);
$("#notas_msg").focus();
$("#notas_msg").keyup(function(){
limitChars("notas_msg", ' . $notame_max . ', "notas_limit");
})
}
</script>
<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
';
//THEME
$txt_title = _('Notas');
$txt_menu = 'comu';
?>