主题:  php论坛里的贴子如何实现在网页里调用?

sheep001

职务:普通成员
等级:1
金币:0.0
发贴:14
#12003/7/16 11:15:51
php论坛里的贴子如何实现在网页里调用?



5D荣誉斑竹

职务:普通成员
等级:2
金币:1.0
发贴:400
#22003/7/16 21:16:54
用程序读取数据库然后显示



sheep001

职务:普通成员
等级:1
金币:0.0
发贴:14
#32003/7/17 10:59:43
能告诉我源代码吗?



sheep001

职务:普通成员
等级:1
金币:0.0
发贴:14
#42003/7/17 11:08:57
我曾找到过一个vbnew.php的代码,调用人家的可以,调用我自已的就不可以,是不是因为路径的问题?
谁能帮帮我?



5D荣誉斑竹

职务:普通成员
等级:2
金币:1.0
发贴:400
#52003/7/20 18:43:14
这个不是一两句话能说得清楚的,如果觉得自己写程序比较麻烦或有难度的话,不如去某一论坛的官方网站去看看有没有类似的程序.



buzzard

职务:普通成员
等级:1
金币:0.0
发贴:75
#62003/7/21 17:55:23
其实自己写的程序更加简单明了。



谁明浪子心

职务:普通成员
等级:2
金币:1.0
发贴:438
#72003/8/8 20:31:23
[9楼]回复:为什么我的论坛会这样

将以下代码存为一个PHP文件

require("datafile/config.php");
require("datafile/style.php");
require("global.php");
?>
align="center" valign="middle">:::论坛新帖 :::
>

$article=file("datafile/newpost.php");
$count=count($article);
$c=min($count,10); //显示5个贴子
if($count>10) $use=$count-$c;
else $use=0;

for ($i=$count-1; $i>=$use; $i--){
$detail=explode("│",$article[$i]);
$file_name=chop($detail[4]);
$forumnum=chop($detail[5]);

if ($use>0) $post=$post.$article[$count-1-$i+$use];

if (file_exists('datafile/forumdata.php')) $forumlist=file('datafile/forumdata.php');
$f_count=count($forumlist);
for ($z=0; $z<$f_count; $z++) {
$f_detail=explode('│',$forumlist[$z]);
if($f_detail[0]!='category'){
if(chop($f_detail[3])==$forumnum){
$forumname=$f_detail[1];
}}}
if (strlen($detail[0])>=28) $detail[0]=substr($detail[0],0,25)."...";
if (strlen($detail[1])>=10) $detail[1]=substr($detail[1],0,8)."...";
$detail[0]=str_replace('%a%','',$detail[0]);
$dtime=getfulldate($detail[2]);
if ($lmd[2]==$date) $lmdauthor="------";
else $lmdauthor="$lmd[1]";
$lmdtime=get_date($lmd[2]).' '.get_time($lmd[2]);

echo "

";
}
if ($use>0) writetofile("datafile/newpost.php",$post);
?>


然后在需要引用的地方打上


一个这么简单的问题折腾了这么久!!

不知道对你有没有用,这是WDB首页调用全部代码!反正我以前的网站能用的!



$detail[0]
作者$detail[1] {$dtime}

更多帖子
每页显示15条 1/1<<<1>>
在 回复主题:php论坛里的贴子如何实现在网页里调用?
正文:
加粗 下划线 文本颜色 居中 插入链接 建立Google搜索链接 插入图片 引用文本
 
汗 喜欢 骄傲的笑 哭 酷! 愤怒 黑线 什么? 猥琐 偷笑 无语 晕 吃惊 诱惑
smile frown redface biggrin wink rolleyes mad eek 禁止笑脸转换

提示:按 Ctrl+Enter 快速提交