$list_forum = mysql_query("SELECT id, title \n\t\t\t\t\t\t\t\t\t FROM " . __PREFIX__ . "forum \n\t\t\t\t\t\t\t\t ORDER BY position"); while ($row = mysql_fetch_array($list_forum)) { $move_topic .= "\n<option value=\"" . $row['id'] . "\">" . $row['title'] . "</option>"; } $move_topic .= "\n</select>" . "\n<br />" . "\n<br />" . "\n<input type=\"hidden\" value=\"" . check_t_id($id) . "\" name=\"move_t_id\" />" . "\n<input type=\"submit\" value=\"Sposta Topic\" />" . "\n</form>\n"; } else { $block_topic = ''; $delete_topic = ''; $move_topic = ''; $set_topic = ''; } // inizio div reply print "\n<div class = 'reply'>\n"; if (login($username, $password)) { // controllo se l'utente è loggato if (check_block_topic($id) == 0 || check_block_topic($id) == NULL) { // controllo se il topic è bloccato/chiuso if (level($username) != 'banned') { // controllo se l'utente è bannato print "<table>" . "\n<tr><td>" . @$block_topic . "\n</td><td>" . @$delete_topic . "</td><td>" . @$move_topic . "</td></tr>" . "\n</table>"; ?> <br /> <button name="grassetto" onclick="document.getElementById('reply').value+='[b] [/b]'"><b>[b]</b></button> <button name="corsivo" onclick="document.getElementById('reply').value+='[i] [/i]'"><i>[i]</i></button> <button name="sottolineato" onclick="document.getElementById('reply').value+='[u] [/u]'"><u>[u]</u></button> <button name="code" onclick="document.getElementById('reply').value+='[code] [/code]'">[code]</button> <button name="quote" onclick="document.getElementById('reply').value+='[quote] [/quote]'">[quote]</button> <button name="scrivi_rosso" onclick="document.getElementById('reply').value+='[red] [/red]'"><u>[red]</u></button> <button name="scrivi_verde" onclick="document.getElementById('reply').value+='[green] [/green]'">[green]</button> <button name="scrivi_giallo" onclick="document.getElementById('reply').value+='[yellow] [/yellow]'">[yellow]</button>
function manage_block_topic($username, $id) { if (level($username) == 'admin' || level($username) == 'mod') { $block = check_block_topic($id); if ($block == 0) { $query = "UPDATE " . __PREFIX__ . "topic SET block = '1' WHERE id = '" . $id . "'"; } elseif ($block == 1) { $query = "UPDATE " . __PREFIX__ . "topic SET block = '0' WHERE id = '" . $id . "'"; } mysql_query($query) or _err(mysql_error()); } else { print "<script>alert(\"Operazione consentita solo ad Amministratori e Moderatori\");</script>"; } }