Example #1
0
}
/* Get list of moderators */
$modsForums = array();
if (isset($mods) and sizeof($mods) > 0) {
    $mds = array();
    foreach ($mods as $md) {
        if (is_array($md)) {
            foreach ($md as $us) {
                if (!in_array($us, $mds)) {
                    $mds[] = $us;
                }
            }
        }
    }
    if (sizeof($mds) > 0) {
        $xtr = getClForums($mds, 'where', '', $dbUserId, 'or', '=');
        if ($row = db_simpleSelect(0, $Tu, $dbUserSheme['username'][1] . ',' . $dbUserId, '', '', '', $dbUserId)) {
            do {
                $modsForums[$row[1]] = "<a href=\"{$main_url}/{$indexphp}action=userinfo&amp;user={$row[1]}\">{$row[0]}</a>";
            } while ($row = db_simpleSelect(1));
        }
    }
    unset($xtr);
}
/* Forums */
$keyAr = 0;
$list_forums = '';
if ($cols = db_simpleSelect(0, $Tf, 'forum_id, forum_name, forum_desc, forum_icon, topics_count, posts_count, forum_group', '', '', '', 'forum_order')) {
    $i = 1;
    if (!isset($startPageModern) or !$startPageModern) {
        $tpl = makeUp('main_forums_cell');
    $xtr = '';
}
$lPosts = array();
if ($user_sort == 1) {
    $orderBy = 'topic_id DESC';
} else {
    $orderBy = 'topic_last_post_id DESC';
}
if ($cols = db_simpleSelect(0, $Tt, 'topic_last_post_id', 'forum_id', $filterCrit, $filterIds, $orderBy, $viewlastdiscussions)) {
    do {
        $lPosts[] = $cols[0];
    } while ($cols = db_simpleSelect(1));
}
$xtr1 = $xtr;
if (sizeof($lPosts) > 0) {
    $xtr = getClForums($lPosts, 'where', '', 'post_id', 'or', '=');
} else {
    $xtr = '';
}
if ($row = db_simpleSelect(0, $Tp, 'poster_id, poster_name, post_time, topic_id')) {
    do {
        $pVals[$row[3]] = array($row[0], $row[1], $row[2]);
    } while ($row = db_simpleSelect(1));
}
$xtr = $xtr1;
$list_topics = '';
if ($cols = db_simpleSelect(0, "{$Tt} Tt left join geobb_lastviewed Tl on (Tt.topic_id = Tl.topic_id and Tl.user_id = {$USER->user_id})", 'Tt.topic_id, topic_title, topic_poster, topic_poster_name, topic_time, forum_id, posts_count, topic_last_post_id, topic_views, (topic_last_post_id > last_post_id) as isnew, last_post_id', 'forum_id', $filterCrit, $filterIds, $orderBy, $viewlastdiscussions, '', '', '', null, isset($_GET['read']) ? 'topic_id having (isnew > 0 or isnew is null)' : '')) {
    $i = 1;
    $tpl = makeUp('main_last_discuss_cell');
    do {
        $forum = $cols[5];
Example #3
0
     }
     if (sizeof($postsAll) > 0) {
         $what = $l_userLastPosts;
         $whatValue = '<ul class="limbb">';
         foreach ($postsAll as $key => $val) {
             $whatValue .= $topicVals[$key];
         }
         $whatValue .= '</ul>';
         $USERINFO .= ParseTpl($usrCell);
     }
 }
 /* Activities */
 if (!defined('NOT_SHOW_ACTIVITIES')) {
     $closedForums = getAccess($clForums, $clForumsUsers, $user_id);
     if ($closedForums != 'n') {
         $xtr = getClForums($closedForums, 'AND', '', 'forum_id', 'AND', '!=');
     } else {
         $xtr = '';
     }
     $what = $l_usrInfoActivities;
     $forums = array();
     $forumIds = array();
     if ($rw = db_simpleSelect(0, $Tp, 'forum_id', 'poster_id', '=', $user)) {
         do {
             if (!isset($forums[$rw[0]])) {
                 $forums[$rw[0]] = 1;
             } else {
                 $forums[$rw[0]]++;
             }
             if (!in_array($rw[0], $forumIds)) {
                 $forumIds[] = $rw[0];
Example #4
0
                $lPosts[] = $cols[0];
            }
        }
        $colls[] = array($cols[0], $cols[1], $cols[2], $cols[3], $cols[4], $cols[5], $cols[6], $cols[7], $cols[8], $cols[9], $cols[10]);
    } while ($cols = db_simpleSelect(1));
}
if (isset($textLd)) {
    if (sizeof($lPosts) > 0) {
        if ($user_sort == 0) {
            $ordb = 'post_id';
            $ordSql = 'DESC';
        } else {
            $ordb = 'topic_id';
            $ordSql = 'ASC';
        }
        $xtr = getClForums($lPosts, 'where', '', $ordb, 'or', '=');
    } else {
        $xtr = '';
    }
    if ($xtr != '') {
        if ($row = db_simpleSelect(0, $Tp, 'poster_id, poster_name, post_time, topic_id, post_text, post_id', '', '', '', 'post_id ' . $ordSql)) {
            do {
                if (!isset($pVals[$row[3]])) {
                    $pVals[$row[3]] = array($row[0], $row[1], $row[2], $row[4], $row[5]);
                } else {
                    continue;
                }
            } while ($row = db_simpleSelect(1));
        }
    }
}
    $exploded[$i] = $searchFor;
    $searchString = db_searchMatchGen($whereGenAr[0], $i);
    $searchString2 = db_searchMatchGen($whereGenAr[1], $i);
}
if ($searchWhere != 0) {
    unset($searchString2);
}
if (!$word || strlen($searchFor) > 100) {
    $searchResults = '<span class=txtSm>' . $l_search[10] . '</span>';
} else {
    if (!isset($searchResults)) {
        $searchResults = '';
    }
    $i = $viewmaxsearch * $page;
    $and = $extra && !$searchWhere ? 'AND' : 'WHERE';
    $xtrE = $extra == 1 ? getClForums($closedForums, $and, $sTA[$searchWhere], 'forum_id', 'AND', '!=') : '';
    $and = $extra || !$searchWhere ? 'AND' : 'WHERE';
    $xtr = $xtrE . getByDay($and, $sTA[$searchWhere], $sTTA[$searchWhere]) . db_searchWithin($searchWhere, true);
    if (!$searchWhere) {
        $numRows = db_simpleSelect(2, $sCA[$searchWhere], 'count(*)', $Tp . '.topic_id', '=', "{$Tt}.topic_id");
    } else {
        $numRows = db_simpleSelect(2, $sCA[$searchWhere], 'count(*)');
    }
    $pageNav = pageNav($page, $numRows, "{$main_url}/{$indexphp}action=search&amp;searchFor={$searchFor}&amp;searchWhere={$searchWhere}&amp;searchHow={$searchHow}&amp;searchForum={$searchForum}&amp;days={$days}&amp;exact={$exact}&amp;page=", $viewmaxsearch, false);
    $makeLim = makeLim($page, $numRows, $viewmaxsearch);
    $xtr = str_replace('WHERE', 'AND', $xtr);
    if ($searchWhere == 0 && $numRows) {
        $xtr .= db_searchWithin($searchWhere, false);
        $cols = db_simpleSelect(0, $Tp . ',' . $Tt . ',' . $Tf, "{$Tp}.post_id, {$Tp}.forum_id, {$Tp}.topic_id, {$Tp}.post_text, {$Tp}.post_time, {$Tt}.topic_title, {$Tf}.forum_name", '', '', '', 'post_id DESC', $makeLim, $Tp . '.topic_id', '=', $Tt . '.topic_id', false);
        do {
            $i++;
Example #6
0
 if ($where == 0) {
     /* If we search by messages, first select the messages, then their topic titles. 2 requests */
     $searchTopics = array();
     $searchData = array();
     $i = 0;
     if ($row = db_searchSelect(0, $Tp, 'post_id, forum_id, topic_id, post_time, post_text', $sqlStr, $makeLim, 'post_id desc')) {
         do {
             if (!in_array($row[2], $searchTopics)) {
                 $searchTopics[] = $row[2];
             }
             $txt = highlightText($row[4], $phrase, $searchType);
             $searchData[$i] = array('post_id' => $row[0], 'forum_id' => $row[1], 'forum_name' => isset($forums[$row[1]]) ? $forums[$row[1]] : 'N/A', 'topic_id' => $row[2], 'datetime' => $row[3], 'text' => $txt);
             $i++;
         } while ($row = db_searchSelect(1));
     }
     $xtrTopics = getClForums($searchTopics, '', '', 'topic_id', 'OR', '=');
     unset($searchTopics);
     $searchTopics = array();
     if ($row = db_searchSelect(0, $Tt, 'topic_id, topic_title', '(' . $xtrTopics . ')')) {
         do {
             $searchTopics[$row[0]] = $row[1];
         } while ($row = db_searchSelect(1));
     }
     /* Output to screen */
     for ($i = 0; $i < $viewmaxsearch; $i++) {
         if (isset($searchData[$i])) {
             $num = $i + 1 + $page * $viewmaxsearch - (PAGE1_OFFSET + 1) * $viewmaxsearch;
             $datetime = convert_date($searchData[$i]['datetime']);
             if (isset($searchData[$i]['topic_id']) and isset($searchTopics[$searchData[$i]['topic_id']])) {
                 $topic_name = $searchTopics[$searchData[$i]['topic_id']];
             } else {
Example #7
0
                         if ($row[4] == 0) {
                             $s = '<span class="warning"><b>-</b></span>';
                         } else {
                             $s = '+';
                         }
                         $listSubs .= "<br /><input type=\"checkbox\" name=\"selsub[]\" value=\"{$row[0]}\" /><span class=\"txtSm\"><a href=\"{$main_url}/{$indexphp}action=userinfo&amp;user={$row[1]}\">{$row[2]}</a> (<a href=\"mailto:{$row[3]}\">{$row[3]}</a>) [{$s}]</span>\n";
                     } while ($row = db_simpleSelect(1));
                     $listSubs .= "<br /><br />&nbsp;<input type=\"submit\" value=\"{$l_deletePost}\" class=\"inputButton\" /></form>\n";
                 }
                 $text2 = ParseTpl(makeUp('admin_viewsubs'));
             }
             break;
         case 'viewsubs2':
             $fs = 0;
             if (isset($_POST['selsub']) and sizeof($_POST['selsub']) > 0) {
                 $xtr = getClForums($_POST['selsub'], '', '', 'id', 'or', '=');
                 $fs = db_delete($Ts, $xtr);
             }
             $errorMSG = $l_subscriptions . ': ' . $l_del . ' ' . $fs . ' ' . $l_rows;
             $correctErr = "<a href=\"{$indexphp}action=vthread&amp;topic={$_POST['topic']}#newreply\">{$l_back}</a>";
             $text2 = ParseTpl(makeUp('main_warning'));
             break;
         default:
             $warning = '';
             $text2 = ParseTpl(makeUp('admin_panel'));
     }
     // end of switch
 } else {
     if (!$warning) {
         $warning = $l_enter_admin_login;
     }
Example #8
0
     $msgg = explode('[USER_ID]', trim($sub0[1]));
     $msg[$langOrig][0] = $msgg[0];
     $msg[$langOrig][1] = $msgg[1];
     $sub[$langOrig] = $sub0[0];
 }
 //Email all users about this reply if allowed
 if ($genEmailDisable != 1 and $emailusers > 0) {
     $allUsers = array();
     if ($row = db_simpleSelect(0, $Ts, 'user_id,active', 'topic_id', '=', $topic, '', '', 'user_id', '!=', $user_id)) {
         do {
             if ($row[1] == 1) {
                 $allUsers[] = $row[0];
             }
         } while ($row = db_simpleSelect(1));
     }
     $xtr = getClForums($allUsers, 'where', '', $dbUserId, 'OR', '=');
     $allUsers = array();
     if ($row = db_simpleSelect(0, $Tu, "{$dbUserId}, {$dbUserSheme['user_email'][1]}, {$dbUserSheme['language'][1]}")) {
         do {
             $allUsers[$row[0]] = array($row[1], $row[2]);
         } while ($row = db_simpleSelect(1));
     }
     unset($xtr);
     foreach ($allUsers as $k => $v) {
         if ($emailusers == 2) {
             /* Send email on user's language */
             $eFile = 'email_reply_notify_' . $v[1];
             if (file_exists($pathToFiles . 'templates/' . $eFile . '.txt')) {
                 if (!isset($setTpls[$v[1]])) {
                     $setTpls[$v[1]] = ParseTpl(makeUp($eFile));
                     $sub0 = explode('SUBJECT>>', $setTpls[$v[1]]);
Example #9
0
if (isset($themeDesc) and in_array($topic, $themeDesc)) {
    $srt = 'DESC';
} else {
    $srt = 'ASC';
}
/* User info in posts */
if (isset($GLOBALS['userInfoInPosts']) and is_array($GLOBALS['userInfoInPosts'])) {
    $userInfo = array();
    if ($cols = db_simpleSelect(0, $Tp, 'poster_id', 'topic_id', '=', $topic, 'post_id ' . $srt, $makeLim)) {
        do {
            if (!in_array($cols[0], $userInfo)) {
                $userInfo[] = $cols[0];
            }
        } while ($cols = db_simpleSelect(1));
    }
    $xtr = getClForums($userInfo, 'where', '', $dbUserId, 'or', '=');
    unset($userInfo);
    if ($cols = db_simpleSelect(0, $Tu, $dbUserId . ',' . implode(',', $userInfoInPosts))) {
        for ($i = 0; $i < sizeof($userInfoInPosts); $i++) {
            ${'userInfo_' . $userInfoInPosts[$i]} = array();
        }
        do {
            for ($i = 0; $i < sizeof($userInfoInPosts); $i++) {
                if (function_exists('parseUserInfo_' . $userInfoInPosts[$i])) {
                    $cols[$i + 1] = call_user_func('parseUserInfo_' . $userInfoInPosts[$i], $cols[$i + 1]);
                }
                ${'userInfo_' . $userInfoInPosts[$i]}[$cols[0]] = $cols[$i + 1];
            }
        } while ($cols = db_simpleSelect(1));
    }
    unset($xtr);
Example #10
0
}
$statsOptL = array($l_stats_popular, $l_stats_viewed, $l_stats_aUsers);
//$statsOptL=array($l_stats_popular,$l_stats_aUsers,$l_stats_viewed);
for ($i = 0; $i <= $lstLim; $i++) {
    if ($i != $lst and $statsOptL[$i] != '') {
        $statsOpt .= ' / <b><a href="' . $main_url . '/' . $indexphp . 'action=stats&amp;top=' . $top . '&amp;days=' . $days . '&amp;lst=' . $i . '"' . $nof . '>' . $statsOptL[$i] . '</a></b>';
    } elseif ($statsOptL[$i] != '') {
        $statsOpt .= ' / <b>' . $statsOptL[$i] . '</b>';
    }
}
$tpl = makeUp('stats_bar');
$timeLimit = date('Y-m-d H:i:s', time() - $days * 86400);
if ($lst == 0) {
    $xtr = $extra == 1 ? getClForums($closedForums, 'AND', '', 'forum_id', 'AND', '!=') : '';
} elseif ($enableViews && $lst == 1) {
    $xtr = $extra == 1 ? getClForums($closedForums, 'AND', '', 'forum_id', 'AND', '!=') : '';
}
if ($lst == 0 && ($cols = db_simpleSelect(0, $Tt, 'topic_id, topic_title, forum_id, posts_count', 'topic_time', '>=', $timeLimit, 'posts_count DESC', $makeLim))) {
    do {
        if (isset($preModerationType) and $preModerationType > 0 and isset($premodTopics) and in_array($cols[0], $premodTopics)) {
            $cols[1] = $l_topicQueued;
        }
        $val = $cols[3] - 1;
        if (!isset($vMax)) {
            $vMax = $val;
        }
        if ($vMax != 0) {
            $stats_barWidth = round(100 * ($val / $vMax));
        }
        if ($stats_barWidth > $stats_barWidthLim) {
            $key = '<a href="' . gen_vthread_url($cols[2], $forumNames[$cols[2]], $cols[0], $cols[1], PAGE1_OFFSET + 1) . '"' . $nof . '>' . $cols[1] . '</a>';
 $forums = array();
 $forumIds = array();
 if ($rw = db_simpleSelect(0, $Tp, 'forum_id', 'poster_id', '=', $user)) {
     do {
         if (!isset($forums[$rw[0]])) {
             $forums[$rw[0]] = 1;
         } else {
             $forums[$rw[0]]++;
         }
         if (!in_array($rw[0], $forumIds)) {
             $forumIds[] = $rw[0];
         }
     } while ($rw = db_simpleSelect(1));
     asort($forums, SORT_NUMERIC);
     $forums = array_reverse($forums, TRUE);
     $xtr = getClForums($forumIds, 'where', '', 'forum_id', 'OR', '=');
     $forumNames = array();
     if ($rw = db_simpleSelect(0, $Tf, 'forum_id,forum_name')) {
         do {
             $forumNames[$rw[0]] = $rw[1];
         } while ($rw = db_simpleSelect(1));
     }
     $userID = $user + 0;
     $key2 = '';
     $whatValue = '';
     $tpl = makeUp('stats_bar');
     if (sizeof($forumNames) > 0) {
         foreach ($forums as $k => $val) {
             if (!isset($vMax)) {
                 $vMax = $val;
             }