示例#1
0
    if (!$page) {
        $page = 1;
    }
    $rows = 20;
    $showpage = getpage("{$_pre}comments", "WHERE uid='{$lfjuid}'", "?job={$job}", $rows);
    $min = ($page - 1) * $rows;
    $query = $db->query("SELECT * FROM {$_pre}comments WHERE uid='{$lfjuid}' ORDER BY cid DESC LIMIT {$min},{$rows}");
    while ($rs = $db->fetch_array($query)) {
        $rs[content] = preg_replace("/<([^<]+)>/is", "", $rs[content]);
        $rs[title] = get_word($rs[content], 70);
        if (!$rs[username]) {
            $detail = explode(".", $rs[ip]);
            $rs[username] = "{$detail['0']}.{$detail['1']}.{$detail['2']}.*";
        }
        $rss = $db->get_one("SELECT city_id FROM {$_pre}db WHERE id='{$rs['id']}'");
        $rs[url] = get_info_url($rs[id], $rs[fid], $rss[city_id]);
        $rs[posttime] = date("Y-m-d H:i", $rs[posttime]);
        $listdb[] = $rs;
    }
    require ROOT_PATH . "member/head.php";
    require dirname(__FILE__) . "/" . "template/comment/mylist.htm";
    require ROOT_PATH . "member/foot.php";
} elseif ($action == "del") {
    if (!$ciddb) {
        showerr("请选择一个");
    }
    foreach ($ciddb as $key => $value) {
        $rs = $db->get_one("SELECT * FROM {$_pre}comments WHERE cid='{$value}'");
        if ($rs[uid] = $lfjuid || ($rs[cuid] = $lfjuid)) {
            $db->query("DELETE FROM {$_pre}comments WHERE cid='{$value}'");
            $_erp = $Fid_db[tableid][$rs[fid]];
示例#2
0
/**
*大分类
**/
function ListOnlySort()
{
    global $Fid_db, $module_DB, $fid, $city_id;
    foreach ($Fid_db[$fid] as $key => $value) {
        unset($rs);
        $rs[name] = $value;
        $rs[fid] = $key;
        $rs[url] = get_info_url('', $rs[fid]);
        $msconfig = $module_DB[$Fid_db[mid][$key]][field][sortid];
        $detail = explode("\r\n", $msconfig[form_set]);
        foreach ($detail as $key2 => $value2) {
            $detail2 = explode("|", $value2);
            $url = get_info_url('', $rs[fid], array('sortid' => "{$detail2['0']}"));
            $rs[sortdb][] = "<A HREF='{$url}'>{$detail2['1']}</A>";
        }
        $listdb[] = $rs;
    }
    return $listdb;
}
示例#3
0
/**
*把$url,$listurl这两个通用网址做处理,以便获取其真实的网址
**/
function make_ture_path($format, $rs)
{
    global $ModuleDB, $webdb, $Html_Type, $showHtml_Type, $city_DB;
    //CMS万能文章列表与内容网址
    if ($format[SYS] == 'CMS') {
        if ($ModuleDB[$format['PRE']]['domain']) {
            $list_url = $show_url = $ModuleDB[$format['PRE']]['domain'] . '/';
            //频道二级域名
        } else {
            $list_url = $show_url = "{$webdb['www_url']}/{$ModuleDB[$format['PRE']]['dirname']}/";
        }
        if (!$Html_Type[CMS][$format['PRE']]) {
            $Html_Type[CMS][$format['PRE']] = @(include ROOT_PATH . "{$ModuleDB[$format['PRE']]['dirname']}/data/htmltype.php");
        }
        $_Html_Type =& $Html_Type[CMS][$format['PRE']];
        if ($format[ctype] == 'article' || $format[ctype] == 'fu_article') {
            if ($_Html_Type[IF_HTML] == 1) {
                //以栏目自定义的文件名优先
                $filename_l = $_Html_Type['list'][$rs[fid]] ? $_Html_Type['list'][$rs[fid]] : $_Html_Type['list'][0];
                //以自定义的内容页文件名优先
                if ($_Html_Type[bencandy_id][$rs[id]]) {
                    $filename_b = $_Html_Type[bencandy_id][$rs[id]];
                } elseif ($_Html_Type[bencandy][$rs[fid]]) {
                    $filename_b = $_Html_Type[bencandy][$rs[fid]];
                } else {
                    $filename_b = $_Html_Type[bencandy][0];
                }
                $list_url .= $filename_l;
                $show_url .= $filename_b;
                //把文件名去掉,访问默认/文档
                $list_url = preg_replace("/(.*)\\/([^\\/]+)/is", "\\1/", $list_url);
                //对于内容页的首页把$page去除掉
                $show_url = preg_replace("/(.*)(-{\\\$page}|_{\\\$page})(.*)/is", "\\1\\3", $show_url);
                //对于内容页的栏目小于1000篇文章时,把DIR分目录去除掉
                if (floor($rs[aid] / 1000) == 0) {
                    $show_url = preg_replace("/(.*)(-{\\\$dirid}|_{\\\$dirid})(.*)/is", "\\1\\3", $show_url);
                }
            } else {
                $list_url .= 'list.php?fid={$fid}';
                $show_url .= 'bencandy.php?fid={$fid}&id={$aid}';
            }
        } elseif ($format[ctype] == 'specialsort') {
            if ($_Html_Type[IF_HTML] == 1) {
                //以栏目自定义的文件名优先
                $filename_l = $_Html_Type[SPlist][$rs[fid]] ? $_Html_Type[SPlist][$rs[fid]] : $_Html_Type[SPlist][0];
                //以自定义的内容页文件名优先
                if ($_Html_Type[special_bencandy][$rs[id]]) {
                    $filename_b = $_Html_Type[special_bencandy][$rs[id]];
                } elseif ($_Html_Type[SPbencandy][$rs[fid]]) {
                    $filename_b = $_Html_Type[SPbencandy][$rs[fid]];
                } else {
                    $filename_b = $_Html_Type[SPbencandy][0];
                }
                $list_url .= $filename_l;
                $show_url .= $filename_b;
            } else {
                $list_url .= 'listsp.php?fid=$fid';
                $show_url .= 'showsp.php?fid=$fid&id=$id';
            }
        } elseif ($format[ctype] == 'special') {
        } elseif ($format[ctype] == 'comment') {
            $show_url .= 'comment.php?fid=$fid&id=$aid';
        }
        //标签里有PHP逻辑,针对静态的时候,不同栏目的自定义URL
        if ($_Html_Type[IF_HTML] == 1 && strstr($format[tplpart_1code], 'print <<<EOT')) {
            $array[urlDB][show_url] = $show_url;
            $array[urlDB][list_url] = $list_url;
            $show_url = '{$show_urldb[$id]}';
            $list_url = '{$list_urldb[$id]}';
        }
        $tpl_1code = str_replace('{$url}', $show_url, $format[tplpart_1code]);
        $tpl_1code = str_replace('$url', $show_url, $tpl_1code);
        $tpl_1code = str_replace('{$list_url}', $list_url, $tpl_1code);
        $tpl_1code = str_replace('$list_url', $list_url, $tpl_1code);
        $tpl_2code = str_replace('{$url}', $show_url, $format[tplpart_2code]);
        $tpl_2code = str_replace('$url', $show_url, $tpl_2code);
        $tpl_2code = str_replace('{$list_url}', $list_url, $tpl_2code);
        $tpl_2code = str_replace('$list_url', $list_url, $tpl_2code);
        $array[tpl_1code] = $tpl_1code;
        $array[tpl_2code] = $tpl_2code;
    } elseif ($format[SYS] == 'fenlei') {
        $keyname = $format[wninfo];
        //分类里边调用,就使用标准的URL处理,被其它模块调用的话,就用动态处理
        if ($ModuleDB[$keyname][id] == $webdb['module_id'] && function_exists('get_info_url')) {
            $list_url = get_info_url('', $rs[fid], $rs[city_id]);
            $show_url = get_info_url($rs[id], $rs[fid], $rs[city_id]);
        } else {
            $list_url = $show_url = "{$webdb['www_url']}/";
            $list_url .= 'list.php?city_id=$rs[city_id]&fid=$rs[fid]';
            $show_url .= 'bencandy.php?city_id=$rs[city_id]&fid=$rs[fid]&id=$rs[id]';
        }
        $tpl_1code = str_replace(array('{$url}', '$url', '{$list_url}', '$list_url'), array($show_url, $show_url, $list_url, $list_url), $format[tplpart_1code]);
        $tpl_2code = str_replace(array('{$url}', '$url', '{$list_url}', '$list_url'), array($show_url, $show_url, $list_url, $list_url), $format[tplpart_2code]);
        $array[tpl_1code] = $tpl_1code;
        $array[tpl_2code] = $tpl_2code;
    } elseif ($format[SYS] == 'normal' || $format[SYS] == 'wn') {
        $keyname = $format[SYS] == 'normal' ? $format[SYS_type] : $format[wninfo];
        if ($city_DB[domain][$rs[city_id]]) {
            //城市二级域名
            $list_url = $show_url = $city_DB[domain][$rs[city_id]] . "/{$ModuleDB[$keyname][dirname]}/";
        } elseif ($ModuleDB[$keyname][domain]) {
            //频道二级域名
            $list_url = $show_url = $ModuleDB[$keyname][domain] . "/";
        } else {
            //频道二级目录
            $list_url = $show_url = "{$webdb['www_url']}/{$ModuleDB[$keyname][dirname]}/";
        }
        $CF = unserialize($ModuleDB[$keyname][config]);
        if ($CF[MakeHtml] == 2) {
            $list_url .= $CF[list_HtmlName2];
            $show_url .= $CF[show_HtmlName2];
        } elseif ($CF[MakeHtml] == 1) {
            $list_url .= $CF[list_HtmlName][$rs[fid]] ? $CF[list_HtmlName][$rs[fid]] : $CF[list_HtmlName1];
            $show_url .= $CF[show_HtmlName][$rs[fid]] ? $CF[show_HtmlName][$rs[fid]] : $CF[show_HtmlName1];
            $list_url = preg_replace("/(.*)\\/([^\\/]+)/is", "\\1/", $list_url);
        } else {
            $list_url .= $CF[list_PhpName];
            $show_url .= $CF[show_PhpName];
        }
        //标签里有PHP逻辑,针对静态的时候,不同栏目的自定义URL
        if ($CF[MakeHtml] == 1 && strstr($format[tplpart_1code], 'print <<<EOT')) {
            $array[urlDB][show_url] = $show_url;
            $array[urlDB][list_url] = $list_url;
            $show_url = '{$show_urldb[$id]}';
            $list_url = '{$list_urldb[$id]}';
        }
        $tpl_1code = str_replace('{$url}', $show_url, $format[tplpart_1code]);
        $tpl_1code = str_replace('$url', $show_url, $tpl_1code);
        $tpl_1code = str_replace('{$list_url}', $list_url, $tpl_1code);
        $tpl_1code = str_replace('$list_url', $list_url, $tpl_1code);
        $tpl_2code = str_replace('{$url}', $show_url, $format[tplpart_2code]);
        $tpl_2code = str_replace('$url', $show_url, $tpl_2code);
        $tpl_2code = str_replace('{$list_url}', $list_url, $tpl_2code);
        $tpl_2code = str_replace('$list_url', $list_url, $tpl_2code);
        $array[tpl_1code] = $tpl_1code;
        $array[tpl_2code] = $tpl_2code;
    } elseif ($format[SYS] == 'artcile') {
        $list_url = $show_url = "{$webdb['www_url']}{$webdb['path']}/";
        if ($webdb[NewsMakeHtml] == 2) {
            $list_url .= $webdb[list_filename2];
            $show_url .= $webdb[bencandy_filename2];
        } elseif ($webdb[NewsMakeHtml] == 1) {
            $list_url = $show_url = "{$webdb['www_url']}/";
            //以栏目自定义的文件名优先
            $filename_l = $Html_Type['list'][$rs[fid]] ? $Html_Type['list'][$rs[fid]] : $webdb[list_filename];
            //以自定义的内容页文件名优先
            if ($showHtml_Type[bencandy][$rs[id]]) {
                $filename_b = $showHtml_Type[bencandy][$rs[id]];
            } elseif ($Html_Type[bencandy][$rs[fid]]) {
                $filename_b = $Html_Type[bencandy][$rs[fid]];
            } else {
                $filename_b = $webdb[bencandy_filename];
            }
            //自定义了栏目域名
            if ($Html_Type[domain][$rs[fid]] && $Html_Type[domain_dir][$rs[fid]]) {
                $rule = str_replace("/", "\\/", $Html_Type[domain_dir][$rs[fid]]);
                $show_url = preg_replace("/^{$rule}/is", "{$Html_Type[domain][$rs[fid]]}/", $filename_b);
                $list_url = preg_replace("/^{$rule}/is", "{$Html_Type[domain][$rs[fid]]}/", $filename_l);
                //特别处理一下些自定义内容页文件名的情况.
                if (!eregi("^http:\\/\\/", $show_url)) {
                    $show_url = "{$webdb['www_url']}/{$filename_b}";
                }
            } else {
                $list_url .= $filename_l;
                $show_url .= $filename_b;
            }
            //把文件名去掉,访问默认/文档
            $list_url = preg_replace("/(.*)\\/([^\\/]+)/is", "\\1/", $list_url);
            //对于内容页的首页把$page去除掉
            $show_url = preg_replace("/(.*)(-{\\\$page}|_{\\\$page})(.*)/is", "\\1\\3", $show_url);
            //对于内容页的栏目小于1000篇文章时,把DIR分目录去除掉
            if (floor($rs[aid] / 1000) == 0) {
                $show_url = preg_replace("/(.*)(-{\\\$dirid}|_{\\\$dirid})(.*)/is", "\\1\\3", $show_url);
            }
        } else {
            $list_url .= 'list.php?fid={$fid}';
            $show_url .= 'bencandy.php?fid={$fid}&id={$aid}';
        }
        //标签里有PHP逻辑,针对静态的时候,不同栏目的自定义URL
        if ($webdb[NewsMakeHtml] == 1 && strstr($format[tplpart_1code], 'print <<<EOT')) {
            $array[urlDB][show_url] = $show_url;
            $array[urlDB][list_url] = $list_url;
            $show_url = '{$show_urldb[$id]}';
            $list_url = '{$list_urldb[$id]}';
        }
        $tpl_1code = str_replace('{$url}', $show_url, $format[tplpart_1code]);
        $tpl_1code = str_replace('$url', $show_url, $tpl_1code);
        $tpl_1code = str_replace('{$list_url}', $list_url, $tpl_1code);
        $tpl_1code = str_replace('$list_url', $list_url, $tpl_1code);
        $tpl_2code = str_replace('{$url}', $show_url, $format[tplpart_2code]);
        $tpl_2code = str_replace('$url', $show_url, $tpl_2code);
        $tpl_2code = str_replace('{$list_url}', $list_url, $tpl_2code);
        $tpl_2code = str_replace('$list_url', $list_url, $tpl_2code);
        $array[tpl_1code] = $tpl_1code;
        $array[tpl_2code] = $tpl_2code;
    } elseif ($format[SYS] == 'pwbbs' || $format[SYS] == 'dzbbs') {
        if ($format[SYS] == 'pwbbs') {
            $show_url = '$webdb[passport_url]/read.php?tid=$tid&page=1';
            $list_url = '$webdb[passport_url]/thread.php?fid=$fid';
        } else {
            $show_url = '$webdb[passport_url]/viewthread.php?tid=$tid&page=1';
            $list_url = '$webdb[passport_url]/forumdisplay.php?fid=$fid';
        }
        $tpl_1code = str_replace('{$url}', $show_url, $format[tplpart_1code]);
        $tpl_1code = str_replace('$url', $show_url, $tpl_1code);
        $tpl_1code = str_replace('{$list_url}', $list_url, $tpl_1code);
        $tpl_1code = str_replace('$list_url', $list_url, $tpl_1code);
        $tpl_2code = str_replace('{$url}', $show_url, $format[tplpart_2code]);
        $tpl_2code = str_replace('$url', $show_url, $tpl_2code);
        $tpl_2code = str_replace('{$list_url}', $list_url, $tpl_2code);
        $tpl_2code = str_replace('$list_url', $list_url, $tpl_2code);
        $array[tpl_1code] = $tpl_1code;
        $array[tpl_2code] = $tpl_2code;
    } else {
        $array[tpl_1code] = $format[tplpart_1code];
        $array[tpl_2code] = $format[tplpart_2code];
    }
    //主要针对幻灯片的内容网址
    $array[showurl] = $show_url;
    return $array;
}
示例#4
0
     $detail = @explode(",", $rs[admin]);
     if ($rs[uid] == $lfjuid) {
         $power = 1;
     } elseif ($lfjid && @in_array($lfjid, $detail)) {
         $power = 2;
     } else {
         $power = 0;
     }
 }
 if ($power == 0) {
     die("ÄãÎÞȨ²Ù×÷");
 }
 if ($step == 2) {
     if ($action == "del") {
         del_info($id, $_erp, $rs);
         $rs[url] = get_info_url('', $rs[fid], $rs[city_id]);
         refreshto($rs[url], "ɾ³ý³É¹¦", 1);
     } elseif ($action == "levels" && $power == 2) {
         $db->query("UPDATE {$_pre}content{$_erp} SET levels='{$levels}' WHERE id='{$id}'");
         refreshto("{$FROMURL}", "²Ù×÷³É¹¦", 1);
     } elseif ($action == "yz" && $power == 2) {
         $db->query("UPDATE {$_pre}content{$_erp} SET yz='{$yz}' WHERE id='{$id}'");
         refreshto("{$FROMURL}", "²Ù×÷³É¹¦", 1);
     } elseif ($action == "top" && $power == 2) {
         $db->query("UPDATE {$_pre}content{$_erp} SET list='{$top}' WHERE id='{$id}'");
         refreshto("{$FROMURL}", "²Ù×÷³É¹¦", 1);
     }
 } else {
     $rs = $db->get_one("SELECT * FROM {$_pre}content{$_erp} WHERE id='{$id}'");
     echo "<A HREF=\"{$city_url}/post.php?job=edit&fid={$fid}&id={$id}\">ÐÞ¸Ä</A><br><A HREF=\"{$city_url}/post.php?action=del&fid={$fid}&id={$id}\" onclick=\"return confirm('ÄãÈ·ÈÏҪɾ³ýÂð?');\">ɾ³ý</A><br>";
     if ($rs[levels] && $power == 2) {