Example #1
0
function list_avatars()
{
    global $hp_url;
    $result = mysql_query('SELECT login.id, login.username, userinfo.gender, userinfo.birthday FROM login, userinfo WHERE login.id = userinfo.userid && image = "1" LIMIT 40');
    if (mysql_num_rows($result) == 0) {
        echo '<br /><br />Hittade inga avatarer som inte validerats.';
    } else {
        echo '<a href="' . $_SERVER['PHP_SELF'] . '?selectall=">Kryssa "Ja" på alla.</a>';
        echo ' | <a onclick="alert(\'Nehejdu :P det går inte ;)\')" style="cursor: pointer;">Döda deras mammor.</a>';
        echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post" name="avatarform">';
        $columns = 0;
        rounded_corners_top();
        echo '<table class="body"><tr>';
        while ($data = mysql_fetch_assoc($result)) {
            if ($data['gender'] == 'F') {
                $bgstyle = 'background: #F7F7F7 url(\'/images/klotterplankbgF.png\') repeat-x;';
            } elseif ($data['gender'] == 'P') {
                $bgstyle = 'background: #F7F7F7 url(\'/images/klotterplankbgP.png\') repeat-x;';
            } else {
                $bgstyle = 'background: #F7F7F7 url(\'/images/klotterplankbg.png\') repeat-x;';
            }
            echo '<td style="' . $bgstyle . ' vertical-align: top;">';
            echo '<a href="' . $hp_url . 'traffa/profile.php?id=' . $data['id'] . '"><b>' . $data['username'] . '</b></a>';
            if ($data['gender'] != NULL) {
                echo ' ' . $data['gender'];
            }
            if ($data['birthday'] != '0000-00-00') {
                $yrsold = floor((time() - strtotime($data['birthday'])) / 31536000);
                echo $yrsold . '';
            }
            echo '<br />';
            echo ui_avatar($data['id']);
            echo '<br />';
            echo '<table><tr>';
            $selected = '';
            if (isset($_GET['selectall'])) {
                $selected = 'checked ';
            }
            echo '<td><input ' . $selected . 'type="radio" name="user' . $data['id'] . '" value="2"></td>';
            echo '<td><input type="radio" name="user' . $data['id'] . '" value="3"></td>';
            echo '<td><input type="radio" name="user' . $data['id'] . '" value="4"></td>';
            echo '</tr><tr>';
            echo '<td style="text-align: center;"><a style="cursor:  pointer;" onclick="document.avatarform.user' . $data['id'] . '[0].checked = true;">Y</a></td>';
            echo '<td style="text-align: center;"><a style="cursor:  pointer;" onclick="document.avatarform.user' . $data['id'] . '[1].checked = true;">N</a></td>';
            echo '<td style="text-align: center;"><a style="cursor:  pointer;" onclick="document.avatarform.user' . $data['id'] . '[2].checked = true;">X</a></td>';
            echo '</tr></table>';
            $columns++;
            if ($columns == 6) {
                echo '</tr><tr>';
                $columns = 0;
            }
            echo '</td>';
        }
        echo '</tr>';
        echo '</table>';
        rounded_corners_bottom();
        echo '<input type="submit" value="Korsfäst!" class="button_80">';
        echo '</form>';
    }
}
Example #2
0
function render_entries($entries, $options)
{
    $content .= '<ul class="group_entries">' . "\n";
    foreach ($entries as $entry) {
        $options['user_id'] = $entry['user_id'];
        $content .= message_top($options);
        $content .= '<div style="border-bottom: 1px solid #ababab;">' . "\n";
        $content .= '<span class="timestamp">' . fix_time($entry['timestamp']) . '</span>' . "\n";
        $content .= '<h2 style="display: inline;">' . $entry['header'] . '</h2> - <a href="/traffa/profile.php?id=' . $entry['user_id'] . '">' . $entry['username'] . '</a> ' . "\n";
        $content .= $entry['gender'];
        $content .= date_get_age($entry['birthday']);
        $content .= '<p>' . "\n";
        $content .= nl2br(html_entity_decode($entry['content'])) . "\n";
        $content .= '</p>' . "\n";
        $content .= '</div>' . "\n";
        // ----START----
        $content .= $_GET['action'] != 'show' ? '<a href="/hamsterpaj/hamsterblogg.php?action=show&id=' . $entry['id'] . '">Kommentera &raquo;</a>' : '<a href="/hamsterpaj/hamsterblogg.php">&laquo; Tillbaka</a>';
        // ----END------
        $content .= message_bottom();
        if ($options['enable_comments'] == true) {
            $content .= rounded_corners_top();
            $content .= '<label>Kommentera:</label>' . "\n";
            $content .= comments_input_draw($entry['id'], 'hamsterblog');
            $content .= rounded_corners_bottom();
            $content .= '<div style="clear: both;"></div>' . "\n";
            $content .= comments_list($entry['id'], 'hamsterblog');
        }
    }
    $content .= '</ul>' . "\n";
    return $content;
}
Example #3
0
function regform_header_p13()
{
    echo rounded_corners_top(array('color' => 'orange_deluxe'));
    $info2 .= '<img style="float: left; padding: 5px 5px 5px 0;" src="http://images.hamsterpaj.net/13skylt.png" />' . "\n";
    $info2 .= '<h1 style="margin: 0 0 3px 0; font-size: 16px;">Hamsterpaj är ingen barnsida, är du under 13 så använd www.lunarstorm.se</h1>' . "\n";
    $info2 .= '<p style="margin: 0 0 0 0;">Vi som gör Hamsterpaj tycker att medlemmar under 13 år ställer till en massa problem. Om du inte har fyllt 13 borde du läsa vår <a href="http://www.hamsterpaj.net/artiklar/?action=show&id=24">ålderspolicy</a> och fundera på om Hamsterpaj är rätt ställe för dig. Annars rekommenderar vi Lunarstorm, där kan man få häftiga statuspoäng!</p>' . "\n";
    $info2 .= '<div style="clear:both;"></div>' . "\n";
    echo $info2;
    echo rounded_corners_bottom(array('color' => 'orange_deluxe'));
}
Example #4
0
function echo_sysop_images($params)
{
    if ($params['return_options'] == true) {
        $query = 'SELECT `id`, `username` FROM login WHERE `userlevel` = \'5\' LIMIT 20';
        $result = mysql_query($query);
        while ($row = mysql_fetch_array($result)) {
            $sysop_id = $row["id"];
            $sysop_name = $row["username"];
            $out .= '<option value="' . $sysop_id . '">' . $sysop_name . '</option>';
        }
    } else {
        $out .= '<h1>Våra soeta Sysops</h1>';
        $out .= '<div id="sysops" class="sysops">';
        $out .= rounded_corners_top(array("color" => "blue_deluxe"));
        $out .= '<ul class="rita_img">';
        $query = 'SELECT `id`, `username` FROM login WHERE `userlevel` = \'5\' LIMIT 20';
        $result = mysql_query($query);
        while ($row = mysql_fetch_array($result)) {
            $sysop_id = $row["id"];
            $sysop_name = $row["username"];
            if (file_exists(IMAGE_PATH . 'images/users/thumb/' . $sysop_id . '.jpg')) {
                $out .= '<li class="imgli">';
                $out .= '';
                $out .= ui_avatar($sysop_id);
                $out .= '';
                $out .= '<a href="/traffa/profile.php?user_id=' . $sysop_id . '">' . $sysop_name . '</a>';
                $out .= '</li>';
            } else {
                $out .= '<li class="imgli">';
                $out .= '<a href="/traffa/profile.php?user_id=' . $sysop_id . '">';
                $out .= '<img src="http://images.hamsterpaj.net/tavling/gissa.png" class="user_avatar" />';
                $out .= '</a>';
                $out .= '<a href="/traffa/profile.php?user_id=' . $sysop_id . '">' . $sysop_name . '</a>';
                $out .= '</li>';
            }
        }
    }
    return $out;
}
Example #5
0
require '/storage/www/www.hamsterpaj.net/data/include/libraries/developer_blog.lib.php';
require PATHS_INCLUDE . 'libraries/comments.lib.php';
$ui_options['stylesheets'][] = 'abuse.css';
$ui_options['javascripts'][] = 'start.js';
$ui_options['javascripts'][] = 'comments.js';
$ui_options['stylesheets'][] = 'comments.css';
$ui_options['stylesheets'][] = 'groups.css';
$ui_options['title'] = 'Hamsterpajs utvecklare skriver för brinnande livet! - Hamsterpaj.net';
$ui_options['menu_path'] = array('hamsterpaj', 'utvecklarblogg');
switch ($_GET['action']) {
    case 'compose':
        if (!is_privilegied('developer_blog_admin')) {
            $out .= 'Lol, jag glömde att stänga för alla :).<br /><a href="/hamsterpaj/utvecklarblogg.php">Tillbaka</a>';
        } else {
            $out .= '<h2>Skriv nytt inlägg i utvecklarbloggen :)</h2>';
            $out .= rounded_corners_top($void, true);
            $out .= '<form action="' . $_SERVER['PHP_SELF'] . '?action=insert" method="post">' . "\n";
            $out .= '<label for="header">Rubrik</label><br />' . "\n";
            $out .= '<input type="text" name="header" /><br />' . "\n";
            $out .= '<label for="content">Text:</label><br />' . "\n";
            $out .= '<textarea name="content" style="width: 500px; height: 300px;">' . "\n";
            $out .= '</textarea><br />' . "\n";
            $out .= '<input type="submit" value="Skriv" class="button_60" />' . "\n";
            $out .= '' . "\n";
            $out .= '</form>' . "\n";
            $out .= rounded_corners_bottom($void, true);
        }
        break;
    case 'insert':
        $query = 'INSERT INTO developer_blog (timestamp, author, header, content) VALUES (' . time() . ', ' . $_SESSION['login']['id'] . ', "' . $_POST['header'] . '", "' . $_POST['content'] . '")';
        mysql_query($query) or die(report_sql_error($query, __FILE__, __LINE__));
Example #6
0
            fwrite($handle, $css);
            fclose($handle);
        }
        // GET IMAGE
        $filename = $img_path . $uid . ".png";
        $handle = fopen($filename, "r");
        $img = fread($handle, filesize($filename));
        fclose($handle);
        // SUBMIT IMAGE
        $handle = fopen($img_path . "submits/" . $uid . ".png", "w+");
        fwrite($handle, $img);
        fclose($handle);
        if (file_exists($img_path . "submits/" . $uid . ".png") && file_exists($img_path . "submits/" . $uid . ".css")) {
            $output .= rounded_corners_top(array('color' => 'orange_deluxe'), true);
            $output .= 'Allt gick fint, vi meddelar dig n&auml;r vi har tittat p&aring; ditt tema.<br />
			<a href="/profilteman">G&aring; tillbaka.</a>';
            $output .= rounded_corners_bottom(array('color' => 'orange_deluxe'), true);
            $query = "INSERT INTO `profile_bg_candidates_submits` (`user_id`, `timestamp`, `status`, `theme_name`) \r\n\t\t\tVALUES ('{$uid}', '" . date("U") . "', '0', '" . $_POST['theme_name'] . "')";
            mysql_query($query);
        }
    } else {
        $output .= rounded_corners_top(array('color' => 'orange_deluxe'), true);
        $output .= '<form action="/profilteman/ptsubmit.php" method="post">
		V&auml;lj ett namn f&ouml;r ditt tema:<input name="theme_name" type="text" /><input type="submit" value="Ok" /><br />
		<a href="/profilteman">G&aring; tillbaka.</a>
		</form>';
        $output .= rounded_corners_bottom(array('color' => 'orange_deluxe'), true);
    }
}
echo $output;
ui_bottom();
Example #7
0
if (is_privilegied('ascii_art_admin')) {
    if (isset($_GET['delete']) && is_numeric($_GET['delete']) && (int) $_GET['delete'] > 0) {
        $query = 'DELETE FROM ascii_art WHERE id = ' . $_GET['delete'] . ' LIMIT 1';
        mysql_query($query) or report_sql_error($query);
        jscript_alert('Go, went och... GONE!');
        jscript_location('ascii_art.php');
    }
}
if (is_privilegied('ascii_art_admin')) {
    if (isset($_POST['title'], $_POST['the_art'])) {
        $query = 'INSERT INTO ascii_art (title, the_art) VALUES ("' . $_POST['title'] . '", "' . $_POST['the_art'] . '")';
        mysql_query($query) or report_sql_error($query);
        jscript_alert('Vi har nu lagt till ASCII-arten i databasen. Det kan dröja upp till 60 sekunder innan den dyker upp bland de andra ASCII-artsen!');
        jscript_location('ascii_art.php');
    }
    echo rounded_corners_top(array('color' => 'white'));
    ?>
		<form method="post" action="<?php 
    echo $_SERVER['PHP_SELF'];
    ?>
">
			<input type="text" name="title" /> (titel)<br />
			<textarea name="the_art" style="width: 100%; height: 300px"></textarea><br />
			<input type="submit" value="Skapa" class="button_80" />
		</form>
		<?php 
    echo rounded_corners_bottom();
}
ui_bottom();
?>
	
function movie_compability_compare($users, $report_user)
{
    /* The $report_user is the user viewing the report */
    global $MOVIE_CATEGORIES;
    if (count($users) > 5) {
        echo '<h1>Du kan som mest jämföra dig med fyra personer samtidigt!</h1>' . "\n";
        echo '<p>En eller flera personer har plockats bort ur jämförelsen, försök att jämföra max fyra personer åt gången.</p>' . "\n";
        $temp = $users;
        $users = array();
        $count = 0;
        foreach ($users as $key => $value) {
            $users[$key] = $value;
            $count++;
            if ($count == 5) {
                break;
            }
        }
    }
    $i = 1;
    foreach (array_keys($users) as $user_id) {
        $bar_ids[$user_id] = $i;
        $i++;
    }
    $users[$report_user]['username'] = '******';
    /* Fetch all the test info and store in the $users array */
    $query = 'SELECT * FROM movie_tests WHERE owner IN("' . implode(array_keys($users), '", "') . '")';
    $result = mysql_query($query) or die(report_sql_error($query, __FILE__, __LINE__));
    while ($data = mysql_fetch_assoc($result)) {
        $users[$data['owner']]['movie_scores'][$data['movie_id']] = $data['score'];
    }
    $all_movies = movie_compability_fetch();
    foreach ($all_movies as $movie) {
        foreach (array_keys($users) as $user_id) {
            /* Count total seen movies? */
            $users[$user_id]['seen_movies'] += isset($users[$user_id]['movie_scores'][$movie['id']]['score']) ? 1 : 0;
            /* Count seen movies in specific category */
            $users[$user_id][$movie['category']]['seen_movies'] += isset($users[$user_id]['movie_scores'][$movie['id']]['score']) ? 1 : 0;
            /* Increase the total score for the specific category and user */
            $users[$user_id][$movie['category']]['total_score'] += $users[$user_id]['movie_scores'][$movie['id']]['score'];
            if (isset($users[$report_user]['movie_scores'][$movie['id']]['score']) && isset($users[$user_id]['movie_scores'][$movie['id']]['score'])) {
                /* Total distance and common movies */
                $users[$user_id]['total_distance'] += abs($users[$report_user]['movie_scores'][$movie['id']]['score'] - $users[$user_id]['movie_scores'][$movie['id']]['score']);
                $users[$user_id]['common_movies']++;
                /* Total distance and common movies for this category */
                $users[$user_id][$movie_category]['total_distance'] += abs($users[$report_user]['movie_scores'][$movie['id']]['score'] - $users[$user_id]['movie_scores'][$movie['id']]['score']);
                $users[$user_id][$movie_category]['common_movies']++;
            }
            /* Mark the movie as seen if anyone of you has seen it */
            if (isset($users[$user_id]['movie_scores'][$movie['id']]['score'])) {
                $all_movies[$movie['handle']]['seen'] = 1;
                $all_movies[$movie['handle']]['scores'][$user_id] = $users[$user_id]['movie_scores'][$movie['id']]['score'];
            }
        }
    }
    /* Loop through all movies and set the score_spread key */
    foreach ($all_movies as $movie_handle => $movie) {
        $all_movies[$movie_handle]['average_score'] = array_sum($movie['scores']) / count($movie['scores']);
        foreach ($movie['scores'] as $score) {
            $all_movies[$movie_handle]['score_spread'] += abs($all_movies[$movie_handle]['average_score'] - $score);
        }
    }
    foreach (array_keys($users) as $user_id) {
        foreach ($MOVIE_CATEGORIES as $category_handle => $category) {
            $users[$user_id][$category_handle]['average_score'] = round($users[$user_id][$category_handle]['total_score'] / $users[$user_id][$category_handle]['seen_movies'], 1);
        }
        $users[$user_id]['match'] = 100 - round($users[$user_id][$movie_category]['total_distance'] / $users[$user_id]['common_movies'] / 5 * 100);
    }
    if (count($users) < 4) {
        foreach ($users as $user_id => $user) {
            if ($user_id != $report_user) {
                $output .= '<h1>Du och ' . $user['username'] . ' matchar till ' . $user['match'] . '%</h1>' . "\n";
            }
        }
        rounded_corners($output, array('style' => 'text-align: center'));
    } else {
        foreach ($users as $user_id => $user) {
            if ($user_id != $report_user) {
                $output .= '<h1>Du och ' . $user['username'] . ' matchar till ' . $user['match'] . '%</h1>' . "\n";
            }
        }
        rounded_corners($output, array('style' => 'text-align: center'));
    }
    rounded_corners_top(array('color' => 'white'));
    echo '<h3>Hur många filmer har ni sett?</h3>' . "\n";
    echo '<div class="bars">' . "\n";
    foreach ($users as $user_id => $user) {
        $user_label = $user_id == $report_user ? 'Du' : $user['username'];
        echo '<div class="bar_' . $bar_ids[$user_id] . '" style="width: ' . $user['seen_movies'] * 6 . 'px;">' . "\n";
        echo '<span class="person">' . $user_label . '</span>' . "\n";
        echo '<span class="movie_count">' . $user['seen_movies'] . 'st</span>' . "\n";
        echo '</div>' . "\n";
    }
    echo '</div>' . "\n";
    rounded_corners_bottom(array('color' => 'white'));
    rounded_corners_top(array('color' => 'white', 'id' => 'movie_compare_categories'));
    echo '<h3>Vad tycker ni egentligen om olika sorters film?</h3>' . "\n";
    foreach ($MOVIE_CATEGORIES as $category_handle => $category) {
        echo '<div class="bars">' . "\n";
        echo '<h4>' . $category['label'] . '</h4>' . "\n";
        foreach ($users as $user_id => $user) {
            echo '<div class="score">' . $user[$category_handle]['average_score'] . '</div>' . "\n";
            echo '<div class="bar_' . $bar_ids[$user_id] . '" style="width: ' . round($user[$category_handle]['average_score'] * 12) . 'px; float: left;"></div>' . "\n";
        }
        echo '</div>' . "\n";
    }
    echo '<br style="clear: both;" />' . "\n";
    rounded_corners_bottom(array('color' => 'white'));
    rounded_corners_top(array('color' => 'white', 'id' => 'movie_compability_not_seen_list'));
    echo '<h3>Hey, ingen av er har kollat in dom här rullarna!</h3>' . "\n";
    foreach ($all_movies as $movie) {
        echo '<ul>' . "\n";
        if ($movie['seen'] != 1) {
            echo '<li id="movie_not_seen_control_' . $movie['handle'] . '" class="movie_not_seen_control">' . $movie['title'] . '</li>' . "\n";
            echo '<div class="movie" id="movie_not_seen_' . $movie['handle'] . '">' . "\n";
            echo '<img src="' . IMAGE_URL . 'movie_compability/folders/' . $movie['handle'] . '.png" alt="' . $movie['handle'] . '" />' . "\n";
            echo '<h3>' . $movie['title'] . '</h3>' . "\n";
            echo '<p>' . $movie['description'] . '</p>' . "\n";
            echo '</div>' . "\n";
        }
        echo '</ul>' . "\n";
    }
    rounded_corners_bottom(array('color' => 'white'));
    echo '<div class="bars">' . "\n";
    foreach ($users as $user_id => $user) {
        echo '<div class="bar_' . $bar_ids[$user_id] . '" style="width: 100px; float: left; margin-right: 10px; text-align: center;">' . $user['username'] . '</div>' . "\n";
    }
    echo '</div>' . "\n";
    /* Movies with high score spread */
    foreach ($all_movies as $movie_handle => $movie) {
        $score_spreads[$movie_handle][] = $movie['score_spread'];
    }
    arsort($score_spreads);
    rounded_corners_top(array('color' => 'white', 'id' => 'movie_compare_score_spread'));
    echo '<h3>Filmer ni inte är överrens om</h3>' . "\n";
    $i = 0;
    foreach ($score_spreads as $movie_handle => $score_spread) {
        if ($i < 4 && $score_spread > 5) {
            echo '<div class="bars">' . "\n";
            echo '<h4>' . $movie_handle . '</h4>' . "\n";
            foreach ($all_movies[$movie_handle]['scores'] as $user_id => $score) {
                echo '<div class="score">' . $score . '</div>' . "\n";
                if (in_array($user_id, array_keys($all_movies[$movie_handle]['scores']))) {
                    echo '<div class="bar_' . $bar_ids[$user_id] . '" style="width: ' . round($score * 18) . 'px; float: left;"></div>' . "\n";
                } else {
                    echo 'Ej sett';
                }
            }
            echo '</div>' . "\n";
            $i++;
        }
    }
    echo '<br style="clear: both;" />' . "\n";
    rounded_corners_bottom(array('color' => 'white'));
    /* Popular and unpopular movies */
    foreach ($all_movies as $movie) {
        $movie_popularity[$movie['handle']] = $movie['average_score'];
    }
    arsort($movie_popularity);
    rounded_corners_top(array('color' => 'white'));
    echo '<div id="movie_compare_most_popular">' . "\n";
    echo '<h3>Skitbra rullar</h3>' . "\n";
    $i = 0;
    foreach ($movie_popularity as $movie_handle => $average_score) {
        if ($i < 2 && count($all_movies[$movie_handle]['scores']) >= count($users) - floor(count($users) / 3)) {
            echo '<div class="bars">' . "\n";
            echo '<h4>' . $movie_handle . '</h4>' . "\n";
            foreach ($all_movies[$movie_handle]['scores'] as $user_id => $score) {
                echo '<div class="score">' . $score . '</div>' . "\n";
                if (in_array($user_id, array_keys($all_movies[$movie_handle]['scores']))) {
                    echo '<div class="bar_' . $bar_ids[$user_id] . '" style="width: ' . round($score * 18) . 'px; float: left;"></div>' . "\n";
                } else {
                    echo 'Ej sett';
                }
            }
            echo '</div>' . "\n";
            $i++;
        }
    }
    echo '</div>' . "\n";
    echo '<div id="movie_compare_most_unpopular">' . "\n";
    echo '<h3>Filmer som suger</h3>' . "\n";
    asort($movie_popularity);
    $i = 0;
    foreach ($movie_popularity as $movie_handle => $average_score) {
        if ($i < 2 && count($all_movies[$movie_handle]['scores']) >= count($users) - floor(count($users) / 3)) {
            echo '<div class="bars">' . "\n";
            echo '<h4>' . $movie_handle . '</h4>' . "\n";
            foreach ($all_movies[$movie_handle]['scores'] as $user_id => $score) {
                echo '<div class="score">' . $score . '</div>' . "\n";
                if (in_array($user_id, array_keys($all_movies[$movie_handle]['scores']))) {
                    echo '<div class="bar_' . $bar_ids[$user_id] . '" style="width: ' . round($score * 18) . 'px; float: left;"></div>' . "\n";
                } else {
                    echo 'Ej sett';
                }
            }
            echo '</div>' . "\n";
            $i++;
        }
    }
    echo '</div>' . "\n";
    echo '<br style="clear: both;" />' . "\n";
    rounded_corners_bottom(array('color' => 'white'));
}
Example #9
0
function list_entries($recipient, $entries, $offset = 0, $filter = 0)
{
    global $hp_includepath;
    if ($offset < 1 || !is_numeric($offset)) {
        $offset = 0;
    }
    $list_sql = 'SELECT gb.id, gb.timestamp, gb.message, gb.sender, gb.read, gb.answered, gb.forum_post, login.username, info.image, ';
    $list_sql .= 'info.birthday, info.gender, is_private, zip_codes.* ';
    $list_sql .= 'FROM traffa_guestbooks AS gb, login, userinfo AS info, zip_codes ';
    if ($filter > 0) {
        $list_sql .= 'WHERE (';
        $list_sql .= '(gb.recipient ="' . $recipient . '" AND gb.sender = "' . $filter . '") ';
        $list_sql .= 'OR (gb.recipient = "' . $filter . '" AND gb.sender = "' . $recipient . '") ';
        $list_sql .= ') AND login.id = gb.sender AND info.userid = gb.sender AND zip_codes.zip_code = info.zip_code ';
    } else {
        $list_sql .= 'WHERE gb.recipient = "' . $recipient . '" AND zip_codes.zip_code = info.zip_code ';
    }
    $list_sql .= 'AND login.id = gb.sender AND info.userid = gb.sender AND deleted = 0 ';
    if (isset($_SESSION['login']['id'])) {
        $list_sql .= 'AND (gb.is_private = 0 OR gb.sender = ' . $_SESSION['login']['id'] . ' OR gb.recipient = ' . $_SESSION['login']['id'] . ') ';
    } else {
        $list_sql .= 'AND gb.is_private = 0 ';
    }
    if ($filter > 0) {
        $list_sql .= 'ORDER BY gb.id DESC';
    } else {
        $list_sql .= 'ORDER BY gb.id DESC LIMIT ' . $offset . ', ' . GUESTBOOK_MESSAGES_PER_PAGE;
    }
    $list_result = mysql_query($list_sql) or die(report_sql_error($list_sql));
    if ($filter == 0) {
        echo '<p class="subtitle">Gästbok - ' . cute_number($entries) . ' inlägg</p>' . "\n";
    } else {
        echo '<p class="subtitle">Gästbok - Visar historik</p>' . "\n";
    }
    if ($offset > 0) {
        echo ' - sida ' . intval($offset / GUESTBOOK_MESSAGES_PER_PAGE + 1) . ' av ' . intval($entries / GUESTBOOK_MESSAGES_PER_PAGE + 1);
    }
    echo '</p>' . "\n";
    $unread = array();
    if (true) {
        while ($entry = mysql_fetch_assoc($list_result)) {
            if ($entry['read'] != 1) {
                rounded_corners_top(array('color' => 'orange_deluxe', 'id' => 'gb_entry_' . $entry['id']));
            } else {
                rounded_corners_top(array('color' => 'blue_deluxe', 'id' => 'gb_entry_' . $entry['id']));
                $button_color = 'blue_';
            }
            echo '<div class="entry_picture">' . "\n";
            if ($entry['image'] == 1 || $entry['image'] == 2) {
                echo ui_avatar($entry['sender']);
            }
            echo '</div>' . "\n";
            echo '<div class="entry_main">' . "\n";
            echo '<div class="entry_info">' . "\n";
            echo '<span class="gb_private" id="gb_private_' . $entry['id'] . '_label">';
            echo $entry['is_private'] == 1 ? 'Detta inlägg är privat' : '';
            echo '</span>' . "\n";
            echo '<span class="gb_unanswered" id="gb_unanswered_' . $entry['id'] . '_label">';
            echo $entry['answered'] != 'Y' ? 'Obesvarat' : '';
            echo '</span>' . "\n";
            echo '<span class="timestamp">Skrevs ' . fix_time($entry['timestamp']) . '</span>';
            echo '<a href="/traffa/profile.php?id=' . $entry['sender'] . '">' . $entry['username'] . '</a>' . "\n";
            echo $entry['gender'] == 'm' ? ' Pojke' : '';
            echo $entry['gender'] == 'f' ? ' Flicka' : '';
            echo $entry['birthday'] != '0000-00-00' ? ' ' . date_get_age($entry['birthday']) . ' år' : '';
            echo strlen($entry['spot']) > 0 ? ' från <a style="cursor: pointer;" onclick="window.open(\'http://www.hitta.se/LargeMap.aspx?ShowSatellite=false&pointX=' . $entry['y_rt90'] . '&pointY=' . $entry['x_rt90'] . '&cx=' . $entry['y_rt90'] . '&cy=' . $entry['x_rt90'] . '&z=6&name=' . $entry['username'] . '%20i%20' . urlencode($entry['spot']) . '\', \'user_map_3\', \'location=false, width=750, height=500\');">' . $entry['spot'] . '</a>' : '';
            echo '</div>' . "\n";
            echo '<p>' . "\n";
            echo setsmilies(nl2br($entry['message']));
            //			preint_r($entry);
            echo '</p>' . "\n";
            echo '</div>' . "\n";
            echo '<div class="entry_controls">' . "\n";
            echo $recipient == $_SESSION['login']['id'] && $entry['sender'] != $_SESSION['login']['id'] ? '<a href="/hamsterpaj/abuse.php?report_type=guestbook_entry&reference_id=' . $entry['id'] . '" class="abuse_button"><img src="http://images.hamsterpaj.net/abuse.png" /></a> ' . "\n" : '';
            echo $recipient == $_SESSION['login']['id'] && $entry['sender'] != $_SESSION['login']['id'] ? '<button class="' . $button_color . 'button_70" onclick="gb_block_user(\'' . $entry['username'] . '\');">Blockera</button> ' . "\n" : '';
            echo $recipient == $_SESSION['login']['id'] || $entry['sender'] == $_SESSION['login']['id'] ? '<button id="gb_private_' . $entry['id'] . '" class="' . $button_color . 'button_80" onclick="gb_private(' . $entry['id'] . ');"' . ($entry['is_private'] == 1 ? ' style="display: none;"' : '') . '>Privatisera</button> ' . "\n" : '';
            echo $recipient == $_SESSION['login']['id'] && $entry['sender'] != $_SESSION['login']['id'] ? '<button id="gb_unprivate_' . $entry['id'] . '" class="' . $button_color . 'button_90" onclick="gb_unprivate(' . $entry['id'] . ');"' . ($entry['is_private'] == 1 ? '' : ' style="display: none;"') . '>Avprivatisera</button> ' . "\n" : '';
            echo '<button class="' . $button_color . 'button_70" onclick="gb_history(' . $recipient . ', ' . $entry['sender'] . ');">Historik</button> ' . "\n";
            echo '<button class="' . $button_color . 'button_60" onclick="gb_goto(' . $entry['sender'] . ');">Gå till</button> ' . "\n";
            echo $recipient == $_SESSION['login']['id'] && $entry['sender'] != $_SESSION['login']['id'] ? '<button class="' . $button_color . 'button_60" onclick="gb_remove(' . $entry['id'] . ', \'' . $entry['username'] . '\', \'' . fix_time($entry['timestamp']) . '\');">Ta bort</button> ' . "\n" : '';
            echo $recipient == $_SESSION['login']['id'] && $entry['sender'] != $_SESSION['login']['id'] ? '<button class="' . $button_color . 'button_50" onclick="gb_answer(\'' . $entry['username'] . '\', ' . $entry['sender'] . ', ' . $entry['id'] . ');">Svara</button> ' . "\n" : '';
            echo '</div>' . "\n";
            if ($entry['read'] != 1) {
                rounded_corners_bottom(array('color' => 'orange_deluxe'));
            } else {
                rounded_corners_bottom(array('color' => 'blue_deluxe'));
            }
            if ($entry['read'] == 0) {
                array_push($unread, $entry['id']);
            }
        }
    } else {
        while ($list_data = mysql_fetch_assoc($list_result)) {
            if ($list_data['read'] == 1) {
                echo '<div style="background: #f7f7f7">' . "\n";
            } else {
                echo '<div style="background: #ffc777">' . "\n";
            }
            echo '<table class="body"><tr><td style="width: 80px; vertical-align: top;">' . "\n";
            if ($list_data['image'] == 1 || $list_data['image'] == 2) {
                echo insert_avatar($list_data['sender']);
            }
            echo '</td>' . "\n" . '<td style="vertical-align: top; width: 650px;">' . "\n";
            if ($list_data['is_private'] == 1) {
                echo '<b>Detta inlägg är privat</b>' . "\n";
            }
            if ($list_data['forum_post'] > 0) {
                echo '<div class="orange_faded_div" style="width: auto;">Detta är en kommentar på ett forumsinlägg. <a href="javascript: void(0);" onclick="window.open(\'/forum_new/read_post_popup.php?id=' . $list_data['forum_post'] . '\', Math.random(), \'width=600, height=450, scrollbars=yes\');">Läs inlägget i en popup</a> eller <a href="/forum_new/index.php?action=redirect_to_post&post_id=' . $list_data['forum_post'] . '">gå till tråden i forumet</a>.</div>';
            }
            if ($_SESSION['login']['id'] == $recipient) {
                $reply_status = $list_data['answered'] == 'Y' ? null : ' Obesvarat';
            }
            echo '<p style="color: grey;">';
            echo $list_data['read'] == 0 ? '<strong>' : null;
            echo '(skrevs ' . fix_time($list_data['timestamp']) . $reply_status . ')';
            echo $list_data['read'] == 0 ? '</strong>' : null;
            echo '<br />' . "\n";
            echo '<a href="/traffa/profile.php?id=' . $list_data['sender'] . '"><b>' . $list_data['username'] . '</b></a> ';
            if ($list_data['gender'] == 'm') {
                echo 'Kille ';
            } elseif ($list_data['gender'] == 'f') {
                echo 'Tjej ';
            }
            $userage = date_get_age($list_data['birthday']);
            if ($userage > 0) {
                echo $userage . ' år ';
            }
            if (strlen($list_data['spot']) > 0) {
                echo 'från ' . $list_data['spot'] . ' ';
            }
            echo '</p>' . "\n";
            echo '<p>';
            echo setSmilies(nl2br($list_data['message']));
            echo '</p>' . "\n";
            echo '<p style="text-align: right;">' . "\n";
            echo '<form action="/traffa/userblocks.php" method="post" style="display: inline; float: right;">' . "\n";
            if ($_SESSION['login']['id'] == $recipient && $filter == 0) {
                echo '<input type="submit" value="Blockera" class="button_70" style="display: inline;" onclick="return confirm(\'Du är på väg att blockera avsändaren från att skicka fler gästboksinlägg och meddelanden till dig\');" />' . "\n";
            }
            if ($filter == 0) {
                echo '<input type="button" onClick="window.location=\'' . $_SERVER['PHP_SELF'] . '?action=history&view=' . $recipient . '&remote=' . $list_data['sender'] . '\';" class="button_70" value="Historik" /> ' . "\n";
            }
            echo '<input type="button" onclick="window.location=\'' . $_SERVER['PHP_SELF'] . '?view=' . $list_data['sender'] . '\';" class="button_60" value="Gå till" /> ' . "\n";
            if ($_SESSION['login']['id'] == $recipient) {
                echo '<input type="button" onclick="window.open(\'/traffa/gb-reply.php?action=reply&username='******'username'] . '&userid=' . $list_data['sender'] . '&answereid=' . $list_data['id'];
                echo '\',\'\' ,\'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=250, height=200\');" value="Svara" class="button_50" /> ' . "\n";
                if ($filter == 0) {
                    echo '<input type="button" onclick="var name=confirm(\'Vill du verkligen ta bort inlägget?\'); if(name==true){ window.location=\'' . $_SERVER['PHP_SELF'] . '?action=delete&entry_id=' . $list_data['id'] . '&return_offset=' . $_GET['offset'] . '\'; }" value="Ta bort" class="button_70" />' . "\n";
                    echo '<input type="hidden" name="addblock" value="' . $list_data['username'] . '" />' . "\n";
                }
            }
            echo '</form>' . "\n";
            if ($_SESSION['login']['id'] == $recipient && $filter == 0) {
                echo '<button class="button_80" style="display: inline;" onclick="idiot_report(\'' . $list_data['sender'] . '\');" />Rapportera</button>' . "\n";
            }
            echo '</p>' . "\n";
            echo '</td></tr>' . "\n" . '</table>' . "\n";
            echo '</div>' . "\n";
            echo '<br />' . "\n";
            if ($list_data['read'] == 0) {
                array_push($unread, $list_data['id']);
            }
        }
    }
    if ($offset > 0) {
        echo '<input type="button" onclick="window.location=\'' . $_SERVER['PHP_SELF'] . '?offset=' . intval($offset - GUESTBOOK_MESSAGES_PER_PAGE) . '&view=' . $recipient . '\';" value="<<Föregående sida" class="button" style="float: left;" />';
    }
    if ($offset + GUESTBOOK_MESSAGES_PER_PAGE < $entries && $entries > GUESTBOOK_MESSAGES_PER_PAGE) {
        echo '<input type="button" onclick="window.location=\'' . $_SERVER['PHP_SELF'] . '?offset=' . intval($offset + GUESTBOOK_MESSAGES_PER_PAGE) . '&view=' . $recipient . '\';" value="Nästa sida>>" class="button" style="float: right;" />';
    }
    echo '<div style="text-align: center; margin-bottom: 15px;">';
    for ($pages = 1; $pages < intval($entries / GUESTBOOK_MESSAGES_PER_PAGE + 1) && $pages < 32; $pages++) {
        echo '<a href="' . $_SERVER['PHP_SELF'] . '?view=' . $recipient . '&offset=' . ($pages - 1) * GUESTBOOK_MESSAGES_PER_PAGE . '">' . $pages . '</a> ';
    }
    echo '</div>';
    if ($recipient == $_SESSION['login']['id'] && $filter == 0) {
        $read_sql = 'UPDATE traffa_guestbooks SET `read` = 1 WHERE id = 1 ';
        //Bara för att göra foreach-loopen smidigare :P
        foreach ($unread as $current) {
            $read_sql .= 'OR id = ' . $current . ' ';
        }
        mysql_query($read_sql) or die(report_sql_error($read_sql, __FILE__, __LINE__));
    }
}
Example #10
0
function photo_display_full($parameters)
{
    event_log_log('photo_display');
    $next_by_day = photo_get_photos(array('limit' => 1, 'photo_taken' => $parameters['image']['photo_taken'], 'order_direction' => 'ASC', 'internal_id_min' => $parameters['image']['internal_id']));
    $next_by_album = photo_get_photos(array('limit' => 1, 'album' => $parameters['image']['album'], 'order_direction' => 'ASC', 'internal_id_min' => $parameters['image']['internal_id']));
    $previous_by_day = photo_get_photos(array('limit' => 1, 'photo_taken' => $parameters['image']['photo_taken'], 'order_direction' => 'DESC', 'internal_id_max' => $parameters['image']['internal_id']));
    $previous_by_album = photo_get_photos(array('limit' => 1, 'album' => $parameters['image']['album'], 'order_direction' => 'DESC', 'internal_id_max' => $parameters['image']['internal_id']));
    echo '<div class="photo_full">' . "\n";
    echo '<div class="head">' . "\n";
    echo '<span class="date">' . $parameters['image']['photo_taken'] . '</span>' . "\n";
    if (strlen($parameters['image']['description']) > 0) {
        echo '<p class="photo_description">' . "\n";
        echo $parameters['image']['description'] . "\n";
        echo '</p>' . "\n";
    }
    echo '</div>' . "\n";
    // Photo with passepartout
    echo '<div class="photo_passepartout_outer">' . "\n";
    echo '<div class="photo_passepartout_inner">' . "\n";
    echo '<img src="' . PHOTO_FULL_IMAGE_URL . floor($parameters['image']['internal_id'] / 5000) . '/' . $parameters['image']['external_id'] . '.jpg" />' . "\n";
    echo '</div>' . "\n";
    echo '</div>' . "\n";
    echo '<div class="foot">' . "\n";
    echo '<div class="next">' . "\n";
    if ($next_by_day[0]['internal_id'] > 0) {
        echo '<a href="/fotoalbum/bild.php?photo=' . $next_by_day[0]['external_id'] . '"><button class="button_110">Samma dag &raquo;</button></a>' . "\n";
    }
    if ($next_by_album[0]['internal_id'] > 0) {
        echo '<a href="/fotoalbum/bild.php?photo=' . $next_by_album[0]['external_id'] . '"><button class="button_110">Samma album &raquo;</button></a>' . "\n";
    }
    echo '</div>' . "\n";
    echo '<div class="previous">' . "\n";
    if ($previous_by_day[0]['internal_id'] > 0) {
        echo '<a href="/fotoalbum/bild.php?photo=' . $previous_by_day[0]['external_id'] . '"><button class="button_110">&laquo; Samma dag</button></a>' . "\n";
    }
    if ($previous_by_album[0]['internal_id'] > 0) {
        echo '<a href="/fotoalbum/bild.php?photo=' . $previous_by_album[0]['external_id'] . '"><button class="button_110">&laquo; Samma album</button></a>' . "\n";
    }
    echo '</div>' . "\n";
    echo '</div>' . "\n";
    echo '</div>' . "\n";
    $query = 'UPDATE photos SET unread_comments = 0 WHERE internal_id = "' . $parameters['image']['internal_id'] . '" LIMIT 1';
    mysql_query($query);
    echo '<h2>Kommentarer</h2>' . "\n";
    echo '<h5>Här kan du lämna din kommentar</h5>' . "\n";
    echo comments_input_draw($parameters['image']['internal_id'], 'photo');
    rounded_corners_top();
    echo comments_list($parameters['image']['internal_id'], 'photo');
    rounded_corners_bottom();
    // Count views
    if (!in_array($parameters['image']['internal_id'], $_SESSION['photos']['viewed_photos'])) {
        $_SESSION['photos']['viewed_photos'][] = $parameters['image']['internal_id'];
        $query = 'UPDATE photos SET view_count = view_count + 1 WHERE internal_id = "' . $parameters['image']['internal_id'] . '" LIMIT 1';
        mysql_query($query);
    }
}
Example #11
0
echo '<input name="contact2_handle" type="text" class="textbox" size="50" value="' . $contact2['handle'] . '"><br/>';
echo '<br /><br />';
echo '<strong>Förnamn</strong><br />' . "\n";
echo '<input type="text" name="firstname" class="textbox" value="' . $_SESSION['traffa']['firstname'] . '" /><br /><br />' . "\n";
echo '<br />';
echo '<input type="submit" value="Spara frivillig information &raquo;" class="button_150" id="optional_info_submit" />';
echo '</form>' . "\n";
/*	echo '</div>' . "\n\n"; */
rounded_corners_tabs_bottom();
/* Lösenordsbyte */
echo '<a name="change_password"></a>';
/* echo '<div class="grey_faded_div">' . "\n"; */
rounded_corners_tabs_top();
echo '<h2 style="margin-top: 0px;">Byt lösenord</h2>' . "\n";
echo '<form action="' . $_SERVER['PHP_SELF'] . '?action=perform_changes&type=password" method="post">' . "\n";
echo '<table><tr style="font-weight: bold;"><td>Nuvarande lösenord</td><td>Nytt lösenord</td><td>Upprepa nytt lösenord</td></tr>' . "\n";
echo '<tr>' . "\n";
echo '<td><input type="password" name="password_old" class="textbox" /></td>' . "\n";
echo '<td><input type="password" name="password_new" class="textbox" /></td>' . "\n";
echo '<td><input type="password" name="password_verify" class="textbox" /></td>' . "\n";
echo '</tr></table><br />' . "\n";
echo '<input type="submit" class="button_80" value="Byt lösenord &raquo;" />' . "\n";
echo '</form>' . "\n";
/* echo '</div>' . "\n"; */
rounded_corners_tabs_bottom();
$rounded_corners_config['color'] = 'orange_deluxe';
$rounded_corners_config['return'] = true;
echo rounded_corners_top($rounded_corners_config);
echo '<span>Bytet av profiltema har flyttat. Du hittar det <a href="http://www.hamsterpaj.net/traffa/profile_presentation_change.php?action=theme_select">här</a></span>' . "\n";
echo rounded_corners_bottom($rounded_corners_config);
ui_bottom();
Example #12
0
</p>

<h4>Bra exempel på inlägg i nivå 2 kategorier:</h4>
<?php 
rounded_corners_top(array('color' => 'green'));
?>
  "Allt möjligt. Skaffa sommarjob, klippa gräs åt folk, va hundvakt när nån åker på semester lr nåt sånt.<br />
  Den desperate kan ju strippa lite ;)"
<?php 
rounded_corners_bottom(array('color' => 'green'));
?>


<h4>Dåliga exempel på inlägg i nivå 2 kategorier:</h4>
<?php 
rounded_corners_top(array('color' => 'red'));
?>
  "Vaddå jobba? spela wow hela sommararen istället!"<br />
  "Bli en lönnmördare och kräv 100000 kronor för att döda någon"<br />
  "hahaha XP"
<?php 
rounded_corners_bottom(array('color' => 'red'));
?>

<h2>Slapp</h2>
<p>
Detta är den nivå som har minst moderering. Chatt, skämt, offtopic  och liknande: Vi tillåter det mesta, men inga agressiva påhopp eller  rena lagförbrytelser.
</p>

<p>
Inga exempel, det är fritt fram att göra det mesta men det betyder  också att Ordningsvakter har fritt fram här att moderera om det börjar  bli påhopp, hot eller liknande.
Example #13
0
<?php

require '../include/core/common.php';
$ui_options['menu_path'] = array('traeffa', 'grupper');
$ui_options['title'] = 'Gruppnotiser - Hamsterpaj.net';
ui_top($ui_options);
if (login_checklogin() != 1) {
    jscript_alert('Du måste vara inloggad för att komma åt denna sidan!');
    jscript_location('index.php');
}
$output .= rounded_corners_top(array('color' => 'blue'));
echo '<h2 style="margin-top: 0px;">Nya inlägg i dina grupper</h2>';
foreach ($_SESSION['groups_members'] as $key => $value) {
    $query = 'SELECT groups_list.message_count, groups_members.read_msg, groups_list.name, groups_members.notices FROM groups_members, groups_list ';
    $query .= 'WHERE groups_members.groupid = ' . $value . ' AND groups_list.groupid = ' . $value;
    $query .= ' AND groups_members.userid =' . $_SESSION['login']['id'];
    $result = mysql_query($query) or die(report_sql_error($query));
    $data = mysql_fetch_assoc($result);
    if ($data['notices'] == "Y") {
        $new_posts = $data['message_count'] - $data['read_msg'];
        if ($new_posts > 0) {
            echo '<strong>';
        }
    }
    echo '<a href="groups.php?action=goto&groupid=' . $value . '">' . $data['name'] . '</a>';
    if ($data['notices'] == "Y") {
        echo ' - ' . $new_posts . ' nya inlägg.';
        if ($new_posts > 0) {
            echo '</strong>';
        }
    } else {
Example #14
0
function posts_list($posts, $discussions = null, $options)
{
    $options['quality_level'] = isset($options['quality_level']) ? $options['quality_level'] : 0;
    $options['mode'] = isset($options['mode']) ? $options['mode'] : 'forum';
    echo '<input type="hidden" id="debug_input" />';
    foreach ($posts as $i => $post) {
        /* Shall we display any discussion splits before the post? */
        $display_discussions = array();
        foreach ($discussions as $key => $discussion) {
            if ($discussion['timestamp'] <= $post['timestamp']) {
                $display_discussions[] = $discussion;
                unset($discussions[$key]);
            }
        }
        if (count($display_discussions) > 0) {
            discussions_list_splits($display_discussions);
        }
        if (in_array('private_gb', $post['flags'])) {
            echo '<h5 class="private_header">Privat inlägg</h5>' . "\n";
            if ($_SESSION['login']['id'] != $post['author'] && $_SESSION['login']['id'] != $options['gb_recipient']) {
                continue;
            }
        }
        echo '<!-- Post #' . $post['post_id'] . ' at ' . date('Y-m-d H:i:s', $post['timestamp']) . '-->' . "\n";
        echo '<a name="post_' . $post['post_id'] . '_anchor"></a>' . "\n";
        if (in_array('removed', $post['flags'])) {
            echo '<div class="removed_post">' . "\n";
            echo '<h2>Borttaget inlägg, skrevs ' . fix_time($post['timestamp']) . ' av <a href="/traffa/profile.php?id=' . $post['author'] . '">' . $post['username'] . '</a></h2>' . "\n";
            echo '</div>' . "\n";
            $displayed_posts[] = $post['post_id'];
            continue;
        }
        // todo!
        /*	detta skall användas för Skräpklassade inlägg, inlägg flaggade med junk
        		$rounded_corners_color = in_array('junk', $post['flags']) ? 'orange' : 
        									((login_checklogin() && strpos( $post['content'], $_SESSION['login']['username'])) ? 'orange' : 'blue');
        
        */
        $rounded_corners_color = login_checklogin() && strpos($post['content'], $_SESSION['login']['username']) ? 'orange' : 'blue';
        echo rounded_corners_top(array('id' => 'post_' . $post['post_id'], 'color' => $rounded_corners_color));
        echo '<div class="post">' . "\n";
        /* Head section */
        echo '<div class="head">' . "\n";
        echo '	<span class="date_time">Skrevs ' . fix_time($post['timestamp']) . '</span>' . "\n";
        echo '	<a href="/traffa/profile.php?id=' . $post['author'] . '">' . $post['username'] . '</a>' . "\n";
        if ($post['gender'] == 'm') {
            echo ' kille';
        } elseif ($post['gender'] == 'f') {
            echo ' tjej';
        }
        echo date_get_age($post['birthday']) > 0 ? ' ' . date_get_age($post['birthday']) . ' år' : '';
        echo strlen($post['spot']) > 0 ? ' från ' . $post['spot'] . "\n" : '';
        $onlinestatus = login_onlinestatus($post['lastaction'], $post['lastrealaction']);
        echo ' <span class="user_label_' . $onlinestatus['handle'] . '">' . $onlinestatus['label'] . '</span>' . "\n";
        echo '</div>' . "\n";
        /* Author pane */
        echo '<div class="author_pane">' . "\n";
        if ($post['image'] == 1 || $post['image'] == 2) {
            echo user_avatar($post['author']) . "\n";
        }
        echo '&nbsp;';
        echo birthdaycake($post['birthday']);
        echo '</div>' . "\n";
        echo '<div id="post_content_' . $post['post_id'] . '" class="content">' . "\n";
        $options_markup['post_id'] = $post['post_id'];
        $options_markup['context'] = 'forum';
        if ($post['no_smilies'] != 1) {
            echo setsmilies(markup_parse($post['content'], $options_markup));
        } else {
            echo markup_parse($post['content'], $options_markup);
        }
        if (strlen($post['forum_signature']) > 0) {
            echo '<div class="signature">' . $post['forum_signature'] . '</div>' . "\n";
        }
        if (strlen($post['user_status']) > 0) {
            echo '<p class="user_status">' . $post['user_status'] . '</p>' . "\n";
        }
        echo '</div>' . "\n";
        echo '<div class="controls">' . "\n";
        if (login_checklogin()) {
            $control_buttons['answer'] = '<input type="button" class="post_answer_button" id="post_answer_button_' . $post['post_id'] . '_' . $post['username'] . '" value="Svara" />';
            $control_buttons['comment'] = '<input type="button" class="post_comment_button" id="post_comment_button_' . $post['post_id'] . '_' . $post['username'] . '" value="Kommentera" />';
            $control_buttons['quote'] = '<input type="button" class="post_quote_button" id="post_quote_button_' . $post['post_id'] . '_' . $post['username'] . '" value="Citera" />';
            $control_buttons['history'] = '<input type="button" class="post_history_button" id="post_history_button_' . $post['post_id'] . '_' . $post['username'] . '" value="Historik" />';
            $control_buttons['delete'] = '<input type="button" class="post_delete_button" id="post_delete_button_' . $post['post_id'] . '_' . $post['username'] . '" value="Ta bort" />';
            $control_buttons['censor'] = '<input type="button" class="post_censor_button" id="post_censor_button_' . $post['post_id'] . '_' . $post['username'] . '" value="Censurera" />';
            $control_buttons['addition'] = '<input type="button" class="post_addition_button" id="post_addition_button_' . $post['post_id'] . '_' . $post['username'] . '" value="Tillägg" />';
            $control_buttons['link'] = '<input type="button" class="post_link_button" id="post_link_button_' . $post['post_id'] . '_' . $post['username'] . '" value="Direktlänk" />';
            $control_buttons['report'] = '<input type="button" class="post_report_button" value="Rapport" onclick="abuse_report(\'post\', \'' . $post['post_id'] . '\');" />';
            $control_buttons['edit'] = '<input type="button" class="post_edit_button" id="post_edit_button_' . $post['post_id'] . '_' . $post['username'] . '" value="Ändra"/>';
            $control_buttons['junk'] = '<input type="button" class="post_junk_button" id="post_junk_button_' . $post['post_id'] . '_' . $post['username'] . '" value="Skräp!"/>';
            $control_set['forum'] = array('answer', 'comment', 'quote', 'link');
            $control_set['guestbook'] = array('answer', 'quote', 'history');
            //			$control_set['game_comment'] = array();
            $control_set['admin'] = array('delete', 'censor', 'addition');
            // todo! Aktivera Skräpknappen när färgspecen är klar, 'junk');
            //			$control_set['game_admin'] = array('delete');
            foreach ($control_set[$options['mode']] as $button) {
                echo $control_buttons[$button] . "\n";
            }
            if (posts_admin_check($post)) {
                if ($options['mode'] == 'game_comment') {
                    $control_set['admin'] = $control_set['game_admin'];
                }
                foreach ($control_set['admin'] as $button) {
                    echo $control_buttons[$button] . "\n";
                }
            }
            if ($post['author'] == $_SESSION['login']['id']) {
                if (!posts_admin_check($post)) {
                    echo $control_buttons['addition'] . "\n";
                }
                if (time() < $post['timestamp'] + 20 * 60) {
                    echo $control_buttons['edit'] . "\n";
                }
            }
            if ($_SESSION['login']['userlevel'] == 2) {
                echo $control_buttons['report'];
            }
        }
        echo '</div>' . "\n";
        echo '<div class="post_addition" id="post_addition_' . $post['post_id'] . '">' . "\n";
        echo '	<textarea id="post_addition_content_' . $post['post_id'] . '" rows="3" cols="50"  ></textarea>' . "\n";
        echo '	<button class="button_60" id="post_addition_submit_' . $post['post_id'] . '" value="post_addition_' . $post['post_id'] . '">Spara</button>' . "\n";
        echo '</div>' . "\n";
        echo '<div class="post_link" id="post_link_' . $post['post_id'] . '">' . "\n";
        echo '<h5>Länken nedan går direkt till detta inlägg.</h5>' . "\n";
        echo '<input type="text" class="post_link_input" value="http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] . '#post_' . $post['post_id'] . '_anchor" />' . "\n";
        echo '</div>' . "\n";
        echo '</div>' . "\n";
        echo rounded_corners_bottom(array('color' => $rounded_corners_color));
        echo "\n\n";
        $displayed_posts[] = $post['post_id'];
    }
    if (login_checklogin()) {
        /* Remove all notices and answer notices for read posts */
        $query = 'DELETE FROM notices WHERE post_id IN("' . implode('", "', $displayed_posts) . '") AND user_id = "' . $_SESSION['login']['id'] . '"';
        mysql_query($query) or die(report_sql_error($query, __FILE__, __LINE__));
    }
    /* List the remaining discussions */
    if (count($discussions) > 0) {
        discussions_list_splits($discussions);
    }
}
Example #15
0
    $display_successful_message = false;
    for ($i = 0; $i < PHOTOS_MAX_UPLOADS; $i++) {
        if (is_uploaded_file($_FILES['photo_' . $i]['tmp_name'])) {
            $options['file'] = $_FILES['photo_' . $i]['tmp_name'];
            $options['user'] = 2348;
            $options['description'] = $_POST['description_' . $i];
            $options['category'] = $_POST['category_' . $i];
            $category = photos_get_categories(array('user' => $options['user'], 'name' => $options['category'], 'create_if_not_found' => true));
            $category = array_pop($category);
            $query = 'UPDATE articles SET photo_category_id = "' . $category['id'] . '" WHERE id = "' . $_GET['article_id'] . '" LIMIT 1';
            jscript_alert($query);
            mysql_query($query) or report_sql_error($query, __FILE__, __LINE__);
            $photo_id = photos_upload($options);
            $display_successful_message = true;
        }
    }
    if ($display_successful_message) {
        $upload_form .= rounded_corners_top(array('color' => 'blue_deluxe'), true);
        $upload_form .= 'Bilderna är uppladdade!';
        $upload_form .= rounded_corners_bottom(array('color' => 'blue_deluxe'), true);
    }
    $upload_form .= photos_upload_form(array('user' => 2348));
}
ui_top($ui_options);
echo $upload_form;
echo $_POST['category_' . $i];
ui_bottom();
?>


Example #16
0
    $query .= '("' . $_SESSION['login']['id'] . '", UNIX_TIMESTAMP(), "' . $message . '")';
    mysql_query($query) or die('Det uppstod ett fel när inlägget skrevs till databasen. Försök igen senare<br/>' . mysql_error());
    global $entries;
    $query = 'DELETE FROM klotterplank WHERE id = ' . intval(mysql_insert_id() - $entries) . ' LIMIT 1';
    mysql_query($query) or die(report_sql_error($query));
    if ($_SESSION['login']['userlevel'] < 5) {
        $_SESSION['klotterplank']['lastpost'] = time();
    } else {
        $_SESSION['klotterplank']['lastpost'] = 1;
    }
    event_log_log('old_klotterplank_post');
}
/*
	HÄR SLUTAR FUNKTIONERNA OCH KODEN SOM KÖRS DIREKT BÖRJAR HÄR!
*/
rounded_corners_top(array('color' => 'orange'));
echo '.<h1>Eyy, detta är gamla klotterplanket...</h1>...gå till <a href="http://www.hamsterpaj.net/traffa/klotterplanket.php">det nya klotterplanket</a> istället!';
rounded_corners_bottom(array('color' => 'orange'));
if (isset($_GET['reload']) && $_GET['reload'] != "0") {
    if ($_GET['reload'] != "10" && $_GET['reload'] != "30" && $_GET['reload'] != "60") {
        echo 'ogiltigt';
        die;
    }
    echo '<script language="JavaScript" type="text/JavaScript">' . "\n";
    echo '<!--//' . "\n";
    echo 'function goReload() {' . "\n";
    echo 'location.href="';
    echo $_SERVER['PHP_SELF'];
    echo '?reload=' . $_GET['reload'];
    echo '&random=' . rand(1000000, 9999999);
    if (isset($_GET['stick']) or isset($_POST['stick'])) {
Example #17
0
function rounded_corners($content, $options = array())
{
    $return = rounded_corners_top($options);
    $return .= $content;
    $return .= rounded_corners_bottom($options);
    return $return;
}
Example #18
0
function photos_date_bar($options)
{
    $query = 'SELECT DISTINCT(date) FROM user_photos WHERE user = "******" ORDER BY date ASC';
    $result = mysql_query($query) or report_sql_error($query, __FILE__, __LINE__);
    while ($data = mysql_fetch_assoc($result)) {
        $months[date('Y-m', strtotime($data['date']))][date('j', strtotime($data['date']))] = $data['date'];
    }
    $out .= rounded_corners_top(array('color' => 'blue_deluxe'));
    $out .= '<select id="photos_date_scroller_dropdown">' . "\n";
    foreach (array_keys($months) as $month) {
        $out .= '<option>' . $month . '</option>' . "\n";
    }
    $out .= '</select>';
    $out .= '<div class="photos_date_scroller">' . "\n";
    foreach ($months as $month => $days) {
        $out .= '<ol>' . "\n";
        for ($i = 1; $i <= date('t', strtotime($month)); $i++) {
            if (isset($days[$i])) {
                $out .= '<li><a href="#" class="photo_date_link" id="photos_' . $month . '-' . $i . '_' . $options['user'] . '">' . $i . '</a></li>' . "\n";
            } else {
                $out .= '<li>' . $i . '</li>' . "\n";
            }
        }
        $out .= '</ol>' . "\n";
    }
    $out .= '</div>' . "\n";
    $out .= '<div id="photos_date_previews">' . "\n";
    $photos = photos_fetch(array('user' => $options['user'], 'date' => $options['date']));
    if (count($photos) > 0) {
        $out .= photos_list_mini($photos);
        $out .= '<br style="clear: both;" />' . "\n";
    }
    $out .= '</div>' . "\n";
    $out .= rounded_corners_bottom();
    return $out;
}
Example #19
0
require '../include/core/common.php';
$ui_options['current_menu'] = 'admin';
$ui_options['stylesheets'][] = 'admin_log.css';
$ui_options['menu_path'] = array('admin', 'log_view');
include $hp_includepath . 'admin-functions.php';
require $hp_includepath . 'avataradmin-functions.php';
if (!is_privilegied('use_ghosting_tools')) {
    header('location: /');
    die;
}
ui_top($ui_options);
if (isset($_POST['username'])) {
    preint_r($_POST);
}
$numeric = array_key_exists('numeric', $_POST) == 1;
echo rounded_corners_top();
echo '<h1 style="margin-top: 0px; padding-top: 2px;">Logg över administrativa händelser</h1>';
echo '<h3>Filtrera på valfria fält</h3><br />';
echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">';
echo '<table class="admin_log" >';
echo '	<tr>';
echo '		<td class="event" >Händelse</td>';
echo '		<td class="comment">Info</td>';
echo '		<td class="time">Tidpunkt</td>';
echo '		<td class="admin">Admin</td>';
echo '		<td class="user">Användare</td>';
echo '		<td class="item">Item id</td>';
echo '	</tr>';
echo '	<tr>';
echo '		<td class="event" ><input type="text" name="event" value="' . $_POST['event'] . '" /></td>';
echo '		<td class="comment" ><input type="text" name="value" value="' . $_POST['value'] . '" /></td>';
Example #20
0
		<input type="submit" value="Uppdatera CSS" /></form>
		CSS:<a href="' . $styleadress . '">' . $styleadress . '</a><br />
		
		<b>så här ser strukturen ut.</b>
		<textarea class="css" readonly="readonly">
		' . $out . '
		</textarea>';
    } else {
        // Echo upload form
        if ($_SESSION['login']['username'] != 'Borttagen') {
            if (is_privilegied('profile_theme_admin') && isset($_GET["fake_id"])) {
                $output .= '<form action="/profilteman/ptaction.php?fake_id=' . $uid . '" method="post" enctype="multipart/form-data">';
            } else {
                $output .= '<form action="/profilteman/ptaction.php" method="post" enctype="multipart/form-data">';
            }
            $output .= '
			<input type="file" name="file" id="file" />
			<input type="submit" value="Ladda upp" />
			</form>
			<b>Du har inte laddat upp något tema ännu</b>';
        }
    }
    echo $output;
}
if (is_privilegied('profile_theme_admin')) {
    $output = rounded_corners_top(array('color' => 'blue_deluxe'));
    $output .= '<a href="/profilteman/ptadmin.php">Till administratörssidan.</a>';
    $output .= rounded_corners_bottom();
    echo $output;
}
ui_bottom();
Example #21
0
    exit;
    //Important!
}
/* Set page title */
$ui_options['title'] .= $profile['username'] . ' - Hamsterpaj.net';
if (strlen($profile['profile_theme']) > 0) {
    $ui_options['stylesheets'][] = 'profile_themes/' . $profile['profile_theme'] . '.css';
}
/* Start of profile */
$output .= profile_top($profile);
/* Including Profile-head */
$output .= profile_head($profile);
/* Presentation changed... */
if (isset($_GET['show_change_profile_notice'])) {
    $rounded_corners_config['color'] = 'orange_deluxe';
    $output .= rounded_corners_top($rounded_corners_config);
    $output .= 'Blev det inte riktigt som du hade tänkt dig? Gå tillbaka och 
		<a href="/installningar/profilesettings.php">ändra din presentation</a> igen!';
    $output .= rounded_corners_bottom($rounded_corners_config);
}
/* Photos */
$photos = photos_fetch(array('user' => $user_id, 'order-by' => 'up.id', 'order-direction' => 'DESC', 'limit' => 11));
if (count($photos) > 4) {
    $output .= photos_list_mini($photos);
} elseif (count($photos) > 0) {
    $output .= photos_list_mini($photos);
}
/* User flags */
$query = 'SELECT ufl.* FROM user_flags AS uf, user_flags_list AS ufl WHERE user = "******" AND ufl.id = uf.flag';
$result = mysql_query($query) or die(report_sql_error($query));
while ($data = mysql_fetch_assoc($result)) {
Example #22
0
        /*
        			$content .= rounded_corners_top(array('color' => 'blue'), true);
        				$content .= '<h2>Hamsterpajs aktivaste grupper</h2>' . "\n";
        				$groups = groups_fetch(array('limit' => 6));
        				$content .= groups_list($groups);
        			$content .= rounded_corners_bottom(array('color' => 'blue'), true);
        
        			$content .= rounded_corners_top(array('color' => 'blue'), true);
        				$content .= '<h2>Hamsterpajs största grupper</h2>' . "\n";
        				$groups = groups_fetch(array('limit' => 6, 'order-by' => 'member_count', 'order-direction' => 'DESC'));
        				$content .= groups_list($groups);
        			$content .= rounded_corners_bottom(array('color' => 'blue'), true);
        */
        $content .= rounded_corners_top();
        $content .= '<h2>Mina grupper</h2>' . "\n";
        $groups = groups_fetch(array('founder' => $_SESSION['login']['id'], 'order-by' => 'id', 'order-direction' => 'DESC'));
        $content .= groups_list($groups);
        $content .= rounded_corners_bottom();
        $content .= rounded_corners_top();
        $content .= '<h2>Hamsterpajs senaste skapade grupper</h2>' . "\n";
        $groups = groups_fetch(array('limit' => 6, 'order-by' => 'id', 'order-direction' => 'DESC'));
        $content .= groups_list($groups);
        $content .= rounded_corners_bottom();
        $content .= '<a href="skapa_grupp">Skapa ny grupp</a>' . "\n";
        break;
}
$content .= '<a href="/grupper/">Tillbaka</a>';
ui_top($ui_options);
echo $content;
preint_r($request);
ui_bottom();
Example #23
0
        /*
        			$content .= rounded_corners_top(array('color' => 'blue'), true);
        				$content .= '<h2>Hamsterpajs aktivaste grupper</h2>' . "\n";
        				$groups = groups_fetch(array('limit' => 6));
        				$content .= groups_list($groups);
        			$content .= rounded_corners_bottom(array('color' => 'blue'), true);
        
        			$content .= rounded_corners_top(array('color' => 'blue'), true);
        				$content .= '<h2>Hamsterpajs största grupper</h2>' . "\n";
        				$groups = groups_fetch(array('limit' => 6, 'order-by' => 'member_count', 'order-direction' => 'DESC'));
        				$content .= groups_list($groups);
        			$content .= rounded_corners_bottom(array('color' => 'blue'), true);
        */
        $content .= rounded_corners_top(array('color' => 'blue'), true);
        $content .= '<h2>Mina grupper</h2>' . "\n";
        $groups = groups_fetch(array('founder' => $_SESSION['login']['id'], 'order-by' => 'id', 'order-direction' => 'DESC'));
        $content .= groups_list($groups);
        $content .= rounded_corners_bottom(array('color' => 'blue'), true);
        $content .= rounded_corners_top(array('color' => 'blue'), true);
        $content .= '<h2>Hamsterpajs senaste skapade grupper</h2>' . "\n";
        $groups = groups_fetch(array('limit' => 6, 'order-by' => 'id', 'order-direction' => 'DESC'));
        $content .= groups_list($groups);
        $content .= rounded_corners_bottom(array('color' => 'blue'), true);
        $content .= '<a href="skapa_grupp">Skapa ny grupp</a>' . "\n";
        break;
}
$content .= '<a href="/grupper/">Tillbaka</a>';
ui_top($ui_options);
echo $content;
preint_r($request);
ui_bottom();
Example #24
0
function open_search_edit_list($options = null)
{
    $query = 'SELECT * FROM open_search_boxes ORDER BY `timestamp` DESC';
    $result = mysql_query($query) or report_sql_error($query, __FILE__, __LINE__);
    $out = '';
    if (mysql_num_rows($result) > 0) {
        $out = '<ul class="open_search_edit">' . "\n";
        while ($data = mysql_fetch_assoc($result)) {
            $out .= rounded_corners_top(array('color' => 'blue_deluxe'), true);
            $out .= '<span style="clear:both;">&nbsp;</span>' . "\n";
            $out .= "\t" . '<li><h3><a href="#" class="box_link" id="link_' . $data['id'] . '"><img src="' . IMAGE_URL . 'plus.gif" alt="Expandera/Kollapsa" id="image_' . $data['id'] . '" /></a> ' . $data['name'] . '</h3>';
            $out .= '<div class="open_search_box_info" id="box_' . $data['id'] . '">' . "\n";
            $data['formname'] = 'edit';
            $data['action'] = 'edit';
            $data['submit_value'] = 'Uppdatera';
            $out .= open_search_addbox_draw_input($data);
            $out .= '</div>';
            $out .= '</li>' . "\n";
            $out .= '<span style="clear:both;">&nbsp;</span>' . "\n";
            $out .= rounded_corners_bottom(array('color' => 'blue_deluxe'), true);
        }
        $out .= '</ul>' . "\n";
    }
    return $out;
}
Example #25
0
 $set[2]['fetch']['order'] = 'random';
 $set[2]['fetch']['limit'] = '4';
 $set[3]['fetch']['entertain_type'] = $request['entertain_type'];
 $set[3]['fetch']['order'] = 'comment_count';
 $set[3]['fetch']['order_direction'] = 'DESC';
 $set[3]['fetch']['limit'] = '4';
 $options = $set[rand(0, 3)];
 $fetch_result = entertain_fetch($options['fetch']);
 $items = $fetch_result['items'];
 //	preint_r($items);
 $list_options['list_style'] = 'thumbnails';
 $output .= rounded_corners_top();
 $output .= entertain_list($items, $list_options);
 $output .= rounded_corners_bottom();
 //En utvalt item med två kommentarer
 $output .= rounded_corners_top();
 $fetch['entertain_type'] = $request['entertain_type'];
 $fetch['order'] = 'random';
 $fetch['limit'] = '1';
 $fetch_result = entertain_fetch($fetch);
 $items = $fetch_result['items'];
 $item = array_pop($items);
 $output .= '<div class="entertain_item_with_comments">' . "\n";
 $output .= entertain_thumbnail_draw($item);
 $comments_options['limit'] = 2;
 $comments_options['style'] = 'no_margin';
 $output .= comments_list($item['id'], 'entertain', $comments_options);
 $output .= '<br style="clear: both;" />' . "\n";
 $output .= '</div>' . "\n";
 $output .= rounded_corners_bottom();
 // Visa en slumpvald item
Example #26
0
/**
* Draws the form where you can add or edit a film.
	$film	an array with all film data
*/
function films_admin_form_draw($film_type, $film = null, $options)
{
    rounded_corners_top();
    if (isset($film)) {
        //		preint_r($film);
        echo '<h1>Redigera film</h1>' . "\n";
    } else {
        echo '<h1>Lägg in en ny film</h1>' . "\n";
    }
    /*
    	echo '<h2>Ladda upp en filmfil:</h2>' . "\n";
    	echo '<form id="film_upload_form" method="post" target="film_upload_frame" action="/film/admin/film_upload_user.php">' . "\n";
    	echo '<input type="file" name="film_upload" />' . "\n";
    	echo '<input type="submit" class="button_80" value="Skicka" />' . "\n";
    	echo '</form>' . "\n";
    	echo '<iframe name="film_upload_frame" style="display: none;" ></iframe>' . "\n";
    */
    echo '<h2>eller klistra in länk till filmfilen:</h2>' . "\n";
    echo '<input type="text" name="fetch_link" id="film_fetch_link_input"/>' . "\n";
    echo '<button class="button_50" id="film_fetch_link_button">Skicka</button>' . "\n";
    if (isset($film)) {
        echo '<input type="checkbox" name="upload_new_file" id="upload_new_file" />' . "\n";
        echo '<label for="upload_new_file" >Uppdatera filmfilen</label>' . "\n";
    }
    echo '<div id="film_preview">' . "\n";
    echo '</div>' . "\n";
    echo '<form id="film_edit_form" method="post" action="/' . $film_type . '/admin/' . (isset($film) ? 'film_save.php' : 'film_new.php') . '" enctype="multipart/form-data">' . "\n";
    if (isset($film)) {
        echo '<input name="film_id" type="hidden" value="' . $film['id'] . '" />' . "\n";
    }
    echo '<h2>Titel</h2>' . "\n";
    echo '<input type="text" name="title" value="' . (isset($film) ? $film['title'] : '') . '" />' . "\n";
    echo '<h2>Filmtyp <strong>Byt absolut inte här, gå istället in på rätt sida!</strong></h2>' . "\n";
    $film_type = isset($film) ? $film['film_type'] : $film_type;
    echo '<input type="radio" name="film_type" value="flash" id="film_type_radio_flash" ' . ($film_type == 'flash' ? 'checked="on"' : '') . '/>' . "\n";
    echo '<label for="film_type_radio_flash">Flash</label>' . "\n";
    echo '<input type="radio" name="film_type" value="klipp" id="film_type_radio_klipp" ' . ($film_type == 'klipp' ? 'checked="on"' : '') . '/>' . "\n";
    echo '<label for="film_type_radio_klipp">Klipp</label>' . "\n";
    echo '<input type="radio" name="film_type" value="bilder" id="film_type_radio_bilder" ' . ($film_type == 'bilder' ? 'checked="on"' : '') . '/>' . "\n";
    echo '<label for="film_type_radio_bilder">Bild</label>' . "\n";
    echo '<h2>Kategori</h2>' . "\n";
    global $film_categories;
    global $film_type_categories;
    //	preint_r($film_categories);
    //	preint_r($film_type_categories[$film_type]);
    foreach ($film_type_categories[$film_type] as $category_id) {
        $categories[$category_id] = $film_categories[$category_id];
    }
    //	preint_r($categories);
    echo '<select name="film_category">' . "\n";
    foreach ($categories as $category_id => $category) {
        echo '<option value="' . $category_id . '"';
        if (isset($film) && $film['category_id'] == $category_id) {
            echo ' selected="selected"';
        }
        echo ' >' . $category['title'] . '</option>' . "\n";
    }
    echo '</select>' . "\n";
    echo '<h2>Övriga nyckelord (separerade med mellanslag)</h2>' . "\n";
    if (isset($film)) {
        unset($keywords);
        $tags = tag_get_by_item('film', $film['id']);
        foreach ($tags as $tag) {
            $keywords[] = $tag['label'];
        }
    }
    preint_r($keywords);
    echo '<textarea name="tags" rows="3" cols="60" >' . (isset($film) ? implode(' ', $keywords) : '') . '</textarea>' . "\n";
    echo '<h2>Bild (skalas och konverteras automagiskt)</h2>' . "\n";
    if (isset($film)) {
        echo '<img src="' . IMAGE_URL . '/film/' . $film['handle'] . '.png" />' . "\n";
    }
    echo '<input name="thumbnail" type="file" />' . "\n";
    echo '<h2>Release</h2>' . "\n";
    echo '<input type="text" name="release" value="' . date('Y-m-d H:i', isset($film) ? $film['release'] : schedule_release_get(array('type' => 'new_' . $film_type))) . '" />' . "\n";
    echo '<input type="checkbox" name="release_now" value="true" id="release_now_check" />' . "\n";
    echo '<label for="release_now_check">Släpp filmen direkt</label>' . "\n";
    echo '<h2>Specialkod</h2>' . "\n";
    echo '<input type="checkbox", value="true", id="chk_use_special_code" name="use_special_code" ' . (isset($film) && $film['use_special_code'] == 1 ? 'checked=checked' : '') . '/>' . "\n";
    echo '<label for="chk_use_special_code">Använd specialkod</label>' . "\n";
    echo '<textarea name="special_code" rows="5" cols="60" >' . (isset($film) ? stripslashes($film['html']) : '') . '</textarea>' . "\n";
    echo '<br />' . "\n";
    echo '<h2>Filmtrailer.se ID (rör ej om du inte vet vad detta är!)</h2>' . "\n";
    echo '<input type="text" name="trailer_id" value="' . $film['trailer_id'] . '" />' . "\n";
    echo '<input type="checkbox", value="delete" id="chk_film_delete" name="delete" />' . "\n";
    echo '<label for="chk_film_delete">Ta bort film</label>' . "\n";
    echo '<input class="button_50" type="submit" value="Spara" />' . "\n";
    echo '</form>' . "\n";
    rounded_corners_bottom();
}
Example #27
0
?>';
$out .= highlight_string($code, true);
$options['return'] = true;
$options['color'] = 'red';
$out .= rounded_corners_top($options);
$out .= 'hejsvejs' . "\n";
$out .= rounded_corners_bottom($options);
$out .= '</div>' . "\n";
$out .= '<div class="example">' . "\n";
$code = '<?php
	$options[\'color\'] = \'red_alert_deluxe\';
?>';
$out .= highlight_string($code, true);
$options['return'] = true;
$options['color'] = 'red_alert_deluxe';
$out .= rounded_corners_top($options);
$out .= 'hejsvejs' . "\n";
$out .= rounded_corners_bottom($options);
$out .= '</div>' . "\n";
$out .= '</div>' . "\n";
$out .= '<div id="attributes_header" class="content_box_header">' . "\n";
$out .= '<h4>Attributes</h4>' . "\n";
$out .= '</div>' . "\n";
$out .= '<div id="attributes" class="content_box">' . "\n";
$out .= '<dl>' . "\n";
$out .= '<dt>' . "\n";
$out .= 'Color' . "\n";
$out .= '</dt>' . "\n";
$out .= '<dd>' . "\n";
$out .= '<strong>Blue</strong>, ' . "\n";
$out .= 'Blue_deluxe, ' . "\n";
Example #28
0
function profile_presentation_change_form($options)
{
    $options['post_to'] = isset($options['post_to']) ? $options['post_to'] : '/installningar/profilesettings.php';
    $return .= '<form action="' . $options['post_to'] . '" method="post" id="profile_presentation_change_form">' . "\n";
    $return .= '	<button id="profile_presentation_change_bold_control" class="button_30">Fet</button>' . "\n";
    $return .= '	<button id="profile_presentation_change_italic_control" class="button_50">Kursiv</button>' . "\n";
    $return .= '	<button id="profile_presentation_change_header_control" class="button_80">R U B R I K</button>' . "\n";
    $return .= '	<input type="button" id="profile_presentation_change_image_control" class="button_130" value="Bild från fotoalbumet" />' . "\n";
    $return .= '	<button id="profile_presentation_change_poll_control" class="button_80">Omröstning</button>' . "\n";
    //$return .= '	<button id="profile_presentation_change_friends_control" class="button_90">Vänner-ruta</button>' . "\n";
    $return .= '	<button id="profile_presentation_change_link_control" class="button_70">Länk till...</button>' . "\n";
    unset($rounded_corners_config);
    $rounded_corners_config['color'] = 'blue_deluxe';
    $rounded_corners_config['id'] = 'profile_presentation_change_markup_properties';
    $return .= rounded_corners_top($rounded_corners_config) . "\n";
    $return .= '<div id="profile_presentation_change_markup_properties_content">&nbsp;</div>';
    $return .= '<button id="profile_presentation_change_markup_properties_close" class="button_60">Stäng</button>';
    $return .= '<br style="clear: both" />' . "\n";
    $return .= rounded_corners_bottom($rounded_corners_config) . "\n";
    $return .= '<textarea name="presentation_text" id="profile_presentation_change_presentation_text" tabindex="2">' . $options['presentation_text'] . '</textarea>' . "\n";
    $return .= '<br />' . "\n";
    $return .= '<button id="profile_presentation_change_preview_button" tabindex="3" class="button_120">Förhandsgranska</button>';
    $return .= ' <input type="submit" value="Spara" id="profile_presentation_change_save" tabindex="3" class="button_60" />' . "\n";
    $return .= '<br style="clear: both;" /></form>' . "\n";
    $return .= '<div id="profile_presentation_change_preview_area">&nbsp;</div>';
    return $return;
}
Example #29
0
function schedule_admin_error($options)
{
    $rounded_corners_options['color'] = 'orange';
    rounded_corners_top($rounded_corners_options);
    echo 'Ett fel har inträffat: ' . $options['error'];
    rounded_corners_bottom($rounded_corners_options);
}
Example #30
0
function guestbook_p12_shield($display)
{
    if ($display == 'on') {
        $options['color'] = 'orange';
        $out .= rounded_corners_top($options);
        $out .= '<img class="guestbook_anti_p12_sign" src="http://images.hamsterpaj.net/anti_p12_sign.png" />' . "\n";
        $out .= '<h2 class="guestbook_anti_p12_header">Anti P12-skylt</h2>' . "\n";
        $out .= '<p style="margin: 0;">Om denna rutan är synlig betyder det att Jag inte vill ha jobbiga gästboksinlägg ifrån omogna människor, 
										till exempel inlägg där någon frågar om jag vill ha camsex eller om jag vill lägga till personen msn “Hej msn? puss”. 
										Jag känner inte dig så varför skulle jag vilja det?</p>' . "\n";
        $out .= '<p style="margin-bottom: 0;">Det äcklet som skriver och frågar mig om sex och sådant kommer att bli rapporterad och en Ordningsvakt 
										kommer att granska gästboksinlägget som skrevs till mig. Sedan kommer Ordningsvakter antagligen att radera äcklets användarkonto 
										och stänga av denne ifrån sajten ifall denne förtjänar det.</p>' . "\n";
        $out .= rounded_corners_bottom();
    }
    return $out;
}