Example #1
0
             $forum_icon = 'default.gif';
         }
         if (!file_exists($pathToFiles . "img/forum_icons/{$forum_icon}")) {
             $warning = $l_error_addforumicon . "'" . $forum_icon . "'";
         } else {
             $fs = updateArray(array('forum_name', 'forum_desc', 'forum_icon', 'forum_group'), $Tf, 'forum_id', $forumID);
             if ($fs > 0) {
                 $warning = $l_forumUpdated;
             } else {
                 $warning = $l_prefsNotUpdated;
             }
         }
     } else {
         $warning = $l_error_addforum;
     }
     $forumsPreview = get_forums_fast_preview();
     $iconList = getForumIcons();
     foreach ($posts as $key => $val) {
         ${$key} = $val;
     }
     $text2 = ParseTpl(makeUp('admin_editforum2'));
 } else {
     $aff = 0;
     /* Amount of user topics */
     $updatedUsers = array();
     if ($rrr = db_simpleSelect(0, $Tp, 'poster_id', 'forum_id', '=', $forumID, '', '', 'poster_id', '!=', 0)) {
         do {
             if (!in_array($rrr[0], $updatedUsers)) {
                 $updatedUsers[] = $rrr[0];
             }
         } while ($rrr = db_simpleSelect(1));
Example #2
0
     if ($row = db_simpleSelect(0, $Tf, 'forum_id, forum_name, forum_desc, forum_order, forum_icon', '', '', '', 'forum_order')) {
         $a = 0;
         do {
             $resultVal['forum_name'][$a] = $row[1];
             $resultVal['forum_desc'][$a] = $row[2];
             $resultVal['forum_order'][$a] = $row[3];
             $resultVal['forum_id'][$a] = $row[0];
             $resultVal['forum_icon'][$a] = $row[4];
             if ($row[0] == $forumID) {
                 $forumname = $row[1];
                 $forumdesc = $row[2];
             }
             $a++;
         } while ($row = db_simpleSelect(1));
         $forumorder = get_template_forum_orders($resultVal, $a - 1, $forumID, $l_mysql_error);
         $forumsPreview = get_forums_fast_preview($resultVal, $a - 1, $l_mysql_error);
         unset($resultVal);
         $iconList = getForumIcons();
     }
     $text2 = ParseTpl(makeUp('admin_editforum2'));
 } else {
     $aff = 0;
     if ($rrr = db_simpleSelect(0, "{$Tt},{$Ts}", "{$Tt}.topic_id", "{$Tt}.forum_id", '=', $forumID, '', '', "{$Tt}.topic_id", '=', "{$Ts}.topic_id")) {
         $ord = '';
         do {
             $ord .= "topic_id={$rrr[0]} or ";
         } while ($rrr = db_simpleSelect(1));
         $ord = substr($ord, 0, strlen($ord) - 4);
         $aff += db_delete($Ts, $ord, '', '');
     }
     $aff += db_delete($Tf, 'forum_id', '=', $forumID);