当前位置: 首页>>代码示例>>PHP>>正文


PHP GetPcatetable函数代码示例

本文整理汇总了PHP中GetPcatetable函数的典型用法代码示例。如果您正苦于以下问题:PHP GetPcatetable函数的具体用法?PHP GetPcatetable怎么用?PHP GetPcatetable使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了GetPcatetable函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: update

 function update($uploaddb)
 {
     foreach ($uploaddb as $key => $value) {
         if ($value['attname'] == 'postcate' && ($value['id'] == '13' || $value['id'] == '27')) {
             $fieldname = 'pcattach';
         } else {
             $fieldname = 'field' . $value['id'];
         }
         $this->attachs[$fieldname] = $value['fileuploadurl'];
         if ($value['attname'] == 'topic') {
             $tablename = GetTopcitable($this->pcid);
         } elseif ($value['attname'] == 'postcate') {
             $tablename = GetPcatetable($this->pcid);
         }
         if ($this->attachs) {
             $this->db->update("UPDATE {$tablename} SET " . pwSqlSingle($this->attachs) . " WHERE tid=" . pwEscape($this->tid));
         }
     }
 }
开发者ID:adi00,项目名称:wumaproject,代码行数:19,代码来源:pcupload.class.php

示例2: update

 function update($uploaddb)
 {
     foreach ($uploaddb as $key => $value) {
         if ($value['id']) {
             $attach = $this->db->get_one("SELECT fieldname FROM pw_pcfield WHERE fieldid=" . S::sqlEscape($value['id']));
         }
         if ($value['attname'] == 'postcate' && $attach['fieldname'] == 'pcattach') {
             $fieldname = 'pcattach';
         } else {
             $fieldname = 'field' . $value['id'];
         }
         $this->attachs[$fieldname] = $value['fileuploadurl'];
         if ($value['attname'] == 'topic') {
             $tablename = GetTopcitable($this->pcid);
         } elseif ($value['attname'] == 'postcate') {
             $tablename = GetPcatetable($this->pcid);
         }
     }
     if ($this->attachs) {
         $this->db->update("UPDATE {$tablename} SET " . S::sqlSingle($this->attachs) . " WHERE tid=" . S::sqlEscape($this->tid));
     }
     return true;
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:23,代码来源:pcupload.class.php

示例3: _delPcTopic

function _delPcTopic($pcdb)
{
    global $db;
    foreach ($pcdb as $key => $value) {
        $pcids = S::sqlImplode($value);
        $key = $key > 20 ? $key - 20 : 0;
        $key = (int) $key;
        $pcvaluetable = GetPcatetable($key);
        $db->update("DELETE FROM {$pcvaluetable} WHERE tid IN({$pcids})");
    }
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:11,代码来源:superdel.php

示例4: _RecyclePcTopic

 function _RecyclePcTopic($pcdb)
 {
     foreach ($pcdb as $key => $value) {
         $pcids = S::sqlImplode($value);
         $key = $key > 20 ? $key - 20 : 0;
         $pcvaluetable = GetPcatetable($key);
         $this->db->update("UPDATE {$pcvaluetable} SET ifrecycle='1' WHERE tid IN({$pcids})");
     }
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:9,代码来源:delarticle.class.php

示例5: getSearchHtml

         if ($rt['ifsearch'] == 1) {
             $searchhtml .= getSearchHtml($rt);
         } elseif ($rt['ifasearch'] == 1) {
             $asearchhtml .= getSearchHtml($rt);
         }
     }
     $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");
开发者ID:adi00,项目名称:wumaproject,代码行数:31,代码来源:postcate.php

示例6: unserialize

    $trade = unserialize($trade['tradeinfo']);
    if (!$trade['alipay']) {
        echo 'fail';
    }
    ajax_footer();
} elseif ($action == 'pcdelimg') {
    InitGP(array('fieldname', 'pctype'));
    InitGP(array('tid', 'id'), 2);
    if (!$tid || !$id || !$fieldname || !$pctype) {
        echo 'fail';
    }
    $id = (int) $id;
    if ($pctype == 'topic') {
        $tablename = GetTopcitable($id);
    } elseif ($pctype == 'postcate') {
        $tablename = GetPcatetable($id);
    }
    $path = $db->get_value("SELECT {$fieldname} FROM {$tablename} WHERE tid=" . pwEscape($tid));
    if (strpos($path, '..') !== false) {
        return false;
    }
    $lastpos = strrpos($path, '/') + 1;
    $s_path = substr($path, 0, $lastpos) . 's_' . substr($path, $lastpos);
    if (!file_exists("{$attachpath}/{$path}")) {
        if (pwFtpNew($ftp, $db_ifftp)) {
            $ftp->delete($path);
            $ftp->delete($s_path);
            pwFtpClose($ftp);
        }
    } else {
        P_unlink("{$attachdir}/{$path}");
开发者ID:adi00,项目名称:wumaproject,代码行数:31,代码来源:pw_ajax.php

示例7: getSearchvalue

 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);
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:63,代码来源:postcate.class.php

示例8: foreach

     foreach (array_keys($modeliddb) as $value) {
         if ($value != 'fid' && $value != 'tid') {
             $mSqldb[$value] = $modeliddb[$value];
         }
     }
     $mSqldb['tid'] = $newtid;
     $mSqldb['fid'] = $to_id;
     $pwSQL = S::sqlSingle($mSqldb);
     $db->update("INSERT INTO {$tablename} SET {$pwSQL}");
 }
 //分类信息处理
 //团购处理
 if ($special > 20) {
     $pcid = $special - 20;
     $pcid = (int) $pcid;
     $tablename = GetPcatetable($pcid);
     $pcdb = $mSqldb = array();
     $pcdb = $db->get_one("SELECT * FROM {$tablename} WHERE tid=" . S::sqlEscape($tid));
     foreach (array_keys($pcdb) as $value) {
         if ($value != 'fid' && $value != 'tid') {
             $mSqldb[$value] = $pcdb[$value];
         }
     }
     $mSqldb['tid'] = $newtid;
     $mSqldb['fid'] = $to_id;
     $pwSQL = S::sqlSingle($mSqldb);
     $db->update("INSERT INTO {$tablename} SET {$pwSQL}");
 }
 //团购处理
 # memcache refresh
 // $threadList = L::loadClass("threadlist", 'forum');
开发者ID:jechiy,项目名称:PHPWind,代码行数:31,代码来源:mawhole.php

示例9: RevertPcTopic

function RevertPcTopic($pcdb)
{
    global $db;
    foreach ($pcdb as $key => $value) {
        $pcids = S::sqlImplode($value);
        $key = $key > 20 ? $key - 20 : 0;
        $pcvaluetable = GetPcatetable($key);
        $db->update("UPDATE {$pcvaluetable} SET ifrecycle='0' WHERE tid IN({$pcids})");
    }
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:10,代码来源:recycle.php

示例10: parseThread


//.........这里部分代码省略.........
         if ($pcid > 0) {
             $postcatepcids[] = $thread['tid'];
         }
         //获取活动的帖子id
         if ($actmid > 0 || $thread['special'] == 8) {
             $activitytiddb[] = $thread['tid'];
         }
         if (getstatus($thread['tpcstatus'], 1)) {
             $cyids[] = $thread['tid'];
         }
         if (getstatus($thread['tpcstatus'], 8)) {
             $replyReward[] = $thread['tid'];
         }
         $threaddb[$thread['tid']] = $thread;
     }
     if ($rewids) {
         $rewids = S::sqlImplode($rewids);
         $query = $this->db->query("SELECT tid,cbval,caval FROM pw_reward WHERE tid IN({$rewids})");
         while ($rt = $this->db->fetch_array($query)) {
             $threaddb[$rt['tid']]['rewcredit'] = $rt['cbval'] + $rt['caval'];
         }
     }
     if ($cyids && !$cyid) {
         $query = $this->db->query("SELECT a.tid,a.cyid,c.cname FROM pw_argument a LEFT JOIN pw_colonys c ON a.cyid=c.id WHERE tid IN (" . S::sqlImplode($cyids) . ')');
         while ($rt = $this->db->fetch_array($query)) {
             $threaddb[$rt['tid']]['colony'] = $rt;
         }
     }
     if ($topicids) {
         $topicvaluetable = GetTopcitable($modelid);
         $query = $this->db->query("SELECT * FROM {$topicvaluetable} WHERE tid IN (" . S::sqlImplode($topicids) . ")");
         while ($rt = $this->db->fetch_array($query)) {
             $threaddb[$rt['tid']]['topic'] = $rt;
         }
     }
     if ($postcatepcids) {
         //团购
         $pcvaluetable = GetPcatetable($pcid);
         $query = $this->db->query("SELECT * FROM {$pcvaluetable} WHERE tid IN (" . S::sqlImplode($postcatepcids) . ")");
         while ($rt = $this->db->fetch_array($query)) {
             $threaddb[$rt['tid']]['topic'] = $rt;
         }
     }
     if ($activitytiddb) {
         //活动
         global $threadshowfield, $postActForBbs;
         $defaultValueTableName = getActivityValueTableNameByActmid();
         if ($actmid) {
             $userDefinedValueTableName = getActivityValueTableNameByActmid($actmid, 1, 1);
             $query = $this->db->query("SELECT actmid,recommend,starttime,endtime,location,contact,telephone,picture1,picture2,picture3,picture4,picture5,signupstarttime,signupendtime,minparticipant,maxparticipant,userlimit,specificuserlimit,genderlimit,fees,feesdetail,paymethod,ut.* FROM {$defaultValueTableName} dt LEFT JOIN {$userDefinedValueTableName} ut USING(tid) WHERE dt.tid IN(" . S::sqlImplode($activitytiddb) . ")");
         } else {
             $query = $this->db->query("SELECT * FROM {$defaultValueTableName} WHERE tid IN(" . S::sqlImplode($activitytiddb) . ")");
         }
         while ($rt = $this->db->fetch_array($query)) {
             if ($rt['recommend'] == 1) {
                 $threaddb[$rt['tid']]['recommendadd'] = " <img src=\"{$imgpath}/activity/actrecommend.gif\" border=0 align=\"absmiddle\" title=\"" . getLangInfo('other', 'act_recommend') . "\">";
             } else {
                 $threaddb[$rt['tid']]['recommendadd'] = "";
             }
             if ($threadshowfield) {
                 foreach ($threadshowfield as $key => $column) {
                     $i = 0;
                     $columnHtml = '';
                     foreach ($column as $field) {
                         // 如人数限制值为0,视为空
                         if (in_array($field['fieldname'], array('minparticipant', 'maxparticipant')) && $rt[$field['fieldname']] == 0) {
                             $rt[$field['fieldname']] = '';
                         }
                         if ($rt[$field['fieldname']] !== '') {
                             $names = $postActForBbs->getNamePartsByName($field['name']);
                             if ($i != 0) {
                                 $columnHtml .= ' ' . $names[0];
                             }
                             $columnHtml .= $names[1] . ' ';
                             $fieldValueHtml = $postActForBbs->getThreadFieldValueHtml($field['type'], $rt[$field['fieldname']], $field['rules'], $field['fieldname']);
                             $columnHtml .= $fieldValueHtml;
                             $columnHtml .= $names[2];
                             $columnHtml = trim($columnHtml);
                         }
                         $i++;
                     }
                     $threaddb[$rt['tid']]['topic'][$key] = $columnHtml ? $columnHtml : '';
                 }
             }
         }
     }
     if ($replyReward) {
         $replyRewardService = L::loadClass('ReplyReward', 'forum');
         /* @var $replyRewardService PW_ReplyReward */
         $replyRewardInfos = $replyRewardService->getRewardByTids($replyReward);
         foreach ($replyRewardInfos as $value) {
             $threaddb[$value['tid']]['replyrewardtip'] = '[回帖奖励' . intval($value['creditnum'] * $value['lefttimes']) . ']';
         }
     }
     if ($updatetop) {
         require_once R_P . 'require/updateforum.php';
         updatetop();
     }
     return $threaddb;
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:101,代码来源:thread.php


注:本文中的GetPcatetable函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。