示例#1
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;
}
示例#2
0
/* 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)) {
    $flags[] = $data;
}
if (count($flags) > 0) {
    $output .= '<div style="margin-bottom: 10px;" class="repeat">' . "\n";
    $output .= '<div class="top">' . "\n";
    $output .= '<div class="bottom" style="padding: 10px;">' . "\n";
    $output .= '<div id="user_flags">' . "\n";
    foreach ($flags as $data) {
        $output .= '<img src="' . IMAGE_URL . 'user_flags/' . $data['handle'] . '.png" alt="' . $data['title'] . '" title="' . $data['title'] . '" id="' . $data['id'] . '" />' . "\n";
    }
示例#3
0
if (isset($_GET['entry'])) {
    $query = 'SELECT * FROM blog WHERE id = "' . $_GET['entry'] . '" AND is_removed = 0';
} else {
    $query = 'SELECT * FROM blog WHERE user = "******" AND is_removed = 0 ORDER BY id DESC LIMIT 1';
}
$result = mysql_query($query) or report_sql_error($query, __FILE__, __LINE__);
if (mysql_num_rows($result) == 1) {
    $data = mysql_fetch_assoc($result);
    $highlight_month = $data['date'];
    $entry .= '<h1>' . $data['date'] . ': ' . $data['title'] . '</h1>' . "\n";
    // Lef-91 adds photos from the same date
    $photos = photos_fetch(array('date' => $data['date'], 'user' => $user_id));
    if (isset($photos)) {
        $entry .= rounded_corners_top();
        $entry .= '<h2 style="margin-top: 0;">Foton från samma datum</h2>' . "\n";
        $entry .= photos_list_mini($photos);
        $entry .= '<div style="clear: both;"></div>' . "\n";
        $entry .= rounded_corners_bottom();
    }
    $entry .= '<p>' . nl2br($data['text']) . '</p>' . "\n";
    if ($user_id == $_SESSION['login']['id'] || is_privilegied('remove_diary_post')) {
        $entry .= '<a href="?user_id=' . $user_id . '&action=remove&id=' . $data['id'] . '">Ta bort dagboksinlägget</a>' . "\n";
    }
    // Comments
    $entry .= rounded_corners_top(array('color' => 'blue_deluxe'));
    $entry .= comments_input_draw($data['id'], 'blog');
    $entry .= '<div style="clear: both;"></div>' . "\n";
    $entry .= rounded_corners_bottom(array('color' => 'blue_deluxe'));
    $entry .= comments_list($data['id'], 'blog');
}
$short_months = array(1 => 'Jan', 2 => 'Feb', 3 => 'Mar', 4 => 'Apr', 5 => 'Maj', 6 => 'Jun', 7 => 'Jul', 8 => 'Aug', 9 => 'Sept', 10 => 'Okt', 11 => 'Nov', 12 => 'Dec');