Пример #1
0
$readdb = $authorids = array();
//主题印戳
if ($forumset['overprint']) {
    $overPrintService = L::loadclass("overprint", 'forum');
    $overprint = $overPrintService->getOverPrintIcon($read['overprint']);
}
if ($forumset['viewpic'] && !$winduid) {
    $viewpic = 1;
}
if ($read['modelid'] || $foruminfo['modelid']) {
    L::loadClass('posttopic', 'forum', false);
    $postTopic = new postTopic($read);
}
if ($read['special'] > 20 || $foruminfo['pcid']) {
    L::loadClass('postcate', 'forum', false);
    $postCate = new postCate($read);
}
if ($read['special'] == 8 || $foruminfo['actmids']) {
    L::loadClass('ActivityForBbs', 'activity', false);
    $postActForBbs = new PW_ActivityForBbs($data);
}
//分类信息主题帖
if ($read['modelid']) {
    $modelid = $read['modelid'];
    $topicvalue = $postTopic->getTopicvalue($read['modelid']);
    $initSearchHtml = $postTopic->initSearchHtml($read['modelid']);
    foreach ($postTopic->topicmodeldb as $key => $value) {
        if ($value['cateid'] == $foruminfo['cateid']) {
            $modeldb[$key] = $value;
        }
    }
Пример #2
0
if ($pcid > 0 || $modelid > 0) {
    $db_forcetype = 0;
}
if ($modelid) {
    //分类主题
    require_once R_P . 'lib/posttopic.class.php';
    $postTopic = new postTopic($pwpost);
    if ($postTopic) {
        $postTopic->postCheck();
    }
    $topichtml = $postTopic->getTopicHtml($modelid);
}
if ($pcid > 0) {
    //团购活动
    require_once R_P . 'lib/postcate.class.php';
    $postCate = new postCate($pwpost);
    if ($postCate) {
        $postCate->postCheck();
    }
    $topichtml = $postCate->getCateHtml($pcid);
}
$page = floor($article / $db_readperpage) + 1;
if (!$pwpost->isGM && !pwRights($pwpost->isBM, 'deltpcs')) {
    if ($groupid == 'guest' || $atcdb['authorid'] != $winduid) {
        Showmsg('modify_noper');
    } elseif ($locked % 3 > 0) {
        Showmsg('modify_locked');
    }
}
if ($winduid != $atcdb['authorid'] && $groupid != 3 && $groupid != 4) {
    $authordb = $db->get_one("SELECT groupid FROM pw_members WHERE uid=" . pwEscape($atcdb['authorid']));
Пример #3
0
<?php

!defined('P_W') && exit('Forbidden');
S::gp(array('tid', 'pcid'), G, 2);
$read = $db->get_one("SELECT authorid,subject,fid FROM pw_threads WHERE tid=" . S::sqlEscape($tid));
$foruminfo = $db->get_one('SELECT forumadmin,fupadmin FROM pw_forums WHERE fid=' . S::sqlEscape($read['fid']));
$isGM = S::inArray($windid, $manager);
$isBM = admincheck($foruminfo['forumadmin'], $foruminfo['fupadmin'], $windid);
L::loadClass('postcate', 'forum', false);
$post = array();
$postCate = new postCate($post);
$isadminright = $postCate->getAdminright($pcid, $read['authorid']);
if (!$isadminright) {
    Showmsg('pcexport_none');
}
$memberdb = array();
$query = $db->query("SELECT username,mobile,phone,address,nums,ifpay,totalcash,name,zip,message FROM pw_pcmember WHERE tid=" . S::sqlEscape($tid));
while ($rt = $db->fetch_array($query)) {
    if ($rt['ifpay'] == 1) {
        $rt['ifpay'] = getLangInfo('other', 'pc_payed');
    } else {
        $rt['ifpay'] = getLangInfo('other', 'pc_paying');
    }
    if ($db_charset == 'utf-8' || $db_charset == 'big5') {
        foreach ($rt as $key => $value) {
            $rt[$key] = pwConvert($value, 'gbk', $db_charset);
        }
    }
    $memberdb[] = $rt;
}
$titledb = array(getLangInfo('other', 'pc_id') . "\t", getLangInfo('other', 'pc_username') . "\t", getLangInfo('other', 'pc_name') . "\t", getLangInfo('other', 'pc_mobile') . "\t", getLangInfo('other', 'pc_phone') . "\t", getLangInfo('other', 'pc_address') . "\t", getLangInfo('other', 'pc_zip') . "\t", getLangInfo('other', 'pc_nums') . "\t", getLangInfo('other', 'pc_totalcash') . "\t", getLangInfo('other', 'pc_message') . "\t", getLangInfo('other', 'pc_ifpay') . "\t\n");
Пример #4
0
<?php

!defined('P_W') && exit('Forbidden');
S::gp(array('page', 'tid', 'jointype', 'payway', 'ifend', 'pcid'));
$isadminright = $jointype == 3 ? 0 : 1;
L::loadClass('postcate', 'forum', false);
$postCate = new postCate($data);
list(, $isviewright) = $postCate->getViewright($pcid, $tid);
$memberdb = array();
$count = $sum = $paysum = 0;
$query = $db->query("SELECT ifpay,nums FROM pw_pcmember WHERE tid=" . S::sqlEscape($tid));
while ($rt = $db->fetch_array($query)) {
    $count++;
    if ($rt['ifpay']) {
        $paysum += $rt['nums'];
    }
    $sum += $rt['nums'];
}
$page < 1 && ($page = 1);
$numofpage = ceil($count / $db_perpage);
if ($numofpage && $page > $numofpage) {
    $page = $numofpage;
}
$start = ($page - 1) * $db_perpage;
$limit = S::sqlLimit($start, $db_perpage);
$pages = numofpage($count, $page, $numofpage, "pw_ajax.php?action={$action}&tid={$tid}&jointype={$jointype}&payway={$payway}&", null, 'ajaxview');
$i = $pcid = 0;
$query = $db->query("SELECT pcmid,uid,pcid,username,nums,totalcash,phone,mobile,address,extra,ifpay,jointime FROM pw_pcmember WHERE tid=" . S::sqlEscape($tid) . " ORDER BY (uid=" . S::sqlEscape($winduid) . ") DESC,ifpay ASC,pcmid DESC {$limit}");
while ($rt = $db->fetch_array($query)) {
    if ($i == 0) {
        $pcid = $rt['pcid'];
Пример #5
0
         }
     }
     $searchhtml .= '</span>';
     $asearchhtml .= '</span>';
     if (strpos($searchhtml, '</span></span>') !== false) {
         $searchhtml = str_replace('</span></span>', '</span>', $searchhtml);
     }
     if (strpos($asearchhtml, '</span></span>') !== false) {
         $asearchhtml = str_replace('</span></span>', '</span>', $asearchhtml);
     }
     $pcid = (int) $pcid;
     $pcvaluetable = GetPcatetable($pcid);
 }
 if ($step == 'search') {
     require_once R_P . 'lib/postcate.class.php';
     $searchPostcate = new postCate($field);
     if (!$newfield) {
         $newfield = StrCode(serialize($field));
     }
     list($count, $tiddb, $alltiddb) = $searchPostcate->getSearchvalue($newfield, 'one', true, true);
     is_array($tiddb) && ($sql .= " AND pv.tid IN(" . pwImplode($tiddb) . ")");
     is_array($alltiddb) && ($alltids = implode(',', $alltiddb));
 }
 if ($step != 'search' || !$count) {
     $alltiddb = $threadb = $newtiddb = array();
     $alltiddb = array();
     $query = $db->query("SELECT tid FROM {$pcvaluetable} WHERE ifrecycle=0");
     while ($rt = $db->fetch_array($query)) {
         $alltiddb[] = $rt['tid'];
     }
     if ($alltiddb) {
Пример #6
0
require_once R_P . 'require/bbscode.php';
S::gp(array('pcid', 'modelid'), 'P', 2);
$fielddb = array();
$data = array();
$atc_content = S::escapeChar(stripslashes(S::getGP('atc_content', 'P')));
$pcinfo = S::escapeChar(stripslashes(S::getGP('pcinfo', 'P')));
if ($modelid > 0) {
    $query = $db->query("SELECT fieldid,fieldname FROM pw_topicfield WHERE modelid=" . S::sqlEscape($modelid));
    while ($rt = $db->fetch_array($query)) {
        $fielddb[$rt['fieldid']] = $rt['fieldname'];
    }
    $pcdb = getPcviewdata($pcinfo, 'topic');
    L::loadClass('posttopic', 'forum', false);
    $postTopic = new postTopic($data);
    $topicvalue = $postTopic->getTopicvalue($modelid, $pcdb);
} elseif ($pcid > 0) {
    $query = $db->query("SELECT fieldid,fieldname FROM pw_pcfield WHERE pcid=" . S::sqlEscape($pcid));
    while ($rt = $db->fetch_array($query)) {
        $fielddb[$rt['fieldname']] = $rt['fieldid'];
    }
    $pcdb = getPcviewdata($pcinfo, 'postcate');
    L::loadClass('postcate', 'forum', false);
    $postCate = new postCate($data);
    list(, $topicvalue) = $postCate->getCatevalue($pcid, $pcdb);
}
$atc_content = wordsConvert($atc_content);
$atc_content = convert($atc_content, $db_windpost);
$preatc = str_replace("\n", "<br>", $atc_content);
require_once R_P . 'require/header.php';
require_once PrintEot('preview');
footer();
Пример #7
0
/*分类、团购 start*/
/*分类信息*/
if ($foruminfo['modelid'] || $modelid > 0) {
    L::loadClass('posttopic', 'forum', false);
    $postTopic = new postTopic($pwpost);
    $modelids = explode(",", $foruminfo['modelid']);
    if ($foruminfo['modelid']) {
        $N_allowtopicopen = true;
    } else {
        $N_allowtopicopen = false;
    }
}
/*团购*/
if ($foruminfo['pcid'] || $pcid > 0) {
    L::loadClass('postcate', 'forum', false);
    $postCate = new postCate($pwpost);
    $pcids = explode(",", $foruminfo['pcid']);
    if ($foruminfo['pcid']) {
        $N_allowpostcateopen = true;
    } else {
        $N_allowpostcateopen = false;
    }
}
if ($modelid > 0) {
    /*分类信息*/
    $fielddb = $postTopic->getFieldData($modelid, 'one');
    foreach ($fielddb as $key => $value) {
        if ($value['threadshow'] == 1) {
            $threadshowfield[$key] = $value;
        }
    }
Пример #8
0
 function getSearchvalue($field, $type, $alltidtype = false, $backtype = false)
 {
     /*获取搜索结果*/
     global $db_perpage, $page, $pcid, $fid, $basename;
     $field = unserialize(StrCode($field, 'DECODE'));
     $sqladd = '';
     $fid && ($sqladd .= " fid=" . S::sqlEscape($fid));
     $fielddb = postCate::getFieldData($pcid, $type);
     foreach ($field as $key => $value) {
         if ($value) {
             if (in_array($fielddb[$key]['type'], array('number', 'radio', 'select'))) {
                 $sqladd .= $sqladd ? " AND " . $fielddb[$key]['fieldname'] . "=" . S::sqlEscape($value) : $fielddb[$key]['fieldname'] . "=" . S::sqlEscape($value);
             } elseif ($fielddb[$key]['type'] == 'checkbox') {
                 $checkboxs = '';
                 foreach ($value as $cv) {
                     $checkboxs .= $checkboxs ? ',' . $cv : $cv;
                 }
                 $value = '%,' . $checkboxs . ',%';
                 $sqladd .= $sqladd ? " AND " . $fielddb[$key]['fieldname'] . " LIKE(" . S::sqlEscape($value) . ")" : $fielddb[$key]['fieldname'] . " LIKE(" . S::sqlEscape($value) . ")";
             } elseif ($fielddb[$key]['type'] == 'calendar' && ($value['start'] || $value['end'])) {
                 $value['start'] && ($value['start'] = PwStrtoTime($value['start']));
                 $value['end'] && ($value['end'] = PwStrtoTime($value['end']));
                 if ($value['start'] > $value['end'] && $value['start'] && $value['end']) {
                     Showmsg('calendar_error');
                 }
                 $calendarEnd = trim(S::sqlEscape($value['end']));
                 $sqladd .= $sqladd ? " AND " . $fielddb[$key]['fieldname'] . ">=" . S::sqlEscape($value['start']) . ($calendarEnd == "''" ? '' : " AND " . $fielddb[$key]['fieldname'] . '<=' . $calendarEnd) : $fielddb[$key]['fieldname'] . ">=" . S::sqlEscape($value['start']) . ($calendarEnd == "''" ? '' : " AND " . $fielddb[$key]['fieldname'] . '<=' . $calendarEnd);
             } elseif (in_array($fielddb[$key]['type'], array('text', 'url', 'email', 'textarea'))) {
                 $value = '%' . $value . '%';
                 $sqladd .= $sqladd ? " AND " . $fielddb[$key]['fieldname'] . " LIKE(" . S::sqlEscape($value) . ")" : $fielddb[$key]['fieldname'] . " LIKE(" . S::sqlEscape($value) . ")";
             } elseif ($fielddb[$key]['type'] == 'range' && $value['min'] && $value['max']) {
                 $sqladd .= $sqladd ? " AND " . $fielddb[$key]['fieldname'] . ">=" . S::sqlEscape($value['min']) . " AND " . $fielddb[$key]['fieldname'] . "<=" . S::sqlEscape($value['max']) : $fielddb[$key]['fieldname'] . ">=" . S::sqlEscape($value['min']) . " AND " . $fielddb[$key]['fieldname'] . "<=" . S::sqlEscape($value['max']);
             } else {
                 $sqladd .= '';
             }
         }
     }
     if ($sqladd) {
         !$page && ($page = 1);
         $start = ($page - 1) * $db_perpage;
         $limit = S::sqlLimit($start, $db_perpage);
         $pcvaluetable = GetPcatetable($pcid);
         $sqladd .= $sqladd ? " AND ifrecycle=0" : " ifrecycle=0";
         $count = $this->db->get_value("SELECT COUNT(*) as count FROM {$pcvaluetable} WHERE {$sqladd}");
         $query = $this->db->query("SELECT tid FROM {$pcvaluetable} WHERE {$sqladd} {$limit}");
         while ($rt = $this->db->fetch_array($query)) {
             $tiddb[] = $rt['tid'];
         }
         if ($alltidtype) {
             $query = $this->db->query("SELECT tid FROM {$pcvaluetable} WHERE {$sqladd}");
             while ($rt = $this->db->fetch_array($query)) {
                 $alltiddb[] = $rt['tid'];
             }
         }
         !$count && ($count = -1);
     } else {
         if ($backtype) {
             adminmsg('topic_search_none', "{$basename}&action=postcate&pcid={$pcid}");
         }
         Showmsg('topic_search_none');
     }
     return array($count, $tiddb, $alltiddb);
 }
Пример #9
0
<?php

!defined('P_W') && exit('Forbidden');
S::gp(array('fid', 'modelid', 'pcid', 'actmid', 'allactmid'));
if ($modelid) {
    L::loadClass('posttopic', 'forum', false);
    $postTopic = new postTopic($pwpost);
    $query = $db->query("SELECT fieldid,name as newname,type,rules,vieworder,textsize FROM pw_topicfield WHERE modelid = " . S::sqlEscape($modelid) . " AND ifable='1' AND ifasearch='1' ORDER BY vieworder ASC,fieldid ASC");
    while ($rt = $db->fetch_array($query)) {
        list($rt['name1'], $rt['name2']) = explode('{#}', $rt['newname']);
        $rt['searchhtml'] = $postTopic->getASearchHtml($rt['type'], $rt['fieldid'], $rt['textsize'], $rt['rules']);
        $asearchdb[$rt['fieldid']] = $rt;
    }
} elseif ($pcid) {
    L::loadClass('postcate', 'forum', false);
    $postTopic = new postCate($pwpost);
    $query = $db->query("SELECT fieldid,name as newname,type,rules,vieworder,textsize FROM pw_pcfield WHERE pcid = " . S::sqlEscape($pcid) . " AND ifable='1' AND ifasearch='1' ORDER BY vieworder ASC,fieldid ASC");
    while ($rt = $db->fetch_array($query)) {
        list($rt['name1'], $rt['name2']) = explode('{#}', $rt['newname']);
        $rt['searchhtml'] = $postTopic->getASearchHtml($rt['type'], $rt['fieldid'], $rt['textsize'], $rt['rules']);
        $asearchdb[$rt['fieldid']] = $rt;
    }
} elseif ($actmid || $allactmid) {
    L::loadClass('ActivityForBbs', 'activity', false);
    $postActForBbs = new PW_ActivityForBbs($data);
    $fieldService = L::loadClass('ActivityField', 'activity');
    if ($actmid) {
        $advancedSearchFieldDb = $fieldService->getEnabledAndAdvancedSearchableFieldsByModelId($actmid);
    } else {
        $advancedSearchFieldDb = $fieldService->getDefaultSearchFields();
    }
Пример #10
0
        exit;
    } elseif ($step == '2') {
        S::gp(array('ifable', 'vieworder', 'ifsearch', 'ifasearch', 'threadshow', 'ifmust', 'textsize'));
        foreach ($vieworder as $key => $value) {
            $field = array();
            $field = array_keys($value);
            $fieldname = $field['0'];
            $viewvalue = $value[$fieldname];
            $db->update("UPDATE pw_pcfield SET " . S::sqlSingle(array('ifable' => $ifable[$key])) . " WHERE fieldid=" . S::sqlEscape($key) . "AND ifdel=0");
            $db->update("UPDATE pw_pcfield SET " . S::sqlSingle(array('vieworder' => $viewvalue, 'ifsearch' => $ifsearch[$key], 'ifasearch' => $ifasearch[$key], 'threadshow' => $threadshow[$key], 'ifmust' => $ifmust[$key], 'textsize' => $textsize[$key])) . " WHERE fieldid=" . S::sqlEscape($key));
        }
        adminmsg("operate_success", $basename . "&action=editmodel&pcid=" . $pcid);
    } elseif ($step == '3') {
        L::loadClass('postcate', 'forum', false);
        $pwpost = array();
        $postCate = new postCate($pwpost);
        $topichtml = $postCate->getCateHtml($pcid);
        include PrintEot('postcate');
        exit;
    }
} elseif ($action == 'addfield') {
    define('AJAX', 1);
    if (!$_POST['step']) {
        $ajax_basename_add = EncodeUrl($basename . "&action=addfield");
        include PrintEot('postcate');
        ajax_footer();
    } elseif ($_POST['step'] == 2) {
        S::gp(array('fieldtype', 'name', 'rule_min', 'rule_max', 'rules', 'descrip'));
        if (empty($fieldtype)) {
            Showmsg('fieldtype_not_exists');
        }
Пример #11
0
    $N_allowtypeopen = false;
}
/*分类、团购、活动 start*/
/*分类信息*/
if ($foruminfo['modelid'] || $modelid > 0) {
    L::loadClass('posttopic', 'forum', false);
    $postTopic = new postTopic($pwpost);
    $modelids = explode(",", $foruminfo['modelid']);
    if ($foruminfo['modelid']) {
        $N_allowtypeopen = true;
    }
}
/*团购*/
if ($foruminfo['pcid'] || $pcid > 0) {
    L::loadClass('postcate', 'forum', false);
    $postCate = new postCate($pwpost);
    $pcids = explode(",", $foruminfo['pcid']);
    if ($foruminfo['pcid']) {
        $N_allowtypeopen = true;
    }
}
/*活动*/
if ($foruminfo['actmids'] || $actmid > 0) {
    L::loadClass('ActivityForBbs', 'activity', false);
    $postActForBbs = new PW_ActivityForBbs($data);
    $actmids = explode(",", $foruminfo['actmids']);
    $firstactmid = 0;
    foreach ($actmids as $value) {
        if (isset($postActForBbs->activitymodeldb[$value]) && $postActForBbs->activitymodeldb[$value]['ifable'] && $postActForBbs->activitycatedb[$postActForBbs->activitymodeldb[$value]['actid']]['ifable']) {
            $firstactmid = $value;
            break;