您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 质量控制/管理 > #LAMP人#爱问系统的开发与设计
知识分享系统的架构与实现DevelopacompetitiveknowledgesharingsitewithPHP杜江DUJIANG@21CTO.COMLAMP人主题分享交流会我过去十年最大的幸运是见了很多牛人,开阔眼界对于年轻人的成长极有助益,我们也决意帮大家多找些人来聊,相互拓宽。---------李开复Agenda什么是知识分享系统系统架构数据库设计配置与安全代码结构关于知识分享系统YahooAnswers(知识堂)新浪爱问知识人百度知道搜狗问答腾讯问问….集体智慧之体现通过查看和搜索找到最佳知识和答案。回答使人们能够方便地解决日常问题,并分享他们的知识,经验和意见。通过搜索提供海量的知识库。通过虚拟货币悬常,对最佳答案加以褒赏会员级别升级等,使社区变得有活力分类的问题与海量的问题和知识,大家都能找到他们感兴趣的内容。参与分享的文化。在系统中激励机制的,会知道哪个人回答了2000个问题?这不仅仅是时间数量问题。会让更多的人回馈社区问答发现答案:真实的人,真实的答案回答系统如何工作?寻求解决方案,简单3步:问:发布任何问题选择问题所在分类选择悬赏分等待解答或其他评论答案:看到一个问题,你可能知道回复答案!等待提问题回馈,最佳答案使用积分,级别及其它方式激发用户的回答发现:搜索一个主题发现想解决的相关问题根据情况发起回题和回复。运营模式企业或专家参与其中的提问回答与自己业务相关的软性答案,更有效的市场推广。答案与发现通过提问与回答了解谁对产品或服务有兴趣在哪些类别协助参与广告客户建立品牌的认同与网友成为共同体运营模式数据的商业分析发现:年龄职业分类与专长细分专业悬赏,真悬赏其它机构的软性商业推广广告知识分享系统架构用户F5/netscalar前端Apache,RewriteModulePHPAPC,XcaheJQuery/JavaScript后端MySQLClustermemcachedWebserviceAPILinux/FreeBSD系统开发之目标开发框架团队容易上手,老中青都能干M.V.C架构,模板分离显示逻辑支持多语言,英简繁语言包管理和操作容易用户体验与界面主要类库、框架和开发工具ADODBSmartyJQueryZendFrameworkorSymfony…PDT(Eclipse)SVNXDebugDB设计部分表结构CREATETABLEask_question(question_idint(10)unsignedNOTNULLauto_increment,cate_idsmallint(5)unsignedNOTNULLdefault'0',pricesmallint(6)unsignedNOTNULLdefault'0',userchar(15)NOTNULLdefault'',user_idmediumint(8)unsignedNOTNULLdefault'0',titlechar(50)NOTNULL,descriptionvarchar(255)NOTNULLdefault'',`url`varchar(255)NOTNULLdefault'',`addtime`int(10)unsignedNOTNULLdefault'0',endtimeint(10)unsignedNOTNULLdefault'0',hiddentinyint(1)unsignedNOTNULLdefault'0',answerssmallint(5)unsignedNOTNULLdefault'0',goodsmediumint(8)unsignedNOTNULLDEFAULT'0',`status`tinyint(1)unsignedNOTNULLdefault'1',PRIMARYKEY(question_id))TYPE=MyISAM;部分表结构CREATETABLEtsk_answer(answer_idint(10)unsignedNOTNULLauto_increment,question_idint(10)unsignedNOTNULLdefault'0',titlechar(50)NOTNULL,uservarchar(15)NOTNULLdefault'',user_idmediumint(8)unsignedNOTNULLdefault'0',vote_yestinyint(1)unsignedNOTNULLdefault'0',vote_notinyint(1)unsignedNOTNULLdefault'0',votessmallint(5)unsignedNOTNULLdefault'0',timeint(10)unsignedNOTNULLdefault'0',adopttimeint(10)unsignedNOTNULLdefault'0',contentmediumtextNOTNULL,PRIMARYKEY(id),KEYquestion_id(question_id),KEYuser_id(user_id),KEYadopt_time(adopt_time))TYPE=MyISAM;部分表结构CREATETABLEtsk_category(cat_idsmallint(5)unsignedNOTNULLauto_increment,`cat_name`char(30)NOTNULL,`dir`char(30)NOTNULL,parent_idsmallint(5)unsignedNOTNULLdefault'0',is_roottinyint(1)unsignedNOTNULLdefault'0',list_ordertinyint(3)NOTNULLdefault'0',questionsint(10)unsignedNOTNULLdefault'0',PRIMARYKEY(cat_id))TYPE=MyISAM;一些难办问题提问的分类。例如健康相关的问题不能提到电子产品,除非是关于哪些电器的具体影响到使用者的健康。一个问题的广泛性和互动基调。非常具体的问题,反应通常会低避免重复提问用户至少每周一次提交新问题重构问题和不同类别,以获得更高的搜索频率过期问题自动关闭悬赏分的给予策略解决方案分类SELECTc.*,COUNT(s.CATID)AShas_childrenFROM`categories`AScLEFTJOIN`categories`ASsONs.parent=c.CATIDGROUPBYc.CATIDORDERBYparent解决方案多语言?php$lang=array();$lang['0']=AboutUs;$lang['1']=MyAccount;$lang['2']=Advertising;$lang['3']=Pleaseenteryourquestion.;$lang['4']=Pleaseselectacategory.;$lang['5']=Yourquestionhasbeensuccessfullysubmitted.;?php$lang=array();$lang['0']=关于我们;$lang['1']=我的帐户;$lang['2']=广告;$lang['3']=请输入您的问题。;$lang['4']=请选择一个分类。;$lang['5']=您的问题已提交成功。;一些解决方案表单重复提交1inputtype=”submit”onclick=”this.disabled=true;“2提交插入后立即跳转3使用表单隐藏值formmethod=postname=testformaction=submit.phpinputtype=”text”name=”data”value=”/inputtype=”hidden”name=”myform_key”value=”?phpechomd5(submittag);?”/inputtype=”submit”onclick=”this.disabled=true;”/form?php$is_new_post=true;//如果session或表单在提交if(isset($_SESSION[”myform_key”])&&isset($_POST[”myform_key”])){//如果提交的表单值与SESSION值相同,则表示已经提交过if($_POST[”myform_key”]==$_SESSION[”myform_key”]){$is_new_post=false;}}if($is_new_post)==true{$_SESSION[”myform_key”]=$_POST[”myform_key”];add_data_to_database($_POST);//inserttodatabase}?b表单提交已经完毕!/b4Ajax方式提交解决方案问题自动关闭1手动触发2crontabcrontab–e比如我们每天的八点运行该脚本:08***/usr/local/目录结构系统配置Cofig.phpini_set('session.save_path',$config['basedir'].'/temporary/sessions');@session_start();$config=array();//目录配置$config['basedir']='D:/workspace/iask.com/';$config['baseurl']='='mysql';$DBHOST='localhost';$DBUSER='root';$DBPASSWORD='';$DBNAME='iask_com';$config['adminurl']=$config[baseurl].'/administrator';$config['cssurl']=$config[baseurl].'/css';$config['imagedir']=$config[basedir].'/images';$config['imageurl']=$config[baseurl].'/images';$config['membersprofilepicdir']=$config[imagedir].'/membersprofilepic';$config['membersprofilepicurl']=$config[imageurl].'/membersprofilepic';require_once($config[basedir].'/smarty/libs/Smarty.class.php');require_once($config[basedir].'/libraries/mysmarty.class.php');require_once($config[basedir].'/libraries/SConfig.php');require_once($config[basedir].'/libraries/SError.php');require_once($config[basedir].'/libraries/adodb/adodb.inc.php');require_once($config[basedir].'/libraries/phpmailer/class.phpmailer.php');require_once($config[basedir].'/libraries/SEmail.php');系统配置Cofig.php$conn=&ADONewConnection($D
本文标题:#LAMP人#爱问系统的开发与设计
链接地址:https://www.777doc.com/doc-5090967 .html