Пример #1
0
function updateArray(&$newResult, $arrTep)
{
    if (!empty($newResult)) {
        foreach ($newResult as $k => $v) {
            if ($v['id'] == $arrTep['pid']) {
                $newResult[$k]['childrens'][] = $arrTep;
                return true;
            } elseif (!empty($v['childrens'])) {
                if (true === updateArray($newResult[$k]['childrens'], $arrTep)) {
                    return true;
                }
            }
        }
    }
    return false;
}
Пример #2
0
/**
 * 将当前节点插入到新的树形数组中
 * @param $newResult 树形数组地址
 * @param $arrTep 当前节点
 */
function updateArray(&$newResult, $arrTep)
{
    if (!empty($newResult)) {
        foreach ($newResult as $k => $v) {
            //查询当前节点的id是否与新的树形数组的id一致,如果是,那么将当前节点存放在树形数组的childrens字段中
            if ($v['id'] == $arrTep['pid']) {
                $newResult[$k]['childrens'][] = $arrTep;
                return true;
            } elseif (!empty($v['childrens'])) {
                //递归调用,查询树形数组的子节点与当前节点的关系
                if (true === updateArray($newResult[$k]['childrens'], $arrTep)) {
                    return true;
                }
            }
        }
    }
    return false;
}
Пример #3
0
$USERINFO = '';
$user = isset($_GET['user']) ? (int) $_GET['user'] + 0 : 0;
$blockedMod = FALSE;
foreach ($mods as $k => $v) {
    if (in_array($user, $v)) {
        $blockedMod = TRUE;
        break;
    }
}
$canBlock = TRUE;
if ($user_id != 1 and $isMod == 1 and $blockedMod) {
    $canBlock = FALSE;
}
if ($canBlock and ($user_id == 1 or $isMod == 1) and $user != 1 and $user_id != $user and isset($_GET['activity']) and ($_GET['activity'] == 1 or $_GET['activity'] == 0)) {
    ${$dbUserAct} = $_GET['activity'];
    updateArray(array($dbUserAct), $Tu, $dbUserId, $user);
}
$usEmail = '';
if (isset($directEmailEnabled)) {
    if ($user_id == 0 and $directEmailGuests or $user_id > 0) {
        $usEmail = '<a href="' . $indexphp . 'action=senddirect&amp;user='******'">' . $l_sendDirect . '</a>';
    }
}
if (!function_exists('parseUserInfo_user_regdate')) {
    function parseUserInfo_user_regdate($val)
    {
        if (strstr($val, '-')) {
            return convert_date($val);
        } else {
            return convert_date(date('Y-m-d H:i:s', $val));
        }
Пример #4
0
     }
     db_delete($Tp, 'post_id', '=', $post);
     if ($poster_id != 0) {
         db_calcAmount($Tp, 'poster_id', $poster_id, $Tu, $dbUserSheme['num_posts'][1], $dbUserId);
     }
     //}
     if (file_exists($pathToFiles . 'bb_plugins2.php')) {
         require $pathToFiles . 'bb_plugins2.php';
     }
 }
 // deletion cycle
 if ($pp = db_simpleSelect(0, $Tp, 'post_id, post_time, poster_name', 'topic_id', '=', $topic, 'post_id DESC', 1)) {
     $topic_last_post_id = $pp[0];
     $topic_last_post_time = $pp[1];
     $topic_last_poster = $pp[2];
     updateArray(array('topic_last_post_id', 'topic_last_post_time', 'topic_last_poster'), $Tt, 'topic_id', $topic);
     db_calcAmount($Tp, 'forum_id', $forum, $Tf, 'posts_count');
     db_calcAmount($Tp, 'topic_id', $topic, $Tt, 'posts_count');
     if (defined('DELETE_PREMOD')) {
         return;
     }
     //CSRF cookie delete
     setcookie($cookiename . 'csrf', '', time() - 2592000, $cookiepath, $cookiedomain, $cookiesecure);
     if (isset($metaLocation)) {
         $meta_relocate = "{$main_url}/{$indexphp}action=vthread&forum={$forum}&topic={$topic}&page={$page}";
         echo ParseTpl(makeUp($metaLocation));
         exit;
     } else {
         if (isset($mod_rewrite) and $mod_rewrite) {
             $urlp = addTopicURLPage(genTopicURL($main_url, $forum, '#GET#', $topic, $topicData[0]), $page);
         } else {
Пример #5
0
         $warning = $l_emailNotExists;
         $text2 = ParseTpl(makeUp('admin_sendmails1'));
         break;
     }
     $warning = $l_completed . " ({$row})";
     $text2 = ParseTpl(makeUp('admin_panel'));
     break;
 case 'restoreData':
     ${$dbUserSheme['username'][1]} = $admin_usr;
     ${$dbUserSheme['user_password'][1]} = writeUserPwd($admin_pwd);
     ${$dbUserSheme['user_email'][1]} = $admin_email;
     ${$dbUserDate} = date('Y-m-d H:i:s');
     $fields = array($dbUserSheme['username'][1], $dbUserSheme['user_password'][1], $dbUserSheme['user_email'][1]);
     if ($res = db_simpleSelect(0, $Tu, $dbUserId, $dbUserId, '=', 1)) {
         $ins = 1;
         $fs = updateArray($fields, $Tu, $dbUserId, 1);
     } else {
         $fields[] = $dbUserDate;
         $fields[] = $dbUserId;
         ${$dbUserId} = 1;
         $ins = 0;
         $fs = insertArray($fields, $Tu);
     }
     if ($fs > 0 and $ins == 1 or $fs == 0 and $ins == 0) {
         $warning = $l_prefsUpdated;
     } else {
         $warning = $l_prefsNotUpdated;
     }
     $text2 = ParseTpl(makeUp('admin_panel'));
     break;
 case 'banUsr1':
Пример #6
0
<?php

/*
This file is part of miniBB. miniBB is free discussion forums/message board software, without any warranty. See COPYING file for more details. Copyright (C) 2004 Paul Puzyrev, Sergei Larionov. www.minibb.net
*/
if (!defined('INCLUDED776')) {
    die('Fatal error.');
}
if (!isset($_GET['chstat'])) {
    die('Fatal error.');
} else {
    $topic_status = $_GET['chstat'];
}
if ($tD = db_simpleSelect(0, $Tt, 'topic_status, topic_poster, sticky', 'topic_id', '=', $topic)) {
    if ($tD[1] == $user_id and $tD[2] != 1 and ($topic_status == 0 and $userUnlock == 1 or $topic_status == 1) or $logged_admin == 1 or $isMod == 1) {
        if (updateArray(array('topic_status'), $Tt, 'topic_id', $topic) > 0) {
            $errorMSG = $topic_status == 1 ? $l_topicLocked : $l_topicUnLocked;
        } else {
            $errorMSG = $l_itseemserror;
        }
        $correctErr = "<a href=\"{$main_url}/{$indexphp}action=vthread&amp;forum={$forum}&amp;topic={$topic}\">{$l_back}</a>";
    } else {
        $errorMSG = $l_forbidden;
        $correctErr = $backErrorLink;
    }
}
$title .= $errorMSG;
echo load_header();
echo ParseTpl(makeUp('main_warning'));
return;
Пример #7
0
                     $sub[$v[1]] = $sub0[0];
                 }
             } else {
                 $v[1] = $langOrig;
             }
         } else {
             $v[1] = $langOrig;
         }
         $subS = $sub[$v[1]];
         $msgS = $msg[$v[1]][0] . $k . $msg[$v[1]][1];
         sendMail($v[0], $subS, $msgS, $reply_to_email, $reply_to_email);
     }
     //foreach
     if (sizeof($allUsers) > 0) {
         $active = 0;
         updateArray(array('active'), $Ts, 'topic_id', $topic);
     }
 }
 //email users
 //Email admin if allowed
 if ($genEmailDisable != 1 and isset($emailadmposts) and $emailadmposts == 1 and $user_id != 1) {
     $subS = $sub[$langOrig];
     $msgS = $msg[$langOrig][0] . '1' . $msg[$langOrig][1];
     sendMail($admin_email, $subS, $msgS, $reply_to_email, $reply_to_email);
 }
 unset($setTpls);
 $emailusers = $tmpUe;
 $insresOrig = $insres;
 //Insert user into email notifies if allowed
 if (isset($_POST['CheckSendMail']) and emailCheckBox() != '' and substr(emailCheckBox(), 0, 8) != '<!--U-->') {
     $ae = db_simpleSelect(0, $Ts, 'count(*)', 'user_id', '=', $user_id, '', '', 'topic_id', '=', $topic);
Пример #8
0
     } else {
         $post_status = 1;
     }
 } elseif (($user_id == 1 or $isMod == 1) and $fEdit == 0) {
     if ($logged_admin == 1 and $userAllow == 1 or $isMod == 1 and $userAllow == $user_id) {
         $post_status = 1;
     } else {
         $post_status = $whoEdited;
         if ($post_status == 2 or $post_status == 3) {
             $post_status = 0;
         }
     }
 } else {
     $post_status = 1;
 }
 $fif = updateArray(array('post_text', 'post_status'), $Tp, 'post_id', $post);
 if ($fif != 0) {
     $errorMSG .= $l_topicTextUpdated . "<br />";
 }
 $title .= $l_editPost;
 if (isset($mod_rewrite) and $mod_rewrite) {
     if (isset($topic_title)) {
         $tt = $topic_title;
     } else {
         $tt = '#GET#';
     }
     $furl = $furlCl = addTopicURLPage(genTopicURL($main_url, $forum, '#GET#', $topic, $tt), $page) . "#msg{$anchor}";
     $topicsLink = "<a href=\"" . addTopicURLPage(genForumURL($main_url, $forum, '#GET#'), PAGE1_OFFSET + 1) . "\">{$l_returntotopics}</a><br />";
 } else {
     $furl = addGenURLPage("{$main_url}/{$indexphp}action=vthread&amp;forum={$forum}&amp;topic={$topic}", $page) . "#msg{$anchor}";
     $furlCl = addGenURLPage("{$main_url}/{$indexphp}action=vthread&forum={$forum}&topic={$topic}", $page, '&') . "#msg{$anchor}";
Пример #9
0
 } elseif ($action == 'vthread') {
     /* Redirect to the regular URL and update sendmails table, if user is accessing topic from email message */
     if (isset($_GET['user'])) {
         $resetUser = $_GET['user'] + 0;
     } else {
         $resetUser = $user_id;
     }
     if (!isset($activeEmailsDisable) and $genEmailDisable == 0 and $emailusers > 0 and $user_id > 0 and $sendid = db_simpleSelect(0, $Ts, 'id,active,user_id', 'user_id', '=', $resetUser, '', '', 'topic_id', '=', $topic) and $sendid[1] == 0) {
         $active = 1;
         updateArray(array('active'), $Ts, 'id', $sendid[0]);
     }
     if (isset($_GET['goPost']) and isset($_GET['user'])) {
         $goPost = $_GET['goPost'] + 0;
         if ($sendid = db_simpleSelect(0, $Ts, 'id,active', 'user_id', '=', $resetUser, '', '', 'topic_id', '=', $topic) and $sendid[1] == 0) {
             $active = 1;
             updateArray(array('active'), $Ts, 'id', $sendid[0]);
         }
         $anchor = '#msg' . $goPost;
         if ($row = db_simpleSelect(0, $Tp, 'count(*)', 'post_id', '<=', $goPost, '', '', 'topic_id', '=', $topic)) {
             $totalPosts = $row[0];
         } else {
             $totalPosts = 0;
         }
         $page = getPage($topic, $totalPosts);
         if (isset($metaLocation)) {
             $meta_relocate = "{$main_url}/{$indexphp}action=vthread&amp;forum={$forum}&amp;topic={$topic}&amp;page={$page}{$anchor}";
             echo ParseTpl(makeUp($metaLocation));
             exit;
         } else {
             if (isset($mod_rewrite) and $mod_rewrite) {
                 $furl = addTopicURLPage(genTopicURL($main_url, $forum, '#GET#', $topic, '#GET#'), $page) . $anchor;
Пример #10
0
    die('Fatal error.');
}
if ($step != 1 and $step != 0) {
    $step = 0;
}
//0 - 1st step, 1-edit concrete
if ($topic != 0 and ($logged_admin == 1 or $isMod == 1) and $rt = db_simpleSelect(0, $Tt, 'topic_title', 'topic_id', '=', $topic) and $rf = db_simpleSelect(0, $Tf, 'count(*)') and $rf[0] > 0 and $rowf = db_simpleSelect(0, $Tf, 'forum_id, forum_name', '', '', '', 'forum_order')) {
    if ($step == 1) {
        if (isset($_POST['forumWhere'])) {
            $forum_id = $_POST['forumWhere'] + 0;
        } else {
            $forum_id = 0;
        }
        if ($forum_id != 0 and $ff = db_simpleSelect(0, $Tf, 'forum_id', 'forum_id', '=', $forum_id)) {
            $u1 = updateArray(array('forum_id'), $Tt, 'topic_id', $topic);
            $u2 = updateArray(array('forum_id'), $Tp, 'topic_id', $topic);
            db_calcAmount($Tp, 'forum_id', $forum_id, $Tf, 'posts_count');
            db_calcAmount($Tp, 'forum_id', $forum, $Tf, 'posts_count');
            db_calcAmount($Tt, 'forum_id', $forum_id, $Tf, 'topics_count');
            db_calcAmount($Tt, 'forum_id', $forum, $Tf, 'topics_count');
            if ($u1 > 0 and $u2 > 0) {
                /* If moving to closed forum, remove all forbidden subscribers */
                if (in_array($forum_id, $clForums)) {
                    if ($row = db_simpleSelect(0, $Ts, 'user_id', 'topic_id', '=', $topic)) {
                        $delstr = '(';
                        do {
                            if (!isset($clForumsUsers[$forum_id]) or isset($clForumsUsers[$forum_id]) and !in_array($row[0], $clForumsUsers[$forum_id])) {
                                db_delete($Ts, 'user_id', '=', $row[0], 'topic_id', '=', $topic);
                            }
                        } while ($row = db_simpleSelect(1));
                    }
Пример #11
0
// echo $_GET["occupation"]."<br>";
// echo get_preffered_style_name($_GET["prefferedstyle"])."<br>";
// echo $_GET["blog_domain"]."<br>";
//    echo $_GET["website"]."<br>";
//    echo $_GET["country"]."<br>";
//    echo $_GET["state"]."<br>";
//    echo $_GET["city"]."<br>";
//    echo $_GET["zipcode"]."<br>";
//    echo $_GET["cyear"]."<br>";
//    echo $_GET["describe_yourself"]."<br>";
//    echo $_GET["gender"]."<br>";
// mno	lastname	middlename	firstname	gender	website	bdate
// occupation	country	state_	city	zip	blogdom	aboutme	ispicset
// fbid	twid	isVal	datejoined
// $whereArray = array('mno',134);
updateArray('fs_members', array('occupation', 'preffered_style', 'blogdom', 'website', 'country', 'state_', 'city', 'zip', 'bdate', 'aboutme', 'gender'), array(get_occupation_name($_GET["occupation"]), get_preffered_style_name($_GET["prefferedstyle"]), $_GET["blog_domain"], $_GET["website"], $_GET["country"], $_GET["state"], $_GET["city"], $_GET["zipcode"], set_year($_GET["cyear"]), $_GET["describe_yourself"], gender($_GET["gender"])), 'mno', $_SESSION['mno']);
// echo "gender = ".gender($_GET["gender"])."<br>";
// echo "gender = ".year($_GET["cyear"])."<br>";
// print_r($your_data);
if ($_GET["gender"] == 1) {
    // print_r($men_brand);
    $_SESSION['gender'] = 1;
    echo "<table border=0 class='blist'>";
    // brands_men($brands_men,$bname=null,$id=null,$class=null)
    brands_men(brands_men_list(), 'brands_men', 'id_men_', 'cl_men_');
    echo "</table>";
    // echo "<input type='button' onclick='getCheckedBoxes();gotoSlide(2)' value='SAVE' > ";
    echo "\n\t\t\t<br><br><br>\n\t \t\t<center>\n\t\t\t\t<input type=button onclick='getCheckedBoxes_men();gotoSlide(2)' value='SAVE' class='m' style='width:200px;height:50px;font-size:20pt;box-shadow:2px 2px 2px #aaa;border:0; ' /> \n\t \t\t</center>\n\t\t";
} else {
    // print_r($women_brand);
    $_SESSION['gender'] = 2;
Пример #12
0
 if (!($updId = db_simpleSelect(0, $Tu, "{$dbUserId},{$dbUserSheme['language'][1]},{$dbUserSheme['username'][1]}", $dbUserSheme['user_email'][1], '=', $email))) {
     $title .= $l_emailNotExists;
     $errorMSG = $l_emailNotExists;
     $correctErr = $backErrorLink;
     echo load_header();
     echo ParseTpl(makeUp('main_warning'));
     return;
 } else {
     $ulang = $updId[1];
     $loginName = $updId[2];
     ${$dbUserNp} = substr(ereg_replace("[^0-9A-Za-z]", "A", writeUserPwd(uniqid(rand()))), 0, 8);
     $newPasswd = ${$dbUserNp};
     ${$dbUserNk} = substr(md5(uniqid(rand())), 0, 32);
     $confirmCode = ${$dbUserNk};
     $updArr = array($dbUserNp, $dbUserNk);
     $fs = updateArray($updArr, $Tu, $dbUserId, $updId[0]);
     if ($fs > 0) {
         if ($emailusers == 2 and file_exists($pathToFiles . 'templates/email_user_password_' . $ulang . '.txt')) {
             $langS = $ulang;
         } else {
             $langS = $langOrig;
         }
         $msg = ParseTpl(makeUp('email_user_password_' . $langS));
         $sub = explode('SUBJECT>>', $msg);
         $sub = explode('<<', $sub[1]);
         $msg = trim($sub[1]);
         $sub = $sub[0];
         if (!isset($reply_to_email)) {
             $reply_to_email = $admin_email;
         }
         sendMail($email, $sub, $msg, $reply_to_email, $reply_to_email);
Пример #13
0
function update_fs_members_4notifications($mno)
{
    // echo "$_POST[iral],$_POST[idal],$_POST[ifal],$_POST[ifam],$_POST[icoal],$_POST[icoab],$_POST[sf],$_POST[coml],$_POST[combp],$_POST[rtmc],$_POST[smnlpbpif]";
    updateArray('fs_members', array('iral', 'idal', 'ifal', 'ifam', 'icoal', 'icoab', 'sf', 'coml', 'combp', 'rtmc', 'smnlpbpif'), array($_POST['iral'], $_POST['idal'], $_POST['ifal'], $_POST['ifam'], $_POST['icoal'], $_POST['icoab'], $_POST['sf'], $_POST['coml'], $_POST['combp'], $_POST['rtmc'], $_POST['smnlpbpif']), 'mno', $mno);
}
Пример #14
0
<?php

/*
This file is part of miniBB. miniBB is free discussion forums/message board software, without any warranty. See COPYING file for more details. Copyright (C) 2004 Paul Puzyrev, Sergei Larionov. www.minibb.net
*/
if (!defined('INCLUDED776')) {
    die('Fatal error.');
}
$USERINFO = '';
$user = isset($_GET['user']) ? $_GET['user'] + 0 : 0;
if (($user_id == 1 or $isMod == 1) and $user != 1 and isset($_GET['activity']) and ($_GET['activity'] == 1 or $_GET['activity'] == 0)) {
    $activity = $_GET['activity'];
    updateArray(array('activity'), $Tu, $dbUserId, $user);
}
if (!isset($l_sendDirect)) {
    $usEmail = '';
} else {
    $usEmail = '<a href="' . $indexphp . 'action=senddirect&amp;user='******'">' . $l_sendDirect . '</a>';
}
$addFieldsGen = array('user_icq', 'user_website', 'user_occ', 'user_from', 'user_interest');
$addFd = '';
$addCustomFd = '';
foreach ($addFieldsGen as $k => $v) {
    if (isset($dbUserSheme[$v][1])) {
        $addFd .= ',' . $dbUserSheme[$v][1];
    } else {
        $addFd .= ',null';
    }
}
foreach ($dbUserSheme as $k => $v) {
    if (strstr($k, 'user_custom')) {
Пример #15
0
    $title .= $l_forbidden;
    $errorMSG = $l_forbidden;
    $correctErr = '';
} elseif ($curr = db_simpleSelect(0, $Tu, $dbUserNp, $dbUserNk, '=', $confirmCode)) {
    if ($confEmail) {
        ${$dbUserNk} = '';
        ${$dbUserNp} = '';
        ${$dbUserAct} = 1;
        $updArr = array($dbUserAct, $dbUserNk, $dbUserNp);
        $fs = updateArray($updArr, $Tu, $dbUserNk, $confirmCode);
        $mes = $l_emailCodeConfirm;
    } else {
        ${$dbUserSheme['user_password'][1]} = writeUserPwd($curr[0]);
        ${$dbUserNk} = '';
        ${$dbUserNp} = '';
        $updArr = array($dbUserSheme['user_password'][1], $dbUserNk, $dbUserNp);
        $fs = updateArray($updArr, $Tu, $dbUserNk, $confirmCode);
        $mes = $l_passwdUpdate;
    }
    if ($fs > 0) {
        $title .= $mes;
        $errorMSG = $mes;
        $correctErr = '';
    } else {
        $title .= $l_itseemserror;
        $errorMSG = $l_itseemserror;
        $correctErr = '';
    }
}
echo load_header();
echo ParseTpl(makeUp('main_warning'));
Пример #16
0
<?php

/*
This file is part of miniBB. miniBB is free discussion forums/message board software, without any warranty. See COPYING file for more details. Copyright (C) 2004 Paul Puzyrev, Sergei Larionov. www.minibb.net
*/
if (!defined('INCLUDED776')) {
    die('Fatal error.');
}
if (!isset($_GET['chstat'])) {
    die('Fatal error.');
} else {
    $sticky = $_GET['chstat'] + 0;
}
if ($logged_admin == 1 or $isMod == 1) {
    if (updateArray(array('sticky'), $Tt, 'topic_id', $topic) > 0) {
        $errorMSG = $sticky > 0 ? $l_topicSticked : $l_topicUnsticked;
    } else {
        $errorMSG = $l_itseemserror;
    }
    $correctErr = "<a href=\"{$main_url}/{$indexphp}action=vthread&amp;forum={$forum}&amp;topic={$topic}\">{$l_back}</a>";
} else {
    $errorMSG = $l_forbidden;
    $correctErr = $backErrorLink;
}
$title .= $errorMSG;
echo load_header();
echo ParseTpl(makeUp('main_warning'));
return;
Пример #17
0
 public function update_logging_in_fb_friends($mno, $fb_all_freinds, $fb_freinds_on_fs, $fb_freinds_on_fb)
 {
     // echo "update_logging_in_fb_friends( $mno , $fb_all_freinds , $fb_freinds_on_fs , $fb_freinds_on_fb )";
     $b = updateArray('fs_members', array('fb_all_freinds', 'fb_freinds_on_fb', 'fb_freinds_on_fs'), array($fb_all_freinds, $fb_freinds_on_fb, $fb_freinds_on_fs), 'mno', intval($mno));
 }
Пример #18
0
     $upda = array($dbUserSheme['user_email'][1], $dbUserSheme['user_viewemail'][1], $dbUserSheme['user_sorttopics'][1], $dbUserSheme['language'][1]);
     foreach ($addFieldsGen as $k) {
         if (isset($dbUserSheme[$k])) {
             $upda[] = $dbUserSheme[$k][1];
         }
     }
     foreach ($dbUserSheme as $k => $v) {
         if (strstr($k, 'user_custom')) {
             $upda[] = $v[1];
         }
     }
     if ($passwd != '') {
         ${$dbUserSheme['user_password'][1]} = md5(${$dbUserSheme['user_password'][1]});
         $upda[] = $dbUserSheme['user_password'][1];
     }
     $upd = updateArray($upda, $Tu, $dbUserId, $user_id);
     if ($upd > 0) {
         $title .= $l_prefsUpdated;
         $warning = $l_prefsUpdated;
         if (${$dbUserSheme['user_password'][2]} != '') {
             $warning .= ', ' . $l_prefsPassUpdated;
         }
     } else {
         $title .= $l_editPrefs;
         $warning = $l_prefsNotUpdated;
     }
 } else {
     if (!isset($l_userErrors[$correct])) {
         $l_userErrors[$correct] = $l_undefined;
     }
     $warning = $l_errorUserData . ": <span class=warning>{$l_userErrors[$correct]}</span>";
Пример #19
0
     } else {
         $antiSpam = 1;
     }
 }
 if ($user_id == 1 or $antiSpam == 0) {
     $forum_id = $forum;
     $topic_id = $topic;
     $poster_id = $user_id;
     $poster_name = $user_usr;
     $post_text = $postText;
     $post_time = 'now()';
     $post_status = 0;
     $inss = insertArray(array('forum_id', 'topic_id', 'poster_id', 'poster_name', 'post_text', 'post_time', 'poster_ip', 'post_status'), $Tp);
     if ($inss == 0) {
         $topic_last_post_id = $insres;
         if (updateArray(array('topic_last_post_id'), $Tt, 'topic_id', $topic) > 0) {
             db_forumReplies($forum, $Tp, $Tf);
             db_topicPosts($topic, $Tt, $Tp);
             //fire an event
             require_once 'geograph/event.class.php';
             new Event(EVENT_NEWREPLY, $topic_last_post_id);
         }
         if ($emailusers == 1 or isset($emailadmposts) and $emailadmposts == 1) {
             $topicTitle = db_simpleSelect(0, $Tt, 'topic_title', 'topic_id', '=', $topic);
             $topicTitle = $topicTitle[0];
             $postTextSmall = strip_tags(substr(str_replace(array('<br>', '&#039;', '&quot;', '&amp;', '&#036;'), array("\r\n", "'", '"', '&', '$'), $postText), 0, 200)) . '...';
             $msg = ParseTpl(makeUp('email_reply_notify'));
             $sub = explode('SUBJECT>>', $msg);
             $sub = explode('<<', $sub[1]);
             $msg = trim($sub[1]);
             $sub = $sub[0];
Пример #20
0
        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);
}
/* --User info in posts */
//echo $topicData[5];
if ($cols = db_simpleSelect(0, $Tp, 'poster_id, poster_name, post_time, post_text, poster_ip, post_status, post_id', 'topic_id', '=', $topic, 'post_id ' . $srt, $makeLim)) {
    if ($page == PAGE1_OFFSET + 1 and isset($enableViews) and $enableViews) {
        updateArray(array('topic_views'), $Tt, 'topic_id', $topic);
    }
    $tpl = makeUp('main_posts_cell');
    $groupDelete = 0;
    do {
        if ($i > 0) {
            $bg = 'tbCel1';
        } else {
            $bg = 'tbCel2';
        }
        $poster_id = $cols[0];
        $postDate = convert_date($cols[2]);
        if (!($user_id == 1 or $isMod == 1 or $user_id == 0)) {
            $availEditMes = ($topicStatus == 0 and (time() - strtotime($cols[2]) < $useredit or $useredit == 0));
        } else {
            $availEditMes = TRUE;