李小菱 發表於 2011-5-13 14:39:15

emlog添加功能-日志分享,评论gravatar头像,快捷回复修改方法

<p><span style="BACKGROUND-COLOR: #dfc5a4"><strong>日志分享功能:</strong></span></p>
<p>1.首先在网站找些分享的js,我用的是这个:http://www.passit.cn</p>
<p>2.然后修改模板下的 echo_log.php 文件:</p>
<p>&nbsp;&lt;h2 class=&quot;content_h2&quot;&gt;&lt;?php topflg($top); ?&gt;&lt;?php echo $log_title; ?&gt;&lt;/h2&gt;<br />&nbsp;&lt;div class=&quot;act&quot;&gt;&lt;?php blog_sort($logid); ?&gt;&lt;/div&gt;<br />&nbsp;&lt;div class=&quot;editor&quot;&gt;&lt;?php editflg($logid,$author); ?&gt;&lt;/div&gt;&nbsp;&nbsp;&nbsp; <br />&nbsp;&lt;div class=&quot;clear line&quot;&gt;&lt;/div&gt;<br />&nbsp;&nbsp;&nbsp; &lt;div class=&quot;bloger&quot;&gt;post by &lt;?php blog_author($author); ?&gt; / &lt;?php echo gmdate('Y-n-j G:i l', $date); ?&gt;&lt;/div&gt;<br />&nbsp;&lt;div class=&quot;post&quot;&gt;&lt;?php echo $log_content; ?&gt;&lt;/div&gt;<br /><span style="COLOR: #e53333">&lt;!--Passit BUTTON BEGIN--&gt;&lt;div class=&quot;passit_barDiv&quot;&gt;&lt;a class=&quot;passit_default&quot; href=&quot;</span><span style="COLOR: #e53333">http://www.passit.cn/bookmark.html</span><span style="COLOR: #e53333">&quot; target=&quot;_blank&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;script type=&quot;text/javascript&quot; src=&quot;</span><span style="COLOR: #e53333">http://www.passit.cn/js/passit_bar_big_new.js?pub=0</span><span style="COLOR: #e53333">&quot; charset=&quot;UTF-8&quot;&gt;&lt;/script&gt;&lt;!--Passit BUTTON END--&gt;&nbsp;</span> <br />&nbsp;&lt;div class=&quot;fujian&quot;&gt;&lt;?php blog_att($logid); ?&gt;&lt;/div&gt;<br />&nbsp;&lt;div class=&quot;tag echo_tag&quot;&gt;&lt;?php blog_tag($logid); ?&gt;&lt;/div&gt;<br />&nbsp;&lt;?php doAction('log_related', $logData); ?&gt;<br />&nbsp;&lt;div class=&quot;nextlog&quot;&gt;&lt;?php neighbor_log($neighborLog); ?&gt;&lt;/div&gt;<br />&nbsp;&lt;?php blog_trackback($tb, $tb_url, $allow_tb); ?&gt;<br />&nbsp;&lt;?php blog_comments($comments); ?&gt;<br />&nbsp;&lt;?php blog_comments_post($logid,$ckname,$ckmail,$ckurl,$verifyCode,$allow_remark);?&gt;</p>
<p>红色部分就是插入的js代码,想插哪看你喜欢咯。</p>
<p><img alt="点击查看原图" src="https://img.jbzj.com/do/uploads/allimg/110513/1441300.jpg" border="0" /></p>
<p><strong><span style="BACKGROUND-COLOR: #dfc5a4">评论gravatar显示</span><span style="BACKGROUND-COLOR: #dfc5a4">头像:</span></strong></p>
<p>修改模板下的 module.php 文件:</p>
<p>找到如下代码:</p>
<p>&lt;?php<br />&nbsp;foreach($comments as $key=&gt;$value):<br />&nbsp;$value['poster'] = $value['url'] ? '&lt;a href=&quot;'.$value['url'].'&quot; target=&quot;_blank&quot;&gt;'.$value['poster'].'&lt;/a&gt;' : $value['poster'];<br />&nbsp;?&gt;<br />&nbsp;&lt;div id=&quot;com_line&quot;&gt;<br />&nbsp;&nbsp;&lt;a name=&quot;&lt;?php echo $value['cid']; ?&gt;&quot;&gt;&lt;/a&gt;<br />&nbsp;&nbsp;&lt;b&gt;&lt;?php echo $value['poster']; ?&gt; &lt;/b&gt;<br />&nbsp;&nbsp;&nbsp;&lt;div class=&quot;time&quot;&gt;&lt;?php echo $value['date']; ?&gt;&lt;/div&gt;<br />&nbsp;&nbsp;&nbsp;&lt;div class=&quot;com_date&quot;&gt;<br /><span style="COLOR: #e53333">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;!-- gravatar头像功能--&gt;</span><br /><span style="COLOR: #e53333">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;div class=&quot;my_gravatar&quot;&gt;</span><br /><span style="COLOR: #e53333">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;img src=&quot;</span><span style="COLOR: #e53333">http://www.gravatar.com/avatar/&lt;?php</span><span style="COLOR: #e53333"> echo md5($value['mail']); ?&gt;&quot; width=&quot;60&quot; height=&quot;60&quot;/&gt;</span><br /><span style="COLOR: #e53333">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/div&gt; </span><br /><span style="COLOR: #e53333">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;!-- //gravatar头像功能--&gt;</span><br />&nbsp;&nbsp;&nbsp;&lt;?php echo $value['content']; ?&gt;<br />&nbsp;&nbsp;&nbsp;&lt;/div&gt;</p>
<p>插入红色部分的代码(具体的显示问题,修改相应的css)</p>
<p><img alt="点击查看原图" src="https://img.jbzj.com/do/uploads/allimg/110513/1441301.jpg" border="0" /></p>
<p><strong><span style="BACKGROUND-COLOR: #dfc5a4">快捷回复(ctrl+alt</span><span style="BACKGROUND-COLOR: #dfc5a4">):</span></strong></p>
<p>修改模板下的 module.php 文件:</p>
<p>找到如下代码:</p>
<p>&lt;?php<br />//blog:发表评论表单<br />function blog_comments_post($logid,$ckname,$ckmail,$ckurl,$verifyCode,$allow_remark){?&gt;<br />&nbsp;&lt;?php if($allow_remark == 'y'): ?&gt;<br /><span style="COLOR: #e53333">&nbsp;&nbsp;&nbsp; &lt;!--ctrl+alt 快捷回复--&gt;</span><br /><span style="COLOR: #e53333">&nbsp;&nbsp;&nbsp; &lt;script&gt;function key_example(){ if(window.event.ctrlKey &amp;&amp; event.keyCode==13) document.commentform.submit(); }document.onkeydown=key_example;&lt;/script&gt;</span><br /><span style="COLOR: #e53333">&nbsp;&nbsp;&nbsp; &lt;!--//ctrl+alt 快捷回复--&gt;</span><br />&nbsp;&lt;p class=&quot;comment&quot;&gt;&lt;b&gt;发表评论:&lt;/b&gt;&lt;a name=&quot;comment&quot;&gt;&lt;/a&gt;&lt;/p&gt;<br />&nbsp;&lt;div class=&quot;comment_post&quot;&gt;<br />&nbsp;&lt;form method=&quot;post&quot;&nbsp; name=&quot;commentform&quot; action=&quot;&lt;?php echo BLOG_URL; ?&gt;index.php?action=addcom&quot; id=&quot;commentform&quot;&gt;<br />&nbsp;&lt;input type=&quot;hidden&quot; name=&quot;gid&quot; value=&quot;&lt;?php echo $logid; ?&gt;&quot; /&gt;<br />&nbsp;&lt;?php if(ROLE == 'visitor'): ?&gt;<br />&nbsp;&lt;p&gt;</p>
<p>插入红色部分的代码。</p>
<p><img alt="点击查看原图" src="https://img.jbzj.com/do/uploads/allimg/110513/1441302.jpg" border="0" /></p>
頁: [1]
查看完整版本: emlog添加功能-日志分享,评论gravatar头像,快捷回复修改方法