コード例 #1
0
ファイル: fp_modules.lib.php プロジェクト: KuBe-zz/hamsterpaj
function fp_modules_list($modules)
{
    $o .= '<form method="post" class="fp_module_admin_list">' . "\n";
    $o .= '<input type="hidden" name="action" value="update_modules" />' . "\n";
    $o .= '<input type="submit" value="spara" />' . "\n";
    $o .= '<ol>' . "\n";
    foreach ($modules as $module) {
        $module_ids[] = $module['id'];
        $o .= '<li>' . "\n";
        $o .= '<p>' . $module['score'] . 'p / ' . cute_number($module['clicks']) . ' klick</p>' . "\n";
        $o .= '<h3><a href="/site_admin/fp_module.php?action=edit&id=' . $module['id'] . '">' . $module['name'] . '</a></h3>' . "\n";
        $o .= '<br style="clear: both;" />' . "\n";
        $o .= '<label>Release</label><label>Removal</label><label>Prio</label>' . "\n";
        $o .= '<input type="text" name="' . $module['id'] . '_launch" value="' . date('Y-m-d H:i', $module['launch']) . '" />' . "\n";
        $o .= '<input type="text" name="' . $module['id'] . '_removal" value="' . date('Y-m-d H:i', $module['removal']) . '" />' . "\n";
        $o .= '<input type="text" name="' . $module['id'] . '_priority" id="prio_' . $module['id'] . '" value="' . $module['priority'] . '" class="prio" />' . "\n";
        $o .= '</li>' . "\n";
    }
    $o .= '<input type="hidden" name="module_ids" value="' . implode(',', $module_ids) . '" />' . "\n";
    $o .= '</ol>' . "\n";
    $o .= '</form>' . "\n";
    return $o;
}
コード例 #2
0
ファイル: index.php プロジェクト: Rojk/hamsterpaj
    }
    $out .= '<br style="font-size: 0px; height: 0px; clear: both; line-height: 0px;" />' . "\n";
    if ($module['commenting'] == 'true' || $module['published'] == 'true' || $module['grading'] == 'true') {
        $out .= '<div class="controls">' . "\n";
        if ($module['published'] == 'true') {
            $out .= '<p class="fp_module_published">Upplagd ' . date('Y-m-d', $module['launch']) . '</p>' . "\n";
        }
        if ($module['grading'] == 'true') {
            if (login_checklogin() && !in_array($module['id'], $_SESSION['fp_module_votes'])) {
                $out .= '<img src="http://images.hamsterpaj.net/discussion_forum/thread_voting_plus.png" class="fp_vote" id="fp_vote_plus_' . $module['id'] . '" />' . "\n";
                $out .= '<img src="http://images.hamsterpaj.net/discussion_forum/thread_voting_minus.png" class="fp_vote" id="fp_vote_minu_' . $module['id'] . '" />' . "\n";
            }
            $out .= '<p class="fp_module_score"><span id="fp_module_score_' . $module['id'] . '">' . $module['score'] . '</span>p</p>' . "\n";
        }
        if ($module['clicks'] > 0) {
            $out .= '<p>' . cute_number($module['clicks']) . ' klick</p>' . "\n";
        }
        $out .= '</div>' . "\n";
    }
    if ($module['format'] == '2_3') {
        $out .= '</div>' . "\n";
        $out .= '<div class="puff">' . "\n";
        $puff_query = 'SELECT * FROM fp_puffs ORDER BY id ASC';
        $puffs = query_cache(array('category' => 'fp_puffs', 'max_limit' => 600, 'query' => $puff_query));
        $puff_key = (date('z') + $puff_no) % count($puffs);
        $out .= $puffs[$puff_key]['content'];
        $out .= '</div>' . "\n";
    }
    $out .= '</li>' . "\n";
}
$out .= '</ol>' . "\n";
コード例 #3
0
ファイル: user_facts.php プロジェクト: Rambutan/hamsterpaj
} elseif ($data['regtimestamp'] < time() - 86400 * 356) {
    $specialstatus = 'Stammis';
} elseif ($data['regtimestamp'] > time() - 86400 * 7) {
    $specialstatus = 'Nykomling';
}
$user_levels_readable = array(1 => 'Vanlig anv.', 2 => 'Medhjälpare', 3 => 'Ordningsvakt', 4 => 'Administratör', 5 => 'Sysop');
if ($data['user_birthday'] != '' && $data['user_birthday'] != "0000-00-00") {
    $extra1 = '<th>Födelsedag</th>';
    $extra2 = '<td>' . $data['user_birthday'] . '</td>';
}
$output .= rounded_corners_tabs_top();
$out .= '<table>' . "\n";
$out .= '<tr><th>Medlem sedan</th><th>Specialstatus</th>' . $extra1 . '</tr>' . "\n";
$out .= '<tr><td>' . date('Y-m-d', $data['regtimestamp']) . '</td><td>' . $specialstatus . '</td>' . $extra2 . '</tr>' . "\n";
$out .= '<tr><th>Inlägg i forumet</th><th>Spam i forumet</th><th>Gästboksinlägg</th></tr>' . "\n";
$out .= '<tr><td>' . cute_number($data['forum_posts']) . '</td><td>' . cute_number($data['forum_spam']) . '</td><td>' . cute_number($data['guestbook_entries']) . '</td></tr>' . "\n";
$out .= '</table>' . "\n";
echo $out;
$output .= rounded_corners_tabs_bottom();
if (is_privilegied('ip_ban_admin') || is_privilegied('remove_user')) {
    $query = 'SELECT lastlogon, lastip, regip, lastusername FROM login WHERE id LIKE "' . $params['user_id'] . '" LIMIT 1';
    $result = mysql_query($query) or report_sql_error($query);
    $user_ips = mysql_fetch_assoc($result);
    $out_ip = 'Senaste inloggning <strong>' . fix_time($user_ips['lastlogon']) . '</strong>';
    $out_ip .= ' Från IP <strong>' . $user_ips['lastip'] . '</strong>' . "\n";
    // Fetch all user with that IP
    $query = 'SELECT DISTINCT login_log.ip, login_log.user_id, login.id, login.username FROM login_log, login WHERE login_log.ip = "' . ip2long($user_ips['lastip']) . '" AND login_log.user_id = login.id AND login_log.user_id != "' . $params['user_id'] . '" AND login.is_removed = 0';
    $ip_users = mysql_query($query) or report_sql_error($query);
    $out_ip .= '| Andra med IPt:' . "\n";
    while ($ip_user = mysql_fetch_assoc($ip_users)) {
        $out_ip .= '<a href="http://www.hamsterpaj.net/traffa/profile.php?user_id=' . $ip_user['id'] . '">' . $ip_user['username'] . '</a>' . "\n";
コード例 #4
0
ファイル: digga.php プロジェクト: Rojk/hamsterpaj
function digga_view($artist_id)
{
    $artist_info = digga_fetch_info($artist_id);
    echo '<h1>Digga ger dig info om ' . $artist_info['name'] . '</h1>' . "\n";
    echo '<h3>' . cute_number($artist_info['popularity']) . ' Hamsterpajare diggar ' . $artist_info['name'] . '!</h3>' . "\n";
    if (strlen($artist_info['description']) > 0) {
        echo '<p class="digga_description">' . "\n";
        echo nl2br($artist_info['description']);
        echo '</p>' . "\n";
    } else {
        echo '<p class="digga_no_description">' . "\n";
        echo 'Vi har tyvärr ingen beskrivning om ' . $artist_info['name'] . ' än. Om du känner att du kan mycket om det ';
        echo 'här bandet eller den här artisten så får du hemskt gärna skriva en egen beskrivning och skicka den som ett ';
        echo 'privat meddelande till <a href="/traffa/profile.php?id=774586">Joar</a>. Glöm inte att tala om vilken artist ';
        echo 'det gäller!' . "\n";
        echo '</p>' . "\n";
    }
    if (is_privilegied('digga_admin')) {
        echo 'Du kan <a href="?action=edit&artist_id=' . $artist_id . '">';
        echo 'ändra beskrivningen och namnet</a>';
    }
    $diggers = digga_fetch_diggers($artist_id);
    if (count($diggers) > 0) {
        echo '<div id="digga_diggers">' . "\n";
        echo '<h2>Hamsterpajare som diggar ' . $artist_info['name'] . '</h2>' . "\n";
        echo '<table>' . "\n";
        foreach ($diggers as $digger) {
            echo '<tr>' . "\n";
            echo '<td><a href="/traffa/profile.php?id=' . $digger['id'] . '">' . $digger['username'] . '</a></td>' . "\n";
            echo '<td>' . $digger['gender'] . date_get_age($digger['birthday']) . '</td>' . "\n";
            echo '<td>';
            echo $digger['lastaction'] > time() - 900 ? 'online' : 'offline';
            echo '</td>' . "\n";
            echo '</tr>' . "\n";
        }
        echo '</table>' . "\n";
        echo '</div>' . "\n";
    }
    echo '<div id="digga_songs">' . "\n";
    echo '<h2>Låtar av ' . $artist_info['name'] . '</h2>' . "\n";
    $query = 'SELECT title FROM songs WHERE artist = "' . $artist_id . '" ORDER BY popularity DESC';
    $result = mysql_query($query) or die(report_sql_error($query, __FILE__, __LINE__));
    echo '<ul style="list-style-type: none;">' . "\n";
    while ($data = mysql_fetch_assoc($result)) {
        echo '<li>' . $data['title'] . '</li>' . "\n";
    }
    echo '</ul>' . "\n";
    echo '</div>' . "\n";
}
コード例 #5
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__));
    }
}
コード例 #6
0
ファイル: guestbook.lib.php プロジェクト: Rojk/hamsterpaj
function guestbook_list($entries)
{
    $out .= '<ul class="guestbook_entries">' . "\n";
    foreach ($entries as $entry) {
        $out .= "\n\n";
        $out .= '<!-- Post #' . cute_number($entry['id']) . ' by ' . $entry['username'] . ' at ' . date('Y-m-d H:i:s', $entry['timestamp']) . '-->' . "\n";
        /*
        $class = ($entry['read'] == 0) ? ' class="unread"': '';
        $out .= '<li' . $class . '>' . "\n";
        if($entry['image'] == 1 || $entry['image'] == 2)
        {
        	$out .= '<img src="http://images.hamsterpaj.net/images/users/thumb/' . $entry['sender'] . '.jpg" class="user_avatar" id="entry_' . $entry['id'] . '_photo" />' . "\n";
        }
        else
        {
        	$out .= '<img src="http://images.hamsterpaj.net/images/users/no_image_mini.png" class="user_avatar" id="entry_' . $entry['id'] . '_photo" />' . "\n";
        }
        
        $out .= '<div class="container">' . "\n";
        $out .= '<div class="top_bg">' . "\n";
        $out .= '<div class="bottom_bg">' . "\n";
        */
        $options['user_id'] = $entry['sender'];
        $options['type'] = $entry['read'] == 0 ? 'unread' : 'standard';
        $out .= message_top($options);
        $out .= '<div id="guestbook_entry_' . $entry['id'] . '">' . "\n";
        $out .= '<span class="timestamp">' . fix_time($entry['timestamp']) . '</span>' . "\n";
        $out .= '<a href="/traffa/profile.php?id=' . $entry['sender'] . '">' . $entry['username'] . '</a> ' . "\n";
        $genders = array('f' => 'F', 'm' => 'P');
        $out .= $genders[$entry['gender']];
        $out .= date_get_age($entry['birthday']) > 0 ? date_get_age($entry['birthday']) : '';
        $out .= '<span class="unanswered" id="unanswered_label_' . $entry['id'] . '"' . $style . '>' . "\n";
        $out .= $entry['answered'] != 'Y' ? '(Obesvarat)' : '';
        $out .= '</span>' . "\n";
        $style = $entry['is_private'] == 0 ? ' style="display: none;"' : '';
        $out .= '<span class="private" id="private_label_' . $entry['id'] . '"' . $style . '>(Privat)</span>' . "\n";
        $out .= '<p>' . setSmilies(nl2br($entry['message'])) . '</p>' . "\n";
        $out .= '<p class="gb_entry_controls">' . "\n";
        $out .= login_checklogin() && $entry['recipient'] == $_SESSION['login']['id'] && $entry['sender'] != $_SESSION['login']['id'] ? '<a href="/traffa/guestbook.php?view=' . $entry['sender'] . '" class="gb_reply_control" id="reply_control_' . $entry['id'] . '">Svara</a>' . "\n" : '';
        $out .= '<a href="/traffa/guestbook.php?view=' . $entry['sender'] . '&history=' . $entry['recipient'] . '">Historik</a>' . "\n";
        $out .= '<a href="/traffa/guestbook.php?view=' . $entry['sender'] . '">Gå till</a>' . "\n";
        $out .= $entry['recipient'] == $_SESSION['login']['id'] ? '<a href="/installningar/userblock.php?action=block&username='******'username'] . '" class="gb_block_control">Blockera</a>' . "\n" : '';
        if (login_checklogin() && $entry['recipient'] == $_SESSION['login']['id'] && $entry['sender'] != $_SESSION['login']['id']) {
            $out .= '<a href="/traffa/guestbook.php?view=' . $entry['sender'] . '" class="gb_delete_control" id="delete_control_' . $entry['id'] . '">Ta bort</a>' . "\n";
        }
        if (login_checklogin() && $entry['recipient'] == $_SESSION['login']['id'] && $entry['sender'] != $_SESSION['login']['id']) {
            $private_style = $entry['is_private'] == 1 ? ' style="display: none;"' : '';
            $unprivate_style = $entry['is_private'] == 0 ? ' style="display: none;"' : '';
            $out .= '<a href="/traffa/guestbook.php?view=' . $entry['sender'] . '" class="gb_private_control" id="private_control_' . $entry['id'] . '"' . $private_style . '>';
            $out .= 'Gör privat</a>' . "\n";
            $out .= '<a href="/traffa/guestbook.php?view=' . $entry['sender'] . '" class="gb_unprivate_control" id="unprivate_control_' . $entry['id'] . '"' . $unprivate_style . '>';
            $out .= 'Gör offentligt</a>' . "\n";
            $out .= '<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";
        }
        $out .= '</p>' . "\n";
        $out .= guestbook_form(array('recipient' => $entry['sender'], 'reply-to' => $entry['id'], 'form_id' => 'gb_reply_form_' . $entry['id']));
        $out .= '</div>' . "\n";
        $out .= message_bottom();
        /*
        $out .= '</div>' . "\n";
        $out .= '</div>' . "\n";
        $out .= '</div>' . "\n";
        
        $out .= '</li>' . "\n";
        */
    }
    $out .= '</ul>' . "\n";
    return $out;
}
コード例 #7
0
function discussion_forum_post_render($data, $parent_post = array(), $options = array())
{
    $options['post'] = $data;
    /*
    			[id] => 2 [handle] => normal_vikt [author] => 3 [timestamp] => 1200341971 [parent_post] => 0 [forum_id] => 0
    			[forum_type] => public_forum [title] => Normal vikt? [content] => Denna post har skapats av en funktion! [score] => 0 
    			[verified] => 0 [removed] => 0 [removal_comment] => [remover] => 0 [child_count] => 1 [locked] => 0 [sticky] => 0
    			[last_post] => 0 [anonymous] => 0 [username] => Johan [birthday] => 1988-09-10 [gender] => m [spot] => Göteborg
    */
    $warned = 0;
    $options['show_post_controls'] = isset($options['show_post_controls']) ? $options['show_post_controls'] : true;
    $options['show_removed_posts_content'] = isset($options['show_removed_posts_content']) ? $options['show_removed_posts_content'] : false;
    $return = '<a name="post_' . $data['id'] . '"></a>' . "\n";
    $return .= '<input type="hidden" id="post_' . $data['id'] . '_author_username" value="' . $data['username'] . '" />' . "\n";
    $return .= '<div class="forum_post_container">' . "\n";
    if ($data['removed'] == 1 && $options['show_removed_posts_content'] != true) {
        $return .= '<div class="forum_post_removed">Inlägget har tagits bort' . "\n";
        $return .= $options['show_post_controls'] == true && forum_security(array('action' => 'unremove_post')) ? '<button value="' . $data['id'] . '" class="forum_unremove_button">trob At</button>, Borttaget av <a href="/traffa/profile.php?id=' . $data['remover'] . '">' . $data['remover'] . '</a>.' . "\n" : '';
        $return .= '</div>';
    } else {
        $return .= strpos(strtolower($data['content']), strtolower($_SESSION['login']['username'])) ? '<div class="highlight">' . "\n" : '';
        $return .= '<div class="forum_post_top"></div>' . "\n";
        $return .= '<div class="forum_post" id="forum_post_' . $data['id'] . '">' . "\n";
        $return .= '<div class="author">' . "\n";
        if (strtolower($data['username']) == 'vit_seger') {
            $data['username'] = '******';
        }
        $return .= '<a class="username" href="/traffa/profile.php?id=' . $data['author'] . '">' . $data['username'];
        $return .= '</a>' . "\n";
        $return .= $data['author'] == 2 ? '&nbsp;<a href="/diskussionsforum/hamsterpaj/veckans_ros/" title="Veckans ros"><img src="http://images.hamsterpaj.net/ros.png" alt="Ros" style="width: 11px; height: 17px;border:0;" /></a><br style="clear: both;" />' . "\n" : '';
        $return .= '<div class="passepartout">' . "\n";
        $return .= ui_avatar($data['author']);
        $return .= '</div>' . "\n";
        $return .= '<span class="gender">' . str_replace(array('m', 'f', 'u'), array('P', 'F', ''), $data['gender']) . '</span>' . "\n";
        if ($data['birthday'] != '0000-00-00') {
            $return .= '<span class="age">' . date_get_age($data['birthday']) . '</span>' . "\n";
        }
        if (strlen($data['spot']) > 0) {
            $return .= ' <span class="location">' . $data['spot'] . '</span>' . "\n";
        }
        if ($data['last_warning'] > time() - 604800) {
            $return .= '<span class="warned">Varnad ' . '</span>' . "\n";
        } elseif (strlen($data['forum_userlabel']) > 0) {
            $return .= '<span class="userlevel">' . $data['forum_userlabel'] . '</span>' . "\n";
        } elseif ($data['regtimestamp'] < time() - 86400 * 356 * 2.5) {
            $return .= '<span class="userlevel">Veteran</span>' . "\n";
        } elseif ($data['regtimestamp'] < time() - 86400 * 356) {
            $return .= '<span class="userlevel">Stammis</span>' . "\n";
        } elseif ($data['regtimestamp'] > time() - 86400 * 7) {
            $return .= '<span class="userlevel">Nykomling</span>' . "\n";
        }
        if ($data['quality_level'] == 1) {
            $return .= '<span class="post_count">' . cute_number($data['author_spam_count']) . ' spam</span>' . "\n";
        } else {
            if ($data['author'] == 15) {
                $author_post_count = 'Några osöta';
            } elseif ($data['author'] == 87926) {
                $author_post_count = 'Många söta';
            } elseif ($data['author'] == 774586) {
                $author_post_count = 'Inte många';
            } elseif ($data['author'] == 787082) {
                $author_post_count = 'Många schmarta';
            } elseif ($data['author'] == 891711) {
                $author_post_count = '';
            } elseif ($data['author'] == 299825) {
                $author_post_count = '666 hatiska inlägg';
            } else {
                $author_post_count = cute_number($data['author_post_count']);
            }
            $return .= '<span class="post_count">' . $author_post_count . ' inlägg</span>' . "\n";
        }
        if ($data['lastaction'] > time() - 600) {
            $return .= '<span class="online_status">Online</span>' . "\n";
        }
        $return .= ui_birthday_cake($data['birthday']) . "\n";
        $return .= '</div>' . "\n";
        $return .= '<div class="post_info">' . "\n";
        $return .= '<span class="post_timestamp">' . fix_time($data['timestamp']) . '</span>' . "\n";
        $return .= $data['parent_post'] == 0 ? '<h3>' . $data['title'] . '</h3>' : '';
        $return .= '</div>' . "\n";
        $return .= '<div class="post_content">' . "\n";
        $return .= $data['removed'] == 1 ? '<strong>Inlägget är borttaget!</strong><br />' . "\n" : '';
        $return .= discussion_forum_parse_output($data['content'], $options);
        if (strlen($data['user_status']) > 0) {
            $return .= '<p class="user_status">' . $data['user_status'] . '</p>' . "\n";
        }
        $return .= '</div>' . "\n";
        $return .= '<div class="controls">' . "\n";
        if ($options['show_post_controls'] == true) {
            $return .= '<input type="text" class="forum_direct_link_input" id="forum_direct_link_input_' . $data['id'] . '" />';
            $return .= '<button id="forum_direct_link_button_' . $data['id'] . '" class="forum_direct_link_button">Länk</button>' . "\n";
            $return .= forum_security(array('action' => 'remove_post')) ? '<button value="' . $data['id'] . '" class="forum_remove_button">Ta bort</button>' . "\n" : '';
            $return .= forum_security(array('action' => 'edit_post', 'post' => $data)) || forum_security(array('action' => 'post_addition', 'post' => $data)) ? '<button id="forum_edit_button_' . $data['id'] . '" class="forum_edit_button">Ändra</button>' . "\n" : '';
            $return .= forum_security() ? '<button id="post_reply_' . $data['id'] . '" class="forum_reply_button">Citera</button>' . "\n" : '';
            $return .= forum_security(array('action' => 'reply', 'post' => $parent_post)) === true ? '<button id="post_reply_' . $data['id'] . '" class="forum_reply_button">Svara</button>' . "\n" : '';
            $return .= login_checklogin() ? '<button id="post_comment_' . $data['author'] . '" class="forum_comment_button" value="' . $data['id'] . '">Gästbok</button>' . "\n" : '';
            if (forum_security()) {
                $return .= '<input type="checkbox" class="post_move_check" name="post[]" value="' . $data['id'] . '" id="forum_move_check_' . $data['id'] . '" />';
                $return .= '<label for="forum_move_check_' . $data['id'] . '">Flytta</label>' . "\n";
            }
            $return .= forum_security(array('action' => 'user_ro')) ? '<button value="' . $data['username'] . '" class="forum_user_ro">QL</button>' . "\n" : '';
            $return .= forum_security(array('action' => 'report')) ? '<a href="/hamsterpaj/abuse.php?report_type=forum_post&reference_id=' . $data['id'] . '" class="abuse_button"><img src="http://images.hamsterpaj.net/abuse.png" /></a>' . "\n" : '';
            $return .= guestbook_form(array('recipient' => $data['author'], 'form_id' => 'forum_comment_' . $data['id']));
        } else {
            $return .= '<small>Knappar har inaktiverats</small>';
        }
        $return .= '</div>' . "\n";
        $return .= '</div>' . "\n";
        $return .= '<div class="forum_post_bottom"> </div>' . "\n";
        $return .= strpos(strtolower($data['content']), strtolower($_SESSION['login']['username'])) ? '</div>' . "\n" : '';
    }
    $return .= '</div>' . "\n";
    return $return;
}
コード例 #8
0
ファイル: diggers.php プロジェクト: Razze/hamsterpaj
}
function digga_instructions()
{
    ?>
	<div id="digga_instructions">
		<h2>Så gör du för att digga</h2>
	</div>
<?php 
}
if ($_SESSION['login']['id'] != 3) {
    die('Closed for maintenance, som man säger i amerikat');
}
if ($_GET['action'] == 'view_info' && is_numeric($_GET['artist_id'])) {
    $artist_info = digga_fetch_info($_GET['artist_id']);
    echo '<h1>Digga ger dig info om ' . $artist_info['name'] . '</h1>' . "\n";
    echo '<h3>' . cute_number($artist_info['popularity']) . ' Hamsterpajare diggar ' . $artist_info['name'] . '!</h3>' . "\n";
    if (strlen($artist_info['description']) > 0) {
        echo '<p class="digga_description">' . "\n";
        echo nl2br($artist_info['description']);
        echo '</p>' . "\n";
    } else {
        echo '<p class="digga_no_description">' . "\n";
        echo 'Vi har tyvärr ingen beskrivning om ' . $artist_info['name'] . ' än. Om du känner att du kan mycket om det ';
        echo 'här bandet eller den här artisten så får du hemskt gärna skriva en egen beskrivning och skicka den som ett ';
        echo 'privat meddelande till <a href="/traffa/profile.php?id=65654">Rojk</a>. Glöm inte att tala om vilken artist ';
        echo 'det gäller!' . "\n";
        echo '</p>' . "\n";
    }
    $diggers = digga_fetch_diggers($_GET['artist_id']);
    if (count($diggers) > 0) {
        echo '<div id="digga_diggers">' . "\n";
コード例 #9
0
ファイル: films.lib.php プロジェクト: Razze/hamsterpaj
function films_film_play_draw($film, $options)
{
    event_log_log('new_' . $film['film_type'] . '_watch');
    film_view_count($film['id']);
    echo '<div class="film_play" id="film_play">' . "\n";
    rounded_corners_top();
    $related_films = films_fetch(array('released' => true, 'film_type' => $film['film_type'], 'exclude' => array($film['id']), 'limit' => 3, 'order' => 'random'));
    films_list($related_films, array('list_type' => 'film_list_compact', 'headline' => 'Fler ' . $film['film_type']));
    echo '<h1 class="film_header">' . $film['title'] . '</h1>' . "\n";
    echo '<div class="film_statistics">' . "\n";
    echo '<div class="film_view_count">' . "\n";
    echo cute_number($film['view_count'] + 1) . ' visningar' . "\n";
    echo '</div>' . "\n";
    // film_view_count
    echo rank_draw($film['rank_average'], array('size' => 'medium'));
    //	echo '<div class="film_rank_count">' . "\n";
    //	echo cute_number($film['rank_count']) . ' röster' . "\n";
    //	echo '</div>' . "\n";
    if (5 == $_SESSION['login']['userlevel']) {
        echo '<a class="film_edit" href="/film/admin/' . $film['handle'] . '.html">[Redigera]</a>' . "\n";
    }
    echo '</div>' . "\n";
    // film_statistics
    echo '<div class="film_player">' . "\n";
    if ($film['trailer_id'] > 0) {
        echo '<!-- Play Networks - Embeddable Flash Player -->' . "\n";
        echo '<div id="playnw" class="playnw">' . "\n";
        echo '<script src="http://se.player.playnetworks.net/player.php?mid=' . $film['trailer_id'] . '&channel_user_id=4601100020-1&width=460&height=345"></script><br>' . "\n";
        echo '</div>' . "\n";
        echo '<!-- Play Networks - Embeddable Flash Player -->' . "\n";
    } elseif ($film['use_special_code'] == 1) {
        echo stripslashes($film['html']);
    } elseif ($film['extension'] == 'swf') {
        //todo! Här skall anpassas till distribute-systemet. distribute_server_get skall anropas för att f? en adress
        // adress skall byggas med server . type . handle . '.' . extension
        echo '<object type="application/x-shockwave-flash" data="http://amuse.hamsterpaj.net/distribute/film/' . $film['handle'] . '.swf" >
					<param name="movie" value="http://amuse.hamsterpaj.net/distribute/film/' . $film['handle'] . '.swf" /></object>';
    } elseif ($film['extension'] == 'flv') {
        //todo! Här skall anpassas till distribute-systemet. distribute_server_get skall anropas för att f? en adress
        // adress skall byggas med server . type . handle . '.' . extension
        echo '<p id="player1"><a href="http://www.macromedia.com/go/getflashplayer">Installera Flash Player</a> för att kunna se den här filmen.</p>
				<script type="text/javascript">
				var s1 = new SWFObject("/film/flvplayer.swf","single","460","345","7");
				s1.addParam("allowfullscreen","true");
				s1.addVariable("file","http://amuse.hamsterpaj.net/distribute/film/' . $film['handle'] . '.flv");
				s1.addVariable("image","' . IMAGE_URL . '/film/' . $film['handle'] . '.png");
				s1.addVariable("width","460");
				s1.addVariable("height","345");
				s1.write("player1");
				</script>';
    } elseif ($film['film_type'] == 'bilder') {
        //todo! Här skall anpassas till distribute-systemet. distribute_server_get skall anropas för att f? en adress
        // adress skall byggas med server . type . handle . '.' . extension
        echo '<img src="http://images.hamsterpaj.net/fun_images/' . $film['handle'] . '.jpg" class="fun_images_big" />' . "\n";
    }
    echo '</div>' . "\n";
    // film_player
    echo '<br style="clear: both;" />' . "\n";
    echo '<div class="film_description">' . "\n";
    if (strlen($film['description']) > 0) {
        echo '<p>' . $film['description'] . '</p>' . "\n";
    }
    if ($film['trailer_id'] > 0) {
        echo '<p>Filmtrailers visas i samarbete med Play Networks</p>' . "\n";
    }
    echo '</div>' . "\n";
    // end film_description
    echo '<div class="film_comments">' . "\n";
    echo '<input type="hidden" id="film_id" value="' . $film['id'] . '" />' . "\n";
    echo '<h2 class="rank_input_header">Din poäng</h2>' . "\n";
    echo '<h2 class="comment_input_header">Din kommentar</h2>' . "\n";
    echo '<br style="clear: both;" />' . "\n";
    $query = 'SELECT rank FROM user_ranks WHERE user_id = "' . $_SESSION['login']['id'] . '" AND item_id = "' . $film['id'] . '" AND item_type = "film"';
    $result = mysql_query($query);
    if (mysql_num_rows($result) == 1) {
        $data = mysql_fetch_assoc($result);
    }
    unset($rank_options);
    $rank_options['previous'] = $data['rank'];
    rank_input_draw($film['id'], 'film', $rank_options);
    comments_input_draw($film['id'], 'film');
    echo '<br style="clear: both;" />' . "\n";
    echo '</div>' . "\n";
    // film_comments
    rounded_corners_bottom();
    $options['comments'] = isset($options['comments']) ? $options['comments'] : 'yes';
    if ($options['comments'] == 'yes') {
        rounded_corners_top();
        echo comments_list($film['id'], 'film');
        rounded_corners_bottom();
    }
    echo '</div>' . "\n";
    // film_play
}
コード例 #10
0
ファイル: entertain.lib.php プロジェクト: KuBe-zz/hamsterpaj
function entertain_item_draw($item, $options)
{
    global $entertain_types;
    entertain_item_viewed($item['id'], $item['entertain_type'], $item['view_count']);
    $output .= '<span class="' . $item['entertain_type'] . '">' . "\n";
    $output .= '<div class="entertain_item">' . "\n";
    // Item title
    $output .= '<h1 class="entertain_header">' . $item['title'] . '</h1>' . "\n";
    /* The entertainment items are displayed in different ways for different types.
    		Games have full width while movie clips, flash films and images are displayed
    		in 3/4 width, whith a few thumbnails on the side.
    	*/
    switch ($item['entertain_type']) {
        case 'software':
        case 'clip':
        case 'flash':
        case 'image':
            $fetch_result = entertain_fetch(array('released' => true, 'entertain_type' => $item['entertain_type'], 'exclude' => array($item['id']), 'limit' => 3, 'order' => 'random'));
            $related_items = $fetch_result['items'];
            $output .= entertain_list($related_items, array('list_style' => 'thumbnails', 'headline' => 'Fler ' . $entertain_types[$item['entertain_type']]['label_plural']));
            break;
        case 'game':
            break;
    }
    // Item rank, counter and release date
    $output .= '<div class="entertain_statistics">' . "\n";
    $output .= '<div class="entertain_rank">' . "\n";
    $output .= rank_draw($item['rank_average'], array('size' => 'medium'));
    $output .= '</div>' . "\n";
    // end entertain_rank
    $output .= '<div class="entertain_view_count">' . "\n";
    $output .= cute_number($item['view_count'] + 1) . ' visningar sedan ' . "\n";
    $output .= date('Y-m-d', $item['release']);
    //fix_time($item['release']);
    $output .= '</div>' . "\n";
    // end entertain_date
    $output .= '</div>' . "\n";
    // end entertain_statistics
    $output .= '<div class="entertain_player" id="entertain_player">' . "\n";
    /* Now we shall display the entertainment item itself. This is done in different ways
    		for different types and also different depending on special properties like
    		use_special_code or trailer_id.
    	*/
    if ($_SESSION['login']['id'] == 87926) {
        preint_r($item);
    }
    //First, we consider a bunch of special cases, that is film trailers, items with their own special html, images and software links
    if ($item['trailer_id'] > 0) {
        $output .= '<!-- Play Networks - Embeddable Flash Player -->' . "\n";
        $output .= '<div id="playnw" class="playnw">' . "\n";
        $output .= '<script src="http://se.player.playnetworks.net/player.php?mid=' . $item['trailer_id'] . '&channel_user_id=4601100020-1&width=474&height=355"></script><br>' . "\n";
        $output .= '</div>' . "\n";
        $output .= '<!-- Play Networks - Embeddable Flash Player -->' . "\n";
    } elseif ($item['use_special_code'] == 1) {
        $output .= stripslashes($item['html']);
    } elseif (strlen($item['link']) > 2 && $item['entertain_type'] == 'image') {
        $server = distribute_server_get(array('item_handle' => $item['handle'], 'type' => $item['entertain_type']));
        $address = 'http://' . $server['address'] . '/distribute/' . $item['entertain_type'] . '/' . $item['handle'] . '.' . $item['extension'];
        $output .= '<a href="' . $item['link'] . '"><img src="' . $address . '" class="entertain_' . $item['entertain_type'] . '" /></a>' . "\n";
    } elseif ($item['entertain_type'] == 'software') {
        $output .= '<button onclick="window.location=\'' . $item['link'] . '\';" class="button_150">Ladda ner</button><br />' . "\n";
        $output .= '<p>Alla filer är givetvis gratis att ladda ner och innehåller inga virus!</p>' . "\n";
    } else {
        $server = distribute_server_get(array('item_handle' => $item['handle'], 'type' => $item['entertain_type']));
        $address = 'http://' . $server['address'] . '/distribute/' . $item['entertain_type'] . '/' . $item['handle'] . '.' . $item['extension'];
        switch ($item['extension']) {
            case 'swf':
                $wrapper = '';
                $output .= '<object type="application/x-shockwave-flash" data="' . $wrapper . $address . '" >
							<param name="movie" value="' . $wrapper . $address . '" /></object>';
                $item['entertain_type'] == 'clip' || $item['entertain_type'] == 'flash' ? event_log_log('jc_ad_after') : '';
                break;
            case 'flv':
                $player_url = '/entertain/flvplayer.swf';
                // On end of J-store campaign, set width to 456 and height to 355 on both places
                $output .= '<div id="player1"><a href="http://www.macromedia.com/go/getflashplayer">Installera Flash Player</a> för att kunna se den här grejen.</div>
						<script type="text/javascript">
						var s1 = new SWFObject("' . $player_url . '","single","466","336","7");
						s1.addParam("allowfullscreen","true");
						s1.addVariable("file","' . $address . '");
						s1.addVariable("image","' . IMAGE_URL . '/entertain/' . $item['handle'] . '.png");
						s1.addVariable("width","466");
						s1.addVariable("height","336");
						s1.write("player1");
						</script>';
                break;
            case 'jpg':
            case 'png':
            case 'gif':
                $server = distribute_server_get(array('item_handle' => $item['handle'], 'type' => $item['entertain_type']));
                $address = 'http://' . $server['address'] . '/distribute/' . $item['entertain_type'] . '/' . $item['handle'] . '.' . $item['extension'];
                $output .= '<img src="' . $address . '" class="entertain_' . $item['entertain_type'] . '" />' . "\n";
        }
    }
    $output .= '<div class="entertain_item_buttons">' . "\n";
    if ($item['entertain_type'] == 'image') {
        $query = 'SELECT id, handle FROM entertain_items WHERE id < "' . $item['id'] . '"';
        $query .= ' AND `release` < ' . time();
        $query .= ' AND entertain_type = "' . $item['entertain_type'] . '"';
        $query .= ' ORDER BY id DESC';
        $query .= ' LIMIT 1';
        $result = mysql_query($query) or die(report_sql_error($query, __FILE__, __LINE__));
        if ($data = mysql_fetch_assoc($result)) {
            $output .= '<a href="/' . $entertain_types[$item['entertain_type']]['url_handle'] . '/' . $data['handle'] . '.html">';
            $output .= '<button id="entertain_previous" class="button_90">';
            $output .= 'Föregående';
            $output .= '</button></a>' . "\n";
        }
        $query = 'SELECT id, handle FROM entertain_items WHERE id > "' . $item['id'] . '"';
        $query .= ' AND `release` < ' . time();
        $query .= ' AND entertain_type = "' . $item['entertain_type'] . '"';
        $query .= ' ORDER BY id ASC';
        $query .= ' LIMIT 1';
        $result = mysql_query($query) or die(report_sql_error($query, __FILE__, __LINE__));
        if ($data = mysql_fetch_assoc($result)) {
            $output .= '<a href="/' . $entertain_types[$item['entertain_type']]['url_handle'] . '/' . $data['handle'] . '.html">';
            $output .= '<button id="entertain_next" class="button_90">';
            $output .= 'Nästa';
            $output .= '</button></a>' . "\n";
        }
    }
    if ($item['extension'] == 'swf') {
        $output .= '<button id="entertain_fullscreen" onclick="javascript: open_fullscreen_window(\'' . $address . '\');">';
        $output .= 'Spela i fullskärm';
        $output .= '</button>' . "\n";
    }
    $output .= '</div>' . "\n";
    // end entertain_item_buttons
    $output .= '</div>' . "\n";
    // end entertain_player
    // Description and game controls
    $output .= '<div class="entertain_description">' . "\n";
    if (strlen($item['description']) > 0) {
        $output .= $item['description'] . "\n";
    }
    if ($item['trailer_id'] > 0) {
        $output .= '<p>Filmtrailers visas i samarbete med Play Networks</p>' . "\n";
    }
    $output .= '</div>' . "\n";
    // end entertain_description
    if (!is_array($item['controls'])) {
        $item['controls'] = unserialize(utf8_decode($item['controls']));
        $utf8_mupp = true;
    }
    if (is_array($item['controls']) && count($item['controls']) > 0) {
        $output .= '<h2>Kontroller</h2>' . "\n";
        $output .= '<table class="entertain_controls">' . "\n";
        $num_of_rows = ceil(count($item['controls']) / 2);
        for ($i = 0; $i < $num_of_rows; $i++) {
            $output .= '<tr>' . "\n";
            if (!$utf8_mupp) {
                $output .= '<td class="combination">' . $item['controls'][$i]['combination'] . '</td>' . "\n";
                $output .= '<td class="description">' . $item['controls'][$i]['description'] . '</td>' . "\n";
            } else {
                $output .= '<td class="combination">' . utf8_encode($item['controls'][$i]['combination']) . '</td>' . "\n";
                $output .= '<td class="description">' . utf8_encode($item['controls'][$i]['description']) . '</td>' . "\n";
            }
            $output .= '</tr>' . "\n";
        }
        $output .= '</table>' . "\n";
    }
    if (is_privilegied('entertain_update')) {
        $output .= '<a class="entertain_edit" href="/' . $entertain_types[$item['entertain_type']]['url_handle'] . '/admin/' . $item['handle'] . '.html">[Redigera]</a>' . "\n";
    }
    if (is_privilegied('entertain_add')) {
        $output .= 'Personen som laddat upp det här objektet är: <a href="/traffa/profile.php?id=' . $item['uploader'] . '">' . $item['uploader'] . '</a>';
    }
    //todo! connect with javascript
    // Comments - Users can rank and leave a comment. These are handled by separate libraries but are connected
    // by javascript so that users submit rank and comment together.
    $output .= '<div class="entertain_comments">' . "\n";
    $output .= '<input type="hidden" id="entertain_item_id" value="' . $item['id'] . '" />' . "\n";
    $output .= '<h2 class="rank_input_header">Din poäng</h2>' . "\n";
    $output .= '<h2 class="comment_input_header">Din kommentar</h2>' . "\n";
    $output .= '<br style="clear: both;" />' . "\n";
    if (login_checklogin()) {
        $query = 'SELECT rank FROM user_ranks WHERE user_id = "' . $_SESSION['login']['id'] . '" AND item_id = "' . $item['id'] . '" AND item_type = "entertain"';
        $result = mysql_query($query);
        if (mysql_num_rows($result) == 1) {
            $data = mysql_fetch_assoc($result);
        }
    }
    unset($rank_options);
    $rank_options['previous'] = $data['rank'];
    $output .= rank_input_draw($item['id'], 'entertain', $rank_options);
    $output .= comments_input_draw($item['id'], 'entertain');
    $output .= '<br style="clear: both;" />' . "\n";
    $output .= '</div>' . "\n";
    // end entertain_comments
    $options['comments'] = isset($options['comments']) ? $options['comments'] : 'yes';
    if ($options['comments'] == 'yes') {
        $output .= comments_list($item['id'], 'entertain');
    }
    $output .= '</div>' . "\n";
    // end entertainment_item
    $output .= '</span>' . "\n";
    // end $entertain_type
    return $output;
}
コード例 #11
0
ファイル: site_stats.module.php プロジェクト: Rojk/hamsterpaj
<?php

$serialized = file_get_contents(PATHS_CACHE . 'live_stats.phpserialized');
$info = unserialize($serialized);
$options['output'] .= '<h4>Besökare</h4>' . "\n";
$options['output'] .= cute_number($info['visitors']) . "\n";
$options['output'] .= '<h4>Inloggade</h4>' . "\n";
$options['output'] .= cute_number($info['logged_in']) . "\n";
$options['output'] .= '<h4>Medlemmar</h4>' . "\n";
$options['output'] .= cute_number($info['members']) . "\n";
$options['output'] .= '<h4>Sidvisningar idag</h4>' . "\n";
$pageviews = query_cache(array('query' => 'SELECT views FROM pageviews WHERE date = "' . date('Y-m-d') . '" LIMIT 1'));
$options['output'] .= cute_number($pageviews[0]['views']);
コード例 #12
0
ファイル: games.lib.php プロジェクト: Razze/hamsterpaj
function games_game_popularity_draw($game, $options = null)
{
    echo '<div class="game_popularity" >' . "\n";
    echo '<div class="game_played">' . "\n";
    echo '<div class="column_1">' . cute_number($game['played']) . '</div><a href="/spel/topplistan/mest_spelade/">Spelningar</a>' . "\n";
    echo '</div>' . "\n";
    echo '<div class="game_points">' . "\n";
    echo '<div class="column_1">' . cute_number($game['points']) . '</div><a href="/spel/topplistan/mest_hypade/">Hypes</a>' . "\n";
    echo '</div>' . "\n";
    echo '<div class="game_release">' . "\n";
    echo '<div class="column_1">Släpptes</div>' . date('Y-m-d', $game['release']) . "\n";
    echo '</div>' . "\n";
    echo '</div>' . "\n";
    //end game_popularity
}
コード例 #13
0
ファイル: contests.lib.php プロジェクト: Razze/hamsterpaj
function contests_list($contests)
{
    global $contest_tags;
    $counter = 0;
    foreach ($contests as $contest) {
        echo '<!-- Contest #' . $contest['id'] . ' -->' . "\n";
        echo '<div class="contest">' . "\n";
        echo '<div class="contest_freetext">' . "\n";
        if ($contest['user_confirmed'] == 1) {
            echo '<img src="http://images.hamsterpaj.net/contests/user_confirmed.png" />' . "\n";
        }
        echo '<h1><a href="/taevlingar/out.php?id=' . $contest['id'] . '" target="_blank">' . $contest['title'] . '</a></h1>' . "\n";
        echo '<p>' . nl2br($contest['description']) . '</p>' . "\n";
        echo '</div>' . "\n";
        echo '<div class="contest_tags">' . "\n";
        echo '<h3>Tävlingstyp</h3>' . "\n";
        $first = true;
        foreach ($contest['tags'] as $handle => $label) {
            if (in_array($label, $contest_tags['contest_types'])) {
                if (!$first) {
                    echo ', ';
                }
                echo '<a href="/taevlingar/' . $handle . '.html">' . $label . '</a>';
                $first = false;
            }
        }
        $first = true;
        echo '<h3>Vinsttyp</h3>' . "\n";
        foreach ($contest['tags'] as $handle => $label) {
            if (in_array($label, $contest_tags['price_types'])) {
                if (!$first) {
                    echo ', ';
                }
                echo '<a href="/taevlingar/' . $handle . '.html">' . $label . '</a>';
                $first = false;
            }
        }
        echo '</div>' . "\n";
        echo '<div class="contest_footer">' . "\n";
        echo '<span class="clicks">' . $contest['clicks'] . ' klick</span>' . "\n";
        $time_left = ceil(($contest['time_end'] - time()) / 86400);
        if ($time_left == 1) {
            $time_label = 'Sista dagen idag';
        } else {
            $time_label = $time_left . ' dagar kvar';
        }
        $value = $contest['value'] == 0 ? 'okänt' : cute_number($contest['value']) . ':-';
        $value = $contest['prize_value_cirka'] == 1 ? 'Ca ' . $value : $value;
        echo '<span class="time_left">' . ceil(($contest['time_end'] - time()) / 86400) . ' dagar kvar</span>' . "\n";
        echo '<span class="value">Värde: ' . $value . '</span>' . "\n";
        echo '<span class="mark_as_done">markera som avklarad</span>' . "\n";
        echo '</div>' . "\n";
        echo '</div>' . "\n\n\n";
        if ($counter == 2) {
            ?>
<script type="text/javascript"><!--
google_ad_client = "pub-9064365008649147";
google_alternate_color = "FFFFFF";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
コード例 #14
0
ファイル: index.php プロジェクト: Rambutan/hamsterpaj
		echo '<td>' . $age . '</td>';
		echo '<td>' . $data['spot'] . '</td>';
		echo '<td>' . duration(time() - $data['regtimestamp']) . '</td>';
		echo '</tr>';
	}*/
?>
	</table>
	
</div>

<div id="scribble_puff">
	<a href="/traffa/klotterplank.php">
	<img src="http://images.hamsterpaj.net/scribbler.png" style="float: left;" />
	<?php 
$query = 'SELECT id FROM klotterplank ORDER BY id DESC LIMIT 1';
$result = mysql_query($query) or die(report_sql_error($query, __FILE__, __LINE__));
$data = mysql_fetch_assoc($result);
echo '<h2>' . cute_number($data['id']) . ' inlägg på klotterplanket just nu!</h2>' . "\n";
?>
	<p>
		På klotterplanket skriver Hamsterpajare dygnet runt korta små inlägg. En del letar efter någon
		att prata med, andra småpratar med den som dyker upp och några vill bara klaga på att lektionen
		suger.<br />
		Klotterplanket är till för dig som inte orkar med chatten och som vill se ansiktet på de du 
		pratar med.
	</p>
</a>
</div>

<?php 
ui_bottom();
コード例 #15
0
ファイル: ui-functions.php プロジェクト: Razze/hamsterpaj
function ui_top($options)
{
    if (isset($_SESSION['new_design'])) {
        echo ui_new_top($options);
        return;
    }
    global $SIDE_MODULES;
    if (!isset($options['adtoma_category'])) {
        $options['adtoma_category'] = 'other';
    }
    define('ADTOMA_CATEGORY', $options['adtoma_category']);
    if (login_checklogin() && rand(1, 5) == 2) {
        $query = 'UPDATE login SET lastrealaction="' . time() . '" WHERE id="' . $_SESSION['login']['id'] . '"';
        mysql_query($query) or die(report_sql_error($query, __FILE__, __LINE__));
    }
    $options['title'] = isset($options['title']) ? $options['title'] : 'Hamsterpaj.net - Onlinespel, community, forum och annat kul ;)';
    $options['stylesheets'][] = 'shared.css';
    $options['stylesheets'][] = 'modules.css';
    $options['stylesheets'][] = 'buttons.css';
    $options['stylesheets'][] = 'new_guestbook.css';
    $options['stylesheets'][] = 'rounded_corners.css';
    $options['stylesheets'][] = 'message.css';
    $options['stylesheets'][] = 'domTT.css';
    $options['stylesheets'][] = 'poll.css';
    /* Order:
    			jQuery
    			Womlib (needs jQuery to work properly!)
    			The rest...
    		*/
    if (is_array($options['javascripts'])) {
        array_unshift($options['javascripts'], 'womlib.js');
    } else {
        $options['javascripts'] = array('womlib.js');
    }
    if ($_SESSION['login']['id'] > 0) {
        $options['javascripts'][] = 'stay_online.js';
    }
    $options['javascripts'][] = 'ui_server_message.js';
    $options['javascripts'][] = 'scripts.js';
    $options['javascripts'][] = 'steve.js';
    $options['javascripts'][] = 'new_guestbook.js';
    $options['javascripts'][] = 'forum.js';
    $options['javascripts'][] = 'posts.js';
    $options['javascripts'][] = 'abuse_report.js';
    $options['javascripts'][] = 'poll.js';
    array_unshift($options['javascripts'], 'jquery.js');
    $options['javascripts'][] = 'swfobject.js';
    $options['javascripts'][] = 'md5.js';
    $options['javascripts'][] = 'xmlhttp_login.js';
    $options['javascripts'][] = 'xmlhttp.js';
    $options['javascripts'][] = 'fult_dhml-skit_som_faar_bilder_att_flyga.js';
    $options['javascripts'][] = 'wave_effect.js';
    $options['javascripts'][] = 'joels_hackerkod.js';
    $options['javascripts'][] = 'ui.js';
    if (!login_checklogin()) {
        $options['javascripts'][] = 'tiny_reg_form.js';
        $options['stylesheets'][] = 'tiny_reg_form.css';
    }
    if (rand(0, 73) == 50) {
        $query = 'UPDATE pageviews SET views = views + 73 WHERE date = "' . date('Y-m-d') . '" LIMIT 1';
        mysql_query($query);
        if (mysql_affected_rows() == 0) {
            $query = 'INSERT INTO pageviews (views, date) VALUES(73, "' . date('Y-m-d') . '")';
            mysql_query($query);
        }
    }
    echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' . "\n";
    echo '<html xmlns="http://www.w3.org/1999/xhtml">' . "\n";
    echo '<head>' . "\n";
    echo '<meta name="description" content="' . $options['meta_description'] . '" />' . "\n";
    echo '<meta name="keywords" content="' . $options['meta_keywords'] . '" />' . "\n";
    echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />' . "\n";
    echo '<title>' . $options['title'] . '</title>' . "\n";
    echo '<link rel="icon" href="http://images.hamsterpaj.net/favicon.png" type="image/x-icon" />' . "\n";
    echo '<link rel="shortcut icon" href="http://images.hamsterpaj.net/favicon.png" type="image/x-icon" />' . "\n";
    array_unshift($options['stylesheets'], 'ui.css.php');
    echo "\n\n" . '<!-- Load stylesheets, version is timestamp of last file modification. Current timestamp is: ' . time() . ' -->' . "\n";
    echo '<style type="text/css">' . "\n";
    foreach ($options['stylesheets'] as $stylesheet) {
        echo '@import url(\'/stylesheets/' . $stylesheet . '?version=' . filemtime(PATHS_WEBROOT . 'stylesheets/' . $stylesheet) . '\');' . "\n";
    }
    echo '</style>' . "\n";
    echo "\n\n" . '<!-- Load javascripts, version is timestamp of last file modification. -->' . "\n";
    foreach ($options['javascripts'] as $javascript) {
        echo '<script type="text/javascript" language="javascript" ';
        echo 'src="/javascripts/' . $javascript . '?version=' . filemtime(PATHS_WEBROOT . 'javascripts/' . $javascript) . '"></script>' . "\n";
    }
    if (isset($options['enable_rte'])) {
        echo '<script language="javascript" type="text/javascript" src="/javascripts/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
						<script language="javascript" type="text/javascript">
						tinyMCE.init({
							mode : "exact",
							elements: "post_form_content",
							theme: "advanced",
							theme_advanced_buttons1 : "bold,italic,underline,separator,bullist,numlist,separator,sup,charmap",
							theme_advanced_buttons2 : "",
							theme_advanced_buttons3 : "",
							theme_advanced_resize_horizontal : false,
							theme_advanced_resizing : true,
							theme_advanced_path : false,
							theme_advanced_toolbar_location : "top",
							theme_advanced_statusbar_location : "bottom",
							theme_advanced_toolbar_align : "left",
							auto_reset_designmode : true
						});
						</script>';
    }
    echo "\n\n";
    echo $options['header_extra'];
    echo '</head>' . "\n";
    echo isset($options['body_extra']) ? '<body ' . $options['body_extra'] . '>' . "\n" : '<body>' . "\n";
    echo '<div id="hamsterpaj_website">' . "\n";
    echo '<!-- Nej, fråga oss inte varför vi har typ tio olika divar som verkar göra samma sak... -->' . "\n";
    echo '<!-- Ad management, adtoma -->' . "\n";
    echo '<script type="text/javascript">' . "\n";
    $adtoma_gender = in_array($_SESSION['userinfo']['gender'], array('P', 'F')) ? $_SESSION['userinfo']['gender'] : 'xx';
    $adtoma_age = $_SESSION['userinfo']['birthday'] != '0000-00-00' ? date_get_age($_SESSION['userinfo']['birthday']) : 'xx';
    $adtoma_birthyear = $_SESSION['userinfo']['birthday'] != '0000-00-00' ? substr($_SESSION['userinfo']['birthday'], 0, 4) : 'xx';
    echo "\t" . 'var CM8Server = "ad.adtoma.com";' . "\n";
    echo "\t" . 'var CM8Cat = "hp.' . ADTOMA_CATEGORY . '";' . "\n";
    echo "\t" . 'var CM8Profile = "hp_age=' . $adtoma_age . '&amp;hp_birthyear=' . $adtoma_birthyear . '&amp;hp_gender=' . $adtoma_gender . '"' . "\n";
    echo '</script>' . "\n";
    echo '<script language="JavaScript" type="text/javascript" src="http://ad.adtoma.com/adam/cm8adam_1_call.js"></script>' . "\n";
    echo "\n\n";
    echo '<div>' . "\n";
    echo '	<script type="text/javascript">CM8ShowAd("Bigbanner");</script>' . "\n";
    echo '</div>' . "\n";
    echo '<div style="width: 1200px;margin-top: 10px">' . "\n";
    if (!login_checklogin() && rand(0, 5) == 4 || login_checklogin() && rand(0, 30) == 7) {
        echo '<a href="/sex_och_sinne/"><img src="http://images.hamsterpaj.net/sex_and_sense/ui_to_new_sex_sense.png" alt="Till nya sex och sinne!" style="margin-left: 670px" /></a>';
    }
    echo '<img src="http://images.hamsterpaj.net/ui/site_top_rounded_corners.png" id="site_top_rounded_corners" />' . "\n";
    echo '<div id="site_container">' . "\n";
    echo '<div id="main">' . "\n";
    echo '<div id="top">' . "\n";
    if (true) {
        if ($_SESSION['login']['id'] == 148153 || isset($_GET['illerpaj'])) {
            echo '<a href="/"><img src="http://images.hamsterpaj.net/illerpaj2.png" id="logo" /></a>' . "\n";
        } elseif (NATTPAJ == true) {
            echo '<a href="/"><img src="http://images.hamsterpaj.net/nattpaj/nattpaj_logo.png" id="logo" /></a>' . "\n";
        } else {
            echo '<a href="/"><img src="http://images.hamsterpaj.net/ui/logo.png" id="logo" /></a>' . "\n";
        }
    } else {
        echo '<div id="logo">' . "\n";
        if (!strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6.0')) {
            ?>
	<object type="application/x-shockwave-flash" data="http://images.hamsterpaj.net/ui/hamsterpaj_logo.swf" width="320" height="60">
		<param name="movie" value="http://images.hamsterpaj.net/ui/hamsterpaj_logo.swf" />
		<img src="http://images.hamsterpaj.net/logo.png" alt="Hamsterpaj logo" />
	</object>
<?php 
        }
        echo '</div>' . "\n";
    }
    echo '<div id="login_pane">' . "\n";
    if (login_checklogin()) {
        echo ui_login_status_bar('page_init');
    } else {
        ?>
			<form action="/login.php?action=login" method="post" id="login_form">
				<div class="username">
					<h5>Användarnamn</h5> 
					<input type="text" name="username"  />
				</div>
				<div class="password">
					<h5>Lösenord</h5>
					<input type="password" name="password" />
				</div>
			<ul class="login_buttons">
				<li>
						<div class="icon">
							<a onclick="javascript: document.getElementById('login_form').submit();">
								<img src="http://images.hamsterpaj.net/login_bar/login_color.png" alt="Logga in" />
							</a>
						</div>
					<a onclick="javascript: document.getElementById('login_form').submit();">
						Logga in
					</a>
				</li>
				
				<li>
						<div class="icon">
						<a href="/register.php">
							<img src="http://images.hamsterpaj.net/login_bar/register_color.png" alt="Bli medlem" />
						</a>
						</div>
						<a href="/register.php">
							Bli medlem
						</a>
				</li>
			</ul>
			<input type="submit" value="logga in" style="width: 0px; height: 0px; float: left; border: none;" />
			<!-- Submit med enterslag fungerar inte i IE om det inte finns en submit-knapp, dessutom får den inte ha display: none; för då funkar det inte i IE... Skitläsare! -->
			</form>
			<?php 
    }
    echo '</div>' . "\n";
    echo '</div>' . "\n";
    echo '</div>' . "\n";
    ?>
		
		<div id="search_and_status">
				<div id="quicksearch">
					<form action="/quicksearch.php">
					<input type="text" id="quicksearch_input" class="quicksearch_input" value="Sök Hamsterpajare..." name="search" />
					<input type="hidden" name="type" value="user" />
		
		<?php 
    if (!strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6.0')) {
        //			echo '<img src="' . IMAGE_URL . 'steve/icon_gun.gif" id="steve_gun"/>' . "\n";
    }
    echo '<input type="submit" value="" class="button_magnifier" />' . "\n";
    echo '</form>' . "\n";
    echo '</div>' . "\n";
    echo '<div class="status">' . "\n";
    if ($_SESSION['disablesteve'] != 1) {
        echo '<img src="http://images.hamsterpaj.net/steve/steve.gif" id="steve" />' . "\n";
    }
    if (login_checklogin()) {
        $status = strlen(trim($_SESSION['userinfo']['user_status'])) > 0 ? $_SESSION['userinfo']['user_status'] : 'Ingen status';
        echo '<input type="text" id="user_status_input" value="' . stripslashes($status) . '" />' . "\n";
        echo '<button class="button_50" id="user_status_save_button">Spara</button>' . "\n";
    }
    echo '</div>' . "\n";
    echo '</div>' . "\n";
    echo '<div id="main_left">' . "\n";
    global $menu;
    /* Merge the users additions to the menu array */
    if (isset($options['menu_addition'])) {
        $menu = array_merge_recursive($menu, $options['menu_addition']);
    }
    foreach ($menu as $handle => $current_menu) {
        if (isset($current_menu['is_privilegied'])) {
            $current_menu['is_privilegied'] = is_array($current_menu['is_privilegied']) ? $current_menu['is_privilegied'] : array($current_menu['is_privilegied']);
            $is_privilegied = false;
            foreach ($current_menu['is_privilegied'] as $privilegie) {
                if (is_privilegied($privilegie)) {
                    $is_privilegied = true;
                }
            }
        } else {
            $is_privilegied = true;
        }
        if ($is_privilegied == true) {
            $class = $handle == $options['menu_path'][0] ? 'menu_active' : 'menu';
            echo '<div class="' . $class . '" id="menu_div_' . $handle . '">' . "\n";
            $target = isset($current_menu['target']) ? ' target="' . $current_menu['target'] . '"' : '';
            echo '<h3><a href="' . $current_menu['url'] . '" class="menu_title" id="menu_title_' . $handle . '"' . $target . '>' . $current_menu['label'] . '</a></h3>' . "\n";
            echo '<div class="menu_content">' . "\n";
            echo '<ul>' . "\n";
            $label = isset($current_menu['index_label']) ? $current_menu['index_label'] : 'Start';
            $class = count($options['menu_path']) == 1 && $handle == $options['menu_path'][0] ? ' class="active"' : '';
            echo '<li' . $class . '><a href="' . $current_menu['url'] . '">' . $label . '</a></li>' . "\n";
            if (count($current_menu['children']) > 0) {
                $count_menu_items = ui_menu_recurse($current_menu['children'], $options, 1);
            }
            echo '</ul>' . "\n";
            echo '</div>' . "\n";
            echo '<img src="http://images.hamsterpaj.net/ui/menu/menu_box_open_bottom.png" class="menu_box_open_bottom" />' . "\n";
            echo '<img src="http://images.hamsterpaj.net/ui/menu/menu_box_closed_bottom.png" class="menu_box_closed_bottom" />' . "\n";
            echo '</div>' . "\n";
        }
    }
    $serialized = file_get_contents(PATHS_INCLUDE . 'cache/live_stats.phpserialized');
    $info = unserialize($serialized);
    echo '<img src="http://images.hamsterpaj.net/ui/menu/left_module_top_bottom.png" class="left_module_top" />' . "\n";
    echo '<div class="left_module">' . "\n";
    echo '<h4>Besökare</h4>' . "\n";
    echo cute_number($info['visitors']) . "\n";
    echo '<h4>Inloggade</h4>' . "\n";
    echo cute_number($info['logged_in']) . "\n";
    echo '<h4>Medlemmar</h4>' . "\n";
    echo cute_number($info['members']) . "\n";
    echo '<h4>Sidvisningar idag</h4>' . "\n";
    $pageviews = query_cache(array('query' => 'SELECT views FROM pageviews WHERE date = "' . date('Y-m-d') . '" LIMIT 1'));
    echo cute_number($pageviews[0]['views']);
    echo '</div>' . "\n";
    echo '<img src="http://images.hamsterpaj.net/ui/menu/left_module_top_bottom.png" class="left_module_bottom" />' . "\n";
    if (login_checklogin()) {
        echo '<img src="http://images.hamsterpaj.net/ui/menu/left_module_top_bottom.png" class="left_module_top" />' . "\n";
        echo '<div class="left_module">' . "\n";
        echo '<h4>Minneslapp</h4>' . "\n";
        echo '<textarea id="note">' . "\n";
        echo htmlentities(stripslashes($_SESSION['note']));
        echo '</textarea>' . "\n";
        echo '<input type="button" value="Spara" class="button_50" onclick="note_save()" />' . "\n";
        echo '</div>' . "\n";
        echo '<img src="http://images.hamsterpaj.net/ui/menu/left_module_top_bottom.png" class="left_module_bottom" />' . "\n";
    }
    echo '</div>' . "\n";
    echo '<div id="middle">' . "\n";
    if (isset($_SESSION['notice_message'])) {
        if (login_checklogin()) {
            $notices[] = array('html' => $_SESSION['notice_message']);
        }
        unset($_SESSION['notice_message']);
    }
    $data = cache_load('recent_update');
    if ($data['timestamp'] > time() - 1200 && $_SESSION['recent_update_notifier'][$data['id']] < 10) {
        global $RECENT_UPDATES;
        $content = '<span class="time">' . date('H:i', $data['timestamp']) . '</span>' . "\n";
        $content .= '<span class="event">' . $RECENT_UPDATES[$data['type']] . '</span>' . "\n";
        $content .= '<span class="link"><a href="/recent_updates_redirect.php?id=' . $data['id'] . '&url=' . urlencode($data['url']) . '&source=global_notice">' . $data['label'] . '</a></span>' . "\n";
        $notices[] = array('html' => $content);
        $_SESSION['recent_update_notifier'][$data['id']]++;
    }
    foreach ($notices as $notice) {
        echo '<div class="notice">' . "\n";
        if (isset($notice['timestamp'])) {
            echo '<span class="time">' . date('H:i', $notice['timestamp']) . '</span>' . "\n";
        }
        echo $notice['html'];
        echo '</div>' . "\n";
    }
    echo '<div id="content">' . "\n";
    echo '<script type="text/javascript">CM8ShowAd("Rektangel");</script>' . "\n";
    if (isset($_SESSION['posted_gb_to_webmaster'])) {
        rounded_corners_top(array('color' => 'red'));
        echo 'Men tjockis, det behövs inte mycket IQ för att förstå att användaren Webmaster inte är en riktig människa, utan en BOT som används för att maskineriet bakom Hamsterpaj ska fungera.<br /><br />Om ditt inlägg var speciellt (alltså inte som allt annat som hamnar i Webmasters inkorg, nämligen spam eller hatbrev) är du välkommen vända dig till någon ordningsvakt (se lista bland högermodulerna här till höger&raquo;).';
        rounded_corners_bottom(array('color' => 'red'));
    }
    if (login_checklogin()) {
        if (isset($_SESSION['unread_gb_entries'])) {
            echo guestbook_list($_SESSION['unread_gb_entries']);
            unset($_SESSION['unread_gb_entries']);
        }
    }
}
コード例 #16
0
ファイル: sponsor.php プロジェクト: Razze/hamsterpaj
<?php

echo '<div style="border: 1px solid ' . $profile_colors['border'] . '; background: ' . $profile_colors['background'] . '; padding: 3px;">' . "\n";
$sponsor_handl = fopen(PATHS_INCLUDE . 'pageviews/sponsor/' . date('Y-m-d') . '.txt', 'a');
fwrite($sponsor_handl, x);
fclose($sponsor_handl);
$img_code = '<img src="' . IMAGE_URL . 'images/sponsorads/dunkenad.jpg" style="border: 1px solid #3f657a; float: left; width: 500px; margin-right: 3px;" />';
if ($_SESSION['sponsor_click'] != 1) {
    echo '<a href="/heggan/sponsor.php" target="_blank">' . $img_code . '</a>';
} else {
    echo $img_code;
}
?>
<div style="height: 100%">
	<?php 
echo 'Visas på <strong>';
include PATHS_INCLUDE . 'sponsor.txt';
echo '</strong> profiler<br /><strong>' . cute_number(filesize(PATHS_INCLUDE . 'pageviews/sponsor/' . date('Y-m-d') . '.txt')) . '</strong> visningar idag<br />';
echo '<strong>';
readfile(PATHS_INCLUDE . 'pageviews/sponsor/' . date('Y-m-d') . '_clicks.txt');
echo '</strong> klick idag.<br />';
?>
	<br />Att synas i rutan kostar 250:- per dygn, exl. moms. Maila johan<script>document.write('@');</script>rodent.se för med information.
</div>
	<br style="clear: both;" />
</div>