コード例 #1
0
ファイル: profile.lib.php プロジェクト: Rambutan/hamsterpaj
function profile_presentation_photos_callback($matches)
{
    if (!is_numeric($matches[1])) {
        return 'Hacker där :(';
    }
    $photo_id = $matches[1];
    $photo_object = photos_fetch(array('id' => $photo_id, 'limit' => 1));
    if (count($photo_object) < 1) {
        return '<strong>[Bilden finns inte]</strong>';
    }
    $output .= photos_list($photo_object);
    $output .= '<br style="clear: both;" />';
    return $output;
}
コード例 #2
0
ファイル: new_photos.php プロジェクト: Rojk/hamsterpaj
require PATHS_LIBRARIES . 'photos.lib.php';
$ui_options['stylesheets'][] = 'photos.css';
$ui_options['menu_path'] = array('traeffa', 'new_photos');
$ui_options['title'] = 'Nya foton - Hamsterpaj.net';
$out .= '<h1>Nya foton</h1>';
//Get pagenumber
$page = 1;
if (isset($_GET['page']) && is_numeric($_GET['page'])) {
    $page = intval($_GET['page']);
    if ($page < 1 || $page > 999) {
        $page = 1;
    }
}
$offset = ($page - 1) * 32;
$photos = photos_fetch(array('order-direction' => 'DESC', 'offset' => $offset, 'limit' => 32));
$out .= photos_list($photos);
//Create Pagination links
if (isset($_GET['page']) && is_numeric($_GET['page'])) {
    $page = intval($_GET['page']);
    if ($page > 1) {
        $out .= ' <a href="' . $_SERVER['PHP_SELF'] . '?page=' . ($page - 1) . '">&laquo; Föregående</a> |';
    }
    if ($page > 0) {
        $out .= ' ' . $page . ' | <a href="' . $_SERVER['PHP_SELF'] . '?page=' . ($page + 1) . '">Nästa &raquo;</a>';
    }
} else {
    $out .= ' <a href="' . $_SERVER['PHP_SELF'] . '?page=2">Nästa &raquo;</a>';
}
ui_top($ui_options);
echo $out;
ui_bottom();
コード例 #3
0
ファイル: events.php プロジェクト: Rojk/hamsterpaj
<?php

require '../include/core/common.php';
require_once PATHS_LIBRARIES . 'photos.lib.php';
require_once PATHS_LIBRARIES . 'comments.lib.php';
require_once PATHS_LIBRARIES . 'guestbook.lib.php';
$ui_options['stylesheets'][] = 'photos.css';
$ui_options['javascripts'][] = 'photos.js';
$ui_options['stylesheets'][] = 'comments.css';
$ui_options['javascripts'][] = 'comments.js';
$ui_options['title'] = 'Dina nya händelser - Hamsterpaj.net';
$ui_options['menu_path'] = array('traeffa', 'haendelser');
ui_top($ui_options);
if (login_checklogin()) {
    echo '<h1>Nya händelser</h1>' . "\n";
    echo '<h2>Nya fotokommentarer</h2>' . "\n";
    $photos = photos_fetch(array('user' => $_SESSION['login']['id'], 'force_unread_comments' => true));
    if (count($photos) > 0) {
        echo 'Wosch! Nya kommentarer att besvara!<br />' . "\n";
        echo photos_list($photos);
    } else {
        echo '<italic>Du har inga oläsa fotokommentarer.</italic>';
    }
    echo '<h2>Gamla PM-systemet är borttaget.</h2>' . "\n";
    echo '<italic>Vi har tagit bort gamla PM-systemet. Mer info lär komma inom kort.</italic>';
} else {
    echo '<h1>Du måste vara inloggad</h1>' . "\n";
    echo 'Du måste vara inloggad för att komma åt den här sidan.' . "\n";
}
ui_bottom();
コード例 #4
0
ファイル: articles.lib.php プロジェクト: Rambutan/hamsterpaj
function render_full_article($article)
{
    if (empty($article)) {
        $out .= rounded_corners_top(array('color' => 'red'));
        $out .= '<h1>Den här artikeln kunde tyvärr inte hittas</h1>' . "\n";
        $out .= '<a href="?action=list"><< Gå till listan över artiklar</a>' . "\n";
        $out .= rounded_corners_bottom(array('color' => 'red'));
    } else {
        $out .= render_article($article);
        if ($article['photo_category_id'] > 0) {
            $options['category'] = $article['photo_category_id'];
            $photos = photos_fetch($options);
            $out .= '<h2>Tillhörande bilder</h2>' . "\n";
            $out .= photos_list($photos);
        }
        if ($article['showauthor'] == 1) {
            $out .= render_author($article['author']);
        }
        if (isset($article['forum_category_id']) && $article['forum_category_id'] != 0) {
            $all_categories_list = discussion_forum_categories_fetch(array('id' => $article['forum_category_id']));
            $category = array_pop($all_categories_list);
            $forum_security = forum_security(array('action' => 'view_category', 'category' => $category));
            if ($forum_security == true) {
                $path_to_category = discussion_forum_path_to_category(array('id' => $category['id']));
                $locator_options['categories'] = $path_to_category;
                unset($options);
                $options['max_levels'] = 0;
                $options['parent'] = $category['id'];
                $categories = discussion_forum_categories_fetch($options);
                $out .= discussion_forum_categories_list($categories);
                $out .= '<h2>Trådar</h2>' . "\n";
                $post_options['forum_id'] = $category['id'];
                $post_options['threads_only'] = true;
                $post_options['order_by_sticky'] = true;
                $post_options['page_offset'] = $request['page_offset'];
                $post_options['url_lookup'] = true;
                $threads = discussion_forum_post_fetch($post_options);
                //$threads['url'] = $path_to_trailing_category = array_pop($path_to_category) . '/' . $thread['handle'] . '/sida_1.php';
                $out .= discussion_forum_thread_list($threads);
                $path_to_trailing_category = array_pop($path_to_category);
                $out .= '<a href="' . $path_to_trailing_category['url'] . '">Skapa en egen tråd länkad till artikeln</a>' . '<br style="clear: both;" />';
                forum_update_category_session(array('category' => $category, 'threads' => $threads));
            }
        }
        if ($article['commentable'] == 1) {
            $out .= rounded_corners_top(array('color' => 'blue_deluxe'));
            if ($article['rankable'] == 1) {
                $out .= rank_input_draw($article['id'], 'articles');
            }
            $out .= comments_input_draw($article['id'], 'articles');
            $out .= '<div style="clear: both;"></div>' . "\n";
            $out .= rounded_corners_bottom();
            $out .= comments_list($article['id'], 'articles');
        }
    }
    if (is_privilegied('articles_admin')) {
        $out .= '<a href="/artiklar/index.php?action=admin&article=edit&id=' . $article['id'] . '">Ändra i artikeln</a>' . "\n";
    }
    return $out;
}
コード例 #5
0
ファイル: profile.lib.php プロジェクト: KuBe-zz/hamsterpaj
function profile_presentation_photos_callback($matches)
{
    $ids = explode(':', $matches[1]);
    foreach ($ids as $id) {
        if (!is_numeric($id)) {
            return 'Hacker där :(';
        }
    }
    $photo_object = photos_fetch(array('id' => $ids, 'limit' => count($ids)));
    if (count($photo_object) < 1) {
        return '<strong>[Bilden finns inte]</strong>';
    }
    // If there are several of the same image
    $photos = array();
    foreach ($ids as $id) {
        foreach ($photo_object as $pic) {
            if ($pic['id'] == $id) {
                $photo = $pic;
            }
        }
        $photos[] = $photo;
    }
    $output .= photos_list($photos);
    $output .= '<br style="clear: both;" />';
    return $output;
}
コード例 #6
0
ファイル: noe-removal.php プロジェクト: scy/scytale.name
    $d = explode("\n", trim($_POST['data']));
    foreach ($d as $l) {
        $ok = preg_match('#http://(www\\.)?flickr\\.com/photos/([^<>/]+)/([^<>/]+)[^ ]* ([0-9 ]+)#', trim($l), $m);
        if (!$ok) {
            echo "<p style='color:#800;'>Warning: Didn't understand that line: <tt>" . htmlentities($l) . "</tt></p>\n";
        } else {
            $p[$m[2]][$m[3]] = explode(' ', trim($m[4]));
            $count++;
        }
    }
    if ($count > 0) {
        echo "<hr/>\n";
        echo "<p><strong>Your <a href='http://www.flickr.com/groups/n-oe/discuss/165489/' target='_blank'>log</a> entry:</strong><br/>Removing the following " . ($count > 1 ? "{$count} photos" : 'photo') . ": ";
        $i = 0;
        foreach ($p as $user => $list) {
            $i++;
            echo htmlspecialchars(photos_list($user, $list) . " from <a href=\"http://www.flickr.com/people/{$user}\">{$user}</a>");
            if ($i < count($p)) {
                echo '; ';
            }
        }
        echo ".</p>\n";
        foreach ($p as $user => $list) {
            echo "<hr/><p><strong>Your message to <a href='http://www.flickr.com/people/{$user}' target='_blank'>{$user}</a></strong>:<br/><strong>" . (count($list) > 1 ? count($list) . ' photos' : 'Photo') . " removed from Night Over-Exposure group pool</strong><br/>";
            echo str_replace("\n", '<br/>', htmlspecialchars("Hi. I've removed " . (count($list) > 1 ? 'some' : 'one') . " of your photos from the Night Over-Exposure photo pool. This is not meant to be an offense, but rather an effort to keep the group limited to a specific kind of photos. Following is a list of the photos removed and, in brackets, the group's rule(s) (read them at the group page[1]) it violates (in my opinion):\n" . preg_replace('#<a href="(http://[^"]+)">[^<]+</a>#', "\n\$1", photos_list($user, $list)) . "\n\nPlease note that this does not mean that your photos are ugly or not well done, I'm just saying that " . (count($list) > 1 ? 'these particular ones don\'t' : 'this one doesn\'t') . " fit into this specific group. Have a look at the other photos at the group pool[2] or the best of[3] to see what Night Over-Exposure is all about. If you have any questions about this removal or think I'm wrong, please contact me or any other administrator[4].\n\nThanks for your understanding.\n\n[1] http://www.flickr.com/groups/n-oe/\n[2] http://www.flickr.com/groups/n-oe/pool/\n[3] http://www.flickr.com/photos/tags/n-oe-bestof/\n[4] http://www.flickr.com/groups_members.gne?id=35432914@N00")) . "</p>\n";
        }
    }
}
?>
</body>
</html>