要修改的文件有两个,一个是 你的模版里的 edit_post.html ,另一个是include/postedit.inc.php ,修改前,前先备份这两个文件。 第一步:打开 edit_post.html 在你喜欢的地方加上 <strong>重新发布</strong> <input type="checkbox" name="repost" value="1" class="checkbo... Read More
posted @ 2011-12-25 18:07 忧国忧铭 Views(223) Comments(0) Diggs(0) Edit
因为PB程序的“是否保存远程图片”这个设置是全局的,无法对某篇文章进行单独设置,可我有些文章的图片并不想远程保存。现在有了解决办法了。很简单。跟我一起来修改吧。 要修改的文件有两个,一个是 你的模版里的 post.html ,另一个是include/postnew.inc.php ,修改前,前先备份这两个文件。 第一步:打开 post.html 在你喜欢的地方加上 <strong>是否保存... Read More
posted @ 2011-12-25 18:04 忧国忧铭 Views(184) Comments(0) Diggs(0) Edit
打开search.php 在每一句 $rs['content'] = str_replace($content_replacement, '', preg_replace($content_preg_replacement, '', $rs['content'])); 的前面加上 $rs['content']=strip_tags($rs['content'], ''); 好了,保存文件... Read More
posted @ 2011-12-25 18:03 忧国忧铭 Views(179) Comments(0) Diggs(0) Edit
先备份好文件。show.php,attachment.inc.php这两个文件!! 第一步: 打开show.php 找到require_once(PBDIGG_ROOT.'include/attachment.inc.php'); 在下面加入 $rspl = $DB->db_fetch_one_array("SELECT COUNT(*) num FROM {$db_prefix}comm... Read More
posted @ 2011-12-25 18:01 忧国忧铭 Views(164) Comments(0) Diggs(0) Edit
把 include/postnew.inc.php里的 preg_match('#^(https?|ftp|gopher|news|telnet|mms|rtsp):\/\/([^\/]*)#i', $fsession['source'], $linkhost); $linkhost = addslashes(HConvert($linkhost[2])); 改成 //pre... Read More
posted @ 2011-12-25 17:54 忧国忧铭 Views(241) Comments(0) Diggs(0) Edit
有些人网站刚刚建立起来,流量少,发布的文章点击数总是那么几个,看着别扭。现在让我们一起来给发布文章的时候,初始化点击数吧,当然你也可以称为造假点击数,呵。添加后这个功能,权限限制还是必须的,只有是管理员才可以用,会员游客都无法使用。要修改的文件有两个,你模版下的post.html,和网站目录下include/postnew.inc.php修改前,请先备份好文件。第一步:打开post.html 找到合适的地方加入: {#if $customer.adminid == "1"#} 初始化点击数:<input type="text" id="v Read More
posted @ 2011-12-25 17:50 忧国忧铭 Views(217) Comments(0) Diggs(0) Edit
打开根目录下的checkcode.php 找到 var $_height = 60; var $_width = 150; 这里是说验证码显示图片的大小。大至是这个意思啦。改成你想改的数值。 找到 $size = $this->_height /4; 这里是说显示的字体大小,数值越大,字体越小,建议设置成2或3左右。 当然这个要根据你的字体文件来设置。 Read More
posted @ 2011-12-25 17:48 忧国忧铭 Views(136) Comments(0) Diggs(0) Edit
方法很简单:修改post.php 第31行将 header('Cache-control: private, must-revalidate');替换为:header("Cache-control: private"); Read More
posted @ 2011-12-25 17:46 忧国忧铭 Views(168) Comments(0) Diggs(0) Edit
PBDIGG 2.0周年版在程序上做了一些小的改动,而模板也因此也有一些改动。不知道是否由于时间紧迫的原因,导致bug出现了很多。下面我们要说的就是2.0周年版在使用ubb编辑器上的一个问题。本着技术分享的原则,下面将文件修改内容写出来。针对新手,提供了程序补丁直接下载。在整个分析中,花了不少时间,主要是对php程序不熟悉造成的。从模板分析到ubb编辑器,最后到程序文件。Finally , I found the anwser.(提醒:在修改程序以前,请备份相关文件。主要涉及3个文件show.php,include/postedit.inc.php,include/postnew.inc.ph Read More
posted @ 2011-12-25 17:40 忧国忧铭 Views(1733) Comments(0) Diggs(2) Edit
最近用开源DIGG软件PBDigg2.0做了一个资源DIGG网站(www.pyming.net),主要是想练练手,但是话说这款开源程序存在着不少问题,所以想写出来和大家分享一下,希望能为有需要的同学提供帮助!可以留言和我交流。首先是默认模版目录,即(/templates/green),在这里我选择的是green模板。announcement.html ---- 公告模版category.html ---- 分类默认模版edit_post.html ---- 编辑已经发表过的文章模板footer.html ------ 底部模版getpw.html ----- 找回密码模版header.html Read More
posted @ 2011-12-25 17:02 忧国忧铭 Views(1030) Comments(0) Diggs(0) Edit
Linux select()详解 select系统调用是用来让我们的程序监视多个文件句柄(file descriptor)的状态变化的。程序会停在select这里等待,直到被监视的文件句柄有某一个或多个发生了状态改变。文件在句柄在Linux里很多,如果你man某个函数,在函数返回值部分说到成功后有一个文件句柄被创建的都是的,如man socket可以看到“On success, a f... Read More
posted @ 2010-11-15 21:44 忧国忧铭 Views(8941) Comments(0) Diggs(0) Edit
使用select函数可以以非阻塞的方式和多个socket通信。程序只是演示select函数的使用,功能非常简单,即使某个连接关闭以后也不会修改当前连接数,连接数达到最大值后会终止程序。1. 程序使用了一个数组fd_A,通信开始后把需要通信的多个socket描述符都放入此数组。2. 首先生成一个叫sock_fd的socket描述符,用于监听端口。3. 将sock_fd和数组fd_A中不为0的描述符放... Read More
posted @ 2010-11-15 21:41 忧国忧铭 Views(16781) Comments(0) Diggs(0) Edit
Ubuntu 在安装时,如同大部分 Linux 发行版一样,都会同时安装 GNU 版本的 Java。这个 Java 的实用程度太低,尤其对于开发人员来说,是没有太多用处的。在 Ubuntu 下,安装 SUN Java 是一件很容易的事情。第一步: Read More
posted @ 2010-09-27 14:53 忧国忧铭 Views(346) Comments(0) Diggs(0) Edit
[代码] Read More
posted @ 2010-08-18 21:03 忧国忧铭 Views(1510) Comments(0) Diggs(0) Edit
[代码] Read More
posted @ 2010-08-18 15:05 忧国忧铭 Views(2041) Comments(0) Diggs(0) Edit
[代码] Read More
posted @ 2010-08-18 15:04 忧国忧铭 Views(968) Comments(0) Diggs(0) Edit
[代码]int main(){ BTree Root; init_BTree(Root); //初始化 //插入测试 int key; /*cout<<"输入要插入的节点,以0结束输入:"<<endl; cin>>key; while(key) { SearchInsertBTree(Root,key); cin>>key; }*/ SearchIn... Read More
posted @ 2010-08-17 10:32 忧国忧铭 Views(1426) Comments(0) Diggs(0) Edit
微软全部产品整理 --------------------------------------------------------------------------------微软的产品涉及软件及互联网的各个领域,生活的各个领域。微软是一头大象,我们只能像盲人一样摸到他的一部分。Most Popular 这些是微软最重要的产品和战略· Bing 必应搜索引擎,微软未来几年最重要的战... Read More
posted @ 2010-08-17 09:59 忧国忧铭 Views(2630) Comments(0) Diggs(0) Edit
[代码] Read More
posted @ 2010-08-12 19:19 忧国忧铭 Views(1100) Comments(0) Diggs(0) Edit
[代码] Read More
posted @ 2010-08-12 10:53 忧国忧铭 Views(4897) Comments(3) Diggs(0) Edit