示例#1
0
    public function toString()
    {
        $controller_method = $this->getBuilderParamManager()->getParam('controller_method', 'thread');
        $p = $this->getParamManager()->getParam('p');
        $p_media = $this->getParamManager()->getParam('p_media');
        if ($this->getParamManager()->getParam('modifiers', false)) {
            $modifiers = $this->getParamManager()->getParam('modifiers');
        }
        $num = $p->num . ($p->subnum ? '_' . $p->subnum : '');
        ?>
        <div class="post stub stub_doc_id_<?php 
        echo $p->doc_id;
        ?>
">
                <button class="btn-toggle-post" data-function="showPost" data-board="<?php 
        echo $p->radix->shortname;
        ?>
"  data-doc-id="<?php 
        echo $p->doc_id;
        ?>
" data-thread-num="<?php 
        echo $p->thread_num;
        ?>
"><i class="icon-plus"></i></button>
                <?php 
        if ($p->email && $p->email !== 'noko') {
            ?>
<a href="mailto:<?php 
            echo rawurlencode($p->email);
            ?>
"><?php 
        }
        ?>
<span class="post_author"><?php 
        echo $p->getNameProcessed();
        ?>
</span><?php 
        echo $p->getNameProcessed() && $p->getTripProcessed() ? ' ' : '';
        ?>
<span class="post_tripcode"><?php 
        echo $p->getTripProcessed();
        ?>
</span><?php 
        if ($p->email && $p->email !== 'noko') {
            ?>
</a><?php 
        }
        ?>
        </div>
        <article class="post doc_id_<?php 
        echo $p->doc_id;
        if ($p->subnum > 0) {
            ?>
 post_ghost<?php 
        }
        if ($p->thread_num === $p->num) {
            ?>
 post_is_op<?php 
        }
        if (!is_null($p_media)) {
            ?>
 has_image<?php 
        }
        ?>
" id="<?php 
        echo $num;
        ?>
">
            <div class="stub pull-left">
                <button class="btn-toggle-post" data-function="hidePost" data-board="<?php 
        echo $p->radix->shortname;
        ?>
" data-doc-id="<?php 
        echo $p->doc_id;
        ?>
"><i class="icon-minus"></i></button>
            </div>
            <div class="<?php 
        if ($p->capcode === 'A') {
            ?>
adminpost<?php 
        }
        ?>
 post_wrapper">
                <?php 
        if ($p_media !== null) {
            ?>
                <div class="post_file" style="overflow:visible;">
                    <span class="post_file_controls">
                    <?php 
            if ($p_media->getMediaStatus($this->getRequest()) !== 'banned' || $this->getAuth()->hasAccess('media.see_hidden')) {
                ?>
                        <?php 
                if (!$p->radix->hide_thumbnails || $this->getAuth()->hasAccess('media.see_hidden')) {
                    ?>
                            <?php 
                    $dropdowntest = 0;
                    if ($dropdowntest === 1) {
                        ?>
                            <a href="<?php 
                        echo $this->getUri()->create((isset($modifiers['post_show_board_name']) && $modifiers['post_show_board_name'] ? '_' : $p->radix->shortname) . '/search/image/' . $p_media->getSafeMediaHash());
                        ?>
" class="btnr parent"><?php 
                        echo _i('View Same');
                        ?>
</a>
                            <a href="http://google.com/searchbyimage?image_url=<?php 
                        echo $p_media->getThumbLink($this->getRequest());
                        ?>
" target="_blank" class="btnr parent">Google</a>
                            <a href="http://iqdb.org/?url=<?php 
                        echo $p_media->getThumbLink($this->getRequest());
                        ?>
" target="_blank" class="btnr parent">iqdb</a>
                            <a href="http://saucenao.com/search.php?url=<?php 
                        echo $p_media->getThumbLink($this->getRequest());
                        ?>
" target="_blank" class="btnr parent">SauceNAO</a>
                            <?php 
                    } else {
                        ?>
                            <div class="saucenav">
                                <ul>
                                    <li class="btnr parent"><a href="#" onclick="return false;">Image Search</a>
                                        <ul class="saucenav-reply">
                                            <li><a href="<?php 
                        echo $this->getUri()->create((isset($modifiers['post_show_board_name']) && $modifiers['post_show_board_name'] ? '_' : $p->radix->shortname) . '/search/image/' . $p_media->getSafeMediaHash());
                        ?>
"><?php 
                        echo _i('View Same');
                        ?>
</a></li>
                                            <li><a href="http://google.com/searchbyimage?image_url=<?php 
                        echo $p_media->getThumbLink($this->getRequest());
                        ?>
" target="_blank">Google</a></li>
                                            <li><a href="http://iqdb.org/?url=<?php 
                        echo $p_media->getThumbLink($this->getRequest());
                        ?>
" target="_blank">Iqdb</a></li>
                                            <li><a href="http://saucenao.com/search.php?url=<?php 
                        echo $p_media->getThumbLink($this->getRequest());
                        ?>
" target="_blank">SauceNAO</a></li>
                                        </ul>
                                    </li>
                                </ul>
                            </div>
                            <?php 
                    }
                    ?>
                            <?php 
                    if (!$p->radix->archive || $p->radix->getValue('archive_full_images')) {
                        ?>
                                <a href="<?php 
                        echo $p_media->getMediaDownloadLink($this->getRequest());
                        ?>
" download="<?php 
                        echo $p_media->getMediaFilenameProcessed();
                        ?>
" style="border-color: #9E9E9E!important;" class="btnr parent"><i class="icon-download-alt"></i></a>
                            <?php 
                    }
                    ?>
                        <?php 
                }
                ?>
                    <?php 
            }
            ?>
                    </span>
                    <?php 
            if ($p_media->getMediaStatus($this->getRequest()) !== 'banned' || $this->getAuth()->hasAccess('media.see_banned')) {
                ?>
                    <?php 
                if (mb_strlen($p_media->getMediaFilenameProcessed()) > 35) {
                    ?>
                        <a href="<?php 
                    echo $p_media->getMediaLink($this->getRequest()) ? $p_media->getMediaLink($this->getRequest()) : $p_media->getRemoteMediaLink($this->getRequest());
                    ?>
" class="post_file_filename" rel="tooltip" title="<?php 
                    echo htmlspecialchars($p_media->media_filename);
                    ?>
" target="_blank"><?php 
                    echo mb_substr($p_media->getMediaFilenameProcessed(), 0, 30, 'utf-8') . ' (...)' . mb_substr($p_media->getMediaFilenameProcessed(), mb_strrpos($p_media->getMediaFilenameProcessed(), '.', 'utf-8'), null, 'utf-8');
                    ?>
</a>,
                    <?php 
                } else {
                    ?>
                        <a href="<?php 
                    echo $p_media->getMediaLink($this->getRequest()) ? $p_media->getMediaLink($this->getRequest()) : $p_media->getRemoteMediaLink($this->getRequest());
                    ?>
" class="post_file_filename" rel="tooltip" title="<?php 
                    echo htmlspecialchars($p_media->media_filename);
                    ?>
" target="_blank"><?php 
                    echo $p_media->getMediaFilenameProcessed();
                    ?>
</a>,
                    <?php 
                }
                ?>
                    <span class="post_file_metadata">
                        <?php 
                echo \Rych\ByteSize\ByteSize::formatBinary($p_media->media_size, 0) . ', ' . $p_media->media_w . 'x' . $p_media->media_h;
                ?>
                    </span>
                    <?php 
            }
            ?>
                </div>
                <div class="thread_image_box">
                    <?php 
            if ($p_media->getMediaStatus($this->getRequest()) === 'banned') {
                ?>
                        <img src="<?php 
                echo $this->getAssetManager()->getAssetLink('images/banned-image.png');
                ?>
" width="150" height="150" />
                    <?php 
            } elseif ($p_media->getMediaStatus($this->getRequest()) !== 'normal') {
                ?>
                        <a href="<?php 
                echo $p_media->getMediaLink($this->getRequest()) ? $p_media->getMediaLink($this->getRequest()) : $p_media->getRemoteMediaLink($this->getRequest());
                ?>
" target="_blank" rel="noreferrer" class="thread_image_link">
                            <img src="<?php 
                echo $this->getAssetManager()->getAssetLink('images/missing-image.jpg');
                ?>
" width="150" height="150" />
                        </a>
                    <?php 
            } else {
                ?>
                        <a href="<?php 
                echo $p_media->getMediaLink($this->getRequest()) ? $p_media->getMediaLink($this->getRequest()) : $p_media->getRemoteMediaLink($this->getRequest());
                ?>
" target="_blank" rel="noreferrer" class="thread_image_link">
                            <?php 
                if (!$this->getAuth()->hasAccess('maccess.mod') && !$p->radix->getValue('transparent_spoiler') && $p_media->spoiler) {
                    ?>
                            <div class="spoiler_box"><span class="spoiler_box_text"><?php 
                    echo _i('Spoiler');
                    ?>
<span class="spoiler_box_text_help"><?php 
                    echo _i('Click to view');
                    ?>
</span></div>
                            <?php 
                } elseif (isset($modifiers['lazyload']) && $modifiers['lazyload'] == true) {
                    ?>
                            <img src="<?php 
                    echo $this->getUri()->base() . $this->getAssetManager()->getAssetLink('images/transparent_pixel.png');
                    ?>
" data-original="<?php 
                    echo $p_media->getThumbLink($this->getRequest());
                    ?>
" width="<?php 
                    echo $p_media->preview_w;
                    ?>
" height="<?php 
                    echo $p_media->preview_h;
                    ?>
" class="lazyload post_image<?php 
                    echo $p_media->spoiler ? ' is_spoiler_image' : '';
                    ?>
" data-md5="<?php 
                    echo $p_media->media_hash;
                    ?>
" />
                            <noscript>
                                <a href="<?php 
                    echo $p_media->getMediaLink($this->getRequest()) ? $p_media->getMediaLink($this->getRequest()) : $p_media->getRemoteMediaLink($this->getRequest());
                    ?>
" target="_blank" rel="noreferrer" class="thread_image_link">
                                    <img src="<?php 
                    echo $p_media->getThumbLink($this->getRequest());
                    ?>
" style="margin-left: -<?php 
                    echo $p_media->preview_w;
                    ?>
px" width="<?php 
                    echo $p_media->preview_w;
                    ?>
" height="<?php 
                    echo $p_media->preview_h;
                    ?>
" class="lazyload post_image<?php 
                    echo $p_media->spoiler ? ' is_spoiler_image' : '';
                    ?>
" data-md5="<?php 
                    echo $p_media->media_hash;
                    ?>
" />
                                </a>
                            </noscript>
                            <?php 
                } else {
                    ?>
                            <img src="<?php 
                    echo $p_media->getThumbLink($this->getRequest());
                    ?>
" width="<?php 
                    echo $p_media->preview_w;
                    ?>
" height="<?php 
                    echo $p_media->preview_h;
                    ?>
" class="lazyload post_image<?php 
                    echo $p_media->spoiler ? ' is_spoiler_image' : '';
                    ?>
" imgstate="normal" smsize="<?php 
                    echo $p->media->preview_w . "x" . $p->media->preview_h;
                    ?>
" data-md5="<?php 
                    echo $p_media->media_hash;
                    ?>
" />
                            <?php 
                }
                ?>
                        </a>
                    <?php 
            }
            ?>
                </div>
                <?php 
        }
        ?>
                <header>
                    <div class="post_data">
                        <?php 
        if (isset($modifiers['post_show_board_name']) && $modifiers['post_show_board_name']) {
            ?>
                        <span class="post_show_board">/<?php 
            echo $p->radix->shortname;
            ?>
/</span>
                        <?php 
        }
        ?>

                        <?php 
        if ($p->getTitleProcessed() !== '') {
            ?>
<h2 class="post_title"><?php 
            echo $p->getTitleProcessed();
            ?>
</h2><?php 
        }
        ?>
                        <span class="post_poster_data">
                            <?php 
        if ($p->email && $p->email !== 'noko') {
            ?>
<a href="mailto:<?php 
            echo rawurlencode($p->email);
            ?>
"><?php 
        }
        ?>
<span class="post_author"><?php 
        echo $p->getNameProcessed();
        ?>
</span><?php 
        echo $p->getNameProcessed() && $p->getTripProcessed() ? ' ' : '';
        ?>
<span class="post_tripcode"><?php 
        echo $p->getTripProcessed();
        ?>
</span><?php 
        if ($p->email && $p->email !== 'noko') {
            ?>
</a><?php 
        }
        ?>

                            <?php 
        if ($p->getPosterHashProcessed()) {
            ?>
<span class="poster_hash">ID:<?php 
            echo $p->getPosterHashProcessed();
            ?>
</span><?php 
        }
        ?>
                            <?php 
        if ($p->capcode !== 'N') {
            ?>
                                <?php 
            if ($p->capcode === 'M') {
                ?>
<span class="post_level post_level_moderator">## <?php 
                echo _i('Mod');
                ?>
</span><?php 
            }
            ?>
                                <?php 
            if ($p->capcode === 'A') {
                ?>
<span class="post_level post_level_administrator">## <?php 
                echo _i('Admin');
                ?>
</span><?php 
            }
            ?>
                                <?php 
            if ($p->capcode === 'D') {
                ?>
<span class="post_level post_level_developer">## <?php 
                echo _i('Developer');
                ?>
</span><?php 
            }
            ?>
                            <?php 
        }
        ?>
                        </span>
                        <span class="time_wrap">
                            <time datetime="<?php 
        echo gmdate(DATE_W3C, $p->timestamp);
        ?>
" <?php 
        if ($p->radix->archive) {
            ?>
 title="<?php 
            echo _i('4chan Time') . ': ' . $p->getFourchanDate();
            ?>
"<?php 
        }
        ?>
><?php 
        echo gmdate('D d M Y H:i:s', $p->timestamp);
        ?>
</time>
                        </span>
                        <a href="<?php 
        echo $this->getUri()->create([$p->radix->shortname, $controller_method, $p->thread_num]) . '#' . $num;
        ?>
" data-post="<?php 
        echo $num;
        ?>
" data-function="highlight">No.</a><a href="<?php 
        echo $this->getUri()->create([$p->radix->shortname, $controller_method, $p->thread_num]) . '#q' . $num;
        ?>
" data-post="<?php 
        echo str_replace('_', ',', $num);
        ?>
" data-function="quote"><?php 
        if ($p->capcode === 'L') {
            echo str_replace('_', ',', 1999999999);
        } else {
            echo str_replace('_', ',', $num);
        }
        ?>
</a>

                        <span class="post_type">
                            <?php 
        if ($p->poster_country !== null) {
            ?>
<span title="<?php 
            echo e($p->poster_country_name);
            ?>
" class="flag flag-<?php 
            echo strtolower($p->poster_country);
            ?>
"></span><?php 
        }
        ?>
                            <?php 
        if ($p->subnum) {
            ?>
<i class="icon-comment-alt" title="<?php 
            echo htmlspecialchars(_i('This post was submitted as a "ghost" reply.'));
            ?>
"></i><?php 
        }
        ?>
                            <?php 
        if (isset($p_media) && $p_media->spoiler) {
            ?>
<i class="icon-eye-close" title="<?php 
            echo htmlspecialchars(_i('The image in this post has been marked spoiler.'));
            ?>
"></i><?php 
        }
        ?>
                            <?php 
        if ($p->deleted && !$p->timestamp_expired) {
            ?>
<i class="icon-trash" title="<?php 
            echo htmlspecialchars(_i('This post was prematurely deleted.'));
            ?>
"></i><?php 
        }
        ?>
                            <?php 
        if ($p->deleted && $p->timestamp_expired) {
            ?>
<i class="icon-trash" title="<?php 
            echo htmlspecialchars(_i('This post was deleted on %s.', gmdate('M d, Y \\a\\t H:i:s e', $p->timestamp_expired)));
            ?>
"></i><?php 
        }
        ?>
                            <?php 
        if ($p->sticky) {
            ?>
<i class="icon-pushpin" title="<?php 
            echo _i('This thread has been stickied.');
            ?>
"></i><?php 
        }
        ?>
                            <?php 
        if ($p->locked) {
            ?>
<i class="icon-lock" title="<?php 
            echo _i('This thread has been locked.');
            ?>
"></i><?php 
        }
        ?>
                        </span>

                        <span class="post_controls">
                            <?php 
        if (isset($modifiers['post_show_view_button'])) {
            ?>
<a href="<?php 
            echo $this->getUri()->create($p->radix->shortname . '/thread/' . $p->thread_num) . '#' . $num;
            ?>
" class="btnr parent"><?php 
            echo _i('View');
            ?>
</a><?php 
        }
        ?>
<a href="#" class="btnr parent" data-post="<?php 
        echo $p->doc_id;
        ?>
" data-post-id="<?php 
        echo $num;
        ?>
" data-board="<?php 
        echo htmlspecialchars($p->radix->shortname);
        ?>
" data-controls-modal="post_tools_modal" data-backdrop="true" data-keyboard="true" data-function="report"><?php 
        echo _i('Report');
        ?>
</a><?php 
        if ($p->subnum > 0 || $this->getAuth()->hasAccess('comment.passwordless_deletion') || !$p->radix->archive) {
            ?>
<a href="#" class="btnr parent" data-post="<?php 
            echo $p->doc_id;
            ?>
" data-post-id="<?php 
            echo $num;
            ?>
" data-board="<?php 
            echo htmlspecialchars($p->radix->shortname);
            ?>
" data-controls-modal="post_tools_modal" data-backdrop="true" data-keyboard="true" data-function="delete"><?php 
            echo _i('Delete');
            ?>
</a><?php 
        }
        ?>
                        </span>
                    </div>
                </header>
                <div class="backlink_list"<?php 
        echo $p->getBacklinks() ? ' style="display:block"' : '';
        ?>
>
                    <?php 
        echo _i('Quoted By:');
        ?>
 <span class="post_backlink" data-post="<?php 
        echo $p->num;
        ?>
"><?php 
        echo $p->getBacklinks() ? implode(' ', $p->getBacklinks()) : '';
        ?>
</span>
                </div>
                <div class="text<?php 
        if (preg_match('/[\\x{4E00}-\\x{9FBF}\\x{3040}-\\x{309F}\\x{30A0}-\\x{30FF}]/u', $p->getCommentProcessed())) {
            echo ' shift-jis';
        }
        ?>
">
                    <?php 
        echo $p->getCommentProcessed();
        ?>
                </div>
                <?php 
        if ($this->getAuth()->hasAccess('maccess.mod')) {
            ?>
                <div class="btn-group" style="clear:both; padding:5px 0 0 0;">
                    <button class="btn btn-mini" data-function="activateModeration"><?php 
            echo _i('Mod');
            if ($p->poster_ip) {
                echo ' ' . Inet::dtop($p->poster_ip);
            }
            ?>
</button>
                </div>
                <div class="btn-group post_mod_controls" style="clear:both; padding:5px 0 0 5px;">
                    <?php 
            if ($p->op) {
                ?>
                    <button class="btn btn-mini" data-function="mod" data-board="<?php 
                echo $p->radix->shortname;
                ?>
" data-id="<?php 
                echo $p->doc_id;
                ?>
" data-action="toggle_sticky"><?php 
                echo _i('Toggle Sticky');
                ?>
</button>
                    <button class="btn btn-mini" data-function="mod" data-board="<?php 
                echo $p->radix->shortname;
                ?>
" data-id="<?php 
                echo $p->doc_id;
                ?>
" data-action="toggle_locked"><?php 
                echo _i('Toggle Locked');
                ?>
</button>
                    <?php 
            }
            ?>
                    <button class="btn btn-mini" data-function="mod" data-board="<?php 
            echo $p->radix->shortname;
            ?>
" data-board-url="<?php 
            echo $this->getUri()->create([$p->radix->shortname]);
            ?>
" data-id="<?php 
            echo $p->doc_id;
            ?>
" data-action="delete_post"><?php 
            echo _i('Delete Post');
            ?>
</button>
                    <?php 
            if (!is_null($p_media)) {
                ?>
                        <button class="btn btn-mini" data-function="mod" data-board="<?php 
                echo $p->radix->shortname;
                ?>
" data-id="<?php 
                echo $p_media->media_id;
                ?>
" data-doc-id="<?php 
                echo $p->doc_id;
                ?>
" data-action="delete_image"><?php 
                echo _i('Delete Image');
                ?>
</button>
                        <button class="btn btn-mini" data-function="mod" data-board="<?php 
                echo $p->radix->shortname;
                ?>
" data-id="<?php 
                echo $p_media->media_id;
                ?>
" data-doc-id="<?php 
                echo $p->doc_id;
                ?>
" data-action="ban_image_local"><?php 
                echo _i('Ban Image');
                ?>
</button>
                        <button class="btn btn-mini" data-function="mod" data-board="<?php 
                echo $p->radix->shortname;
                ?>
" data-id="<?php 
                echo $p_media->media_id;
                ?>
" data-doc-id="<?php 
                echo $p->doc_id;
                ?>
" data-action="ban_image_global"><?php 
                echo _i('Ban Image Globally');
                ?>
</button>
                    <?php 
            }
            ?>
                    <?php 
            if ($p->poster_ip) {
                ?>
                        <button class="btn btn-mini" data-function="ban" data-controls-modal="post_tools_modal" data-backdrop="true" data-keyboard="true" data-board="<?php 
                echo $p->radix->shortname;
                ?>
" data-ip="<?php 
                echo Inet::dtop($p->poster_ip);
                ?>
" data-action="ban_user"><?php 
                echo _i('Ban IP:') . ' ' . Inet::dtop($p->poster_ip);
                ?>
</button>
                        <button class="btn btn-mini" data-function="searchUser" data-board="<?php 
                echo $p->radix->shortname;
                ?>
" data-id="<?php 
                echo $p->doc_id;
                ?>
" data-poster-ip="<?php 
                echo Inet::dtop($p->poster_ip);
                ?>
"><?php 
                echo _i('Search IP');
                ?>
</button>
                        <?php 
                if ($this->getPreferences()->get('foolfuuka.sphinx.global')) {
                    ?>
                            <button class="btn btn-mini" data-function="searchUserGlobal" data-board="<?php 
                    echo $p->radix->shortname;
                    ?>
" data-id="<?php 
                    echo $p->doc_id;
                    ?>
" data-poster-ip="<?php 
                    echo Inet::dtop($p->poster_ip);
                    ?>
"><?php 
                    echo _i('Search IP Globally');
                    ?>
</button>
                        <?php 
                }
                ?>
                    <?php 
            }
            ?>
                </div>
                <?php 
            if ($p->getReports()) {
                ?>
                    <?php 
                foreach ($p->getReports() as $report) {
                    ?>
                        <div class="report_reason"><?php 
                    echo '<strong>' . _i('Reported Reason:') . '</strong> ' . $report->getReasonProcessed();
                    ?>
                            <br/>
                            <div class="ip_reporter">
                                <strong><?php 
                    echo _i('Info:');
                    ?>
</strong>
                                <?php 
                    echo Inet::dtop($report->ip_reporter);
                    ?>
, <?php 
                    echo _i('Type:');
                    ?>
 <?php 
                    echo $report->media_id !== null ? _i('media') : _i('post');
                    ?>
, <?php 
                    echo _i('Time:');
                    ?>
 <?php 
                    echo gmdate('D M d H:i:s Y', $report->created);
                    ?>
                                <button class="btn btn-mini" data-function="mod" data-id="<?php 
                    echo $report->id;
                    ?>
" data-board="<?php 
                    echo htmlspecialchars($p->radix->shortname);
                    ?>
" data-action="delete_report"><?php 
                    echo _i('Delete Report');
                    ?>
</button>
                            </div>
                        </div>
                    <?php 
                }
                ?>
                <?php 
            }
            ?>
                <?php 
        }
        ?>
            </div>
        </article>
        <?php 
    }
示例#2
0
文件: Gallery.php 项目: voh/FoolFuuka
    public function toString()
    {
        $board = $this->getParamManager()->getParam('board');
        $radix = $this->getBuilderParamManager()->getParam('radix');
        ?>
        <div id="thread_o_matic" class="clearfix">
        <?php 
        $separator = 0;
        foreach ($board as $k => $p_bulk) {
            $p = new Comment($this->getContext(), $p_bulk);
            if ($p_bulk->media !== null) {
                $p_media = new Media($this->getContext(), $p_bulk);
            } else {
                $p_media = null;
            }
            $separator++;
            ?>
        <article id="<?php 
            echo $p->num;
            ?>
" class="thread doc_id_<?php 
            echo $p->doc_id;
            ?>
">
            <header>
                <div class="post_data">
                    <h2 class="post_title"><?php 
            echo $p->getTitleProcessed();
            ?>
</h2>
                    <span class="post_author"><?php 
            echo $p->email && $p->email !== 'noko' ? '<a href="mailto:' . rawurlencode($p->email) . '">' . $p->getNameProcessed() . '</a>' : $p->getNameProcessed();
            ?>
</span>
                    <span class="post_trip"><?php 
            echo $p->getTripProcessed();
            ?>
</span>
                    <span class="poster_hash"><?php 
            echo $p->getPosterHashProcessed() ? 'ID:' . $p->getPosterHashProcessed() : '';
            ?>
</span>
                    <?php 
            if ($p->capcode == 'M') {
                ?>
                    <span class="post_level post_level_moderator">## <?php 
                echo _i('Mod');
                ?>
</span>
                    <?php 
            }
            ?>
                    <?php 
            if ($p->capcode == 'A') {
                ?>
                    <span class="post_level post_level_administrator">## <?php 
                echo _i('Admin');
                ?>
</span>
                    <?php 
            }
            ?>
                    <?php 
            if ($p->capcode == 'D') {
                ?>
                    <span class="post_level post_level_developer">## <?php 
                echo _i('Developer');
                ?>
</span>
                    <?php 
            }
            ?>
<br/>
                    <time datetime="<?php 
            echo gmdate(DATE_W3C, $p->timestamp);
            ?>
"><?php 
            echo gmdate('D M d H:i:s Y', $p->timestamp);
            ?>
</time>
                    <span class="post_number"><a href="<?php 
            echo $this->getUri()->create($radix->shortname . '/thread/' . $p->num) . '#' . $p->num;
            ?>
" data-function="highlight" data-post="<?php 
            echo $p->num;
            ?>
">No.</a><a href="<?php 
            echo $this->getUri()->create($radix->shortname . '/thread/' . $p->num) . '#q' . $p->num;
            ?>
" data-function="quote" data-post="<?php 
            echo $p->num;
            ?>
"><?php 
            echo $p->num;
            ?>
</a></span>
                    <?php 
            if ($p->poster_country !== null) {
                ?>
<span class="post_type"><span title="<?php 
                echo e($p->poster_country_name);
                ?>
" class="flag flag-<?php 
                echo strtolower($p->poster_country);
                ?>
"></span></span><?php 
            }
            ?>
                    <span class="post_controls"><a href="<?php 
            echo $this->getUri()->create($radix->shortname . '/thread/' . $p->num);
            ?>
" class="btnr parent"><?php 
            echo _i('View');
            ?>
</a><a href="<?php 
            echo $this->getUri()->create($radix->shortname . '/thread/' . $p->num) . '#reply';
            ?>
" class="btnr parent"><?php 
            echo _i('Reply');
            ?>
</a><?php 
            echo isset($p->count_all) && $p->count_all > 50 ? '<a href="' . $this->getUri()->create($radix->shortname . '/last50/' . $p->num) . '" class="btnr parent">' . _i('Last 50') . '</a>' : '';
            if ($radix->archive == 1) {
                ?>
<a href="http://boards.4chan.org/<?php 
                echo $radix->shortname . '/thread/' . $p->num;
                ?>
" class="btnr parent"><?php 
                echo _i('Original');
                ?>
</a><?php 
            }
            ?>
<a href="<?php 
            echo $this->getUri()->create($radix->shortname . '/report/' . $p->doc_id);
            ?>
" class="btnr parent" data-function="report" data-post="<?php 
            echo $p->doc_id;
            ?>
" data-post-id="<?php 
            echo $p->num;
            ?>
" data-board="<?php 
            echo htmlspecialchars($p->radix->shortname);
            ?>
" data-controls-modal="post_tools_modal" data-backdrop="true" data-keyboard="true"><?php 
            echo _i('Report');
            ?>
</a><?php 
            if ($this->getAuth()->hasAccess('maccess.mod')) {
                ?>
<a href="<?php 
                echo $this->getUri()->create($radix->shortname . '/delete/' . $p->doc_id);
                ?>
" class="btnr parent" data-function="delete" data-post="<?php 
                echo $p->doc_id;
                ?>
" data-post-id="<?php 
                echo $p->num;
                ?>
" data-board="<?php 
                echo htmlspecialchars($p->radix->shortname);
                ?>
" data-controls-modal="post_tools_modal" data-backdrop="true" data-keyboard="true"><?php 
                echo _i('Delete');
                ?>
</a><?php 
            }
            ?>
</span>
                </div>
            </header>
            <?php 
            if ($p_media !== null) {
                ?>
            <div class="thread_image_box" title="<?php 
                echo $p->getCommentProcessed() ? htmlspecialchars(strip_tags($p->getCommentProcessed())) : '';
                ?>
">
                <?php 
                if ($p_media->getMediaStatus($this->getRequest()) === 'banned') {
                    ?>
                <img src="<?php 
                    echo $this->getAssetManager()->getAssetLink('images/banned-image.png');
                    ?>
" width="150" height="150" />
                <?php 
                } elseif ($p_media->getMediaStatus($this->getRequest()) !== 'normal') {
                    ?>
                <a href="<?php 
                    echo $p_media->getMediaLink($this->getRequest()) ? $p_media->getMediaLink($this->getRequest()) : $p_media->getRemoteMediaLink($this->getRequest());
                    ?>
" target="_blank" rel="noreferrer" class="thread_image_link">
                    <img src="<?php 
                    echo $this->getAssetManager()->getAssetLink('images/missing-image.jpg');
                    ?>
" width="150" height="150" />
                </a>
                <?php 
                } else {
                    ?>
                <a href="<?php 
                    echo $this->getUri()->create($radix->shortname . '/thread/' . $p->num);
                    ?>
" rel="noreferrer" target="_blank" class="thread_image_link"<?php 
                    echo $p_media->getMediaLink($this->getRequest()) ? ' data-expand="true"' : '';
                    ?>
>
                    <?php 
                    if (!$this->getAuth()->hasAccess('maccess.mod') && !$radix->getValue('transparent_spoiler') && $p_media->spoiler) {
                        ?>
                    <div class="spoiler_box"><span class="spoiler_box_text"><?php 
                        echo _i('Spoiler');
                        ?>
<span class="spoiler_box_text_help"><?php 
                        echo _i('Click to view');
                        ?>
</span></div>
                    <?php 
                    } else {
                        ?>
                    <img src="<?php 
                        echo $p_media->getThumbLink($this->getRequest());
                        ?>
" width="<?php 
                        echo $p_media->preview_w;
                        ?>
" height="<?php 
                        echo $p_media->preview_h;
                        ?>
" data-width="<?php 
                        echo $p_media->media_w;
                        ?>
" data-height="<?php 
                        echo $p_media->media_h;
                        ?>
" data-md5="<?php 
                        echo $p_media->media_hash;
                        ?>
" class="thread_image<?php 
                        echo $p_media->spoiler ? ' is_spoiler_image' : '';
                        ?>
" />
                    <?php 
                    }
                    ?>
                </a>
                <?php 
                }
                ?>
                <?php 
                if ($p_media->getMediaStatus($this->getRequest()) !== 'banned' || $this->getAuth()->hasAccess('media.see_banned')) {
                    ?>
                <div class="post_file" style="padding-left: 2px"><?php 
                    echo \Rych\ByteSize\ByteSize::formatBinary($p_media->media_size, 0) . ', ' . $p_media->media_w . 'x' . $p_media->media_h . ', ' . $p_media->media_filename;
                    ?>
</div>
                <div class="post_file_controls">
                    <a href="<?php 
                    echo $p_media->getMediaLink($this->getRequest()) ? $p_media->getMediaLink($this->getRequest()) : $p_media->getRemoteMediaLink($this->getRequest());
                    ?>
" class="btnr" target="_blank">Full</a><a href="<?php 
                    echo $this->getUri()->create($radix->shortname . '/search/image/' . urlencode(substr($p_media->media_hash, 0, -2)));
                    ?>
" class="btnr parent"><?php 
                    echo _i('View Same');
                    ?>
</a><a target="_blank" href="http://iqdb.org/?url=<?php 
                    echo $p_media->getThumbLink($this->getRequest());
                    ?>
" class="btnr parent">iqdb</a><a target="_blank" href="http://saucenao.com/search.php?url=<?php 
                    echo $p_media->getThumbLink($this->getRequest());
                    ?>
" class="btnr parent">SauceNAO</a><a target="_blank" href="http://google.com/searchbyimage?image_url=<?php 
                    echo $p_media->getThumbLink($this->getRequest());
                    ?>
" class="btnr parent">Google</a>
                </div>
                <?php 
                }
                ?>
            </div>
            <?php 
            }
            ?>
            <div class="thread_tools_bottom">
                <?php 
            if (isset($p->comment->nreplies)) {
                ?>
                <?php 
                echo _i('Replies');
                ?>
 : <?php 
                echo $p->nreplies - 1;
                ?>
 | <?php 
                echo _i('Images');
                ?>
: <?php 
                echo $p->nimages - ($p_media !== null ? 1 : 0);
                ?>
                <?php 
            }
            ?>
                <?php 
            if ($p->deleted == 1) {
                ?>
<span class="post_type"><img src="<?php 
                echo $this->getAssetManager()->getAssetLink('images/icons/file-delete-icon.png');
                ?>
" title="<?php 
                echo htmlspecialchars(_i('This post was deleted from 4chan manually'));
                ?>
"/></span><?php 
            }
            ?>
                <?php 
            if (isset($p_media) && $p_media->spoiler == 1) {
                ?>
<span class="post_type"><img src="<?php 
                echo $this->getAssetManager()->getAssetLink('images/icons/spoiler-icon.png');
                ?>
" title="<?php 
                echo htmlspecialchars(_i('This post contains a spoiler image'));
                ?>
"/></span><?php 
            }
            ?>
            </div>
        </article>
        <?php 
            if ($separator % 4 == 0) {
                echo '<div class="clearfix"></div>';
            }
        }
        ?>
        </div>
        <article class="thread">
            <div id="backlink" class="thread_o_matic" style="position: absolute; top: 0; left: 0; z-index: 5;"></div>
        </article>
        <?php 
    }
示例#3
0
文件: Board.php 项目: voh/FoolFuuka
    public function toString()
    {
        $radix = $this->getBuilderParamManager()->getParam('radix');
        $board = $this->getParamManager()->getParam('board');
        $controller_method = $this->getBuilderParamManager()->getParam('controller_method', 'thread');
        $thread_id = $this->getBuilderParamManager()->getParam('thread_id', 0);
        $form = $this->getForm();
        if ($thread_id > 0) {
            echo $form->open(['enctype' => 'multipart/form-data', 'onsubmit' => 'fuel_set_csrf_token(this);', 'action' => $radix->shortname . '/submit', 'id' => 'postform']);
            echo $form->hidden('csrf_token', $this->getSecurity()->getCsrfToken());
            echo $form->hidden('id', 'postform');
            echo isset($backend_vars['last_limit']) ? $form->hidden('reply_last_limit', $backend_vars['last_limit']) : '';
        }
        ?>

        <div class="content">
        <?php 
        foreach ($board as $key => $post) {
            if (isset($post['op'])) {
                $op_bulk = $post['op'];
                $op = new Comment($this->getContext(), $op_bulk);
                $op->setControllerMethod($controller_method);
                if ($op_bulk->media !== null) {
                    $op_media = new Media($this->getContext(), $op_bulk);
                } else {
                    $op_media = null;
                }
                ?>
            <div id="<?php 
                echo $op->num;
                ?>
">
                <?php 
                if ($op_media !== null) {
                    ?>
                    <?php 
                    if ($op_media->getMediaStatus($this->getRequest()) !== 'banned') {
                        ?>
                    <span><?php 
                        echo _i('File:') . ' ' . ByteSize::formatBinary($op_media->media_size, 0) . ', ' . $op_media->media_w . 'x' . $op_media->media_h . ', ' . $op_media->getMediaFilenameProcessed();
                        ?>
 <?php 
                        echo '<!-- ' . substr($op_media->media_hash, 0, -2) . '-->';
                        ?>
</span>
                        <?php 
                        if (!$op->radix->hide_thumbnails || $this->getAuth()->hasAccess('maccess.mod')) {
                            ?>
                            [<a href="<?php 
                            echo $this->getUri()->create($op->radix->shortname . '/search/image/' . $op_media->getSafeMediaHash());
                            ?>
"><?php 
                            echo _i('View Same');
                            ?>
</a>]
                            [<a href="http://google.com/searchbyimage?image_url=<?php 
                            echo $op_media->getThumbLink($this->getRequest());
                            ?>
">Google</a>]
                            [<a href="http://iqdb.org/?url=<?php 
                            echo $op_media->getThumbLink($this->getRequest());
                            ?>
">iqdb</a>]
                            [<a href="http://saucenao.com/search.php?url=<?php 
                            echo $op_media->getThumbLink($this->getRequest());
                            ?>
">SauceNAO</a>]
                        <?php 
                        }
                        ?>
                    <br />
                    <?php 
                    }
                    ?>
                    <?php 
                    if ($op_media->getMediaStatus($this->getRequest()) === 'banned') {
                        ?>
                        <img src="<?php 
                        echo $this->getAssetManager()->getAssetLink('images/banned-image.png');
                        ?>
" width="150" height="150" class="thumb"/>
                    <?php 
                    } elseif ($op_media->getMediaStatus($this->getRequest()) !== 'normal') {
                        ?>
                        <a href="<?php 
                        echo $op_media->getMediaLink($this->getRequest()) ? $op_media->getMediaLink($this->getRequest()) : $op_media->getRemoteMediaLink($this->getRequest());
                        ?>
" rel="noreferrer">
                            <img src="<?php 
                        echo $this->getAssetManager()->getAssetLink('images/missing-image.jpg');
                        ?>
" width="150" height="150" class="thumb"/>
                        </a>
                    <?php 
                    } else {
                        ?>
                        <a href="<?php 
                        echo $op_media->getMediaLink($this->getRequest()) ? $op_media->getMediaLink($this->getRequest()) : $op_media->getRemoteMediaLink($this->getRequest());
                        ?>
" rel="noreferrer">
                            <?php 
                        if (!$this->getAuth()->hasAccess('maccess.mod') && $op_media->spoiler) {
                            ?>
                            <img src="<?php 
                            echo $this->getAssetManager()->getAssetLink('images/spoiler.png');
                            ?>
" width="100" height="100" class="thumb" alt="[SPOILER]" />
                            <?php 
                        } else {
                            ?>
                            <img src="<?php 
                            echo $op_media->getThumbLink($this->getRequest());
                            ?>
" width="<?php 
                            echo $op_media->preview_w;
                            ?>
" height="<?php 
                            echo $op_media->preview_h;
                            ?>
" class="thumb" alt="<?php 
                            echo $op->num;
                            ?>
" />
                            <?php 
                        }
                        ?>
                        </a>
                    <?php 
                    }
                    ?>
                <?php 
                }
                ?>

                <label>
                    <input type="checkbox" name="delete[]" value="<?php 
                echo $op->doc_id;
                ?>
" />
                    <span class="filetitle"><?php 
                echo $op->getTitleProcessed();
                ?>
</span>
                    <span class="postername<?php 
                echo $op->capcode == 'M' ? ' mod' : '';
                echo $op->capcode == 'A' ? ' admin' : '';
                echo $op->capcode == 'D' ? ' developer' : '';
                ?>
"><?php 
                echo $op->email && $op->email !== 'noko' ? '<a href="mailto:' . rawurlencode($op->email) . '">' . $op->getNameProcessed() . '</a>' : $op->getNameProcessed();
                ?>
</span>
                    <span class="postertrip<?php 
                echo $op->capcode == 'M' ? ' mod' : '';
                echo $op->capcode == 'A' ? ' admin' : '';
                echo $op->capcode == 'D' ? ' developer' : '';
                ?>
"><?php 
                echo $op->getTripProcessed();
                ?>
</span>
                    <span class="poster_hash"><?php 
                if ($op->getPosterHashProcessed()) {
                    ?>
ID:<?php 
                    echo $op->getPosterHashProcessed();
                }
                ?>
</span>
                    <?php 
                if ($op->capcode == 'M') {
                    ?>
                        <span class="postername mod">## <?php 
                    echo _i('Mod');
                    ?>
</span>
                    <?php 
                }
                ?>
                    <?php 
                if ($op->capcode == 'A') {
                    ?>
                        <span class="postername admin">## <?php 
                    echo _i('Admin');
                    ?>
</span>
                    <?php 
                }
                ?>
                    <?php 
                if ($op->capcode == 'D') {
                    ?>
                        <span class="postername admin">## <?php 
                    echo _i('Developer');
                    ?>
</span>
                    <?php 
                }
                ?>
                    <?php 
                echo gmdate('D d M H:i:s Y', $op->getOriginalTimestamp());
                ?>
                    <?php 
                if ($op->poster_country !== null) {
                    ?>
<span class="poster_country"><span title="<?php 
                    echo e($op->poster_country_name);
                    ?>
" class="flag flag-<?php 
                    echo strtolower($op->poster_country);
                    ?>
"></span></span><?php 
                }
                ?>
                </label>

                <?php 
                if ($thread_id == 0) {
                    ?>
                    <a class="js" href="<?php 
                    echo $this->getUri()->create(array($op->radix->shortname, $controller_method, $op->num)) . '#' . $op->num;
                    ?>
">No.<?php 
                    echo $op->num;
                    ?>
</a>
                <?php 
                } else {
                    ?>
                    <a class="js" href="<?php 
                    echo $this->getUri()->create(array($op->radix->shortname, $controller_method, $op->num)) . '#' . $op->num;
                    ?>
">No.</a><a class="js" href="javascript:replyQuote('>><?php 
                    echo $op->num;
                    ?>
\n')"><?php 
                    echo $op->num;
                    ?>
</a>
                <?php 
                }
                ?>

                <?php 
                if (isset($op_media) && $op_media->spoiler == 1) {
                    ?>
<img class="inline" src="<?php 
                    echo $this->getAssetManager()->getAssetLink('images/icons/spoiler-icon.png');
                    ?>
" alt="[SPOILER]" title="<?php 
                    echo _i('The image in this post has been marked spoiler.');
                    ?>
"><?php 
                }
                ?>
                <?php 
                if ($op->deleted == 1 && $op->timestamp_expired == 0) {
                    ?>
<img class="inline" src="<?php 
                    echo $this->getAssetManager()->getAssetLink('images/icons/file-delete-icon.png');
                    ?>
" alt="[DELETED]" title="<?php 
                    echo _i('This thread was prematurely deleted.');
                    ?>
"><?php 
                }
                ?>
                <?php 
                if ($op->deleted == 1 && $op->timestamp_expired != 0) {
                    ?>
<img class="inline" src="<?php 
                    echo $this->getAssetManager()->getAssetLink('images/icons/file-delete-icon.png');
                    ?>
" alt="[DELETED]" title="<?php 
                    echo _i('This thread was deleted on %s.', gmdate('M d, Y \\a\\t H:i:s e', $op->timestamp_expired));
                    ?>
"><?php 
                }
                ?>
                <?php 
                if ($op->sticky == 1) {
                    ?>
<img class="inline" src="<?php 
                    echo $this->getAssetManager()->getAssetLink('images/icons/sticky-icon.png');
                    ?>
" alt="[STICKY]" title="<?php 
                    echo _i('This thread has been stickied.');
                    ?>
"><?php 
                }
                ?>
                <?php 
                if ($op->locked == 1) {
                    ?>
<img class="inline" src="<?php 
                    echo $this->getAssetManager()->getAssetLink('images/icons/locked-icon.png');
                    ?>
" alt="[LOCKED]" title="<?php 
                    echo _i('This thread has been locked.');
                    ?>
"><?php 
                }
                ?>

                [<a href="<?php 
                echo $this->getUri()->create(array($op->radix->shortname, 'thread', $op->num));
                ?>
"><?php 
                echo _i('Reply');
                ?>
</a>]
                <?php 
                if (isset($post['omitted']) && $post['omitted'] > 50) {
                    ?>
 [<a href="<?php 
                    echo $this->getUri()->create($op->radix->shortname . '/last/50/' . $op->num);
                    ?>
"><?php 
                    echo _i('Last 50');
                    ?>
</a>]<?php 
                }
                ?>
                <?php 
                if ($op->radix->archive) {
                    ?>
 [<a href="//boards.4chan.org/<?php 
                    echo $op->radix->shortname . '/thread/' . $op->num;
                    ?>
"><?php 
                    echo _i('Original');
                    ?>
</a>]<?php 
                }
                ?>

                <div class="quoted-by" style="display: <?php 
                echo $op->getBacklinks() ? 'block' : 'none';
                ?>
">
                    <?php 
                echo _i('Quoted By:');
                ?>
 <?php 
                echo $op->getBacklinks() ? implode(' ', $op->getBacklinks()) : '';
                ?>
                </div>

                <blockquote><p><?php 
                echo $op->getCommentProcessed();
                ?>
</p></blockquote>
                <?php 
                if (isset($post['omitted']) && $post['omitted'] > 0) {
                    ?>
                <span class="omitted">
                    <?php 
                    if (isset($post['images_omitted']) && $post['images_omitted'] > 0) {
                        ?>
                    <?php 
                        echo $post['omitted'] + $post['images_omitted'] . ' ' . _n('post', 'posts', $post['omitted'] + $post['images_omitted']);
                        ?>
                    <?php 
                        echo ' ' . _n('omitted', 'omitted', $post['omitted'] + $post['images_omitted']);
                        ?>
.
                    <?php 
                    } else {
                        ?>
                    <?php 
                        echo $post['omitted'] . ' ' . _n('post', 'posts', $post['omitted']);
                        ?>
                    <?php 
                        echo ' ' . _n('omitted', 'omitted', $post['omitted'] + $post['images_omitted']);
                        ?>
.
                    <?php 
                    }
                    ?>
                </span>
                <?php 
                }
                ?>
            </div>
            <?php 
            }
            ?>

            <?php 
            if (isset($post['posts'])) {
                $post_counter = 0;
                $image_counter = 0;
                $board_comment_view = $this->getBuilder()->createPartial('post', 'board_comment');
                // reusable Comment object not to create one every loop
                $comment = new Comment($this->getContext());
                $comment->setControllerMethod($controller_method);
                $media_obj = new Media($this->getContext());
                foreach ($post['posts'] as $p) {
                    /** @var CommentBulk $p */
                    $post_counter++;
                    if ($p->media !== null) {
                        $image_counter++;
                    }
                    $comment->setBulk($p);
                    // set the $media to null and leave the Media object in existence
                    if ($p->media !== null) {
                        $media_obj->setBulk($p);
                        $media = $media_obj;
                    } else {
                        $media = null;
                    }
                    $board_comment_view->getParamManager()->setParams(['p' => $comment, 'p_media' => $media, 'modifiers' => $this->getBuilderParamManager()->getParam('modifiers', false), 'post_counter' => $post_counter, 'image_counter' => $image_counter]);
                    // refreshes the string
                    $board_comment_view->doBuild();
                    echo $board_comment_view->build();
                    // remove extra strings from the objects
                    $board_comment_view->clearBuilt();
                    $p->comment->clean();
                    if ($p->media !== null) {
                        $p->media->clean();
                    }
                }
            }
            ?>

            <?php 
            if ($thread_id > 0) {
                ?>
            <?php 
                echo $this->getBuilder()->isPartial('tools_reply_box') ? $this->getBuilder()->getPartial('tools_reply_box')->build() : '';
                ?>
            <?php 
            }
            ?>

            <br class="newthr" />
            <hr />
        <?php 
        }
        ?>
        </div>

        <?php 
        if ($thread_id > 0) {
            echo $form->close();
        }
        ?>
    <?php 
    }
示例#4
0
    public function toString()
    {
        $controller_method = $this->getBuilderParamManager()->getParam('controller_method', 'thread');
        $p = $this->getParamManager()->getParam('p');
        $p_media = $this->getParamManager()->getParam('p_media');
        if ($this->getParamManager()->getParam('modifiers', false)) {
            $modifiers = $this->getParamManager()->getParam('modifiers');
        }
        if ($this->getParamManager()->getParam('modifiers', false)) {
            $modifiers = $this->getParamManager()->getParam('modifiers');
        }
        ?>

        <table>
            <tbody>
                <tr>
                    <td class="doubledash">&gt;&gt;</td>
                    <td class="<?php 
        echo $p->subnum > 0 ? 'subreply' : 'reply';
        ?>
" id="<?php 
        echo $p->num . ($p->subnum > 0 ? '_' . $p->subnum : '');
        ?>
">
                        <label>
                            <input type="checkbox" name="delete[]" value="<?php 
        echo $p->doc_id;
        ?>
"/>
                            <?php 
        if (isset($modifiers['post_show_board_name']) && $modifiers['post_show_board_name']) {
            ?>
<span class="post_show_board">/<?php 
            echo $p->radix->shortname;
            ?>
/</span><?php 
        }
        ?>
                            <span class="filetitle"><?php 
        echo $p->getTitleProcessed();
        ?>
</span>
                            <span class="postername<?php 
        echo $p->capcode == 'M' ? ' mod' : '';
        echo $p->capcode == 'A' ? ' admin' : '';
        echo $p->capcode == 'D' ? ' developer' : '';
        ?>
"><?php 
        echo $p->email && $p->email !== 'noko' ? '<a href="mailto:' . rawurlencode($p->email) . '">' . $p->getNameProcessed() . '</a>' : $p->getNameProcessed();
        ?>
</span>
                            <span class="postertrip<?php 
        echo $p->capcode == 'M' ? ' mod' : '';
        echo $p->capcode == 'A' ? ' admin' : '';
        echo $p->capcode == 'D' ? ' developer' : '';
        ?>
"><?php 
        echo $p->getTripProcessed();
        ?>
</span>
                            <span class="poster_hash"><?php 
        if ($p->getPosterHashProcessed()) {
            ?>
ID:<?php 
            echo $p->getPosterHashProcessed();
        }
        ?>
</span>
                            <?php 
        if ($p->capcode == 'M') {
            ?>
            <span class="postername mod">## <?php 
            echo _i('Mod');
            ?>
</span>
            <?php 
        }
        ?>
                            <?php 
        if ($p->capcode == 'A') {
            ?>
            <span class="postername admin">## <?php 
            echo _i('Admin');
            ?>
</span>
            <?php 
        }
        ?>
                            <?php 
        if ($p->capcode == 'D') {
            ?>
            <span class="postername admin">## <?php 
            echo _i('Developers');
            ?>
</span>
            <?php 
        }
        ?>
                            <?php 
        echo gmdate('D d M H:i:s Y', $p->getOriginalTimestamp());
        ?>
                            <?php 
        if ($p->poster_country !== null) {
            ?>
<span class="poster_country"><span title="<?php 
            echo e($p->poster_country_name);
            ?>
" class="flag flag-<?php 
            echo strtolower($p->poster_country);
            ?>
"></span></span><?php 
        }
        ?>
                        </label>
                        <?php 
        if (!$this->getBuilderParamManager()->getParam('thread_id', 0)) {
            ?>
                        <a class="js" href="<?php 
            echo $this->getUri()->create([$p->radix->shortname, $controller_method, $p->thread_num]) . '#' . $p->num . ($p->subnum > 0 ? '_' . $p->subnum : '');
            ?>
">No.<?php 
            echo $p->num . ($p->subnum > 0 ? ',' . $p->subnum : '');
            ?>
</a>
                        <?php 
        } else {
            ?>
                        <a class="js" href="<?php 
            echo $this->getUri()->create([$p->radix->shortname, $controller_method, $p->thread_num]) . '#' . $p->num . ($p->subnum > 0 ? '_' . $p->subnum : '');
            ?>
">No.</a><a class="js" href="javascript:replyQuote('>><?php 
            echo $p->num . ($p->subnum > 0 ? ',' . $p->subnum : '');
            ?>
\n')"><?php 
            echo $p->num . ($p->subnum > 0 ? ',' . $p->subnum : '');
            ?>
</a>
                        <?php 
        }
        ?>

                        <?php 
        if ($p->subnum > 0) {
            ?>
<img class="inline" src="<?php 
            echo $this->getAssetManager()->getAssetLink('images/icons/communicate-icon.png');
            ?>
" alt="[INTERNAL]" title="<?php 
            echo _i('This post was submitted as a "ghost" reply.');
            ?>
"/><?php 
        }
        ?>
                        <?php 
        if (isset($p_media) && $p_media->spoiler == 1) {
            ?>
<img class="inline" src="<?php 
            echo $this->getAssetManager()->getAssetLink('images/icons/spoiler-icon.png');
            ?>
" alt="[SPOILER]" title="<?php 
            echo _i('The image in this post has been marked spoiler.');
            ?>
"/><?php 
        }
        ?>
                        <?php 
        if ($p->deleted == 1 && $p->timestamp_expired == 0) {
            ?>
<img class="inline" src="<?php 
            echo $this->getAssetManager()->getAssetLink('images/icons/file-delete-icon.png');
            ?>
" alt="[DELETED]" title="<?php 
            echo _i('This post was prematurely deleted.');
            ?>
"/><?php 
        }
        ?>
                        <?php 
        if ($p->deleted == 1 && $p->timestamp_expired != 0) {
            ?>
<img class="inline" src="<?php 
            echo $this->getAssetManager()->getAssetLink('images/icons/file-delete-icon.png');
            ?>
" alt="[DELETED]" title="<?php 
            echo _i('This post was deleted on %s.', gmdate('M d, Y \\a\\t H:i:s e', $p->timestamp_expired));
            ?>
"/><?php 
        }
        ?>
                        <?php 
        if ($p->sticky == 1) {
            ?>
<img class="inline" src="<?php 
            echo $this->getAssetManager()->getAssetLink('images/icons/sticky-icon.png');
            ?>
" alt="[STICKY]" title="<?php 
            echo _i('This thread has been stickied.');
            ?>
"><?php 
        }
        ?>
                        <?php 
        if ($p->locked == 1) {
            ?>
<img class="inline" src="<?php 
            echo $this->getAssetManager()->getAssetLink('images/icons/locked-icon.png');
            ?>
" alt="[LOCKED]" title="<?php 
            echo _i('This thread has been locked.');
            ?>
"><?php 
        }
        ?>

                        <?php 
        if (isset($modifiers['post_show_view_button'])) {
            ?>
[<a class="btnr" href="<?php 
            echo $this->getUri()->create([$p->radix->shortname, 'thread', $p->thread_num]) . '#' . $p->num . ($p->subnum ? '_' . $p->subnum : '');
            ?>
">View</a>]<?php 
        }
        ?>

                        <br/>
                        <?php 
        if ($p_media !== null) {
            ?>
            <?php 
            if ($p_media->getMediaStatus($this->getRequest()) !== 'banned') {
                ?>
                <span>
                                <?php 
                echo _i('File:') . ' ' . \Rych\ByteSize\ByteSize::formatBinary($p_media->media_size, 0) . ', ' . $p_media->media_w . 'x' . $p_media->media_h . ', ' . $p_media->getMediaFilenameProcessed();
                ?>
                    <?php 
                echo '<!-- ' . substr($p_media->media_hash, 0, -2) . '-->';
                ?>
                            </span>

                <?php 
                if (!$p->radix->hide_thumbnails || $this->getAuth()->hasAccess('maccess.mod')) {
                    ?>
                    [<a href="<?php 
                    echo $this->getUri()->create($p->radix->shortname . '/search/image/' . $p_media->getSafeMediaHash());
                    ?>
"><?php 
                    echo _i('View Same');
                    ?>
</a>]
                    [<a href="http://google.com/searchbyimage?image_url=<?php 
                    echo $p_media->getThumbLink($this->getRequest());
                    ?>
">Google</a>]
                    [<a href="http://iqdb.org/?url=<?php 
                    echo $p_media->getThumbLink($this->getRequest());
                    ?>
">iqdb</a>]
                    [<a href="http://saucenao.com/search.php?url=<?php 
                    echo $p_media->getThumbLink($this->getRequest());
                    ?>
">SauceNAO</a>]
                    <?php 
                }
                ?>
                <br />
                <?php 
            }
            ?>
            <?php 
            if ($p_media->getMediaStatus($this->getRequest()) === 'banned') {
                ?>
                <img src="<?php 
                echo $this->getAssetManager()->getAssetLink('images/banned-image.png');
                ?>
" width="150" height="150" class="thumb"/>
                <?php 
            } elseif ($p_media->getMediaStatus($this->getRequest()) !== 'normal') {
                ?>
                <a href="<?php 
                echo $p_media->getMediaLink($this->getRequest()) ? $p_media->getMediaLink($this->getRequest()) : $p_media->getRemoteMediaLink($this->getRequest());
                ?>
" rel="noreferrer">
                    <img src="<?php 
                echo $this->getAssetManager()->getAssetLink('images/missing-image.jpg');
                ?>
" width="150" height="150" class="thumb"/>
                </a>
                <?php 
            } else {
                ?>
                <a href="<?php 
                echo $p_media->getMediaLink($this->getRequest()) ? $p_media->getMediaLink($this->getRequest()) : $p_media->getRemoteMediaLink($this->getRequest());
                ?>
" rel="noreferrer">
                    <?php 
                if (!$this->getAuth()->hasAccess('maccess.mod') && $p_media->spoiler) {
                    ?>
                    <img src="<?php 
                    echo $this->getAssetManager()->getAssetLink('images/spoiler.png');
                    ?>
" width="100" height="100" class="thumb" alt="[SPOILER]" />
                    <?php 
                } else {
                    ?>
                    <img src="<?php 
                    echo $p_media->getThumbLink($this->getRequest());
                    ?>
" alt="<?php 
                    echo $p->num;
                    ?>
" width="<?php 
                    echo $p_media->preview_w;
                    ?>
" height="<?php 
                    echo $p_media->preview_h;
                    ?>
" class="thumb" />
                    <?php 
                }
                ?>
                </a>
                <?php 
            }
            ?>
            <?php 
        }
        ?>
                        <div class="quoted-by" style="display: <?php 
        echo $p->getBacklinks() ? 'block' : 'none';
        ?>
">
                            <?php 
        echo _i('Quoted By:');
        ?>
 <?php 
        echo $p->getBacklinks() ? implode(' ', $p->getBacklinks()) : '';
        ?>
                        </div>
                        <blockquote><p><?php 
        echo $p->getCommentProcessed();
        ?>
</p></blockquote>
                    </td>
                </tr>
            </tbody>
        </table>
        <?php 
    }
示例#5
0
    public function toString()
    {
        $board = $this->getParamManager()->getParam('board');
        $controller_method = $this->getBuilderParamManager()->getParam('controller_method', 'thread');
        $thread_id = $this->getBuilderParamManager()->getParam('thread_id', 0);
        foreach ($board as $key => $post) {
            if (isset($post['op'])) {
                $op_bulk = $post['op'];
                $op = new Comment($this->getContext(), $op_bulk);
                $op->setControllerMethod($controller_method);
                if ($op_bulk->media !== null) {
                    $op_media = new Media($this->getContext(), $op_bulk);
                } else {
                    $op_media = null;
                }
                $num = $op->num . ($op->subnum ? '_' . $op->subnum : '');
                ?>
        <?php 
                if ($thread_id === 0) {
                    ?>
        <div class="thread stub stub_doc_id_<?php 
                    echo $op->doc_id;
                    ?>
">
            <button class="btn-toggle-post" data-function="showThread" data-board="<?php 
                    echo $op->radix->shortname;
                    ?>
" data-doc-id="<?php 
                    echo $op->doc_id;
                    ?>
" data-thread-num="<?php 
                    echo $op->thread_num;
                    ?>
"><i class="icon-plus"></i></button>
            <?php 
                    if ($op->email && $op->email !== 'noko') {
                        ?>
<a href="mailto:<?php 
                        echo rawurlencode($op->email);
                        ?>
"><?php 
                    }
                    ?>
<span class="post_author"><?php 
                    echo $op->getNameProcessed();
                    ?>
</span><?php 
                    echo $op->getNameProcessed() && $op->getTripProcessed() ? ' ' : '';
                    ?>
<span class="post_tripcode"><?php 
                    echo $op->getTripProcessed();
                    ?>
</span><?php 
                    if ($op->email && $op->email !== 'noko') {
                        ?>
</a><?php 
                    }
                    ?>
            (<?php 
                    echo $post['omitted'] + 5 . ' ' . _i('replies');
                    ?>
)
        </div>
        <?php 
                }
                ?>
        <article id="<?php 
                echo $num;
                ?>
" class="clearfix thread doc_id_<?php 
                echo $op->doc_id;
                ?>
 board_<?php 
                echo $op->radix->shortname;
                ?>
" data-doc-id="<?php 
                echo $op->doc_id;
                ?>
" data-thread-num="<?php 
                echo $op->thread_num;
                ?>
">
                <?php 
                if ($thread_id === 0) {
                    ?>
                <div class="stub pull-left">
                    <button class="btn-toggle-post" data-function="hideThread" data-board="<?php 
                    echo $op->radix->shortname;
                    ?>
" data-doc-id="<?php 
                    echo $op->doc_id;
                    ?>
"><i class="icon-minus"></i></button>
                </div>
                <?php 
                }
                ?>
                <?php 
                \Foolz\Plugin\Hook::forge('foolfuuka.themes.default_after_op_open')->setObject($this)->setParam('board', $op->radix)->execute();
                ?>
                <?php 
                if ($op_media !== null) {
                    ?>
                <div class="thread_image_box">
                    <?php 
                    if ($op_media->getMediaStatus($this->getRequest()) === 'banned') {
                        ?>
                    <img src="<?php 
                        echo $this->getAssetManager()->getAssetLink('images/banned-image.png');
                        ?>
" width="150" height="150" />
                    <?php 
                    } elseif ($op_media->getMediaStatus($this->getRequest()) !== 'normal') {
                        ?>
                    <a href="<?php 
                        echo $op_media->getMediaLink($this->getRequest()) ? $op_media->getMediaLink($this->getRequest()) : $op_media->getRemoteMediaLink($this->getRequest());
                        ?>
" target="_blank" rel="noreferrer" class="thread_image_link">
                        <img src="<?php 
                        echo $this->getAssetManager()->getAssetLink('images/missing-image.jpg');
                        ?>
" width="150" height="150" />
                    </a>
                    <?php 
                    } else {
                        ?>
                    <a href="<?php 
                        echo $op_media->getMediaLink($this->getRequest()) ? $op_media->getMediaLink($this->getRequest()) : $op_media->getRemoteMediaLink($this->getRequest());
                        ?>
" target="_blank" rel="noreferrer" class="thread_image_link">
                        <?php 
                        if (!$this->getAuth()->hasAccess('maccess.mod') && !$op->radix->getValue('transparent_spoiler') && $op_media->spoiler) {
                            ?>
                        <div class="spoiler_box"><span class="spoiler_box_text"><?php 
                            echo _i('Spoiler');
                            ?>
<span class="spoiler_box_text_help"><?php 
                            echo _i('Click to view');
                            ?>
</span></div>
                        <?php 
                        } else {
                            ?>
                        <img src="<?php 
                            echo $op_media->getThumbLink($this->getRequest());
                            ?>
" width="<?php 
                            echo $op_media->preview_w;
                            ?>
" height="<?php 
                            echo $op_media->preview_h;
                            ?>
" class="thread_image<?php 
                            echo $op_media->spoiler ? ' is_spoiler_image' : '';
                            ?>
" data-md5="<?php 
                            echo $op_media->media_hash;
                            ?>
" />
                        <?php 
                        }
                        ?>
                    </a>
                    <?php 
                    }
                    ?>
                    <?php 
                    if ($op_media->getMediaStatus($this->getRequest()) !== 'banned') {
                        ?>
                    <div class="post_file" style="padding-left: 2px;<?php 
                        if ($op_media->preview_w > 149) {
                            echo 'max-width:' . $op_media->preview_w . 'px;';
                        }
                        ?>
">
                        <?php 
                        echo ByteSize::formatBinary($op_media->media_size, 0) . ', ' . $op_media->media_w . 'x' . $op_media->media_h . ', ';
                        ?>
<a class="post_file_filename" href="<?php 
                        echo $op_media->getMediaLink($this->getRequest()) ? $op_media->getMediaLink($this->getRequest()) : $op_media->getRemoteMediaLink($this->getRequest());
                        ?>
" target="_blank"><?php 
                        echo $op_media->getMediaFilenameProcessed();
                        ?>
</a>
                    </div>
                    <?php 
                    }
                    ?>
                    <div class="post_file_controls">
                        <?php 
                    if ($op_media->getMediaStatus($this->getRequest()) !== 'banned' || $this->getAuth()->hasAccess('media.see_banned')) {
                        ?>
                        <?php 
                        if (!$op->radix->hide_thumbnails || $this->getAuth()->hasAccess('maccess.mod')) {
                            ?>
                            <a href="<?php 
                            echo $this->getUri()->create($op->radix->shortname . '/search/image/' . $op_media->getSafeMediaHash());
                            ?>
" class="btnr parent"><?php 
                            echo _i('View Same');
                            ?>
</a><a
                                href="http://google.com/searchbyimage?image_url=<?php 
                            echo $op_media->getThumbLink($this->getRequest());
                            ?>
" target="_blank"
                                class="btnr parent">Google</a><a
                                href="http://iqdb.org/?url=<?php 
                            echo $op_media->getThumbLink($this->getRequest());
                            ?>
" target="_blank"
                                class="btnr parent">iqdb</a><a
                                href="http://saucenao.com/search.php?url=<?php 
                            echo $op_media->getThumbLink($this->getRequest());
                            ?>
" target="_blank"
                                class="btnr parent">SauceNAO</a><?php 
                            if (!$op->radix->archive || $op->radix->getValue('archive_full_images')) {
                                ?>
<a
                                href="<?php 
                                echo $op_media->getMediaDownloadLink($this->getRequest());
                                ?>
" download="<?php 
                                echo $op_media->getMediaFilenameProcessed();
                                ?>
"
                                class="btnr parent"><i class="icon-download-alt"></i></a><?php 
                            }
                            ?>
                            <?php 
                        }
                        ?>
                        <?php 
                    }
                    ?>
                    </div>
                </div>
                <?php 
                }
                ?>
                <header>
                    <div class="post_data">
                        <?php 
                if ($op->getTitleProcessed() !== '') {
                    ?>
<h2 class="post_title"><?php 
                    echo $op->getTitleProcessed();
                    ?>
</h2><?php 
                }
                ?>
                        <span class="post_poster_data">
                            <?php 
                if ($op->email && $op->email !== 'noko') {
                    ?>
<a href="mailto:<?php 
                    echo rawurlencode($op->email);
                    ?>
"><?php 
                }
                ?>
<span class="post_author"><?php 
                echo $op->getNameProcessed();
                ?>
</span><?php 
                echo $op->getNameProcessed() && $op->getTripProcessed() ? ' ' : '';
                ?>
<span class="post_tripcode"><?php 
                echo $op->getTripProcessed();
                ?>
</span><?php 
                if ($op->email && $op->email !== 'noko') {
                    ?>
</a><?php 
                }
                ?>

                            <?php 
                if ($op->getPosterHashProcessed()) {
                    ?>
<span class="poster_hash">ID:<?php 
                    echo $op->getPosterHashProcessed();
                    ?>
</span><?php 
                }
                ?>
                            <?php 
                if ($op->capcode !== 'N') {
                    ?>
                            <?php 
                    if ($op->capcode === 'M') {
                        ?>
<span class="post_level post_level_moderator">## <?php 
                        echo _i('Mod');
                        ?>
</span><?php 
                    }
                    ?>
                            <?php 
                    if ($op->capcode === 'A') {
                        ?>
<span class="post_level post_level_administrator">## <?php 
                        echo _i('Admin');
                        ?>
</span><?php 
                    }
                    ?>
                            <?php 
                    if ($op->capcode === 'D') {
                        ?>
<span class="post_level post_level_developer">## <?php 
                        echo _i('Developer');
                        ?>
</span><?php 
                    }
                    ?>
                            <?php 
                }
                ?>
                        </span>
                        <span class="time_wrap">
                            <time datetime="<?php 
                echo gmdate(DATE_W3C, $op->timestamp);
                ?>
" class="show_time" <?php 
                if ($op->radix->archive) {
                    ?>
 title="<?php 
                    echo _i('4chan Time') . ': ' . $op->getFourchanDate();
                    ?>
"<?php 
                }
                ?>
><?php 
                echo gmdate('D d M H:i:s Y', $op->timestamp);
                ?>
</time>
                        </span>
                        <a href="<?php 
                echo $this->getUri()->create(array($op->radix->shortname, $controller_method, $op->thread_num)) . '#' . $num;
                ?>
" data-post="<?php 
                echo $num;
                ?>
" data-function="highlight">No.</a><a href="<?php 
                echo $this->getUri()->create(array($op->radix->shortname, $controller_method, $op->thread_num)) . '#q' . $num;
                ?>
" data-post="<?php 
                echo $num;
                ?>
" data-function="quote"><?php 
                echo $num;
                ?>
</a>

                        <span class="post_type">
                            <?php 
                if ($op->poster_country !== null) {
                    ?>
<span title="<?php 
                    echo e($op->poster_country_name);
                    ?>
" class="flag flag-<?php 
                    echo strtolower($op->poster_country);
                    ?>
"></span><?php 
                }
                ?>
                            <?php 
                if (isset($op_media) && $op_media->spoiler) {
                    ?>
<i class="icon-eye-close" title="<?php 
                    echo htmlspecialchars(_i('The image in this post has been marked spoiler.'));
                    ?>
"></i><?php 
                }
                ?>
                            <?php 
                if ($op->deleted && !$op->timestamp_expired) {
                    ?>
<i class="icon-trash" title="<?php 
                    echo htmlspecialchars(_i('This thread was prematurely deleted.'));
                    ?>
"></i><?php 
                }
                ?>
                            <?php 
                if ($op->deleted && $op->timestamp_expired) {
                    ?>
<i class="icon-trash" title="<?php 
                    echo htmlspecialchars(_i('This thread was deleted on %s.', gmdate('M d, Y \\a\\t H:i:s e', $op->timestamp_expired)));
                    ?>
"></i><?php 
                }
                ?>
                            <?php 
                if ($op->sticky) {
                    ?>
<i class="icon-pushpin" title="<?php 
                    echo _i('This thread has been stickied.');
                    ?>
"></i><?php 
                }
                ?>
                            <?php 
                if ($op->locked) {
                    ?>
<i class="icon-lock" title="<?php 
                    echo _i('This thread has been locked.');
                    ?>
"></i><?php 
                }
                ?>
                        </span>

                        <span class="post_controls">
                <a href="<?php 
                echo $this->getUri()->create(array($op->radix->shortname, 'thread', $num));
                ?>
" class="btnr parent"><?php 
                echo _i('View');
                ?>
</a><a href="<?php 
                echo $this->getUri()->create(array($op->radix->shortname, $controller_method, $num)) . '#reply';
                ?>
" class="btnr parent"><?php 
                echo _i('Reply');
                ?>
</a><?php 
                echo isset($post['omitted']) && $post['omitted'] > 50 ? '<a href="' . $this->getUri()->create($op->radix->shortname . '/last/50/' . $num) . '" class="btnr parent">' . _i('Last 50') . '</a>' : '';
                echo $op->radix->archive ? '<a href="//boards.4chan.org/' . $op->radix->shortname . '/thread/' . $num . '" class="btnr parent">' . _i('Original') . '</a>' : '';
                ?>
<a href="#" class="btnr parent" data-post="<?php 
                echo $op->doc_id;
                ?>
" data-post-id="<?php 
                echo $num;
                ?>
" data-board="<?php 
                echo htmlspecialchars($op->radix->shortname);
                ?>
" data-controls-modal="post_tools_modal" data-backdrop="true" data-keyboard="true" data-function="report"><?php 
                echo _i('Report');
                ?>
</a><?php 
                if ($this->getAuth()->hasAccess('maccess.mod') || !$op->radix->archive) {
                    ?>
<a href="#" class="btnr parent" data-post="<?php 
                    echo $op->doc_id;
                    ?>
" data-post-id="<?php 
                    echo $num;
                    ?>
" data-board="<?php 
                    echo htmlspecialchars($op->radix->shortname);
                    ?>
" data-controls-modal="post_tools_modal" data-backdrop="true" data-keyboard="true" data-function="delete"><?php 
                    echo _i('Delete');
                    ?>
</a><?php 
                }
                ?>
            </span>

                        <div class="backlink_list"<?php 
                echo $op->getBacklinks() ? ' style="display:block"' : '';
                ?>
>
                            <?php 
                echo _i('Quoted By:');
                ?>
 <span class="post_backlink" data-post="<?php 
                echo $num;
                ?>
"><?php 
                echo $op->getBacklinks() ? implode(' ', $op->getBacklinks()) : '';
                ?>
</span>
                        </div>

                        <?php 
                if ($this->getAuth()->hasAccess('maccess.mod')) {
                    ?>
                        <div class="btn-group" style="clear:both; padding:5px 0 0 0;">
                            <button class="btn btn-mini" data-function="activateModeration"><?php 
                    echo _i('Mod');
                    if ($op->poster_ip) {
                        echo ' ' . Inet::dtop($op->poster_ip);
                    }
                    ?>
</button>
                        </div>
                        <div class="btn-group post_mod_controls" style="clear:both; padding:5px 0 0 0;">
                            <button class="btn btn-mini" data-function="mod" data-board="<?php 
                    echo $op->radix->shortname;
                    ?>
" data-id="<?php 
                    echo $op->doc_id;
                    ?>
" data-action="delete_post"><?php 
                    echo _i('Delete Thread');
                    ?>
</button>
                            <?php 
                    if (!is_null($op_media)) {
                        ?>
                            <button class="btn btn-mini" data-function="mod" data-board="<?php 
                        echo $op->radix->shortname;
                        ?>
" data-id="<?php 
                        echo $op_media->media_id;
                        ?>
" data-doc-id="<?php 
                        echo $op->doc_id;
                        ?>
" data-action="delete_image"><?php 
                        echo _i('Delete Image');
                        ?>
</button>
                            <button class="btn btn-mini" data-function="mod" data-board="<?php 
                        echo $op->radix->shortname;
                        ?>
" data-id="<?php 
                        echo $op_media->media_id;
                        ?>
" data-doc-id="<?php 
                        echo $op->doc_id;
                        ?>
" data-action="ban_image_local"><?php 
                        echo _i('Ban Image');
                        ?>
</button>
                            <button class="btn btn-mini" data-function="mod" data-board="<?php 
                        echo $op->radix->shortname;
                        ?>
" data-id="<?php 
                        echo $op_media->media_id;
                        ?>
" data-doc-id="<?php 
                        echo $op->doc_id;
                        ?>
" data-action="ban_image_global"><?php 
                        echo _i('Ban Image Globally');
                        ?>
</button>
                            <?php 
                    }
                    ?>
                            <?php 
                    if ($op->poster_ip) {
                        ?>
                            <button class="btn btn-mini" data-function="ban" data-controls-modal="post_tools_modal" data-backdrop="true" data-keyboard="true" data-board="<?php 
                        echo $op->radix->shortname;
                        ?>
" data-ip="<?php 
                        echo Inet::dtop($op->poster_ip);
                        ?>
" data-action="ban_user"><?php 
                        echo _i('Ban IP:') . ' ' . Inet::dtop($op->poster_ip);
                        ?>
</button>
                            <button class="btn btn-mini" data-function="searchUser" data-board="<?php 
                        echo $op->radix->shortname;
                        ?>
" data-board-url="<?php 
                        echo $this->getUri()->create(array($op->radix->shortname));
                        ?>
" data-id="<?php 
                        echo $op->doc_id;
                        ?>
" data-poster-ip="<?php 
                        echo Inet::dtop($op->poster_ip);
                        ?>
"><?php 
                        echo _i('Search IP');
                        ?>
</button>
                            <?php 
                        if ($this->getPreferences()->get('foolfuuka.sphinx.global')) {
                            ?>
                                <button class="btn btn-mini" data-function="searchUserGlobal" data-board="<?php 
                            echo $op->radix->shortname;
                            ?>
" data-board-url="<?php 
                            echo $this->getUri()->create(array($op->radix->shortname));
                            ?>
" data-id="<?php 
                            echo $op->doc_id;
                            ?>
" data-poster-ip="<?php 
                            echo Inet::dtop($op->poster_ip);
                            ?>
"><?php 
                            echo _i('Search IP Globally');
                            ?>
</button>
                                <?php 
                        }
                        ?>
                            <?php 
                    }
                    ?>
                        </div>
                        <?php 
                }
                ?>
                    </div>
                </header>

                <div class="text<?php 
                if (preg_match('/[\\x{4E00}-\\x{9FBF}\\x{3040}-\\x{309F}\\x{30A0}-\\x{30FF}]/u', $op->getCommentProcessed())) {
                    echo ' shift-jis';
                }
                ?>
">
                    <?php 
                echo $op->getCommentProcessed();
                ?>
                </div>
                <div class="thread_tools_bottom">
                    <?php 
                if (isset($post['omitted']) && $post['omitted'] > 0) {
                    ?>
        <span class="omitted">
            <a style="display:inline-block" href="<?php 
                    echo $this->getUri()->create(array($op->radix->shortname, $controller_method, $op->thread_num));
                    ?>
" data-function="expandThread" data-thread-num="<?php 
                    echo $op->thread_num;
                    ?>
"><i class="icon icon-resize-full"></i></a>
                    <span class="omitted_text">
                <span class="omitted_posts"><?php 
                    echo $post['omitted'];
                    ?>
</span> <?php 
                    echo _n('post', 'posts', $post['omitted']);
                    ?>
                        <?php 
                    if (isset($post['images_omitted']) && $post['images_omitted'] > 0) {
                        ?>
                        <?php 
                        echo _i('and');
                        ?>
 <span class="omitted_images"><?php 
                        echo $post['images_omitted'];
                        ?>
</span> <?php 
                        echo _n('image', 'images', $post['images_omitted']);
                        ?>
                        <?php 
                    }
                    ?>
                        <?php 
                    echo _n('omitted', 'omitted', $post['omitted'] + $post['images_omitted']);
                    ?>
        </span>
                    <?php 
                }
                ?>
                </div>

                <?php 
                if ($op->getReports()) {
                    ?>
                <?php 
                    foreach ($op->getReports() as $report) {
                        ?>
                    <div class="report_reason"><?php 
                        echo '<strong>' . _i('Reported Reason:') . '</strong> ' . $report->getReasonProcessed();
                        ?>
                        <br/>
                        <div class="ip_reporter">
                            <strong><?php 
                        echo _i('Info:');
                        ?>
</strong>
                            <?php 
                        echo Inet::dtop($report->ip_reporter);
                        ?>
, <?php 
                        echo _i('Type:');
                        ?>
 <?php 
                        echo $report->media_id !== null ? _i('media') : _i('post');
                        ?>
, <?php 
                        echo _i('Time:');
                        ?>
 <?php 
                        echo gmdate('D M d H:i:s Y', $report->created);
                        ?>
                            <button class="btn btn-mini" data-function="mod" data-id="<?php 
                        echo $report->id;
                        ?>
" data-board="<?php 
                        echo htmlspecialchars($op->radix->shortname);
                        ?>
" data-action="delete_report"><?php 
                        echo _i('Delete Report');
                        ?>
</button>
                        </div>
                    </div>
                    <?php 
                    }
                    ?>
                <?php 
                }
                ?>
                <?php 
            } elseif (isset($post['posts'])) {
                ?>
        <article class="clearfix thread">
                    <?php 
                \Foolz\Plugin\Hook::forge('foolfuuka.themes.default_after_headless_open')->setObject($this)->setParam('board', array(isset($radix) ? $radix : null))->execute();
                ?>
                <?php 
            }
            ?>

            <aside class="posts">
                <?php 
            if (isset($post['posts'])) {
                $post_counter = 0;
                $image_counter = 0;
                $board_comment_view = $this->getBuilder()->createPartial('post', 'board_comment');
                // reusable Comment object not to create one every loop
                $comment = new Comment($this->getContext());
                $comment->setControllerMethod($controller_method);
                $media_obj = new Media($this->getContext());
                $search = array('/\\>[^\\S ]+/s', '/[^\\S ]+\\</s', '/(\\s)+/s');
                $replace = array('>', '<', '\\1');
                foreach ($post['posts'] as $p) {
                    /** @var CommentBulk $p */
                    $post_counter++;
                    if ($p->media !== null) {
                        $image_counter++;
                    }
                    if ($image_counter == 150) {
                        $modifiers['lazyload'] = true;
                    }
                    $comment->setBulk($p);
                    // set the $media to null and leave the Media object in existence
                    if ($p->media !== null) {
                        $media_obj->setBulk($p);
                        $media = $media_obj;
                    } else {
                        $media = null;
                    }
                    $board_comment_view->getParamManager()->setParams(['p' => $comment, 'p_media' => $media, 'modifiers' => $this->getBuilderParamManager()->getParam('modifiers', false), 'post_counter' => $post_counter, 'image_counter' => $image_counter]);
                    // refreshes the string
                    $board_comment_view->doBuild();
                    echo preg_replace($search, $replace, $board_comment_view->build());
                    // remove extra strings from the objects
                    $board_comment_view->clearBuilt();
                    $p->comment->clean();
                    if ($p->media !== null) {
                        $p->media->clean();
                    }
                    $this->flush();
                }
            }
            ?>
            </aside>

            <?php 
            if ($thread_id !== 0) {
                ?>
            <div class="js_hook_realtimethread"></div>
            <?php 
                echo $this->getBuilder()->isPartial('tools_reply_box') ? $this->getBuilder()->getPartial('tools_reply_box')->build() : '';
                ?>
            <?php 
            }
            ?>
            <?php 
            if (isset($post['op']) || isset($post['posts'])) {
                ?>
        </article>
        <?php 
            }
            ?>
            <?php 
        }
        ?>
        <article class="clearfix thread backlink_container">
            <div id="backlink" style="position: absolute; top: 0; left: 0; z-index: 5;"></div>
        </article>
        <?php 
    }