Пример #1
0
	        <div class="widget">
			<h3>Меню профиля</h3>
	        <?php 
    if (is_bb_profile()) {
        profile_menu();
    }
    ?>
	        </div>
		
		<?php 
}
?>
		
		
		<?php 
if (is_topic()) {
    ?>
			<div class="widget">
				<h3>О теме</h3>
	        	<ul>
	            	<li><?php 
    printf('Отправлено %1$s назад', get_topic_start_time(), get_topic_author());
    ?>
</li>
	            	<li><?php 
    printf('%2$s', get_topic_start_time(), get_topic_author());
    ?>
</li>
	            	<li><?php 
    printf('<a href=\\"%1$s\\">Последнее сообщение</a> от %2$s', attribute_escape(get_topic_last_post_link()), get_topic_last_poster());
    ?>
Пример #2
0
function bb_attachments_post_attachments($post_id = 0)
{
    global $bbdb, $bb_attachments, $bb_attachments_cache, $bb_current_user;
    $output = "";
    if ($post_id && ($bb_attachments['role']['see'] == "read" || bb_current_user_can($bb_attachments['role']['see']))) {
        $time = time() - 60;
        $can_delete = false;
        $self = false;
        $admin = false;
        $filter = true;
        // " AND status = 0 "; 	// speedup checks with flag
        if ($bb_current_user->ID == get_post_author_id($post_id)) {
            $self = true;
        }
        if ((!is_topic() || isset($_GET['bb_attachments'])) && bb_current_user_can('moderate')) {
            $filter = "";
            $admin = bb_current_user_can('administrate');
        }
        if (bb_current_user_can($bb_attachments['role']['delete']) && bb_current_user_can('edit_post', $post_id)) {
            $can_delete = true;
        }
        $location = bb_attachments_location();
        $can_inline = true;
        if (!($bb_attachments['role']['inline'] == "read" || bb_current_user_can($bb_attachments['role']['inline']))) {
            $can_inline = false;
        }
        if (!isset($bb_attachments_cache[$post_id])) {
            $bb_attachments_cache[$post_id] = $bbdb->get_results("SELECT * FROM " . $bb_attachments['db'] . " WHERE post_id = {$post_id} ORDER BY time DESC LIMIT 999");
        }
        if (count($bb_attachments_cache[$post_id])) {
            foreach ($bb_attachments_cache[$post_id] as $attachment) {
                $showerror = $self && $attachment->time > $time ? true : false;
                if ($attachment->status == 0 || empty($filter) || $showerror) {
                    $attachment->filename = stripslashes($attachment->filename);
                    $output .= "<li>";
                    $output .= "<span" . ($attachment->status > 0 ? " class='deleted' " : "") . "> ";
                    if ($attachment->status > 0) {
                        $icon = "missing.gif";
                    } else {
                        if (isset($bb_attachments['icons'][$attachment->ext])) {
                            $icon = $bb_attachments['icons'][$attachment->ext];
                        } else {
                            $icon = $bb_attachments['icons']['default'];
                        }
                    }
                    $output .= " <img align='absmiddle' title='" . $attachment->ext . "' src='" . $bb_attachments['icons']['url'] . $icon . "' /> ";
                    if ($attachment->status > 0 && (empty($filter) || $showerror)) {
                        $output .= " [" . __($bb_attachments['status'][$attachment->status]) . "] {$attachment->filename} ";
                    }
                    if ($attachment->status == 0) {
                        $output .= " " . "<a href='" . attribute_escape(add_query_arg('bbat', $attachment->id, add_query_arg('bb_attachments', $attachment->post_id, remove_query_arg(array('bb_attachments', 'bbat', 'bbat_delete'))))) . "'>" . $attachment->filename . "</a> " . " ";
                    }
                    $output .= " <span class='num'>(" . round($attachment->size / 1024, 1) . " KB";
                    if ($attachment->status < 2) {
                        $output .= ", " . bb_number_format_i18n($attachment->downloads) . " " . __('downloads');
                    }
                    $output .= ")</span> ";
                    if ($attachment->time < $time) {
                        $output .= " <small>" . bb_since($attachment->time) . " " . __('old') . "</small> ";
                    }
                    if ($admin) {
                        $output .= ' [<a href="' . attribute_escape(bb_get_option('uri') . 'bb-admin/view-ip.php?ip=' . long2ip($attachment->user_ip)) . '">' . long2ip($attachment->user_ip) . '</a>] ';
                    }
                    if ($attachment->status == 0 && $can_delete) {
                        $output .= ' [<a onClick="return confirm(' . "'" . __('Delete') . " {$attachment->filename} ?" . "'" . ')" href="' . add_query_arg('bbat_delete', $attachment->id) . '">x</a>] ';
                    }
                    if ($attachment->status == 0 && $location == "edit.php" && $can_inline) {
                        $fullpath = $bb_attachments['path'] . floor($attachment->id / 1000) . "/" . $attachment->id . "." . $attachment->filename;
                        if (list($width, $height, $type) = getimagesize($fullpath)) {
                            $output .= " [<strong><a href='#' onclick='bbat_inline_insert({$attachment->post_id},{$attachment->id}); return false;'>" . __("INSERT") . "</a></strong>] ";
                        }
                    }
                    $output .= " </span></li>";
                }
            }
        }
        if ($output) {
            $output = "<h3>" . __("Attachments") . "</h3><ol>" . $output . "</ol>";
        }
        if ($location == "edit.php") {
            $output .= '<scr' . 'ipt type="text/javascript" defer="defer">
	function bbat_inline_insert(post_id,id) {
	bbat_field = document.getElementsByTagName("textarea")[0];
	bbat_value="[attachment="+post_id+","+id+"]";
	if (document.selection) {bbat_field.focus(); sel = document.selection.createRange();sel.text = bbat_value;}
	else if (bbat_field.selectionStart || bbat_field.selectionStart == "0") {var startPos = bbat_field.selectionStart; var endPos = bbat_field.selectionEnd;
		bbat_field.value = bbat_field.value.substring(0, startPos)+ bbat_value+ bbat_field.value.substring(endPos, bbat_field.value.length);
	} else {bbat_field.value += bbat_value;}
return false;} </script>';
        }
    }
    if (is_bb_feed()) {
        $output = wp_specialchars($output);
    }
    return $output;
}
Пример #3
0
function post_form_auto_add_radiobuttons()
{
    global $topic_id;
    if (!is_topic()) {
        $sub_image = bb_get_active_theme_uri() . '/images/btn_postTopic.gif';
    } else {
        $sub_image = bb_get_active_theme_uri() . '/images/btn_postReply.gif';
    }
    if (!is_topic()) {
        echo '
		<p>		
		<label for="nm_add_topic_icon" style="display:inline;">Add a Topic Icon </label>
			<table>
<tr>
<td width="20"><input type="radio" id="topic_icon" name="topic_icon" value="photos.png"/></td>
<td width="40"><img src="' . bb_get_active_theme_uri() . '/images/photos.png" alt=""></td>
<td width="20"><input type="radio" id="topic_icon" name="topic_icon" value="video.jpg"/></td>
<td width="40"><img src="' . bb_get_active_theme_uri() . '/images/video.jpg" alt=""></td>
<td width="20"><input type="radio" id="topic_icon" name="topic_icon" value="icon3.gif"/></td>
<td width="40"><img src="' . bb_get_active_theme_uri() . '/images/icon3.gif" alt=""></td>
<td width="20"><input type="radio" id="topic_icon" name="topic_icon" value="icon7.gif"/></td>
<td width="40"><img src="' . bb_get_active_theme_uri() . '/images/icon7.gif" alt=""></td>
<td width="20"><input type="radio" id="topic_icon" name="topic_icon" value="icon14.gif"/></td>
<td width="40"><img src="' . bb_get_active_theme_uri() . '/images/icon14.gif" alt=""></td>
<td width="20"><input type="radio" id="topic_icon" name="topic_icon" value="icon13.gif"/></td>
<td width="40"><img src="' . bb_get_active_theme_uri() . '/images/icon13.gif" alt=""></td>
</tr>
</table>
</p>
<p class="submit">


	 <INPUT TYPE="image" SRC="' . $sub_image . '" HEIGHT="29" WIDTH="147" BORDER="0" id="postformsub" name="Submit" ALT="postformsub" />

</p>
';
    } else {
        echo ' <INPUT TYPE="image" SRC="' . $sub_image . '" HEIGHT="29" WIDTH="147" BORDER="0" id="postformsub" name="Submit" ALT="postformsub" />';
    }
}
Пример #4
0
		<input name="topic" type="text" id="topic" size="50" maxlength="80" tabindex="1" />
	</label>
</p>
<?php 
}
do_action('post_form_pre_post');
?>
<p>
	<label for="post_content"><?php 
_e('Post:');
?>
		<textarea name="post_content" cols="50" rows="8" id="post_content" tabindex="3"></textarea>
	</label>
</p>
<?php 
if (!is_topic()) {
    ?>
<p>
	<label for="tags-input"><?php 
    printf(__('Enter a few words (called <a href="%s">tags</a>) separated by commas to help someone find your topic:'), bb_get_tag_page_link());
    ?>
		<input id="tags-input" name="tags" type="text" size="50" maxlength="100" value="<?php 
    bb_tag_name();
    ?>
 " tabindex="4" />
	</label>
</p>
<?php 
}
if (is_bb_tag() || is_front()) {
    ?>
Пример #5
0
?>
>
<head profile="http://gmpg.org/xfn/11">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title><?php 
bb_title();
?>
</title>
	
	<?php 
bb_feed_head();
?>
 
	
<?php 
if (is_topic() && bb_is_user_logged_in()) {
    ?>
	<script type="text/javascript">
		var lastMod = <?php 
    topic_time('timestamp');
    ?>
;
		var page = <?php 
    global $page;
    echo $page;
    ?>
;
		var currentUserId = <?php 
    bb_current_user_info('id');
    ?>
;
Пример #6
0
 function breadcrumbs()
 {
     $page = '';
     if (bb_get_location() == 'login-page') {
         $page = __('Log in', 'guangzhou');
     } elseif (is_forum()) {
         $page = get_forum_name();
     } elseif (is_bb_tags() && get_tag_name() != '') {
         $page = '<a href="' . bb_get_tag_page_link() . '">' . __('Tags') . '</a> &raquo; ' . get_tag_name();
     } elseif (is_topic()) {
         if (get_forum_name()) {
             $page = '<a href="' . get_forum_link() . '">' . get_forum_name() . '</a>';
         }
     }
     if ($page) {
         $page = '| ' . $page;
     }
     return '<a href="' . bb_get_option('uri') . '">' . bb_get_option('name') . '</a> ' . $page;
 }
Пример #7
0
<?php

$tpl = new bQuickTpl();
include getcwd() . "/modules/site/common.php";
//--check if topic id is received--//
if (isset($vars[1]) && $vars[1]) {
    $topic_id = $vars[1];
} else {
    echo $tpl->render("themes/site/" . theme_name . "/html/404.php");
    exit;
}
//--check if topic exists--//
if (!is_topic($database, $topic_id)) {
    echo $tpl->render("themes/site/" . theme_name . "/html/404.php");
    exit;
}
//--get topic information--//
$get_topic_info = get_topic($database, $topic_id);
$tpl->topic_info = $get_topic_info;
//--pagination--//
foreach ($vars as $var) {
    if (strpos($var, 'p:') === 0) {
        $page_no_var = $var;
        //get the current Page from URL
    }
}
$perpage = poems_by_topic_per_page;
$paginate = paginate($perpage, $page_no_var);
$next_number = $paginate['next_number'];
//--get poems by topics--//
$get_topic_poems = get_topic_poems($database, $topic_id, array("COUNT" => true, "LIMIT" => array($next_number, $perpage)));