Example #1
0
    echo '<a href="/avatar.php?id=' . $userinfo['login']['id'] . '&refuse&admin" ';
    echo 'onclick="return confirm(\'Är du säker på att du vill ta bort denna bild?\');" ';
    echo '/><strong>Ta bort avatar</strong></a>';
}
if ($_SESSION['login']['userlevel'] >= USERLEVELS_EDIT_PRESENTATION) {
    echo ' <strong><a href="/admin/edit_presentation.php?id=' . $userinfo['login']['id'] . '">Ändra presentation</a></strong> ';
}
if ($_SESSION['login']['userlevel'] >= 3) {
    echo '<input type="button" value="Ta bort" onclick="if(confirm(\'Vill du ta bort den här knäppgöken?\')){window.location=\'/remove_user.php?userid=' . $userinfo['login']['id'] . '\';}" />' . "\n";
}
if ($_SESSION['login']['userlevel'] >= 3) {
    echo '<h1>Aiight, snabbkoll vad för shit användaren hittat på på sajten</h1>' . "\n";
    echo '<h2>Senast skickade gästboksinlägg</h2>' . "\n";
    $query = 'SELECT * FROM traffa_guestbooks WHERE sender = "' . $userinfo['login']['id'] . '" AND is_private != 1 ORDER BY id DESC LIMIT 5';
    $result = mysql_query($query) or die(report_sql_error($query, __FILE__, __LINE__));
    while ($data = mysql_fetch_assoc($result)) {
        echo '<strong>' . fix_time($data['timestamp']) . '</strong>' . "\n";
        echo '<p>' . htmlspecialchars($data['message']) . '</p>' . "\n";
    }
    echo '<h2>Senaste inläggen i forumet</h2>' . "\n";
    $query = 'SELECT * FROM posts WHERE author = "' . $userinfo['login']['id'] . '" ORDER BY id DESC LIMIT 5';
    $result = mysql_query($query) or die(report_sql_error($query, __FILE__, __LINE__));
    while ($data = mysql_fetch_assoc($result)) {
        echo '<strong>' . fix_time($data['timestamp']) . '</strong>' . "\n";
        echo '<p><a href="' . posts_url_get($data['id']) . '">' . htmlspecialchars($data['content']) . '</a></p>' . "\n";
    }
}
?>
  <div style="clear: both;"></div>
  </div>
Example #2
0
function discussions_list($discussions, $options)
{
    $options['checkbox'] = isset($options['checkbox']) ? $options['checkbox'] : false;
    $options['remove_notices_only'] = isset($options['remove_notices_only']) ? $options['remove_notices_only'] : false;
    $options['expandbutton'] = isset($options['expandbutton']) ? $options['expandbutton'] : true;
    //todo! skall vara false som default, ändras när anropet i forum/forum.php justerats
    echo "\n\n";
    if ($options['enable_tabs']) {
        $forum_tabs['intressanta'] = 'Intressanta';
        $forum_tabs['laesta'] = 'Lästa';
        $forum_tabs['dina_diskussioner'] = 'Dina diskussioner';
        $forum_tabs['nya'] = 'Nya';
        $forum_tabs['nya_inlaegg'] = 'Med nya inlägg';
        $forum_tabs['dar_du_har_svarat'] = 'Där du har svarat';
        $options['this_path'] = isset($options['this_path']) ? $options['this_path'] : '/forum/index/';
        $current_tab = isset($options['current_tab']) ? $options['current_tab'] : 'intressanta';
        echo '<!-- Control tabs for discussions list -->' . "\n";
        echo '<div class="forum_tabs">' . "\n";
        foreach ($forum_tabs as $handle => $label) {
            $class = $handle == $current_tab ? ' class="current"' : '';
            echo '	<div' . $class . '>' . "\n";
            echo '		<a href="' . $options['this_path'] . $handle . '.php">' . $label . '</a>' . "\n";
            echo '	</div>' . "\n";
        }
        echo '</div>' . "\n\n";
    }
    echo '<!-- Discussion list with ' . count($discussions) . ' items -->' . "\n";
    echo '<div class="discussion_list">' . "\n";
    echo '	<div class="headers">' . "\n";
    echo '		<span class="title">Rubrik</span>' . "\n";
    echo '		<span class="answers">Inlägg</span>' . "\n";
    if (login_checklogin()) {
        echo '		<span class="unread">Olästa</span>' . "\n";
    }
    echo '		<span class="author">Skapare</span>' . "\n";
    if ($options['expandbutton']) {
        echo '		<img id="discussion_list_expander" class="expander_button" src="' . IMAGE_URL . 'buttons/green_arrow_down_circle.png" alt="Expandera listan" />' . "\n";
    }
    echo '	</div>' . "\n";
    echo '	<br style="clear: both;" />' . "\n";
    echo '	<div class="discussions" ' . ($options['long_list'] ? ' style="height: 300px;" ' : '') . ' id="discussion_list">' . "\n";
    foreach ($discussions as $discussion) {
        $discussion['title'] = strlen($discussion['title']) > DISCUSSIONS_LIST_TITLE_LENGTH - 2 ? substr($discussion['title'], 0, DISCUSSIONS_LIST_TITLE_LENGTH) . '...' : $discussion['title'];
        $parent = forum_get_parent_category($discussion['category_handle']);
        echo "\n" . '		<!-- Discussion #' . $discussion['id'] . ' (' . $discussion['handle'] . ') -->' . "\n";
        echo '		<div class="discussion" id="discussion_' . $discussion['id'] . '">' . "\n";
        echo '			<div class="discussion_main">' . "\n";
        echo '				<div class="title">' . "\n";
        //if($_SESSION['login']['id'] == 644314) echo date('Y-m-d',$discussion['timestamp']);
        if (isset($options['post'][$discussion['id']]['post_id'])) {
            echo '<a href="' . posts_url_get($options['post'][$discussion['id']]['post_id']) . '">' . $discussion['title'] . '</a>' . "\n";
        } else {
            echo '<a href="/forum/' . $parent . '/' . $discussion['category_handle'] . '/' . $discussion['handle'] . '/">' . $discussion['title'] . '</a>' . "\n";
        }
        echo '</div>' . "\n";
        echo '<span class="answers">' . $discussion['posts'] . '</span>' . "\n";
        if (login_checklogin()) {
            if ($discussion['posts'] - $discussion['read_posts'] > 0) {
                echo '				<span class="unread">' . ($discussion['posts'] - $discussion['read_posts']) . '</span>' . "\n";
            } else {
                echo '				<span class="unread_zero">0</span>' . "\n";
            }
        }
        echo '				<div class="author">' . "\n";
        echo '					<a href="/traffa/profile.php?id=' . $discussion['author'] . '">' . $discussion['author_username'] . '</a>' . "\n";
        echo '				</div>' . "\n";
        if ($options['checkbox']) {
            echo '<input type="checkbox" class="chkbox_remove" id="discussion_watch_delete_' . $discussion['id'] . '" />';
        }
        echo '			</div>' . "\n";
        /*
        		echo '<div class="discussion_extra" id="discussion_extra_' . $discussion['id'] . '">' . "\n";
        		echo '<span class="time">' . fix_time($discussion['timestamp']) . '</span>' . "\n";
        		echo '<h5>Taggad som</h5>' . "\n";
        		echo '<span class="tags">' . "\n";
        		foreach($discussion['tags'] AS $tag)
        		{
        			echo $tag['label'] . ', ' . "\n";
        		}
        		echo '</span>' . "\n";
        		echo '</div>' . "\n";
        */
        echo '		</div>' . "\n";
    }
    echo '	</div>' . "\n";
    if ($options['checkbox']) {
        echo '<button class="button_50" id="submit_selections" onclick="javascript: discussions_submit_selections_click(\'' . $options['action'] . '\');" >' . $options['caption'] . '</button>' . "\n";
    }
    echo '</div>' . "\n\n";
}
Example #3
0
                    echo '<h1>Hörru du din tjuv! Låt bli andras inlägg!</h1>' . "\n";
                    exit;
                }
                $query = 'UPDATE posts SET content="' . mysql_real_escape_string(html_entity_decode($_POST['post_form_content'])) . '" WHERE id="' . $_POST['post_id'] . '"';
                mysql_query($query) or die(report_sql_error($result, __FILE__, __LINE__));
                echo '<h1>Inlägget sparat</h1>' . "\n";
                echo '<p>Stäng det här fönstret och ladda om forumsidan för att se ditt inlägg.</p>' . "\n";
                break;
            case 'post_comment_save':
                $posts = posts_fetch(array('post_id' => $_POST['post_id']));
                $post = array_pop($posts);
                new_entry($post['author'], $_SESSION['login']['id'], $_POST['post_form_content']);
                echo '<h5>Kommentaren är nu skickad. Du kan stänga det här fönstret.</h5>' . "\n";
                break;
            case 'post_delete_comment_save':
                $posts = posts_fetch(array('post_id' => $_POST['post_id']));
                $post = array_pop($posts);
                $discussions = discussions_fetch(array('id' => $post['discussion_id']));
                $discussion = array_pop($discussions);
                $message = 'Ditt inlägg i diskussionen <a href="' . posts_url_get($_POST['post_id']) . '">' . $discussion['title'] . '</a> har tagits bort.<br />' . $_POST['post_form_content'];
                new_entry($post['author'], $_SESSION['login']['id'], $message);
                echo '<h5>Användaren är nu informerad. Du kan stänga det här fönstret.</h5>' . "\n";
                break;
            case 'discussion_delete_comment_save':
                $message = 'Din diskussion ' . $_POST['discussion_title'] . ' har tagits bort. Ordningsvakten hälsar: ' . $_POST['post_form_content'];
                new_entry($_POST['discussion_author'], $_SESSION['login']['id'], $message);
                echo '<h5>Användaren är nu informerad. Du kan stänga det här fönstret.</h5>' . "\n";
                break;
        }
    }
}