opensns转发行为模拟
2016-05-16 21:28
246 查看
第一步:实现简单的在源函数修改
转发行为包括:源微博id(即如果该微博本来就是转发的微博,那么该id是转发的源头),现被转发微博id(当前微博id),微博content。初级实现方法:IndexController.class.php文件中sendrepost方法,public function sendrepost() { $aSourceId = I ( 'get.sourceId', 0, 'intval' ); $aWeiboId = I ( 'get.weiboId', 0, 'intval' ); // $aSourceId = 121; // $aWeiboId = 121; $weiboModel = D ( 'Weibo' ); $result = $weiboModel->getWeiboDetail ( $aSourceId ); $this->assign ( 'sourceWeibo', $result ); $weiboContent = ''; if ($aSourceId != $aWeiboId) {//$aSourceId:源微博id ; $aWeiboId:当前被转发微博id $weibo1 = $weiboModel->getWeiboDetail ( $aWeiboId ); $weiboContent = '//@' . $weibo1 ['user'] ['nickname'] . ' :' . $weibo1 ['content']; // $weiboContent = '自己写的,作为标志'; } $this->assign ( 'weiboId', $aWeiboId ); $this->assign ( 'weiboContent', $weiboContent ); $this->assign ( 'sourceId', $aSourceId ); $this->display (); }其中注释部分就是修改的部分,初级修改可以实现按照给定的微博id(即121)给定的weibocontent,然后现在实现的是无论点击哪个位置的转发,都是根据设定好的sourceId和WeiboId转发博文。
$weiboContent = '自己写的,作为标志'; <span style="font-size:14px;color:#FF0000;">第二步:</span><span style="font-size:14px;color:#FF0000;">实现了增加转发页面,具有一个正常转发页面,一个模拟转发页面</span> 实现逻辑:
index1.html(最后应改为inrepost)页面(index.html后台部分在IndexController.class.php的index函数,里面有widget组建中的WeiboDetail.class.php), 其中include loadweibo.html,(而loadweibo有两个实现部分,一个是loadweibo.html负责前端展示,一个是IndexController.class.php负责数据后端处理), loadweibo.html中指向了weibo文件夹下的widget组建下的WeiboDetailWidget.class.php,WeiboDetailWidget.class.php文件里面有两个方法,detail和weibo_html方法, 此处的detail方法指向了view文件夹下的default文件夹下的Widget文件夹下的detail.html,(里面指向index文件weibodetail.html和_operation.html, 其中weibodetail也指向_operation.html),然后就进入_operation.html,_operation.html文件内部指向index文件sendrepost.html,sendrepost.html后台处理文件在 IndexController.class.php有sendrepost方法,其中sendrepost.html文件内部指向doSendRepost.html(其实没有这个文件,这个文件是在点击转发后的弹窗形式), 然后在IndexController.class.php的dosendrepost方法做修改)。
具体方法:1.index:
相关文章推荐
- linux系统创建主分区、逻辑分区 、设置ext系列分区的参数以及检测分区的方法
- docker的4种网络模式
- AOP学习过程中遇到的问题汇总
- bash 调用
- Why Tomcat7 is replicating all my logs in /var/log/messages
- linux基本命令(27)——linux chmod命令
- Why Tomcat7 is replicating all my logs in /var/log/messages
- Centos外网连接不上的原因之一分析
- Docker run 参数
- iftop图解
- CentOS 7 安装好后,无法使用小键盘的解决办法
- Linux下more命令C语言实现实践
- Android的特性及其平台架构介绍
- module_platform_driver()宏
- Docker 常用命令
- Linux基础命令03-rm_cat_rmdir_ln_apt-get
- linux字符设备驱动初识
- Linux根文件系统制作与各种挂载方式的实现
- android adb shell
- linux基本命令(26)——用SecureCRT来上传和下载文件