Exemple #1
0
 public function exec()
 {
     // Download binary file
     if ($this->_binary_file) {
         // Send headers
         $this->_sendHeaders();
         // Send file
         readfile($this->_binary_file);
         exit;
     }
     // 404? (without template)
     if (!$this->_template || !Template::exists($this->_template) && $this->_template != '_404') {
         $this->setData('cache.excluded', true);
         $this->_template = '_404';
     }
     // Output
     timer('start', 'template_parse');
     ob_start();
     Template::parse($this->_template, $this->_data);
     $content = ob_get_clean();
     $content = Event::filter('content', $content);
     timer('end', 'template_parse');
     // If not excluding cache, then save cache
     if (!$this->getData('cache.excluded')) {
         Cache::factory()->save($this->_headers, $content, $this->getData('page_ttl'));
     }
     // Send headers
     $this->_sendHeaders();
     // Send content
     echo Event::filter('cache', $content);
 }
Exemple #2
0
function display($data)
{
    global $base, $ev;
    echo $data, "\n";
    if ($ev) {
        $ev->delTimer();
    }
    $ev = null;
    timer();
}
Exemple #3
0
function cek_login()
{
    $timeout = $_SESSION[timeout];
    if (time() < $timeout) {
        timer();
        return true;
    } else {
        unset($_SESSION[timeout]);
        return false;
    }
}
Exemple #4
0
function cek_login()
{
    $timeout = $_SESSION[timeout];
    if (time() < $timeout) {
        timer();
        return true;
    } else {
        mysql_query("UPDATE online SET online='T' WHERE id_siswa = '{$_SESSION['idsiswa']}'");
        unset($_SESSION[timeout]);
        return false;
    }
}
function returntimer($pagetimer)
{
    /*$intertime = timer() - $timer;
    	//if ($_SERVER['REQUEST_TIME']) $intertime = timer() - $_SERVER['REQUEST_TIME'];
    	$lol = substr($intertime, 2, 3);
    	if ($lol[0] == 0 && $lol[1] == 0) $lol = $lol[2];
    	elseif ($lol[0] == 0) $lol = $lol[1].$lol[2];
    
    	$intertime = ($intertime >= 1 ? substr($intertime, 0, 5)." sec" : $lol."ms");
    	return $intertime;*/
    $timer = round(timer() - $pagetimer, 3);
    return $timer[0] == 0 ? round(substr($timer, 2)) . " ms" : $timer . "  sec";
}
Exemple #6
0
 public function create()
 {
     //$core = Singleton::factory('Core');
     $title = KvLite::get('site', 'title');
     $this->headTitle($title)->setSeparator(' :: ');
     $this->genMeta();
     //$this->headLink()->prependStylesheet('/asset/css/layout.css');
     //$this->headLink()->prependStylesheet('/asset/css/main.css');
     //$this->headLink()->prependStylesheet('/asset/css/base.css');
     if (defined('TIMERSTART') && !defined('TIMERTOTAL')) {
         timer();
     }
     return $this->render('layout.phtml');
 }
Exemple #7
0
function print_lateral($nick, $cargo_ID = false, $time, $siglas = '', $user_ID = '', $avatar = '', $votos = 0, $voto = false, $tipo = 'msg', $item_ID = 0)
{
    global $pol;
    if ($cargo_ID == 99) {
        $cargo = 'Extranjero';
    }
    return '<table border="0" width="100%"><tr>
<td width="40" valign="top">' . ($avatar == 'true' ? '<span>' . avatar($user_ID, 40) . '</span>' : '') . '</td>
<td align="right" valign="top" nowrap="nowrap">
<b>' . ($cargo_ID ? '<img src="' . IMG . 'cargos/' . $cargo_ID . '.gif" /> ' : '') . crear_link($nick) . '</b><br />
<span class="min">' . timer($time) . ' ' . $siglas . '</span> 
<span id="' . $tipo . $item_ID . '">' . confianza($votos) . '</span>' . ($pol['pais'] == PAIS && $item_ID != 0 && $user_ID != $pol['user_ID'] ? '<br />
<span id="data_' . $tipo . $item_ID . '" class="votar" type="' . $tipo . '" name="' . $item_ID . '" value="' . $voto . '"></span>' : '') . '
</td></tr></table>';
}
function returntimer($pagetimer)
{
    // better then previous but still bit shitty assumes all pages are +10ms :)
    $timer = timer() - $pagetimer;
    if ($timer[0] == 0) {
        if (substr($timer, 2, 1) == 0) {
            $timer = substr($timer, 3, 2) . " ms";
        } else {
            $timer = substr($timer, 2, 3) . " ms";
        }
        // +100 ms
    } else {
        $timer = $timer . "  sec";
    }
    return $timer;
}
 public function run()
 {
     //            $lock = SynLockFactory::getFileSynLock(0x1234);
     //            tprintError("try to get the lock....");
     //            $lock->tryLock();
     //            tprintOk("get the lock.");
     //            sleep(10);
     //            tprintWarning("release the lock.");
     //            $lock->unlock();
     $model = Loader::model("news");
     $timer = timer();
     for ($i = 0; $i < 1000000; $i++) {
         $data = array('name' => 'xiaoming', 'pass' => 'xiaoming_pass', 'address' => 'china ShenZhen');
         $model->insert($data);
     }
     tprintOk("插入完成,耗时:" . (timer() - $timer) . " 秒");
 }
Exemple #10
0
 public function prepareUser()
 {
     $i = microtime(true);
     error_log(' [TIMER] ------------');
     $this->loadCandidates();
     timer($i, 'loadCandidates');
     $this->loadDiscussion();
     timer($i, 'loadDiscussion');
     $this->loadResponses2();
     timer($i, 'loadResponses');
     $this->prepareActivity();
     timer($i, 'prepareActivity');
     $this->prepareSort();
     timer($i, 'prepareSort');
     $this->sortA();
     timer($i, 'sortA');
 }
Exemple #11
0
    function display_forum_tags($info)
    {
        $locale = fusion_get_locale();
        echo render_breadcrumbs();
        if (isset($_GET['tag_id'])) {
            // thread design
            echo "<!--pre_forum-->\n";
            echo "<div class='forum-title m-t-20'>" . $locale['forum_0341'] . "</div>\n";
            echo "<div class='filter'>\n";
            forum_filter($info);
            echo "</div>\n";
            if (!empty($info['threads']['pagenav'])) {
                echo "<div class='text-right'>\n";
                echo $info['threads']['pagenav'];
                echo "</div>\n";
            }
            if (!empty($info['threads'])) {
                echo "<div class='forum-container list-group-item'>\n";
                if (!empty($info['threads']['sticky'])) {
                    foreach ($info['threads']['sticky'] as $cdata) {
                        render_thread_item($cdata);
                    }
                }
                if (!empty($info['threads']['item'])) {
                    foreach ($info['threads']['item'] as $cdata) {
                        render_thread_item($cdata);
                    }
                }
                echo "</div>\n";
            } else {
                echo "<div class='text-center'>" . $locale['forum_0269'] . "</div>\n";
            }
            if (!empty($info['threads']['pagenav'])) {
                echo "<div class='text-right hidden-xs m-t-15'>\n";
                echo $info['threads']['pagenav'];
                echo "</div>\n";
            }
            if (!empty($info['threads']['pagenav2'])) {
                echo "<div class='hidden-sm hidden-md hidden-lg m-t-15'>\n";
                echo $info['threads']['pagenav2'];
                echo "</div>\n";
            }
        } else {
            ?>
            <div class="row m-0">
                <?php 
            if (!empty($info['tags'])) {
                ?>
                    <?php 
                unset($info['tags'][0]);
                ?>
                    <?php 
                foreach ($info['tags'] as $tag_id => $tag_data) {
                    ?>
                        <div class="col-xs-12 col-sm-4" style="height: 200px; max-height:200px; background-color: <?php 
                    echo $tag_data['tag_color'];
                    ?>
">
                            <a href="<?php 
                    echo $tag_data['tag_link'];
                    ?>
">
                                <div class="panel-body">
                                    <h4 class="text-white"><?php 
                    echo $tag_data['tag_title'];
                    ?>
</h4>
                                    <p class="text-white"><?php 
                    echo $tag_data['tag_description'];
                    ?>
</p>
                                </div>
                                <hr/>
                                <?php 
                    if (!empty($tag_data['threads'])) {
                        ?>
                                <span class="tag_result text-white">
                                    <?php 
                        echo trim_text($tag_data['threads']['thread_subject'], 10) . " - " . timer($tag_data['threads']['thread_lastpost']);
                        ?>
                                </span>
                                <?php 
                    }
                    ?>
                            </a>
                        </div>
                    <?php 
                }
                ?>
                <?php 
            }
            ?>
            </div>
            <?php 
        }
    }
require dirname(__DIR__) . "/logic.php";
require __DIR__ . "/lib_mongodb.php";
require __DIR__ . "/autoload.php";
use model\User;
use model\Question;
use model\Answer;
$base_url = 'http://www.zhihu.com';
$ids = Question::getIds();
echo "there are ", count($ids), " questions to fetch\n";
$sum = $existing_sum = 1;
foreach ($ids as $qid) {
    $url = "{$base_url}/question/{$qid}";
    timer();
    list($code, $content) = odie_get($url);
    slog($url . " [{$code}]");
    $t = timer();
    echo "Fetch question {$qid} [{$code}] {$t} ms\n";
    $username_list = get_username_list($content);
    timer();
    foreach ($username_list as $username => $nickname) {
        echo "\t{$username}";
        if (User::saveUser($username, $nickname)) {
            $existing_sum++;
        }
        $sum++;
    }
    Question::setFetched($qid);
    $rate = intval((1 - $existing_sum / $sum) * 100);
    $t = timer();
    echo "\tSave: {$t} ms\t Rate {$rate}%\n";
}
Exemple #13
0
<?php

if (!defined('UC_SYSOP')) {
    die('Direct access denied.');
}
show_blocks('d');
?>
<td valign="top" width="155">
<?php 
show_blocks('r');
?>
</td>
<?php 
// Variables for End Time
$seconds = timer() - $tstart;
$phptime = $seconds - $querytime;
$query_time = $querytime;
$percentphp = number_format($phptime / $seconds * 100, 2);
$percentsql = number_format($query_time / $seconds * 100, 2);
$seconds = substr($seconds, 0, 8);
// Хочешь убрать копирайт? (TBVERSION) - Поддержки разработчика, заплати! Не будь быдлом!
print "</td></tr></table>\n";
print "<table class=\"bottom\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr valign=\"top\">\n";
print "<td width=\"49%\" class=\"bottom\"><div align=\"center\"><br /><b>" . TBVERSION . (BETA ? BETA_NOTICE : "") . "<br />" . sprintf($tracker_lang["page_generated"], $seconds, $queries, $percentphp, $percentsql) . "</b></div></td>\n";
print "</tr></table>\n";
print "</body></html>\n";
Exemple #14
0
<?
// LTC WALLET
session_start();
include("functions.php");
$start = timer();

include("config.php");
include("bitcoin.inc");
include("address.inc");
include("recaptchalib.inc");
include ("adscaptchalib.inc");

//captha
$publickey = "6LfYSssSAAAAAF2w_TeMklmv-6VWUDhcECr9rWfI";
$privatekey = "6LfYSssSAAAAAPntQz9H0twbsdyk8kQHO_F4mupD";

// init

#$btclient = new bitcoinClient("http",$btclogin["username"],$btclogin["password"],$btclogin["host"],$btclogin["port"]);
#$addr = new Address($btclient,$sqlogin);
#$derp = $btclient->getinfo();
//Wallet by microwallet
$microwallet = new Microwallet('YOUR_API_KEY_HERE');


//$this->PDO_Conn = new PDO("mysql:host={$sqllogin['host']};dbname={$sqllogin['dbname']}", $sqllogin['username'], $sqllogin['password']);
$dbconn = mysql_connect($sqlogin['host'],$sqlogin['username'],$sqlogin['password']);
mysql_select_db($sqlogin['dbname']);

// time for pages ..
Exemple #15
0
             echo '<img style="margin: 0 0 -3px 0;border: 0px;" src="../files/blogs/anime_icon_' . $row['id'] . '.jpg" alt="" width="32" height="32"/>&#160;';
             echo '</td><td>';
             echo '<a href="../blogs/index.php?act=view&amp;id=' . $row['id'] . '">' . htmlentities($row['name'], ENT_QUOTES, 'UTF-8') . '</a> <br />(' . date('d.m.o / H:i', $row['time'] + $sdvigclock * 3600) . ')<br />';
             echo '</td></tr></table>';
         } else {
             echo '<a href="../blogs/index.php?act=view&amp;id=' . $row['id'] . '">' . htmlentities($row['name'], ENT_QUOTES, 'UTF-8') . '</a> (' . date('d.m.o / H:i', $row['time'] + $sdvigclock * 3600) . ')<br />';
         }
         echo '<div class="sub"></div>';
         $text = $row['text'];
         if (mb_strlen($text) > 100) {
             $str = mb_substr($text, 0, 100);
             $text = mb_substr($str, 0, mb_strrpos($str, ' ')) . '...';
         }
         echo functions::checkout($text, 2, 1);
         if ($row['time'] > time()) {
             echo '<div class="sub func">Waktu tersisa untuk disembunyikan: ' . timer($row['time'] - time()) . '</div>';
         }
         echo '</div>
 <div class="bmenu"><a href="manage.php?act=newsedit&amp;id=' . $row['id'] . '">Edit Blogs</a> | <a href="manage.php?act=delnews&amp;id=' . $row['id'] . '">Delete</a></div>';
         ++$i;
     }
     echo '<div class="phdr">Total Blogs: ' . $total . '</div>';
     if ($total > $kmess) {
         echo '<p>' . functions::display_pagination('index.php?act=animes&amp;mod=list&amp;', $start, $total, $kmess) . '</p>';
         echo '<p><form action="index.php" method="get">
 <input type="hidden" name="act" value="mod_news"/>
 <input type="hidden" name="mod" value="list"/>
 <input type="text" name="page" size="2"/>
 <input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/></form></p>';
     }
 } else {
                echo form_button('preview', $locale['articles_0240'], $locale['articles_0240'], array('class' => 'btn-default m-r-10'));
                echo form_button('publish', $locale['articles_0242'], $locale['articles_0242'], array('class' => 'btn-primary m-r-10'));
                echo form_button('delete', $locale['articles_0243'], $locale['articles_0243'], array('class' => 'btn-warning m-r-10'));
                echo closeform();
            }
        }
    }
} else {
    $result = dbquery("SELECT\n\t\t\tts.submit_id, ts.submit_datestamp, ts.submit_criteria, tu.user_id, tu.user_name, tu.user_avatar, tu.user_status\n\t\t\tFROM " . DB_SUBMISSIONS . " ts\n\t\t\tLEFT JOIN " . DB_USERS . " tu ON ts.submit_user=tu.user_id\n\t\t\tWHERE submit_type='a' order by submit_datestamp desc\n\t\t\t");
    $rows = dbrows($result);
    if ($rows > 0) {
        echo "<div class='well'>" . sprintf($locale['articles_0044'], format_word($rows, $locale['fmt_submission'])) . "</div>\n";
        echo "<table class='table table-striped'>\n";
        echo "<tr>\n";
        echo "<th>" . $locale['articles_0041'] . "</th>\n<th>" . $locale['articles_0046'] . "</th><th>" . $locale['articles_0047'] . "</th><th>" . $locale['articles_0048'] . "</th>";
        echo "</tr>\n";
        echo "<tbody>\n";
        while ($data = dbarray($result)) {
            $submit_criteria = unserialize($data['submit_criteria']);
            echo "<tr>\n";
            echo "<td><a href='" . clean_request("submit_id=" . $data['submit_id'], array("section", "aid"), TRUE) . "'>" . $submit_criteria['article_subject'] . "</a></td>\n";
            echo "<td>" . profile_link($data['user_id'], $data['user_name'], $data['user_status']) . "</td>\n";
            echo "<td>" . timer($data['submit_datestamp']) . "</td>\n";
            echo "<td>" . $data['submit_id'] . "</td>\n";
            echo "</tr>\n";
        }
        echo "</tbody>\n</table>\n";
    } else {
        echo "<div class='well text-center m-t-20'>" . $locale['articles_0042'] . "</div>\n";
    }
}
Exemple #17
0
function render_dashboard()
{
    global $members, $forum, $download, $news, $articles, $weblinks, $photos, $global_comments, $global_ratings, $global_submissions, $link_type, $submit_type, $comments_type, $locale, $aidlink, $settings, $infusions_count;
    $mobile = '12';
    $tablet = '12';
    $laptop = '6';
    $desktop = '3';
    opentable($locale['250']);
    echo "<!--Start Members-->\n";
    echo "<div class='row'>\n";
    echo "<div class='col-xs-{$mobile} col-sm-{$tablet} col-md-{$laptop} col-lg-{$desktop}'>\n";
    openside();
    echo "<img class='pull-left m-r-10 dashboard-icon' src='" . get_image("ac_M") . "'/>\n";
    echo "<h4 class='text-right m-t-0 m-b-0'>\n" . number_format($members['registered']) . "</h4>";
    echo "<span class='m-t-10 text-uppercase text-lighter text-smaller pull-right'><strong>" . $locale['251'] . "</strong></span>\n";
    closeside("" . (checkrights("M") ? "<div class='text-right text-uppercase'>\n<a class='text-smaller' href='" . ADMIN . "members.php" . $aidlink . "'>" . $locale['255'] . "</a><i class='entypo right-open-mini'></i></div>\n" : '') . "");
    echo "</div>\n<div class='col-xs-{$mobile} col-sm-{$tablet} col-md-{$laptop} col-lg-{$desktop}'>\n";
    openside();
    echo "<img class='pull-left m-r-10 dashboard-icon' src='" . get_image("ac_M") . "'/>\n";
    echo "<h4 class='text-right m-t-0 m-b-0'>\n" . number_format($members['cancelled']) . "</h4>";
    echo "<span class='m-t-10 text-uppercase text-lighter text-smaller pull-right'><strong>" . $locale['263'] . "</strong></span>\n";
    closeside("" . (checkrights("M") ? "<div class='text-right text-uppercase'>\n<a class='text-smaller' href='" . ADMIN . "members.php" . $aidlink . "&amp;status=5'>" . $locale['255'] . "</a> <i class='entypo right-open-mini'></i></div>\n" : '') . "");
    echo "</div>\n<div class='col-xs-{$mobile} col-sm-{$tablet} col-md-{$laptop} col-lg-{$desktop}'>\n";
    openside();
    echo "<img class='pull-left m-r-10 dashboard-icon' src='" . get_image("ac_M") . "'/>\n";
    echo "<h4 class='text-right m-t-0 m-b-0'>\n" . number_format($members['unactivated']) . "</h4>";
    echo "<span class='m-t-10 text-uppercase text-lighter text-smaller pull-right'><strong>" . $locale['252'] . "</strong></span>\n";
    closeside("" . (checkrights("M") ? "<div class='text-right text-uppercase'>\n<a class='text-smaller' href='" . ADMIN . "members.php" . $aidlink . "&amp;status=2'>" . $locale['255'] . "</a> <i class='entypo right-open-mini'></i></div>\n" : '') . "");
    echo "</div>\n<div class='col-xs-{$mobile} col-sm-{$tablet} col-md-{$laptop} col-lg-{$desktop}'>\n";
    openside();
    echo "<img class='pull-left m-r-10 dashboard-icon' src='" . get_image("ac_M") . "'/>\n";
    echo "<h4 class='text-right m-t-0 m-b-0'>\n" . number_format($members['security_ban']) . "</h4>";
    echo "<span class='m-t-10 text-uppercase text-lighter text-smaller pull-right'><strong>" . $locale['253'] . "</strong></span>\n";
    closeside("" . (checkrights("M") ? "<div class='text-right text-uppercase'><a class='text-smaller' href='" . ADMIN . "members.php" . $aidlink . "&amp;status=4'>" . $locale['255'] . "</a> <i class='entypo right-open-mini'></i></div>\n" : '') . "");
    echo "</div>\n</div>\n";
    echo "<!--End Members-->\n";
    $mobile = '12';
    $tablet = '12';
    $laptop = '6';
    $desktop = '4';
    echo "<div class='row'>\n";
    if (db_exists(DB_FORUMS)) {
        echo "<div class='col-xs-{$mobile} col-sm-{$tablet} col-md-{$laptop} col-lg-{$desktop}'>\n";
        openside("", "well");
        echo "<span class='text-smaller text-uppercase'><strong>" . $locale['265'] . " " . $locale['258'] . "</strong></span>\n<br/>\n";
        echo "<div class='clearfix m-t-10'>\n";
        echo "<img class='img-responsive pull-right dashboard-icon' src='" . get_image("ac_F") . "'/>\n";
        echo "<div class='pull-left display-inline-block m-r-10'>\n";
        echo "<span class='text-smaller'>" . $locale['265'] . "</span>\n<br/>\n";
        echo "<h4 class='m-t-0'>" . number_format($forum['count']) . "</h4>\n";
        echo "</div>\n";
        echo "<div class='pull-left display-inline-block m-r-10'>\n";
        echo "<span class='text-smaller'>" . $locale['256'] . "</span>\n<br/>\n";
        echo "<h4 class='m-t-0'>" . number_format($forum['thread']) . "</h4>\n";
        echo "</div>\n";
        echo "<div class='pull-left display-inline-block m-r-10'>\n";
        echo "<span class='text-smaller'>" . $locale['259'] . "</span>\n<br/>\n";
        echo "<h4 class='m-t-0'>" . number_format($forum['post']) . "</h4>\n";
        echo "</div>\n";
        echo "<div class='pull-left display-inline-block m-r-10'>\n";
        echo "<span class='text-smaller'>" . $locale['260'] . "</span>\n<br/>\n";
        echo "<h4 class='m-t-0'>" . $forum['users'] . "</h4>\n";
        echo "</div>\n";
        echo "</div>\n";
        closeside();
        echo "</div>\n";
    }
    if (db_exists(DB_DOWNLOADS)) {
        echo "<div class='col-xs-{$mobile} col-sm-{$tablet} col-md-{$laptop} col-lg-{$desktop}'>\n";
        openside("", "well");
        echo "<span class='text-smaller text-uppercase'><strong>" . $locale['268'] . " " . $locale['258'] . "</strong></span>\n<br/>\n";
        echo "<div class='clearfix m-t-10'>\n";
        echo "<img class='img-responsive pull-right dashboard-icon' src='" . get_image("ac_D") . "'/>\n";
        echo "<div class='pull-left display-inline-block m-r-10'>\n";
        echo "<span class='text-smaller'>" . $locale['268'] . "</span>\n<br/>\n";
        echo "<h4 class='m-t-0'>" . number_format($download['download']) . "</h4>\n";
        echo "</div>\n";
        echo "<div class='pull-left display-inline-block m-r-10'>\n";
        echo "<span class='text-smaller'>" . $locale['257'] . "</span>\n<br/>\n";
        echo "<h4 class='m-t-0'>" . number_format($download['comment']) . "</h4>\n";
        echo "</div>\n";
        echo "<div class='pull-left display-inline-block m-r-10'>\n";
        echo "<span class='text-smaller'>" . $locale['254'] . "</span>\n<br/>\n";
        echo "<h4 class='m-t-0'>" . number_format($download['submit']) . "</h4>\n";
        echo "</div>\n";
        echo "</div>\n";
        closeside();
        echo "</div>\n";
    }
    if (db_exists(DB_NEWS)) {
        echo "<div class='col-xs-{$mobile} col-sm-{$tablet} col-md-{$laptop} col-lg-{$desktop}'>\n";
        openside("", "well");
        echo "<span class='text-smaller text-uppercase'><strong>" . $locale['269'] . " " . $locale['258'] . "</strong></span>\n<br/>\n";
        echo "<div class='clearfix m-t-10'>\n";
        echo "<img class='img-responsive pull-right dashboard-icon' src='" . get_image("ac_N") . "'/>\n";
        echo "<div class='pull-left display-inline-block m-r-10'>\n";
        echo "<span class='text-smaller'>" . $locale['269'] . "</span>\n<br/>\n";
        echo "<h4 class='m-t-0'>" . number_format($news['news']) . "</h4>\n";
        echo "</div>\n";
        echo "<div class='pull-left display-inline-block m-r-10'>\n";
        echo "<span class='text-smaller'>" . $locale['257'] . "</span>\n<br/>\n";
        echo "<h4 class='m-t-0'>" . number_format($news['comment']) . "</h4>\n";
        echo "</div>\n";
        echo "<div class='pull-left display-inline-block m-r-10'>\n";
        echo "<span class='text-smaller'>" . $locale['254'] . "</span>\n<br/>\n";
        echo "<h4 class='m-t-0'>" . number_format($news['submit']) . "</h4>\n";
        echo "</div>\n";
        echo "</div>\n";
        closeside();
        echo "</div>\n";
    }
    if (db_exists(DB_ARTICLES)) {
        echo "<div class='col-xs-{$mobile} col-sm-{$tablet} col-md-{$laptop} col-lg-{$desktop}'>\n";
        openside("", "well");
        echo "<span class='text-smaller text-uppercase'><strong>" . $locale['270'] . " " . $locale['258'] . "</strong></span>\n<br/>\n";
        echo "<div class='clearfix m-t-10'>\n";
        echo "<img class='img-responsive pull-right dashboard-icon' src='" . get_image("ac_A") . "'/>\n";
        echo "<div class='pull-left display-inline-block m-r-10'>\n";
        echo "<span class='text-smaller'>" . $locale['270'] . "</span>\n<br/>\n";
        echo "<h4 class='m-t-0'>" . number_format($articles['article']) . "</h4>\n";
        echo "</div>\n";
        echo "<div class='pull-left display-inline-block m-r-10'>\n";
        echo "<span class='text-smaller'>" . $locale['257'] . "</span>\n<br/>\n";
        echo "<h4 class='m-t-0'>" . number_format($articles['comment']) . "</h4>\n";
        echo "</div>\n";
        echo "<div class='pull-left display-inline-block m-r-10'>\n";
        echo "<span class='text-smaller'>" . $locale['254'] . "</span>\n<br/>\n";
        echo "<h4 class='m-t-0'>" . number_format($articles['submit']) . "</h4>\n";
        echo "</div>\n";
        echo "</div>\n";
        closeside();
        echo "</div>\n";
    }
    if (db_exists(DB_WEBLINKS)) {
        echo "<div class='col-xs-{$mobile} col-sm-{$tablet} col-md-{$laptop} col-lg-{$desktop}'>\n";
        openside("", "well");
        echo "<span class='text-smaller text-uppercase'><strong>" . $locale['271'] . " " . $locale['258'] . "</strong></span>\n<br/>\n";
        echo "<div class='clearfix m-t-10'>\n";
        echo "<img class='img-responsive pull-right dashboard-icon' src='" . get_image("ac_W") . "'/>\n";
        echo "<div class='pull-left display-inline-block m-r-10'>\n";
        echo "<span class='text-smaller'>" . $locale['271'] . "</span>\n<br/>\n";
        echo "<h4 class='m-t-0'>" . number_format($weblinks['weblink']) . "</h4>\n";
        echo "</div>\n";
        echo "<div class='pull-left display-inline-block m-r-10'>\n";
        echo "<span class='text-smaller'>" . $locale['257'] . "</span>\n<br/>\n";
        echo "<h4 class='m-t-0'>" . number_format($weblinks['comment']) . "</h4>\n";
        echo "</div>\n";
        echo "<div class='pull-left display-inline-block m-r-10'>\n";
        echo "<span class='text-smaller'>" . $locale['254'] . "</span>\n<br/>\n";
        echo "<h4 class='m-t-0'>" . number_format($weblinks['submit']) . "</h4>\n";
        echo "</div>\n";
        echo "</div>\n";
        closeside();
        echo "</div>";
    }
    if (db_exists(DB_PHOTOS)) {
        echo "<div class='col-xs-{$mobile} col-sm-{$tablet} col-md-{$laptop} col-lg-{$desktop}'>\n";
        openside("", "well");
        echo "<span class='text-smaller text-uppercase'><strong>" . $locale['272'] . " " . $locale['258'] . "</strong></span>\n<br/>\n";
        echo "<div class='clearfix m-t-10'>\n";
        echo "<img class='img-responsive pull-right dashboard-icon' src='" . get_image("ac_PH") . "'/>\n";
        echo "<div class='pull-left display-inline-block m-r-10'>\n";
        echo "<span class='text-smaller'>" . $locale['272'] . "</span>\n<br/>\n";
        echo "<h4 class='m-t-0'>" . number_format($photos['photo']) . "</h4>\n";
        echo "</div>\n";
        echo "<div class='pull-left display-inline-block m-r-10'>\n";
        echo "<span class='text-smaller'>" . $locale['257'] . "</span>\n<br/>\n";
        echo "<h4 class='m-t-0'>" . number_format($photos['comment']) . "</h4>\n";
        echo "</div>\n";
        echo "<div class='pull-left display-inline-block m-r-10'>\n";
        echo "<span class='text-smaller'>" . $locale['254'] . "</span>\n<br/>\n";
        echo "<h4 class='m-t-0'>" . number_format($photos['submit']) . "</h4>\n";
        echo "</div>\n";
        echo "</div>\n";
        closeside();
        echo "</div>\n";
    }
    echo "</div>\n";
    echo "<div class='row'>\n";
    echo "<div class='col-xs-12 co-sm-6 col-md-6 col-lg-3'>\n";
    openside("<span class='text-smaller text-uppercase'><strong>" . $locale['283'] . "</strong></span><span class='pull-right badge'>" . number_format($infusions_count) . "</span>");
    if ($infusions_count > 0) {
        global $global_infusions;
        echo "<div class='comment_content'>\n";
        if (!empty($global_infusions)) {
            foreach ($global_infusions as $inf_id => $inf_data) {
                echo "<span class='badge m-b-10'>" . $inf_data['inf_title'] . "</span>\n";
            }
        }
        echo "</div>\n";
        closeside("" . (checkrights("I") ? "<div class='text-right text-uppercase'>\n<a class='text-smaller' href='" . ADMIN . "infusions.php" . $aidlink . "'>" . $locale['285'] . "</a><i class='entypo right-open-mini'></i></div>\n" : '') . "");
    } else {
        echo "<div class='text-center'>" . $locale['284'] . "</div>\n";
        closeside();
    }
    // comments
    echo "</div>\n<div class='col-xs-12 co-sm-6 col-md-6 col-lg-3'>\n";
    openside("<span class='text-smaller text-uppercase'><strong>" . $locale['277'] . "</strong></span><span class='pull-right badge'>" . number_format($global_comments['rows']) . "</span>");
    if (count($global_comments['data']) > 0) {
        foreach ($global_comments['data'] as $i => $comment_data) {
            echo "<!--Start Comment Item-->\n";
            echo "<div data-id='{$i}' class='comment_content clearfix p-t-10 p-b-10' " . ($i > 0 ? "style='border-top:1px solid #ddd;'" : '') . " >\n";
            echo "<div class='pull-left display-inline-block' style='margin-top:0px; margin-bottom:10px;'>" . display_avatar($comment_data, "25px", "", FALSE, "", "") . "</div>\n";
            echo "<div id='comment_action-{$i}' class='btn-group pull-right display-none' style='position:absolute; right: 30px; margin-top:25px;'>\n\n\t\t\t\t<a class='btn btn-xs btn-default' title='" . $locale['274'] . "' href='" . ADMIN . "comments.php" . $aidlink . "&amp;ctype=" . $comment_data['comment_type'] . "&amp;comment_item_id=" . $comment_data['comment_item_id'] . "'><i class='entypo eye'></i></a>\n\t\t\t\t<a class='btn btn-xs btn-default' title='" . $locale['275'] . "' href='" . ADMIN . "comments.php" . $aidlink . "&amp;action=edit&amp;comment_id=" . $comment_data['comment_id'] . "&amp;ctype=" . $comment_data['comment_type'] . "&amp;comment_item_id=" . $comment_data['comment_item_id'] . "'><i class='entypo pencil'></i></a>\n\t\t\t\t<a class='btn btn-xs btn-default' title='" . $locale['276'] . "' href='" . ADMIN . "comments.php" . $aidlink . "&amp;action=delete&amp;comment_id=" . $comment_data['comment_id'] . "&amp;ctype=" . $comment_data['comment_type'] . "&amp;comment_item_id=" . $comment_data['comment_item_id'] . "'><i class='entypo trash'></i></a></div>\n";
            echo "<strong>" . profile_link($comment_data['user_id'], $comment_data['user_name'], $comment_data['user_status']) . "</strong>\n";
            echo "<span class='text-lighter'>" . $locale['273'] . "</span> <a href='" . sprintf($link_type[$comment_data['comment_type']], $comment_data['comment_item_id']) . "'><strong>" . $comments_type[$comment_data['comment_type']] . "</strong></a>";
            echo "<br/>\n" . timer($comment_data['comment_datestamp']) . "<br/>\n";
            echo "<span class='text-smaller text-lighter'>" . trimlink(parseubb($comment_data['comment_message']), 70) . "</span>\n";
            echo "</div>\n";
            echo "<!--End Comment Item-->\n";
        }
        if (isset($global_comments['comments_nav'])) {
            echo "<div class='clearfix'>\n";
            echo "<span class='pull-right text-smaller'>" . $global_comments['comments_nav'] . "</span>";
            echo "</div>\n";
        }
    } else {
        echo "<div class='text-center'>" . $global_comments['nodata'] . "</div>\n";
    }
    closeside();
    echo "</div>\n<div class='col-xs-12 co-sm-6 col-md-6 col-lg-3'>\n";
    // Ratings
    openside("<span class='text-smaller text-uppercase'><strong>" . $locale['278'] . "</strong></span>");
    if (count($global_ratings['data']) > 0) {
        foreach ($global_ratings['data'] as $i => $ratings_data) {
            echo "<!--Start Rating Item-->\n";
            echo "<div class='comment_content clearfix p-t-10 p-b-10' " . ($i > 0 ? "style='border-top:1px solid #ddd;'" : '') . " >\n";
            echo "<div class='pull-left display-inline-block' style='margin-top:0px; margin-bottom:10px;'>" . display_avatar($ratings_data, "25px", "", FALSE, "", "") . "</div>\n";
            echo "<strong>" . profile_link($ratings_data['user_id'], $ratings_data['user_name'], $ratings_data['user_status']) . "</strong>\n";
            echo "<span class='text-lighter'>" . $locale['273a'] . "</span>\n";
            echo "<a href='" . sprintf($link_type[$ratings_data['rating_type']], $ratings_data['rating_item_id']) . "'><strong>" . $comments_type[$ratings_data['rating_type']] . "</strong></a>";
            echo "<span class='text-lighter m-l-10'>" . str_repeat("<i class='fa fa-star fa-fw'></i>", $ratings_data['rating_vote']) . "</span>\n<br/>";
            echo timer($ratings_data['rating_datestamp']) . "<br/>\n";
            echo "</div>\n";
            echo "<!--End Rating Item-->\n";
        }
        if (isset($global_ratings['ratings_nav'])) {
            echo "<div class='clearfix'>\n";
            echo "<span class='pull-right text-smaller'>" . $global_ratings['ratings_nav'] . "</span>";
            echo "</div>\n";
        }
    } else {
        echo "<div class='text-center'>" . $global_ratings['nodata'] . "</div>\n";
    }
    closeside();
    echo "</div>\n<div class='col-xs-12 co-sm-6 col-md-6 col-lg-3'>\n";
    openside("<span class='text-smaller text-uppercase'><strong>" . $locale['279'] . "</strong></span><span class='pull-right badge'>" . number_format($global_submissions['rows']) . "</span>");
    if (count($global_submissions['data']) > 0) {
        foreach ($global_submissions['data'] as $i => $submit_data) {
            switch ($submit_data['submit_type']) {
                case "n":
                    $review_link = INFUSIONS . "news/news_admin.php" . $aidlink . "&amp;section=submissions&amp;submit_id=" . $submit_data['submit_id'];
                    break;
                case "a":
                    $review_link = INFUSIONS . "articles/articles_admin.php" . $aidlink . "&amp;section=submissions&amp;submit_id=" . $submit_data['submit_id'];
                    break;
                case "p":
                    $review_link = INFUSIONS . "gallery/gallery_admin.php" . $aidlink . "&amp;section=submissions&amp;submit_id=" . $submit_data['submit_id'];
                    break;
                case "b":
                    $review_link = INFUSIONS . "blog/blog_admin.php" . $aidlink . "&amp;section=submissions&amp;submit_id=" . $submit_data['submit_id'];
                    break;
                case "d":
                    $review_link = INFUSIONS . "downloads/downloads_admin.php" . $aidlink . "&amp;section=submissions&amp;submit_id=" . $submit_data['submit_id'];
                    break;
                case "l":
                    $review_link = INFUSIONS . "weblinks/weblinks_admin.php" . $aidlink . "&amp;section=submissions&amp;submit_id=" . $submit_data['submit_id'];
                    break;
                default:
                    // @todo: add admin class API to use infusion_db.php to register submission link
                    $review_link = "";
            }
            echo "<!--Start Submissions Item-->\n";
            echo "<div data-id='{$i}' class='submission_content clearfix p-t-10 p-b-10' " . ($i > 0 ? "style='border-top:1px solid #ddd;'" : '') . " >\n";
            echo "<div class='pull-left display-inline-block' style='margin-top:0px; margin-bottom:10px;'>" . display_avatar($submit_data, "25px", "", FALSE, "", "") . "</div>\n";
            echo "<strong>" . profile_link($submit_data['user_id'], $submit_data['user_name'], $submit_data['user_status']) . "</strong>\n";
            echo "<span class='text-lighter'>" . $locale['273b'] . " <strong>" . $submit_type[$submit_data['submit_type']] . "</strong></span><br/>\n";
            echo timer($submit_data['submit_datestamp']) . "<br/>\n";
            if (!empty($review_link)) {
                echo "<a class='btn btn-xs btn-default m-t-5' title='" . $locale['286'] . "' href='" . $review_link . "'>" . $locale['286'] . "</a>\n";
            }
            echo "</div>\n";
            echo "<!--End Submissions Item-->\n";
        }
        if (isset($global_submissions['submissions_nav'])) {
            echo "<div class='clearfix'>\n";
            echo "<span class='pull-right text-smaller'>" . $global_submissions['submissions_nav'] . "</span>";
            echo "</div>\n";
        }
    } else {
        echo "<div class='text-center'>" . $global_submissions['nodata'] . "</div>\n";
    }
    closeside();
    echo "</div>\n";
    closetable();
    add_to_jquery("\n\t\$('.comment_content').hover(function() {\n\t\$('#comment_action-'+\$(this).data('id')).removeClass('display-none');\n\t},function(){\n\t\$('#comment_action-'+\$(this).data('id')).addClass('display-none');\n\t});\n\t\$('.submission_content').hover(function() {\n\t\$('#submission_action-'+\$(this).data('id')).removeClass('display-none');\n\t},function(){\n\t\$('#submission_action-'+\$(this).data('id')).addClass('display-none');\n\t});\n\t");
}
Exemple #18
0
 function render_thread_item($data)
 {
     global $locale, $info, $userdata;
     echo "<div class='thread-item' id='thread_" . $data['thread_id'] . "'>\n";
     echo "<div class='row m-0'>\n";
     echo "<div class='col-xs-12 col-sm-9 col-md-6 p-l-0'>\n";
     echo "<div class='pull-left m-r-10 m-t-5'>\n" . $data['thread_last']['avatar'] . "</div>\n";
     $thead_icons = '';
     foreach ($data['thread_icons'] as $icon) {
         $thead_icons .= $icon;
     }
     echo "<div class='overflow-hide'>\n";
     echo "<a class='forum-link' href='" . $data['thread_link']['link'] . "'>" . $data['thread_link']['title'] . "</a>\n<span class='m-l-10 m-r-10 text-lighter'>" . $thead_icons . "</span>\n";
     echo "<div class='text-smaller'>" . $data['thread_starter'] . "</div>\n";
     echo $data['thread_pages'];
     echo isset($data['track_button']) ? "<div class='forum_track'><a onclick=\"return confirm('" . $locale['global_060'] . "');\" href='" . $data['track_button']['link'] . "'>" . $data['track_button']['name'] . "</a>\n</div>\n" : '';
     echo "</div>\n";
     echo "</div>\n";
     // end grid
     echo "<div class='hidden-xs col-sm-3 col-md-3 p-l-0 p-r-0 text-center'>\n";
     echo "<div class='display-inline-block forum-stats p-5 m-r-5 m-b-0'>\n";
     echo "<h4 class='text-bigger strong text-dark m-0'>" . number_format($data['thread_views']) . "</h4>\n";
     echo "<span>" . format_word($data['thread_views'], $locale['fmt_views'], 0) . "</span>";
     echo "</div>\n";
     echo "<div class='display-inline-block forum-stats p-5 m-r-5 m-b-0'>\n";
     echo "<h4 class='text-bigger strong text-dark m-0'>" . number_format($data['thread_postcount']) . "</h4>\n";
     echo "<span>" . format_word($data['thread_postcount'], $locale['fmt_post'], 0) . "</span>";
     echo "</div>\n";
     if ($data['forum_type'] == '4') {
         echo "<div class='display-inline-block forum-stats p-5 m-r-5 m-b-0'>\n";
         echo "<h4 class='text-bigger strong text-dark m-0'>" . number_format($data['vote_count']) . "</h4>\n";
         echo "<span>" . format_word($data['vote_count'], $locale['fmt_vote'], 0) . "</span>";
         echo "</div>\n";
     }
     echo "</div>\n";
     // end grid
     echo "<div class='forum-lastuser hidden-xs hidden-sm col-md-3'>\n\t\t\t" . $data['thread_last']['profile_link'] . " " . timer($data['thread_last']['time']) . "<br/>\n\t\t\t" . fusion_first_words(strip_tags($data['thread_last']['post_message']), 10) . "\n\t\t</div>\n";
     echo "</div>\n";
     echo "</div>\n";
 }
Exemple #19
0
 /**
  * Get thread posts info
  */
 private function get_thread_post()
 {
     global $forum_settings, $locale, $userdata;
     $user_sig_module = \PHPFusion\UserFields::check_user_field('user_sig');
     $user_web_module = \PHPFusion\UserFields::check_user_field('user_web');
     $userid = isset($userdata['user_id']) ? (int) $userdata['user_id'] : 0;
     switch ($this->thread_info['section']) {
         case 'oldest':
             $sortCol = 'post_datestamp ASC';
             break;
         case 'latest':
             $sortCol = 'post_datestamp DESC';
             break;
         case 'high':
             $sortCol = 'vote_points DESC';
             break;
         default:
             $sortCol = 'post_datestamp ASC';
     }
     // @todo: where to calculate has voted without doing it in while loop?
     require_once INCLUDES . "mimetypes_include.php";
     $result = dbquery("\n\t\t\t\t\tSELECT p.*,\n\t\t\t\t\tt.thread_id,\n\t\t\t\t\tu.user_id, u.user_name, u.user_status, u.user_avatar, u.user_level, u.user_posts, u.user_groups, u.user_joined, u.user_lastvisit, u.user_ip,\n\t\t\t\t\t" . ($user_sig_module ? " u.user_sig," : "") . ($user_web_module ? " u.user_web," : "") . "\n\t\t\t\t\tu2.user_name AS edit_name, u2.user_status AS edit_status,\n\t\t\t\t\tcount(a1.attach_id) 'attach_image_count',\n\t\t\t\t\tcount(a2.attach_id) 'attach_files_count',\n\t\t\t\t\tSUM(v.vote_points) as vote_points, count(v2.thread_id) as has_voted\n\t\t\t\t\tFROM " . DB_FORUM_POSTS . " p\n\t\t\t\t\tINNER JOIN " . DB_FORUM_THREADS . " t ON t.thread_id = p.thread_id\n\t\t\t\t\tLEFT JOIN " . DB_FORUM_VOTES . " v ON v.post_id = p.post_id\n\t\t\t\t\tLEFT JOIN " . DB_FORUM_VOTES . " v2 on v2.thread_id = p.thread_id AND v2.vote_user = '******'\n\t\t\t\t\tLEFT JOIN " . DB_USERS . " u ON p.post_author = u.user_id\n\t\t\t\t\tLEFT JOIN " . DB_USERS . " u2 ON p.post_edituser = u2.user_id AND post_edituser > '0'\n\t\t\t\t\tLEFT JOIN " . DB_FORUM_ATTACHMENTS . " a1 on a1.post_id = p.post_id AND a1.attach_mime IN ('" . implode(",", img_mimeTypes()) . "')\n\t\t\t\t\tLEFT JOIN " . DB_FORUM_ATTACHMENTS . " a2 on a2.post_id = p.post_id AND a2.attach_mime NOT IN ('" . implode(",", img_mimeTypes()) . "')\n\t\t\t\t\tWHERE p.thread_id='" . intval($_GET['thread_id']) . "' AND post_hidden='0'\n\t\t\t\t\t" . ($this->thread_info['thread']['forum_type'] == '4' ? "OR p.post_id='" . intval($this->thread_info['post_firstpost']) . "'" : '') . "\n\t\t\t\t\tGROUP by p.post_id\n\t\t\t\t\tORDER BY {$sortCol} LIMIT " . intval($_GET['rowstart']) . ", " . intval($forum_settings['posts_per_page']));
     $this->thread_info['post_rows'] = dbrows($result);
     if ($this->thread_info['post_rows'] > 0) {
         /* Set Threads Navigation */
         $this->thread_info['thread_posts'] = format_word($this->thread_info['post_rows'], $locale['fmt_post']);
         $this->thread_info['page_nav'] = '';
         if ($this->thread_info['max_post_items'] > $this->thread_info['posts_per_page']) {
             $this->thread_info['page_nav'] = "<div class='pull-right'>" . makepagenav($_GET['rowstart'], $this->thread_info['posts_per_page'], $this->thread_info['max_post_items'], 3, INFUSIONS . "forum/viewthread.php?thread_id=" . $this->thread_info['thread']['thread_id'] . (isset($_GET['highlight']) ? "&amp;highlight=" . urlencode($_GET['highlight']) : '') . "&amp;") . "</div>";
         }
         $i = 1;
         while ($pdata = dbarray($result)) {
             // Format Post Message
             $post_message = $pdata['post_smileys'] ? parsesmileys($pdata['post_message']) : $pdata['post_message'];
             $post_message = nl2br(parseubb($post_message));
             if (isset($_GET['highlight'])) {
                 $post_message = "<div class='search_result'>" . $post_message . "</div>\n";
             }
             // Marker
             $marker = array('link' => "#post_" . $pdata['post_id'], "title" => "#" . ($i + $_GET['rowstart']), 'id' => "post_" . $pdata['post_id']);
             $post_marker = "<a class='marker' href='" . $marker['link'] . "' id='" . $marker['id'] . "'>" . $marker['title'] . "</a>";
             $post_marker .= "<a title='" . $locale['forum_0241'] . "' href='#top'><i class='entypo up-open'></i></a>\n";
             // Post Attachments
             $post_attachments = "";
             if ($pdata['attach_files_count'] || $pdata['attach_image_count']) {
                 if ($this->getThreadPermission("can_download_attach")) {
                     $attachResult = dbquery("SELECT * FROM " . DB_FORUM_ATTACHMENTS . " WHERE post_id='" . intval($pdata['post_id']) . "'");
                     if (dbrows($attachResult) > 0) {
                         $aImage = "";
                         $aFiles = "";
                         while ($attachData = dbarray($attachResult)) {
                             if (in_array($attachData['attach_mime'], img_mimeTypes())) {
                                 $aImage .= display_image_attach($attachData['attach_name'], "50", "50", $pdata['post_id']) . "\n";
                             } else {
                                 $aFiles .= "<div class='display-inline-block'><i class='entypo attach'></i><a href='" . FUSION_SELF . "?thread_id=" . $pdata['thread_id'] . "&amp;getfile=" . $attachData['attach_id'] . "'>" . $attachData['attach_name'] . "</a>&nbsp;";
                                 $aFiles .= "[<span class='small'>" . parsebytesize(filesize(INFUSIONS . "forum/attachments/" . $attachData['attach_name'])) . " / " . $attachData['attach_count'] . $locale['forum_0162'] . "</span>]</div>\n";
                             }
                         }
                         if (!empty($aFiles)) {
                             $post_attachments .= "<div class='emulated-fieldset'>\n";
                             $post_attachments .= "<span class='emulated-legend'>" . profile_link($pdata['user_id'], $pdata['user_name'], $pdata['user_status']) . $locale['forum_0154'] . ($pdata['attach_files_count'] > 1 ? $locale['forum_0158'] : $locale['forum_0157']) . "</span>\n";
                             $post_attachments .= "<div class='attachments-list m-t-10'>" . $aFiles . "</div>\n";
                             $post_attachments .= "</div>\n";
                         }
                         if (!empty($aImage)) {
                             $post_attachments .= "<div class='emulated-fieldset'>\n";
                             $post_attachments .= "<span class='emulated-legend'>" . profile_link($pdata['user_id'], $pdata['user_name'], $pdata['user_status']) . $locale['forum_0154'] . ($pdata['attach_image_count'] > 1 ? $locale['forum_0156'] : $locale['forum_0155']) . "</span>\n";
                             $post_attachments .= "<div class='attachments-list'>" . $aImage . "</div>\n";
                             $post_attachments .= "</div>\n";
                             if (!defined('COLORBOX')) {
                                 define('COLORBOX', TRUE);
                                 add_to_head("<link rel='stylesheet' href='" . INCLUDES . "jquery/colorbox/colorbox.css' type='text/css' media='screen' />");
                                 add_to_head("<script type='text/javascript' src='" . INCLUDES . "jquery/colorbox/jquery.colorbox.js'></script>");
                                 add_to_jquery("\$('a[rel^=\"attach\"]').colorbox({ current: '" . $locale['forum_0159'] . " {current} " . $locale['forum_0160'] . " {total}',width:'80%',height:'80%'});");
                             }
                         }
                     } else {
                         $post_attachments = "Failed to fetch the attachment";
                     }
                 } else {
                     $post_attachments = "<small><i class='fa fa-clipboard'></i> " . $locale['forum_0184'] . "</small>\n";
                 }
             }
             $pdata += array("user_online" => $pdata['user_lastvisit'] >= time() - 3600 ? TRUE : FALSE, "is_first_post" => $pdata['post_id'] == $this->thread_info['post_firstpost'] ? TRUE : FALSE, "is_last_post" => $pdata['post_id'] == $this->thread_info['post_lastpost'] ? TRUE : FALSE, "user_profile_link" => profile_link($pdata['user_id'], $pdata['user_name'], $pdata['user_status']), "user_avatar_image" => display_avatar($pdata, '40px', FALSE, FALSE, 'img-rounded'), "user_ip" => $forum_settings['forum_ips'] && iMOD ? $locale['forum_0268'] . ' ' . $pdata['post_ip'] : '', "user_post_count" => format_word($pdata['user_posts'], $locale['fmt_post']), "print" => array('link' => BASEDIR . "print.php?type=F&amp;item_id=" . $_GET['thread_id'] . "&amp;post=" . $pdata['post_id'] . "&amp;nr=" . ($i + $_GET['rowstart']), 'title' => $locale['forum_0179']), "post_marker" => $post_marker, "marker" => $marker, "post_attachments" => $post_attachments);
             $pdata['post_message'] = $post_message;
             /**
              * User Stuffs, Sig, User Message, Web
              */
             // Quote & Edit Link
             if ($this->getThreadPermission("can_reply")) {
                 if (!$this->thread_info['thread']['thread_locked']) {
                     $pdata['post_quote'] = array('link' => INFUSIONS . "forum/viewthread.php?action=reply&amp;forum_id=" . $pdata['forum_id'] . "&amp;thread_id=" . $pdata['thread_id'] . "&amp;post_id=" . $pdata['post_id'] . "&amp;quote=" . $pdata['post_id'], 'title' => $locale['forum_0266']);
                     if (iMOD || ($forum_settings['forum_edit_lock'] == TRUE && $pdata['is_last_post'] || $forum_settings['forum_edit_lock'] == FALSE) && $userdata['user_id'] == $pdata['post_author'] && ($forum_settings['forum_edit_timelimit'] <= 0 || time() - $forum_settings['forum_edit_timelimit'] * 60 < $pdata['post_datestamp'])) {
                         $pdata['post_edit'] = array('link' => INFUSIONS . "forum/viewthread.php?action=edit&amp;forum_id=" . $pdata['forum_id'] . "&amp;thread_id=" . $pdata['thread_id'] . "&amp;post_id=" . $pdata['post_id'], 'title' => $locale['forum_0265']);
                     }
                     $pdata['post_reply'] = array('link' => INFUSIONS . "forum/viewthread.php?action=reply&amp;forum_id=" . $pdata['forum_id'] . "&amp;thread_id=" . $pdata['thread_id'] . "&amp;post_id=" . $pdata['post_id'], 'title' => $locale['forum_0509']);
                 } elseif (iMOD) {
                     $pdata['post_edit'] = array('link' => INFUSIONS . "forum/viewthread.php?action=edit&amp;forum_id=" . $pdata['forum_id'] . "&amp;thread_id=" . $pdata['thread_id'] . "&amp;post_id=" . $pdata['post_id'], 'title' => $locale['forum_0265']);
                 }
             }
             // rank img
             if ($pdata['user_level'] <= USER_LEVEL_ADMIN) {
                 if ($forum_settings['forum_ranks']) {
                     $pdata['user_rank'] = show_forum_rank($pdata['user_posts'], $pdata['user_level'], $pdata['user_groups']);
                     // in fact now is get forum rank
                 } else {
                     $pdata['user_rank'] = getuserlevel($pdata['user_level']);
                 }
             } else {
                 if ($forum_settings['forum_ranks']) {
                     $pdata['user_rank'] = iMOD ? show_forum_rank($pdata['user_posts'], 104, $pdata['user_groups']) : show_forum_rank($pdata['user_posts'], $pdata['user_level'], $pdata['user_groups']);
                 } else {
                     $pdata['user_rank'] = iMOD ? $locale['userf1'] : getuserlevel($pdata['user_level']);
                 }
             }
             // Website
             if ($pdata['user_web'] && (iADMIN || $pdata['user_status'] != 6 && $pdata['user_status'] != 5)) {
                 $user_web_url_prefix = !preg_match("@^http(s)?\\:\\/\\/@i", $pdata['user_web']) ? "http://" . $pdata['user_web'] : $pdata['user_web'];
                 $pdata['user_web'] = array('link' => $user_web_url_prefix . $pdata['user_web'], 'title' => $locale['forum_0364']);
             } else {
                 $pdata['user_web'] = array('link' => '', 'title' => '');
             }
             // PM link
             $pdata['user_message'] = array('link' => '', 'title' => '');
             if (iMEMBER && $pdata['user_id'] != $userdata['user_id'] && (iADMIN || $pdata['user_status'] != 6 && $pdata['user_status'] != 5)) {
                 $pdata['user_message'] = array('link' => BASEDIR . 'messages.php?msg_send=' . $pdata['user_id'], "title" => $locale['send_message']);
             }
             // User Sig
             if ($pdata['user_sig'] && isset($pdata['post_showsig']) && $pdata['user_status'] != 6 && $pdata['user_status'] != 5) {
                 $pdata['user_sig'] = nl2br(parseubb(parsesmileys(stripslashes($pdata['user_sig'])), "b|i|u||center|small|url|mail|img|color"));
             } else {
                 $pdata['user_sig'] = "";
             }
             // Voting - need up or down link - accessible to author also the vote
             // answered and on going questions.
             // Answer rating
             $pdata['vote_message'] = '';
             //echo $data['forum_type'] == 4 ? "<br/>\n".(number_format($data['thread_postcount']-1)).$locale['forum_0365']."" : ''; // answers
             // form components
             $pdata['post_checkbox'] = iMOD ? "<input type='checkbox' name='delete_post[]' value='" . $pdata['post_id'] . "'/>" : '';
             $pdata['post_votebox'] = '';
             if ($this->thread_info['thread']['forum_type'] == 4) {
                 if ($this->getThreadPermission("can_rate")) {
                     // can vote.
                     $pdata['vote_up'] = array('link' => INFUSIONS . "forum/postify.php?post=voteup&amp;forum_id=" . $pdata['forum_id'] . "&amp;thread_id=" . $pdata['thread_id'] . "&amp;post_id=" . $pdata['post_id'], "title" => $locale['forum_0265']);
                     $pdata['vote_down'] = array('link' => INFUSIONS . "forum/postify.php?post=votedown&amp;forum_id=" . $pdata['forum_id'] . "&amp;thread_id=" . $pdata['thread_id'] . "&amp;post_id=" . $pdata['post_id'], "title" => $locale['forum_0265']);
                     $pdata['post_votebox'] = "<div class='text-center'>\n";
                     $pdata['post_votebox'] .= "<a href='" . $pdata['vote_up']['link'] . "' class='btn btn-default btn-xs m-b-5 p-5' title='" . $locale['forum_0265'] . "'>\n<i class='entypo up-dir icon-xs'></i></a>";
                     $pdata['post_votebox'] .= "<h3 class='m-0'>" . (!empty($pdata['vote_points']) ? $pdata['vote_points'] : 0) . "</h3>\n";
                     $pdata['post_votebox'] .= "<a href='" . $pdata['vote_down']['link'] . "' class='btn btn-default btn-xs m-t-5 p-5' title='" . $locale['forum_0265'] . "'>\n<i class='entypo down-dir icon-xs'></i></a>";
                     $pdata['post_votebox'] .= "</div>\n";
                 } else {
                     $pdata['post_votebox'] = "<div class='text-center'>\n";
                     $pdata['post_votebox'] .= "<h3 class='m-0'>" . (!empty($pdata['vote_points']) ? $pdata['vote_points'] : 0) . "</h3>\n";
                     $pdata['post_votebox'] .= "</div>\n";
                 }
             }
             // Edit Reason - NOT WORKING?
             $pdata['post_edit_reason'] = '';
             if ($pdata['post_edittime']) {
                 $edit_reason = "<div class='edit_reason m-t-10'><small>" . $locale['forum_0164'] . profile_link($pdata['post_edituser'], $pdata['edit_name'], $pdata['edit_status']) . $locale['forum_0167'] . showdate("forumdate", $pdata['post_edittime']) . "</small>\n";
                 if ($pdata['post_editreason'] && iMEMBER) {
                     $edit_reason .= "<br /><a id='reason_pid_" . $pdata['post_id'] . "' rel='" . $pdata['post_id'] . "' class='reason_button small' data-target='reason_div_pid_" . $pdata['post_id'] . "'>";
                     $edit_reason .= "<strong>" . $locale['forum_0165'] . "</strong>";
                     $edit_reason .= "</a>\n";
                     $edit_reason .= "<div id='reason_div_pid_" . $pdata['post_id'] . "' class='reason_div small'>" . $pdata['post_editreason'] . "</div>\n";
                 }
                 $edit_reason .= "</div>\n";
                 $pdata['post_edit_reason'] = $edit_reason;
                 $this->edit_reason = TRUE;
             }
             // Custom Post Message Link/Buttons
             $pdata['post_links'] = '';
             $pdata['post_links'] .= !empty($pdata['post_quote']) ? "<a class='btn btn-xs btn-default' title='" . $pdata['post_quote']["title"] . "' href='" . $pdata['post_quote']['link'] . "'>" . $pdata['post_quote']['title'] . "</a>\n" : '';
             $pdata['post_links'] .= !empty($pdata['post_edit']) ? "<a class='btn btn-xs btn-default' title='" . $pdata['post_edit']["title"] . "' href='" . $pdata['post_edit']['link'] . "'>" . $pdata['post_edit']['title'] . "</a>\n" : '';
             $pdata['post_links'] .= !empty($pdata['print']) ? "<a class='btn btn-xs btn-default' title='" . $pdata['print']["title"] . "' href='" . $pdata['print']['link'] . "'>" . $pdata['print']['title'] . "</a>\n" : '';
             $pdata['post_links'] .= !empty($pdata['user_web']) ? "<a class='btn btn-xs btn-default' class='forum_user_actions' href='" . $pdata['user_web']['link'] . "' target='_blank'>" . $pdata['user_web']['title'] . "</a>\n" : '';
             $pdata['post_links'] .= !empty($pdata['user_message']) ? "<a class='btn btn-xs btn-default' href='" . $pdata['user_message']['link'] . "' target='_blank'>" . $pdata['user_message']['title'] . "</a>\n" : '';
             // Post Date
             $pdata['post_date'] = $locale['forum_0524'] . " " . timer($pdata['post_datestamp']) . " - " . showdate('forumdate', $pdata['post_datestamp']);
             $pdata['post_shortdate'] = $locale['forum_0524'] . " " . timer($pdata['post_datestamp']);
             $pdata['post_longdate'] = $locale['forum_0524'] . " " . showdate('forumdate', $pdata['post_datestamp']);
             $this->thread_info['post_items'][$pdata['post_id']] = $pdata;
             $i++;
         }
     }
 }
Exemple #20
0
/** Custom data formatter */
function parseInfo($data)
{
    global $locale, $dl_settings;
    $download_image = '';
    if ($data['download_image'] && $dl_settings['download_screenshot'] == "1") {
        $hiRes_image_path = get_download_image_path($data['download_image'], $data['download_image_thumb'], TRUE);
        $lowRes_image_path = get_download_image_path($data['download_image'], $data['download_image_thumb'], FALSE);
        $download_image = "<a href='" . INFUSIONS . "downloads/downloads.php?download_id=" . $data['download_id'] . "'>" . thumbnail($lowRes_image_path, '100px') . "</a>";
    }
    return array('download_anchor' => "<a name='download_" . $data['download_id'] . "' id='download_" . $data['download_id'] . "'></a>", 'download_description_short' => nl2br(parseubb(parsesmileys(html_entity_decode(stripslashes($data['download_description_short']))))), 'download_description' => nl2br(parseubb(parsesmileys(html_entity_decode(stripslashes($data['download_description']))))), 'download_link' => INFUSIONS . "downloads/downloads.php?download_id=" . $data['download_id'], 'download_category_link' => "<a href='" . INFUSIONS . "downloads/downloads.php?cat_id=" . $data['download_cat'] . "'>" . $data['download_cat_name'] . "</a>\n", 'download_readmore_link' => "<a href='" . INFUSIONS . "downloads/downloads.php?download_id=" . $data['download_id'] . "'>" . $locale['download_1006'] . "</a>\n", 'download_title' => stripslashes($data['download_title']), 'download_image' => $download_image, 'download_thumb' => get_download_image_path($data['download_image'], $data['download_image_thumb'], FALSE), "download_count" => format_word($data['download_count'], $locale['fmt_download']), "download_comments" => format_word($data['count_comment'], $locale['fmt_comment']), 'download_sum_rating' => format_word($data['sum_rating'], $locale['fmt_rating']), 'download_count_votes' => format_word($data['count_votes'], $locale['fmt_vote']), 'download_user_avatar' => display_avatar($data, '25px', '', TRUE, 'img-rounded'), 'download_user_link' => profile_link($data['user_id'], $data['user_name'], $data['user_status'], 'strong'), 'download_post_time' => showdate('shortdate', $data['download_datestamp']), 'download_post_time2' => $locale['global_049'] . " " . timer($data['download_datestamp']), 'download_file_link' => file_exists(DOWNLOADS . '/files/' . $data['download_file']) ? INFUSIONS . "downloads/downloads.php?file_id=" . $data['download_id'] : '');
}
Exemple #21
0
// xss injection
$result = dbquery("SELECT tn.thread_id FROM " . DB_FORUM_THREAD_NOTIFY . " tn\n            INNER JOIN " . DB_FORUM_THREADS . " tt ON tn.thread_id = tt.thread_id\n            INNER JOIN " . DB_FORUMS . " tf ON tt.forum_id = tf.forum_id\n            WHERE tn.notify_user="******" AND " . groupaccess('forum_access') . " AND tt.thread_hidden='0'");
$rows = dbrows($result);
if (!isset($_GET['rowstart']) or !isnum($_GET['rowstart']) or $_GET['rowstart'] > $rows) {
    $_GET['rowstart'] = 0;
}
$info['post_rows'] = $rows;
if ($rows) {
    require_once INCLUDES . "mimetypes_include.php";
    $info['page_nav'] = $rows > 10 ? makepagenav($_GET['rowstart'], 16, $rows, 3, FUSION_REQUEST, "rowstart") : "";
    $result = dbquery("\n                SELECT tf.forum_id, tf.forum_name, tf.forum_access, tf.forum_type, tf.forum_mods,\n                tn.thread_id, tn.notify_datestamp, tn.notify_user,\n                ttc.forum_id AS forum_cat_id, ttc.forum_name AS forum_cat_name,\n                tp.post_datestamp, tp.post_message,\n                tt.thread_subject, tt.forum_id, tt.thread_lastpost, tt.thread_lastpostid, tt.thread_lastuser, tt.thread_postcount, tt.thread_views, tt.thread_locked,\n                tt.thread_author, tt.thread_poll, tt.thread_sticky,\n                uc.user_id AS s_user_id, uc.user_name AS author_name, uc.user_status AS author_status, uc.user_avatar AS author_avatar,\n                u.user_id, u.user_name as last_user_name, u.user_status as last_user_status, u.user_avatar as last_user_avatar,\n                count(v.post_id) AS vote_count,\n                count(a1.attach_mime) 'attach_image',\n\t\t\t\tcount(a2.attach_mime) 'attach_files'\n                FROM " . DB_FORUM_THREAD_NOTIFY . " tn\n                INNER JOIN " . DB_FORUM_THREADS . " tt ON tn.thread_id = tt.thread_id\n                INNER JOIN " . DB_FORUMS . " tf ON tt.forum_id = tf.forum_id\n                LEFT JOIN " . DB_FORUMS . " ttc ON ttc.forum_id = tf.forum_cat\n                LEFT JOIN " . DB_USERS . " uc ON tt.thread_author = uc.user_id\n                LEFT JOIN " . DB_USERS . " u ON tt.thread_lastuser = u.user_id\n                LEFT JOIN " . DB_FORUM_POSTS . " tp ON tt.thread_id = tp.thread_id\n                LEFT JOIN " . DB_FORUM_VOTES . " v ON v.thread_id = tt.thread_id AND tp.post_id = v.post_id\n                LEFT JOIN " . DB_FORUM_ATTACHMENTS . " a1 on a1.thread_id = tt.thread_id AND a1.attach_mime IN ('" . implode(",", img_mimeTypes()) . "')\n\t\t\t\tLEFT JOIN " . DB_FORUM_ATTACHMENTS . " a2 on a2.thread_id = tt.thread_id AND a2.attach_mime NOT IN ('" . implode(",", img_mimeTypes()) . "')\n                WHERE tn.notify_user="******" AND " . groupaccess('forum_access') . " AND tt.thread_hidden='0'\n                GROUP BY tn.thread_id\n                ORDER BY tn.notify_datestamp DESC\n                LIMIT " . $_GET['rowstart'] . ",16\n            ");
    $i = 0;
    while ($threads = dbarray($result)) {
        // opt for moderators.
        $this->forum_info['moderators'] = \PHPFusion\Forums\Moderator::parse_forum_mods($threads['forum_mods']);
        $icon = "";
        $match_regex = $threads['thread_id'] . "\\|" . $threads['thread_lastpost'] . "\\|" . $threads['forum_id'];
        if ($threads['thread_lastpost'] > $this->forum_info['lastvisited']) {
            if (iMEMBER && ($threads['thread_lastuser'] == $userdata['user_id'] || preg_match("(^\\.{$match_regex}\$|\\.{$match_regex}\\.|\\.{$match_regex}\$)", $userdata['user_threads']))) {
                $icon = "<i class='" . get_forumIcons('thread') . "' title='" . $locale['forum_0261'] . "'></i>";
            } else {
                $icon = "<i class='" . get_forumIcons('new') . "' title='" . $locale['forum_0260'] . "'></i>";
            }
        }
        $author = array('user_id' => $threads['thread_author'], 'user_name' => $threads['author_name'], 'user_status' => $threads['author_status'], 'user_avatar' => $threads['author_avatar']);
        $lastuser = array('user_id' => $threads['thread_lastuser'], 'user_name' => $threads['last_user_name'], 'user_status' => $threads['last_user_status'], 'user_avatar' => $threads['last_user_avatar']);
        $threads += array("thread_link" => array("link" => INFUSIONS . "forum/viewthread.php?thread_id=" . $threads['thread_id'], "title" => $threads['thread_subject']), "forum_type" => $threads['forum_type'], "thread_pages" => makepagenav(0, $forum_settings['posts_per_page'], $threads['thread_postcount'], 3, FORUM . "viewthread.php?thread_id=" . $threads['thread_id'] . "&amp;"), "thread_icons" => array('lock' => $threads['thread_locked'] ? "<i class='" . get_forumIcons('lock') . "' title='" . $locale['forum_0263'] . "'></i>" : '', 'sticky' => $threads['thread_sticky'] ? "<i class='" . get_forumIcons('sticky') . "' title='" . $locale['forum_0103'] . "'></i>" : '', 'poll' => $threads['thread_poll'] ? "<i class='" . get_forumIcons('poll') . "' title='" . $locale['forum_0314'] . "'></i>" : '', 'hot' => $threads['thread_postcount'] >= 20 ? "<i class='" . get_forumIcons('hot') . "' title='" . $locale['forum_0311'] . "'></i>" : '', 'reads' => $threads['thread_views'] >= 20 ? "<i class='" . get_forumIcons('reads') . "' title='" . $locale['forum_0311'] . "'></i>" : '', 'image' => $threads['attach_image'] > 0 ? "<i class='" . get_forumIcons('image') . "' title='" . $locale['forum_0313'] . "'></i>" : '', 'file' => $threads['attach_files'] > 0 ? "<i class='" . get_forumIcons('file') . "' title='" . $locale['forum_0312'] . "'></i>" : '', 'icon' => $icon), "thread_starter" => $locale['forum_0006'] . timer($threads['post_datestamp']) . " " . $locale['by'] . " " . profile_link($author['user_id'], $author['user_name'], $author['user_status']) . "</span>", "thread_author" => $author, "thread_last" => array('avatar' => display_avatar($lastuser, '30px', '', '', ''), 'profile_link' => profile_link($lastuser['user_id'], $lastuser['user_name'], $lastuser['user_status']), 'time' => $threads['post_datestamp'], 'post_message' => parseubb(parsesmileys($threads['post_message'])), "formatted" => "<div class='pull-left'>" . display_avatar($lastuser, '30px', '', '', '') . "</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class='overflow-hide'>" . $locale['forum_0373'] . " <span class='forum_profile_link'>" . profile_link($lastuser['user_id'], $lastuser['user_name'], $lastuser['user_status']) . "</span><br/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . timer($threads['post_datestamp']) . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>"), "track_button" => array('link' => FORUM . "index.php?section=tracked&amp;delete=" . $threads['thread_id'], 'title' => $locale['global_058']));
        // push
        $this->forum_info['item'][$threads['thread_id']] = $threads;
    }
}
Exemple #22
0
        /**
         * Message Reader Functions for Inbox, Outbox, Archive
         */
        function _inbox($info)
        {
            if (isset($_GET['msg_read']) && isset($info['items'][$_GET['msg_read']])) {
                // read view
                $data = $info['items'][$_GET['msg_read']];
                echo '
                <h4>' . $data['message']['message_header'] . '</h4>
                <div class="clearfix m-t-20 m-b-20">
                    <div class="pull-left m-r-15">' . display_avatar($data, "40px") . '</div>
                    <div class="overflow-hide">
                        ' . profile_link($data['user_id'], $data['user_name'], $data['user_status']) . '<br/>
                        ' . showdate("shortdate", $data['message_datestamp']) . timer($data['message_datestamp']) . '
                    </div>
                </div>
                ' . $data['message']['message_text'] . '
                <hr/>
                ' . $info['reply_form'];
            } elseif (isset($_GET['msg_send'])) {
                // send new message form
                echo $info['reply_form'];
            } else {
                // display view
                global $locale;
                if (!empty($info['items'])) {
                    $unread = array();
                    $read = array();
                    foreach ($info['items'] as $message_id => $messageData) {
                        if ($messageData['message_read']) {
                            $read[$message_id] = $messageData;
                        } else {
                            $unread[$message_id] = $messageData;
                        }
                    }
                    echo '<h5><a data-target="#unread_inbox" class="pointer text-dark" data-toggle="collapse">
                    <i class="fa fa-caret-down"></i> ' . $locale['446'] . '</a></h5>
                    <div id="unread_inbox" class="collapse in">';
                    if (!empty($unread)) {
                        echo '<table id="unread_tbl" class="table table-responsive table-hover">';
                        foreach ($unread as $id => $messageData) {
                            echo "<tr>\n";
                            echo "<td>" . form_checkbox("pmID", "", $id, array("input_id" => "pmID-" . $id, "value" => $id, "class" => "checkbox m-b-0")) . "</td>\n";
                            echo "<td class='col-xs-2'><strong>" . $messageData['contact_user']['user_name'] . "</strong></td>\n";
                            echo "<td class='col-xs-7'><strong><a href='" . $messageData['message']['link'] . "'>" . $messageData['message']['name'] . "</a></strong></td>\n";
                            echo "<td>" . date("d M", $messageData['message_datestamp']) . "</td>\n";
                            echo "</tr>\n";
                        }
                        echo '</table>';
                    } else {
                        echo '<div class="text-center list-group-item">' . $locale['471'] . '</div>';
                    }
                    echo '</div>';
                    echo '<h5><a data-target="#read_inbox" class="pointer text-dark" data-toggle="collapse">
				<i class="fa fa-caret-down"></i> ' . $locale['447'] . '</a></h5>
				<div id="read_inbox" class="collapse in">';
                    if (!empty($read)) {
                        echo '<table id="read_tbl"  class="table table-responsive table-hover">';
                        foreach ($read as $id => $messageData) {
                            echo "<tr>\n";
                            echo "<td>" . form_checkbox("pmID", "", $id, array("input_id" => "pmID-" . $id, "value" => $id, "class" => "checkbox m-b-0")) . "</td>\n";
                            echo "<td class='col-xs-2'>" . $messageData['contact_user']['user_name'] . "</td>\n";
                            echo "<td class='col-xs-7'><a href='" . $messageData['message']['link'] . "'>" . $messageData['message']['name'] . "</a></td>\n";
                            echo "<td>" . date("d M", $messageData['message_datestamp']) . "</td>\n";
                            echo "</tr>\n";
                        }
                    }
                    echo '</table>';
                    echo '</div>';
                } else {
                    echo '<div class="text-center list-group-item">' . $info['no_item'] . '</div>';
                }
            }
        }
Exemple #23
0
function net2ftp($action)
{
    // --------------
    // This function is the main net2ftp function; it is the interface between 3rd party
    // scripts (CMS, control panels, etc), and the internal net2ftp modules and plugins.
    //
    // This function is called 5 times per pageload: to send the HTTP headers, to print
    // the javascript code, to print the CSS code, to print the body onload actions and
    // finally to print the body content.
    // --------------
    // -------------------------------------------------------------------------
    // Check that "sendHttpHeaders" action is only executed once
    // Check that no other actions can be executed if "sendHttpHeaders" has not yet been executed
    // -------------------------------------------------------------------------
    if ($action == "sendHttpHeaders") {
        if (defined("NET2FTP_SENDHTTPHEADERS") == true) {
            echo "Error: please call the net2ftp(\$action) function only once with \$action = \"sendHttpHeaders\"!";
            return false;
        } else {
            define("NET2FTP_SENDHTTPHEADERS", 1);
        }
    } else {
        if (defined("NET2FTP_SENDHTTPHEADERS") == false) {
            echo "Error: please call the net2ftp(\$action) function first with \$action = \"sendHttpHeaders\"!";
            return false;
        }
    }
    // -------------------------------------------------------------------------
    // Global variables
    // -------------------------------------------------------------------------
    global $net2ftp_settings, $net2ftp_globals, $net2ftp_result, $net2ftp_messages;
    // Set the NET2FTP constant which is used to check if template files are called by net2ftp
    if (defined("NET2FTP") == false) {
        define("NET2FTP", 1);
    }
    // Initialize the global variables
    if ($action == "sendHttpHeaders") {
        $net2ftp_globals = array();
        $net2ftp_messages = array();
        $net2ftp_output = array();
        $net2ftp_result["success"] = true;
        $net2ftp_result["errormessage"] = "";
        $net2ftp_result["debug_backtrace"] = "";
        $net2ftp_result["exit"] = false;
        $net2ftp_settings = array();
    }
    // -------------------------------------------------------------------------
    // If an error occured during a previous execution of net2ftp(), return false
    // and let index.php print the error message
    // -------------------------------------------------------------------------
    if ($net2ftp_result["success"] == false) {
        return false;
    }
    // -------------------------------------------------------------------------
    // Input checks
    // -------------------------------------------------------------------------
    if ($action != "sendHttpHeaders" && $action != "printJavascript" && $action != "printCss" && $action != "printBodyOnload" && $action != "printBody") {
        $net2ftp_result["success"] = false;
        $net2ftp_result["errormessage"] = "The \$action variable has an unknown value: {$action}.";
        $net2ftp_result["debug_backtrace"] = debug_backtrace();
        logError();
        return false;
    }
    // -------------------------------------------------------------------------
    // Read settings files
    // -------------------------------------------------------------------------
    if ($action == "sendHttpHeaders") {
        require NET2FTP_APPLICATION_ROOTDIR . "/settings.inc.php";
        require NET2FTP_APPLICATION_ROOTDIR . "/settings_authorizations.inc.php";
        require NET2FTP_APPLICATION_ROOTDIR . "/settings_screens.inc.php";
    }
    // -------------------------------------------------------------------------
    // Main directories
    // -------------------------------------------------------------------------
    $net2ftp_globals["application_rootdir"] = NET2FTP_APPLICATION_ROOTDIR;
    if (NET2FTP_APPLICATION_ROOTDIR_URL == "/") {
        $net2ftp_globals["application_rootdir_url"] = "";
    } else {
        $net2ftp_globals["application_rootdir_url"] = NET2FTP_APPLICATION_ROOTDIR_URL;
    }
    $net2ftp_globals["application_includesdir"] = $net2ftp_globals["application_rootdir"] . "/includes";
    $net2ftp_globals["application_languagesdir"] = $net2ftp_globals["application_rootdir"] . "/languages";
    $net2ftp_globals["application_modulesdir"] = $net2ftp_globals["application_rootdir"] . "/modules";
    $net2ftp_globals["application_pluginsdir"] = $net2ftp_globals["application_rootdir"] . "/plugins";
    $net2ftp_globals["application_skinsdir"] = $net2ftp_globals["application_rootdir"] . "/skins";
    $net2ftp_globals["application_tempdir"] = $net2ftp_globals["application_rootdir"] . "/temp";
    // -------------------------------------------------------------------------
    // Set basic settings
    // -------------------------------------------------------------------------
    if ($action == "sendHttpHeaders") {
        // Run the script to the end, even if the user hits the stop button
        ignore_user_abort();
        // Execute function shutdown() if the script reaches the maximum execution time (usually 30 seconds)
        // DON'T REGISTER IT HERE YET, as this causes errors on newer versions of PHP; first include the function libraries
        //		register_shutdown_function("net2ftp_shutdown");
        // Set the error reporting level
        if ($net2ftp_settings["error_reporting"] == "ALL") {
            error_reporting(E_ALL);
        } elseif ($net2ftp_settings["error_reporting"] == "NONE") {
            error_reporting(0);
        } else {
            error_reporting(E_ERROR | E_WARNING | E_PARSE);
        }
        // Timer: start
        $net2ftp_globals["starttime"] = microtime();
        $net2ftp_globals["endtime"] = microtime();
    }
    // Set the PHP temporary directory
    //	putenv("TMPDIR=" . $net2ftp_globals["application_tempdir"]);
    // -------------------------------------------------------------------------
    // Function libraries:
    // 1. Libraries which are always needed
    // 2. Register global variables
    // 3. Function libraries which are needed depending on certain variables
    // // --> Do this only once, when $action == "sendHttpHeaders"
    // -------------------------------------------------------------------------
    if ($action == "sendHttpHeaders") {
        // 1. Libraries which are always needed
        require_once $net2ftp_globals["application_includesdir"] . "/authorizations.inc.php";
        require_once $net2ftp_globals["application_includesdir"] . "/consumption.inc.php";
        require_once $net2ftp_globals["application_includesdir"] . "/database.inc.php";
        require_once $net2ftp_globals["application_includesdir"] . "/errorhandling.inc.php";
        require_once $net2ftp_globals["application_includesdir"] . "/filesystem.inc.php";
        require_once $net2ftp_globals["application_includesdir"] . "/html.inc.php";
        require_once $net2ftp_globals["application_includesdir"] . "/StonePhpSafeCrypt.php";
        require_once $net2ftp_globals["application_languagesdir"] . "/languages.inc.php";
        require_once $net2ftp_globals["application_skinsdir"] . "/skins.inc.php";
        // 1. Define functions which are used, but which did not exist before PHP version 4.3.0
        if (version_compare(phpversion(), "4.3.0", "<")) {
            require_once $net2ftp_globals["application_includesdir"] . "/before430.inc.php";
        }
        // 2. Register global variables (POST, GET, GLOBAL, ...)
        require_once $net2ftp_globals["application_includesdir"] . "/registerglobals.inc.php";
        // 3. Function libraries which are needed depending on certain variables
        if ($net2ftp_globals["state"] == "upload" || $net2ftp_globals["state"] == "unzip") {
            require_once $net2ftp_globals["application_includesdir"] . "/pclerror.lib.php";
            require_once $net2ftp_globals["application_includesdir"] . "/pcltar.lib.php";
            require_once $net2ftp_globals["application_includesdir"] . "/pcltrace.lib.php";
            require_once $net2ftp_globals["application_includesdir"] . "/pclzip.lib.php";
        }
        if ($net2ftp_globals["state"] == "advanced_ftpserver" || $net2ftp_globals["state"] == "advanced_parsing" || $net2ftp_globals["state"] == "advanced_webserver" || $net2ftp_globals["state"] == "browse" || $net2ftp_globals["state"] == "copymovedelete" || $net2ftp_globals["state"] == "chmod" || $net2ftp_globals["state"] == "calculatesize" || $net2ftp_globals["state"] == "downloadzip" || $net2ftp_globals["state"] == "findstring" || $net2ftp_globals["state"] == "followsymlink" || $net2ftp_globals["state"] == "install" || $net2ftp_globals["state"] == "zip") {
            require_once $net2ftp_globals["application_includesdir"] . "/browse.inc.php";
        }
        if ($net2ftp_globals["state"] == "downloadzip" || $net2ftp_globals["state"] == "zip") {
            require_once $net2ftp_globals["application_includesdir"] . "/zip.lib.php";
        }
        // 4. Load the plugins
        require_once $net2ftp_globals["application_pluginsdir"] . "/plugins.inc.php";
        $net2ftp_globals["activePlugins"] = getActivePlugins();
        net2ftp_plugin_includePhpFiles();
        // 5. Load the language file
        includeLanguageFile();
    }
    // -------------------------------------------------------------------------
    // Execute function shutdown() if the script reaches the maximum execution time (usually 30 seconds)
    // -------------------------------------------------------------------------
    if ($action == "sendHttpHeaders") {
        register_shutdown_function("net2ftp_shutdown");
    }
    // -------------------------------------------------------------------------
    // Log access
    // --> Do this only once, when $action == "sendHttpHeaders"
    // -------------------------------------------------------------------------
    if ($action == "sendHttpHeaders") {
        logAccess();
        if ($net2ftp_result["success"] == false) {
            logError();
            return false;
        }
    }
    // -------------------------------------------------------------------------
    // Check authorizations
    // --> Do this only once, when $action == "sendHttpHeaders"
    // -------------------------------------------------------------------------
    if ($action == "sendHttpHeaders" && $net2ftp_settings["check_authorization"] == "yes" && $net2ftp_globals["ftpserver"] != "") {
        checkAuthorization($net2ftp_globals["ftpserver"], $net2ftp_globals["ftpserverport"], $net2ftp_globals["directory"], $net2ftp_globals["username"]);
        if ($net2ftp_result["success"] == false) {
            logError();
            return false;
        }
    }
    // -------------------------------------------------------------------------
    // Get the consumption counter values from the database
    // This retrieves the consumption of network and server resources for the
    // current IP address and FTP server from the database, and stores these
    // values in global variables. See /includes/consumption.inc.php for the details.
    // --> Do this only once, when $action == "sendHttpHeaders"
    // -------------------------------------------------------------------------
    if ($action == "sendHttpHeaders") {
        getConsumption();
        if ($net2ftp_result["success"] == false) {
            logError();
            return false;
        }
    }
    // -------------------------------------------------------------------------
    // Execute the action!
    // -------------------------------------------------------------------------
    // ------------------------------------
    // For most modules, everything must be done: send headers, print body, etc
    // ------------------------------------
    if ($net2ftp_globals["state"] == "admin" || $net2ftp_globals["state"] == "admin_createtables" || $net2ftp_globals["state"] == "admin_emptylogs" || $net2ftp_globals["state"] == "admin_viewlogs" || $net2ftp_globals["state"] == "advanced" || $net2ftp_globals["state"] == "advanced_ftpserver" || $net2ftp_globals["state"] == "advanced_parsing" || $net2ftp_globals["state"] == "advanced_webserver" || $net2ftp_globals["state"] == "bookmark" || $net2ftp_globals["state"] == "browse" || $net2ftp_globals["state"] == "calculatesize" || $net2ftp_globals["state"] == "chmod" || $net2ftp_globals["state"] == "copymovedelete" || $net2ftp_globals["state"] == "edit" || $net2ftp_globals["state"] == "findstring" || $net2ftp_globals["state"] == "install" || $net2ftp_globals["state"] == "jupload" && $net2ftp_globals["screen"] == 1 || $net2ftp_globals["state"] == "login" || $net2ftp_globals["state"] == "login_small" || $net2ftp_globals["state"] == "logout" || $net2ftp_globals["state"] == "newdir" || $net2ftp_globals["state"] == "raw" || $net2ftp_globals["state"] == "rename" || $net2ftp_globals["state"] == "unzip" || $net2ftp_globals["state"] == "upload" || $net2ftp_globals["state"] == "view" && $net2ftp_globals["state2"] == "" || $net2ftp_globals["state"] == "zip") {
        require_once $net2ftp_globals["application_modulesdir"] . "/" . $net2ftp_globals["state"] . "/" . $net2ftp_globals["state"] . ".inc.php";
        if ($action == "sendHttpHeaders") {
            net2ftp_module_sendHttpHeaders();
            // If needed, exit to avoid sending non-header output (by net2ftp or other application)
            // Example: if a module sends a HTTP redirect header (See /includes/authorizations.inc.php function checkAdminUsernamePassword()!)
            if ($net2ftp_result["exit"] == true) {
                exit;
            }
        } elseif ($action == "printJavascript") {
            net2ftp_module_printJavascript();
            net2ftp_plugin_printJavascript();
        } elseif ($action == "printCss") {
            net2ftp_module_printCss();
            net2ftp_plugin_printCss();
        } elseif ($action == "printBodyOnload") {
            net2ftp_module_printBodyOnload();
            net2ftp_plugin_printBodyOnload();
        } elseif ($action == "printBody") {
            // Print the status bar to be able to show the progress
            if (isStatusbarActive() == true) {
                require_once $net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/statusbar.template.php";
            }
            require_once $net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/status/status.inc.php";
            // Do the work and meanwhile update the progress bar
            net2ftp_module_printBody();
            // Update the consumption statistics
            $net2ftp_globals["endtime"] = microtime();
            $net2ftp_globals["time_taken"] = timer();
            addConsumption(0, $net2ftp_globals["time_taken"]);
            putConsumption();
            // Set the progress bar to "finished"
            if (isStatusbarActive() == true) {
                $statusmessage = __("Script finished in %1\$s seconds", $net2ftp_globals["time_taken"]);
                setStatus(1, 1, $statusmessage);
            }
        }
    } elseif ($net2ftp_globals["state"] == "clearcookies" || $net2ftp_globals["state"] == "downloadfile" || $net2ftp_globals["state"] == "downloadzip" || $net2ftp_globals["state"] == "followsymlink" || $net2ftp_globals["state"] == "jupload" && $net2ftp_globals["screen"] == 2 || $net2ftp_globals["state"] == "view" && $net2ftp_globals["state2"] != "") {
        require_once $net2ftp_globals["application_modulesdir"] . "/" . $net2ftp_globals["state"] . "/" . $net2ftp_globals["state"] . ".inc.php";
        if ($action == "sendHttpHeaders") {
            // Do the work - do not update the progress bar
            net2ftp_module_sendHttpHeaders();
            // Update the consumption statistics
            $net2ftp_globals["endtime"] = microtime();
            $net2ftp_globals["time_taken"] = timer();
            addConsumption(0, $net2ftp_globals["time_taken"]);
            putConsumption();
            // Exit to avoid sending non-header output (by net2ftp or other application)
            exit;
        } elseif ($action == "printJavascript") {
        } elseif ($action == "printCss") {
        } elseif ($action == "printBodyOnload") {
        } elseif ($action == "printBody") {
        }
    } elseif ($net2ftp_globals["state"] == "error") {
        logError();
        return false;
    } else {
        $errormessage = __("Unexpected state string: %1\$s. Exiting.", $net2ftp_globals["state"]);
        setErrorVars(false, $errormessage, debug_backtrace(), __FILE__, __LINE__);
        logError();
        return false;
    }
}
Exemple #24
0
/**
 * Информация об использовании приложением ОЗУ и генерации страницы
 * @return string строка с информацией
 */
function smarty_get_memory_usage()
{
    $start = globals::g('start');
    if (function_exists('memory_get_usage')) {
        $memory_usage = display::o()->convert_size(memory_get_usage());
    }
    return sprintf(lang::o()->v('page_loaded_in'), timer() - $start, count(db::o()->query_stat)) . ($memory_usage ? sprintf(lang::o()->v('memory_loaded'), $memory_usage) : "");
}
function notificacion($user_ID, $texto = '', $url = '', $emisor = 'sistema')
{
    global $pol, $link;
    switch ($user_ID) {
        case 'print':
            if (isset($pol['user_ID'])) {
                $t = '';
                $total_num = 0;
                // NOTIFICACION ELECCIONES
                if ($pol['config']['elecciones_estado'] == 'elecciones' and $pol['estado'] == 'ciudadano') {
                    $result = mysql_query("SELECT ID FROM " . SQL . "elecciones WHERE user_ID = '" . $pol['user_ID'] . "' LIMIT 1", $link);
                    while ($r = mysql_fetch_array($result)) {
                        $havotado = $r['ID'];
                    }
                    if (!isset($havotado)) {
                        $nuevos_num++;
                    }
                    $total_num++;
                    $elecciones_quedan = strtotime($pol['config']['elecciones_inicio']) + $pol['config']['elecciones_duracion'];
                    if (!isset($havotado)) {
                        $t .= '<li><a href="/elecciones/votar" class="noti-nuevo">&iexcl;Elecciones en curso!<span class="md">Quedan ' . timer($elecciones_quedan, true) . '</span></a></li>';
                    }
                }
                // NOTIFICACION VOTACIONES
                $pol['config']['info_consultas'] = 0;
                $result = mysql_query("SELECT v.ID, pais, pregunta, acceso_votar, acceso_cfg_votar, acceso_ver, acceso_cfg_ver \r\n\t\t\t\tFROM votacion `v`\r\n\t\t\t\tLEFT OUTER JOIN votacion_votos `vv` ON v.ID = vv.ref_ID AND vv.user_ID = '" . $pol['user_ID'] . "'\r\n\t\t\t\tWHERE v.estado = 'ok' AND (v.pais = '" . PAIS . "' OR acceso_votar IN ('supervisores_censo', 'privado')) AND vv.ID IS null", $link);
                while ($r = mysql_fetch_array($result)) {
                    if (nucleo_acceso($r['acceso_votar'], $r['acceso_cfg_votar']) and nucleo_acceso($r['acceso_ver'], $r['acceso_cfg_ver'])) {
                        $pol['config']['info_consultas']++;
                        $nuevos_num++;
                        $total_num++;
                        $t .= '<li><a href="http://' . $r['pais'] . '.' . DOMAIN . '/votacion/' . $r['ID'] . '" class="noti-nuevo">Votación: ' . $r['pregunta'] . '</a></li>';
                    }
                }
                // NOTIFICACIONES
                $result = mysql_query("SELECT noti_ID, visto, texto, url, MAX(time) AS time_max, COUNT(*) AS num FROM notificaciones WHERE user_ID = '" . $pol['user_ID'] . "' GROUP BY visto, texto ORDER BY visto DESC, time_max DESC LIMIT 7", $link);
                while ($r = mysql_fetch_array($result)) {
                    $total_num += $r['num'];
                    if ($r['visto'] == 'false') {
                        $nuevos_num += $r['num'];
                    }
                    $t .= '<li><a href="' . ($r['visto'] == 'false' ? '/?noti=' . $r['noti_ID'] : $r['url']) . '"' . ($r['visto'] == 'false' ? ' class="noti-nuevo"' : '') . (substr($r['url'], 0, 4) == 'http' ? ' target="_blank"' : '') . '>' . $r['texto'] . ($r['num'] > 1 ? '<span class="md">' . $r['num'] . '</span>' : '') . '</a></li>';
                }
            } else {
                $t = '<li><a href="' . REGISTRAR . '?p=' . PAIS . '" class="noti-nuevo">Primer paso: Crea tu ciudadano</a></li>';
                $total_num = 1;
                $nuevos_num = 1;
            }
            global $txt_elec_time;
            return '<li id="menu-noti"' . ($nuevos_num != 0 ? ' class="menu-sel"' : '') . '><a href="/hacer">Notificaciones<span class="md">' . $nuevos_num . '</span></a><ul><li style="border-bottom:1px dotted #DDD;"><a href="/elecciones">' . (isset($txt_elec_time) ? 'Elecciones en <b>' . $txt_elec_time . '</b>, ' : '') . 'proceso ' . (time() > strtotime(date('Y-m-d 20:00:00')) ? 'hace' : 'en') . ' <b>' . timer(date('Y-m-d 20:00:00')) . '</b></a></li>' . $t . ($total_num == 0 ? '<li>No hay notificaciones</li>' : '') . '<li style="text-align:right;"><a href="/hacer"><b>¿Qué hacer?</b></a></li></ul></li>' . ($nuevos != 0 ? '' : '<script type="text/javascript">p_scroll = true;</script>');
            break;
        case 'visto':
            $result = mysql_query("SELECT noti_ID, visto, texto, url FROM notificaciones WHERE noti_ID = '" . $texto . "' LIMIT 1", $link);
            while ($r = mysql_fetch_array($result)) {
                if ($r['visto'] == 'false') {
                    mysql_query("UPDATE notificaciones SET visto = 'true' WHERE visto = 'false' AND user_ID = '" . $pol['user_ID'] . "' AND texto = '" . $r['texto'] . "'", $link);
                }
                redirect($r['url']);
            }
            break;
        default:
            mysql_query("INSERT INTO notificaciones (user_ID, texto, url, emisor) VALUES ('" . $user_ID . "', '" . $texto . "', '" . $url . "', '" . $emisor . "')", $link);
            return true;
    }
}
Exemple #26
0
 public function get_mood_message()
 {
     // whether any user has reacted to this post
     $locale = fusion_get_locale("", FORUM_ADMIN_LOCALE);
     $locale += fusion_get_locale("", FORUM_LOCALE);
     $last_datestamp = array();
     $mood_description = array();
     $mood_cache = $this->cache_mood();
     $response_query = "SELECT pn.*, u.user_id, u.user_name, u.user_avatar, u.user_status\n        FROM " . DB_POST_NOTIFY . " pn\n        LEFT JOIN " . DB_USERS . " u ON pn.notify_sender = u.user_id\n        WHERE post_id='" . $this->post_id . "' GROUP BY pn.notify_mood_id ORDER BY pn.notify_mood_id ASC, pn.post_id ASC";
     $response_result = dbquery($response_query);
     if (dbrows($response_result)) {
         while ($m_data = dbarray($response_result)) {
             $user_output = "<a class='mood_sender' href='" . FUSION_REQUEST . "#post_" . $this->post_id . "'>\n" . profile_link($m_data['user_id'], $m_data['user_name'], $m_data['user_status'], "", FALSE) . "</a>";
             if (fusion_get_userdata('user_id') == $m_data['notify_sender']) {
                 $user_output = $locale['you'];
             }
             $reply_sender[$m_data['notify_mood_id']][] = $user_output;
             // The pairing errors are when `notify_mood_id` is illegally inserted or deleted
             // To code fallback on empty
             $last_datestamp[$m_data['notify_mood_id']] = $m_data['notify_datestamp'];
             $icon = isset($mood_cache[$m_data['notify_mood_id']]['mood_icon']) ? $mood_cache[$m_data['notify_mood_id']]['mood_icon'] : "fa fa-question fa-fw";
             $mood_icon[$m_data['notify_mood_id']] = "<i class='{$icon}'></i>";
             $description = isset($mood_cache[$m_data['notify_mood_id']]['mood_description']) ? $mood_cache[$m_data['notify_mood_id']]['mood_description'] : $locale['forum_0529'];
             $mood_description[$m_data['notify_mood_id']] = $description;
         }
         $output_message = "";
         foreach ($mood_description as $mood_id => $mood_output) {
             $senders = implode(", ", $reply_sender[$mood_id]);
             $output_message .= sprintf($locale['forum_0528'], $mood_icon[$mood_id], $senders, $mood_output, timer($last_datestamp[$mood_id])) . "\n                        <br/>";
         }
         return (string) $output_message;
     }
 }
$OrgList = new OrganizationList(AGENCIES_LIST_URL);
$termsArray = $OrgList->getTreeArrayFor(ORGANIZATION_TO_EXPORT);
/**
 * sometimes there is no parent term (ex. Department of Labor)
 */
if (!defined('PARENT_TERM')) {
    define('PARENT_TERM', '_');
}
/**
 * Create results dir for logs and json results
 */
$results_dir = CKANMNGR_RESULTS_DIR . date('/Ymd-His') . '_EXPORT_' . PARENT_TERM;
mkdir($results_dir);
/**
 * Search for packages by terms found
 */
/**
 * Production
 */
$CkanManager = new CkanManager(CKAN_API_URL);
//$CkanManager = new CkanManager(CKAN_QA_API_URL);
//$CkanManager = new CkanManager(INVENTORY_CKAN_PROD_API_URL, INVENTORY_CKAN_PROD_API_KEY);
/**
 * Staging
 */
//$CkanManager = new CkanManager(CKAN_STAGING_API_URL);
$CkanManager->resultsDir = $results_dir;
$CkanManager->exportPackagesByOrgTerms($termsArray);
// show running time on finish
timer();
Exemple #28
0
 function render_thread($info)
 {
     global $locale;
     $buttons = !empty($info['buttons']) ? $info['buttons'] : array();
     $data = !empty($info['thread']) ? $info['thread'] : array();
     $pdata = !empty($info['post_items']) ? $info['post_items'] : array();
     $icon = array('', '', 'fa fa-trophy fa-fw');
     $p_title = array();
     echo render_breadcrumbs();
     echo "<div class='clearfix'>\n";
     if (isset($info['page_nav'])) {
         echo "<div id='forum_top' class='pull-right m-t-10 text-lighter clearfix'>\n" . $info['page_nav'] . "</div>\n";
     }
     echo "<h2 class='m-t-0 thread-header pull-left m-r-20'>\n\t\t" . ($data['thread_sticky'] == TRUE ? "<i title='" . $locale['forum_0103'] . "' class='" . get_forumIcons("sticky") . "'></i>" : "") . "\n\t\t" . ($data['thread_locked'] == TRUE ? "<i title='" . $locale['forum_0102'] . "' class='" . get_forumIcons("lock") . "'></i>" : "") . "\n\t\t" . $data['thread_subject'] . "</h2>\n";
     echo "</div>\n";
     echo "<div class='last-updated'>" . $locale['forum_0363'] . timer($data['thread_lastpost']) . " <i class='fa fa-calendar fa-fw'></i></div>\n";
     if (!empty($info['poll_form'])) {
         echo "<div class='well'>" . $info['poll_form'] . "</div>\n";
     }
     if ($info['permissions']['can_post']) {
         echo "<div class='pull-right'>\n";
         if ($info['permissions']['can_create_poll']) {
             echo "<a class='btn btn-success btn-sm " . (!empty($info['thread']['thread_poll']) ? 'disabled' : '') . "' title='" . $buttons['poll']['title'] . "' href='" . $buttons['poll']['link'] . "'>" . $buttons['poll']['title'] . " <i class='fa fa-pie-chart'></i> </a>\n";
         }
         echo "<a class='btn btn-primary btn-sm " . (empty($buttons['newthread']) ? 'disabled' : '') . " ' href='" . $buttons['newthread']['link'] . "'>" . $buttons['newthread']['title'] . "</a>\n";
         echo "</div>\n";
     }
     echo "<div class='top-action-bar'>\n";
     // now change the whole thing to dropdown selector
     $selector['oldest'] = $locale['forum_0180'];
     $selector['latest'] = $locale['forum_0181'];
     echo "<span class='display-inline-block m-r-10 btn-group' style='position:relative; vertical-align:middle;'>\n";
     echo "<a class='btn btn-sm btn-default' data-toggle='dropdown' class='dropdown-toggle'><strong>" . $locale['forum_0183'] . "</strong>\n\t\t" . (isset($_GET['section']) && in_array($_GET['section'], array_flip($selector)) ? $selector[$_GET['section']] : $locale['forum_0180']) . " <span class='caret'></span>\n\t\t</a>\n";
     echo "<ul class='dropdown-menu'>\n";
     foreach ($info['post-filters'] as $i => $filters) {
         echo "<li><a class='text-smaller' href='" . $filters['value'] . "'>" . $filters['locale'] . "</a></li>\n";
     }
     echo "</ul>\n";
     echo !empty($buttons['notify']) ? "<a class='btn btn-default btn-sm' title='" . $buttons['notify']['title'] . "' href='" . $buttons['notify']['link'] . "'>" . $buttons['notify']['title'] . " <i class='fa fa-eye'></i></a>\n" : '';
     echo "<a class='btn btn-default btn-sm' title='" . $buttons['print']['title'] . "' href='" . $buttons['print']['link'] . "'>" . $buttons['print']['title'] . " <i class='fa fa-print'></i> </a>\n";
     echo "</span>\n";
     echo "</div>\n";
     echo "<!--pre_forum_thread-->\n";
     echo $info['open_post_form'];
     $i = 0;
     if (!empty($pdata)) {
         foreach ($pdata as $post_id => $post_data) {
             $i++;
             echo "<!--forum_thread_prepost_" . $post_data['post_id'] . "-->\n";
             render_post_item($post_data, $i);
             if ($post_id == $info['post_firstpost'] && $info['permissions']['can_post']) {
                 echo "<div class='text-right'>\n";
                 echo "<div class='display-inline-block'>" . $info['thread_posts'] . "</div>\n";
                 echo "<a class='m-l-20 btn btn-success btn-md vatop " . (empty($buttons['reply']) ? 'disabled' : '') . "' href='" . $buttons['reply']['link'] . "'>" . $buttons['reply']['title'] . "</a>\n";
                 echo "</div>\n";
             }
         }
     }
     if (isset($info['page_nav'])) {
         echo "<div id='forum_bottom' class='text-left m-b-10 text-lighter clearfix'>\n" . $info['page_nav'] . "</div>\n";
     }
     if (iMOD) {
         echo $info['mod_form'];
     }
     // Thread buttons, bottom
     if (iMEMBER && $info['permissions']['can_post']) {
         echo "<div class='text-right m-t-20'>\n";
         echo "<a class='btn btn-primary btn-sm m-r-5 " . (empty($buttons['newthread']) ? 'disabled' : '') . " ' href='" . $buttons['newthread']['link'] . "'>" . $buttons['newthread']['title'] . "</a>\n";
         echo "<a class='btn btn-primary btn-sm " . (empty($buttons['reply']) ? 'disabled' : '') . "' href='" . $buttons['reply']['link'] . "'>" . $buttons['reply']['title'] . "</a>\n";
         echo "</div>\n";
     }
     echo $info['close_post_form'];
     echo $info['quick_reply_form'];
     echo "\n\t\t<div class='list-group-item m-t-20'>\n\t\t\t<span>" . sprintf($locale['forum_perm_access'], $info['permissions']['can_access'] == TRUE ? "<strong class='text-success'>" . $locale['can'] . "</strong>" : "<strong class='text-danger'>" . $locale['cannot'] . "</strong>") . "</span><br/>\n\t\t\t<span>" . sprintf($locale['forum_perm_post'], $info['permissions']['can_post'] == TRUE ? "<strong class='text-success'>" . $locale['can'] . "</strong>" : "<strong class='text-danger'>" . $locale['cannot'] . "</strong>") . "</span><br/>\n\t\t\t<span>" . sprintf($locale['forum_perm_reply'], $info['permissions']['can_reply'] == TRUE ? "<strong class='text-success'>" . $locale['can'] . "</strong>" : "<strong class='text-danger'>" . $locale['cannot'] . "</strong>") . "</span><br/>\n\t\t\t";
     if ($data['thread_poll'] == TRUE) {
         echo "\t<span>" . sprintf($locale['forum_perm_edit_poll'], $info['permissions']['can_edit_poll'] == TRUE ? "<strong  class='text-success'>" . $locale['can'] . "</strong>" : "<strong class='text-danger'>" . $locale['cannot'] . "</strong>") . "</span><br/>\n\t\t\t<span>" . sprintf($locale['forum_perm_vote_poll'], $info['permissions']['can_vote_poll'] == TRUE ? "<strong  class='text-success'>" . $locale['can'] . "</strong>" : "<strong class='text-danger'>" . $locale['cannot'] . "</strong>") . "</span><br/>";
     } else {
         echo "\t<span>" . sprintf($locale['forum_perm_create_poll'], $info['permissions']['can_create_poll'] == TRUE ? "<strong  class='text-success'>" . $locale['can'] . "</strong>" : "<strong class='text-danger'>" . $locale['cannot'] . "</strong>") . "</span><br/>";
     }
     echo "\n\t\t\t<span>" . sprintf($locale['forum_perm_upload'], $info['permissions']['can_upload_attach'] == TRUE ? "<strong  class='text-success'>" . $locale['can'] . "</strong>" : "<strong class='text-danger'>" . $locale['cannot'] . "</strong>") . "</span><br/>\n\t\t\t<span>" . sprintf($locale['forum_perm_download'], $info['permissions']['can_download_attach'] == TRUE ? "<strong  class='text-success'>" . $locale['can'] . "</strong>" : "<strong class='text-danger'>" . $locale['cannot'] . "</strong>") . "</span><br/>\n\t\t\t";
     if ($data['forum_type'] == "4") {
         echo "<span>" . sprintf($locale['forum_perm_rate'], $info['permissions']['can_rate'] == TRUE ? "<strong  class='text-success'>" . $locale['can'] . "</strong>" : "<strong class='text-danger'>" . $locale['cannot'] . "</strong>") . "</span><br/>";
     }
     echo "\n\t\t</div>\n\n\t\t";
     if ($info['forum_moderators']) {
         echo "<div class='list-group-item'>" . $locale['forum_0185'] . " " . $info['forum_moderators'] . "</div>\n";
     }
     if (!empty($info['thread_users'])) {
         echo "<div class='list-group-item'>\n";
         echo "<span class='m-r-10'>" . $locale['forum_0581'] . "</span>";
         $i = 1;
         $max = count($info['thread_users']);
         foreach ($info['thread_users'] as $user_id => $users) {
             echo $users;
             echo $max == $i ? " " : ", ";
             $i++;
         }
         echo "</div>\n";
     }
 }
function net2ftp_shutdown()
{
    // --------------
    // This function is registered through register_shutdown_function, so that it would be
    // executed when the script reaches the maximum execution time.
    //
    // The function displays a warning message, and deletes temporary files.
    // --------------
    // -------------------------------------------------------------------------
    // Global variables and settings
    // -------------------------------------------------------------------------
    global $net2ftp_globals, $net2ftp_settings, $net2ftp_result;
    // -------------------------------------------------------------------------
    // Delete the temporary files which were not deleted automatically
    // -------------------------------------------------------------------------
    if (isset($net2ftp_globals["tempfiles"]) == true) {
        for ($i = 0; $i < sizeof($net2ftp_globals["tempfiles"]); $i++) {
            delete_dirorfile($net2ftp_globals["tempfiles"][$i]);
        }
    }
    // end if
    // -------------------------------------------------------------------------
    // Store the consumption counter values in the database
    // -------------------------------------------------------------------------
    putConsumption();
    // -------------------------------------------------------------------------
    // Print a message to tell the user that the script was halted
    // -------------------------------------------------------------------------
    $time_taken = timer();
    $max_execution_time = @ini_get("max_execution_time");
    // - Check if the $max_execution_time is > 0, because on some PHP configs it is -1 (more
    // specifically: when PHP is run as CGI module).
    // - Check the time taken versus the maximum execution time, because on Windows + Apache
    // servers, the shutdown function is always called, even if the maximum execution time
    // was not reached.
    if ($max_execution_time > 0 && $time_taken > $max_execution_time - 1) {
        if (isStatusbarActive() == true && function_exists("setStatus") == true) {
            setStatus(10, 10, __("Script halted"));
        }
        $text = "";
        $text .= "<b>" . __("Your task was stopped") . "</b><br /><br />\n";
        $text .= __("The task you wanted to perform with net2ftp took more time than the allowed %1\$s seconds, and therefor that task was stopped.", $max_execution_time) . "<br />\n";
        $text .= __("This time limit guarantees the fair use of the web server for everyone.") . "<br /><br />\n";
        $text .= __("Try to split your task in smaller tasks: restrict your selection of files, and omit the biggest files.") . "<br /><br />\n";
        if ($net2ftp_settings["net2ftpdotcom"] == "yes") {
            $text .= __("If you really need net2ftp to be able to handle big tasks which take a long time, consider installing net2ftp on your own server.");
        }
        if ($net2ftp_globals["state"] == "jupload") {
            echo $text;
        } else {
            echo "<div class=\"warning-box\"><div class=\"warning-text\">{$text}</div></div>\n\n";
        }
    }
}
/**
 * @param $comment_type - abbr or short ID
 * @param $comment_db - Current Application DB - DB_BLOG for example.
 * @param $comment_col - current sql primary key column - 'blog_id' for example
 * @param $comment_item_id - current sql primary key value '$_GET['blog_id']' for example
 * @param $clink - current page link 'FUSION_SELF' is ok.
 */
function showcomments($comment_type, $comment_db, $comment_col, $comment_item_id, $clink)
{
    global $settings, $locale, $userdata, $aidlink;
    $link = FUSION_SELF . (FUSION_QUERY ? "?" . FUSION_QUERY : "");
    $link = preg_replace("^(&amp;|\\?)c_action=(edit|delete)&amp;comment_id=\\d*^", "", $link);
    $_GET['comment'] = isset($_GET['comment']) && isnum($_GET['comment']) ? $_GET['comment'] : 0;
    $cpp = $settings['comments_per_page'];
    if (iMEMBER && (isset($_GET['c_action']) && $_GET['c_action'] == "delete") && (isset($_GET['comment_id']) && isnum($_GET['comment_id']))) {
        if (iADMIN && checkrights("C") || iMEMBER && dbcount("(comment_id)", DB_COMMENTS, "comment_id='" . $_GET['comment_id'] . "' AND comment_name='" . $userdata['user_id'] . "'")) {
            $result = dbquery("DELETE FROM " . DB_COMMENTS . "\n\t\t\t\tWHERE comment_id='" . $_GET['comment_id'] . "'" . (iADMIN ? "" : "\n\t\t\t\tAND comment_name='" . $userdata['user_id'] . "'"));
        }
        redirect($clink . ($settings['comments_sorting'] == "ASC" ? "" : "&amp;c_start=0"));
    }
    if ($settings['comments_enabled'] == "1") {
        if ((iMEMBER || $settings['guestposts'] == "1") && isset($_POST['post_comment'])) {
            if (!iMEMBER && $settings['guestpost'] == 1) {
                if (!isset($_POST['comment_name'])) {
                    redirect($link);
                }
                if (isnum($_POST['comment_name'])) {
                    $_POST['comment_name'] = '';
                }
                $_CAPTCHA_IS_VALID = FALSE;
                include INCLUDES . "captchas/" . $settings['captcha'] . "/captcha_check.php";
                if (!isset($_POST['captcha_code']) || $_CAPTCHA_IS_VALID == FALSE) {
                    redirect($link);
                }
            }
            $comment_data = array('comment_id' => isset($_GET['comment_id']) && isnum($_GET['comment_id']) ? $_GET['comment_id'] : 0, 'comment_name' => iMEMBER ? $userdata['user_id'] : form_sanitizer($_POST['comment_name'], '', 'comment_name'), 'comment_message' => form_sanitizer($_POST['comment_message'], '', 'comment_message'), 'comment_datestamp' => time(), 'comment_item_id' => $comment_item_id, 'comment_type' => $comment_type, 'comment_cat' => 0, 'comment_ip' => USER_IP, 'comment_ip_type' => USER_IP_TYPE, 'comment_hidden' => 0);
            if (iMEMBER && (isset($_GET['c_action']) && $_GET['c_action'] == "edit") && $comment_data['comment_id']) {
                $comment_updated = FALSE;
                if (iADMIN && checkrights("C") || iMEMBER && dbcount("(comment_id)", DB_COMMENTS, "comment_id='" . $comment_data['comment_id'] . "' \n\t\t\t\tAND comment_item_id='" . $comment_item_id . "'\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tAND comment_type='" . $comment_type . "' \n\t\t\t\tAND comment_name='" . $userdata['user_id'] . "' \n\t\t\t\tAND comment_hidden='0'")) {
                    dbquery_insert(DB_COMMENTS, $comment_data, 'update');
                    if ($comment_data['comment_message']) {
                        $result = dbquery("UPDATE " . DB_COMMENTS . " SET comment_message='" . $comment_data['comment_message'] . "'\n  \t\t\t\t\t\t\t\t\t   WHERE comment_id='" . $_GET['comment_id'] . "' " . (iADMIN ? "" : "AND comment_name='" . $userdata['user_id'] . "'"));
                        if ($result) {
                            $comment_updated = TRUE;
                        }
                    }
                }
                if ($comment_updated) {
                    if ($settings['comments_sorting'] == "ASC") {
                        $c_operator = "<=";
                    } else {
                        $c_operator = ">=";
                    }
                    $c_count = dbcount("(comment_id)", DB_COMMENTS, "comment_id" . $c_operator . "'" . $comment_data['comment_id'] . "'\n\t\t\t\t\t\t\t\tAND comment_item_id='" . $comment_item_id . "'\n\t\t\t\t\t\t\t\tAND comment_type='" . $comment_type . "'");
                    $c_start = (ceil($c_count / $cpp) - 1) * $cpp;
                }
                redirect($clink . "&amp;c_start=" . (isset($c_start) && isnum($c_start) ? $c_start : ""));
            } else {
                if (!dbcount("(" . $comment_col . ")", $comment_db, $comment_col . "='" . $comment_item_id . "'")) {
                    redirect(BASEDIR . "index.php");
                }
                $id = 0;
                if ($comment_data['comment_name'] && $comment_data['comment_message']) {
                    require_once INCLUDES . "flood_include.php";
                    if (!flood_control("comment_datestamp", DB_COMMENTS, "comment_ip='" . USER_IP . "'")) {
                        dbquery_insert(DB_COMMENTS, $comment_data, 'save');
                        $id = dblastid();
                    }
                }
                if ($settings['comments_sorting'] == "ASC") {
                    $c_count = dbcount("(comment_id)", DB_COMMENTS, "comment_item_id='" . $comment_item_id . "' AND comment_type='" . $comment_type . "'");
                    $c_start = (ceil($c_count / $cpp) - 1) * $cpp;
                } else {
                    $c_start = 0;
                }
                //if (!$settings['site_seo']) {
                redirect($clink . "&amp;c_start=" . $c_start . "#c" . $id);
                //}
            }
        }
        $c_arr = array("c_con" => array(), "c_info" => array("c_makepagenav" => FALSE, "admin_link" => FALSE));
        $c_rows = dbcount("(comment_id)", DB_COMMENTS, "comment_item_id='" . $comment_item_id . "' AND comment_type='" . $comment_type . "' AND comment_hidden='0'");
        if (!isset($_GET['c_start']) && $c_rows > $cpp) {
            $_GET['c_start'] = (ceil($c_rows / $cpp) - 1) * $cpp;
        }
        if (!isset($_GET['c_start']) || !isnum($_GET['c_start'])) {
            $_GET['c_start'] = 0;
        }
        $result = dbquery("SELECT tcm.comment_id, tcm.comment_name, tcm.comment_message, tcm.comment_datestamp,\n\t\t\t\t\ttcu.user_id, tcu.user_name, tcu.user_avatar, tcu.user_status\n\t\t\t\t\tFROM " . DB_COMMENTS . " tcm\n\t\t\t\t\tLEFT JOIN " . DB_USERS . " tcu ON tcm.comment_name=tcu.user_id\n\t\t\t\t\tWHERE comment_item_id='" . $comment_item_id . "' AND comment_type='" . $comment_type . "' AND comment_hidden='0'\n\t\t\t\t\tORDER BY comment_datestamp " . $settings['comments_sorting'] . " LIMIT " . $_GET['c_start'] . "," . $cpp);
        if (dbrows($result) > 0) {
            $i = $settings['comments_sorting'] == "ASC" ? $_GET['c_start'] + 1 : $c_rows - $_GET['c_start'];
            if ($c_rows > $cpp) {
                $c_arr['c_info']['c_makepagenav'] = makepagenav($_GET['c_start'], $cpp, $c_rows, 3, $clink . "&amp;", "c_start");
            }
            while ($data = dbarray($result)) {
                $c_arr['c_con'][$i]['comment_id'] = $data['comment_id'];
                $c_arr['c_con'][$i]['edit_dell'] = FALSE;
                $c_arr['c_con'][$i]['i'] = $i;
                if ($data['user_name']) {
                    $c_arr['c_con'][$i]['comment_name'] = profile_link($data['comment_name'], $data['user_name'], $data['user_status'], 'strong text-dark');
                } else {
                    $c_arr['c_con'][$i]['comment_name'] = $data['comment_name'];
                }
                $c_arr['c_con'][$i]['user_avatar'] = display_avatar($data, '35px', '', true, 'img-rounded');
                $c_arr['c_con'][$i]['user'] = array('user_id' => $data['user_id'], 'user_name' => $data['user_name'], 'user_avatar' => $avatar = $data['user_avatar'] !== '' && file_exists(IMAGES . 'avatars/' . $data['user_avatar']) ? IMAGES . 'avatars/' . $data['user_avatar'] : IMAGES . "avatars/noavatar50.png", 'user_status' => $data['user_status']);
                $c_arr['c_con'][$i]['comment_datestamp'] = showdate('shortdate', $data['comment_datestamp']);
                $c_arr['c_con'][$i]['comment_time'] = timer($data['comment_datestamp']);
                $c_arr['c_con'][$i]['comment_message'] = "<!--comment_message-->\n" . nl2br(parseubb(parsesmileys($data['comment_message'])));
                if (iADMIN && checkrights("C") || iMEMBER && $data['comment_name'] == $userdata['user_id'] && isset($data['user_name'])) {
                    $edit_link = clean_request('c_action=edit&comment_id=' . $data['comment_id'], array('c_action', 'comment_id'), false) . "#edit_comment";
                    $delete_link = clean_request('c_action=delete&comment_id=' . $data['comment_id'], array('c_action', 'comment_id'), false);
                    $c_arr['c_con'][$i]['edit_link'] = array('link' => $edit_link, 'name' => $locale['c108']);
                    $c_arr['c_con'][$i]['delete_link'] = array('link' => $delete_link, 'name' => $locale['c109']);
                    $c_arr['c_con'][$i]['edit_dell'] = "<!--comment_actions-->\n";
                    $c_arr['c_con'][$i]['edit_dell'] .= "<div class='btn-group'>";
                    $c_arr['c_con'][$i]['edit_dell'] .= "<a class='btn btn-xs btn-default' href='" . $edit_link . "'>";
                    $c_arr['c_con'][$i]['edit_dell'] .= $locale['c108'] . "</a>\n";
                    $c_arr['c_con'][$i]['edit_dell'] .= "<a class='btn btn-xs btn-default' href='" . $delete_link . "' onclick=\"return confirm('" . $locale['c110'] . "');\">";
                    $c_arr['c_con'][$i]['edit_dell'] .= "<i class='fa fa-trash'></i> " . $locale['c109'] . "</a>";
                    $c_arr['c_con'][$i]['edit_dell'] .= "</div>\n";
                }
                $settings['comments_sorting'] == "ASC" ? $i++ : $i--;
            }
            if (iADMIN && checkrights("C")) {
                $c_arr['c_info']['admin_link'] = "<!--comment_admin-->\n";
                $c_arr['c_info']['admin_link'] .= "<a href='" . ADMIN . "comments.php" . $aidlink . "&amp;ctype=" . $comment_type . "&amp;comment_item_id=" . $comment_item_id . "'>" . $locale['c106'] . "</a>";
            }
        }
        opentable($locale['c102']);
        $comment_message = "";
        if (iMEMBER && (isset($_GET['c_action']) && $_GET['c_action'] == "edit") && (isset($_GET['comment_id']) && isnum($_GET['comment_id']))) {
            $eresult = dbquery("SELECT tcm.comment_id, tcm.comment_name, tcm.comment_message, tcu.user_name\n\t\t\t\tFROM " . DB_COMMENTS . " tcm\n\t\t\t\tLEFT JOIN " . DB_USERS . " tcu ON tcm.comment_name=tcu.user_id\n\t\t\t\tWHERE comment_id='" . $_GET['comment_id'] . "' AND comment_item_id='" . $comment_item_id . "'\n\t\t\t\tAND comment_type='" . $comment_type . "' AND comment_hidden='0'");
            if (dbrows($eresult) > 0) {
                $edata = dbarray($eresult);
                if (iADMIN && checkrights("C") || iMEMBER && $edata['comment_name'] == $userdata['user_id'] && isset($edata['user_name'])) {
                    $clink .= "&amp;c_action=edit&amp;comment_id=" . $edata['comment_id'];
                    $comment_message = $edata['comment_message'];
                }
            } else {
                $comment_message = "";
            }
        }
        if (iMEMBER || $settings['guestposts'] == "1") {
            require_once INCLUDES . "bbcode_include.php";
            echo "<a id='edit_comment' name='edit_comment'></a>\n";
            echo openform('inputform', 'post', $clink, array('class' => 'm-b-20', 'max_tokens' => 1));
            if (iGUEST) {
                echo form_text('comment_name', $locale['c104'], '', array('max_length' => 30));
            }
            echo form_textarea('comment_message', '', $comment_message, array('required' => 1, 'autosize' => 1, 'form_name' => 'inputform', 'bbcode' => 1));
            if (iGUEST && (!isset($_CAPTCHA_HIDE_INPUT) || isset($_CAPTCHA_HIDE_INPUT) && !$_CAPTCHA_HIDE_INPUT)) {
                $_CAPTCHA_HIDE_INPUT = FALSE;
                echo "<div style='width:360px; margin:10px auto;'>";
                echo $locale['global_150'] . "<br />\n";
                include INCLUDES . "captchas/" . $settings['captcha'] . "/captcha_display.php";
                if (!$_CAPTCHA_HIDE_INPUT) {
                    echo "<br />\n<label for='captcha_code'>" . $locale['global_151'] . "</label>";
                    echo "<br />\n<input type='text' id='captcha_code' name='captcha_code' class='textbox' autocomplete='off' style='width:100px' />\n";
                }
                echo "</div>\n";
            }
            echo form_button('post_comment', $comment_message ? $locale['c103'] : $locale['c102'], $comment_message ? $locale['c103'] : $locale['c102'], array('class' => 'btn-success m-t-10'));
            echo closeform();
        } else {
            echo "<div class='well'>\n";
            echo $locale['c105'] . "\n";
            echo "</div>\n";
        }
        closetable();
        echo "<a id='comments' name='comments'></a>";
        render_comments($c_arr['c_con'], $c_arr['c_info']);
    }
}