Example #1
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 #2
0
$out .= '<h3>Server_message - ui_server_message()</h3>' . "\n";
$out .= '<p>Creates a warning/notification</p>' . "\n";
$out .= '<div id="demo_header" class="content_box_header">' . "\n";
$out .= '<h4>Demo</h4>' . "\n";
$out .= '</div>' . "\n";
$out .= '<div id="demo" class="content_box">' . "\n";
$out .= '<div class="example">' . "\n";
$code = '<?php	
	$options[\'type\'] = \'notification\';
	$options[\'title\'] = \'This is a notification\';
	$options[\'message\'] = \'More information about the notification\';
	$out .= ui_server_message($options);
?>';
$out .= highlight_string($code, true);
$options['user_id'] = 625058;
$out .= message_top($options);
$out .= '<p>Here u put some text</p>' . "\n";
$out .= '<p>Here u put some more text</p>' . "\n";
$out .= message_bottom();
$out .= '</div>' . "\n";
$out .= '<div class="example">' . "\n";
$code = '<?php	
	$options[\'type\'] = \'warning\';
	$options[\'title\'] = \'This is a warning\';
	$options[\'message\'] = \'More information about the warning\';
	$out .= ui_server_message($options);
?>';
$out .= highlight_string($code, true);
$out .= '<div class="server_message_warning">' . "\n";
$out .= '<h2>This is a warning</h2>' . "\n";
$out .= '<p>More information about the warning</p>' . "\n";
Example #3
0
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;
}
Example #4
0
function groups_entries_render($entries)
{
    $out .= '<ul class="group_entries">' . "\n";
    foreach ($entries as $entry) {
        $options['user_id'] = $entry['user_id'];
        $options['type'] = $entry['read'] == 0 ? 'unread' : 'standard';
        $out .= message_top($options);
        $out .= nl2br(trim($entry['message'])) . "\n";
        $out .= message_bottom();
    }
    $out .= '</ul>' . "\n";
    $out .= '<br style="clear: both;" />' . "\n";
    return $out;
}