本帖最后由 ebottle 于 2009-8-11 16:14 编辑
就不提供修改后的文件了,直接说方法:
1、cp_blog.htm
在:- <tr>
- <th width="100">动态选项</th>
- <td>
- <input type="checkbox" name="makefeed" id="makefeed" value="1"<!--{if ckprivacy('blog', 1)}--> checked<!--{/if}-->> 产生动态 (<a href="cp.php?ac=privacy#feed" target="_blank">更改默认设置</a>)
- </td>
- </tr>
复制代码 之前添加:- <!--{if $mtags}-->
- <tr>
- <th>投稿到圈子</th>
- <td>
- <select name="tagid">
- <option value="">选择圈子</option>
- <!--{loop $mtags $value}-->
- <option value="$value[tagid]" <!--{if $value[tagid]==$event[tagid]}-->selected<!--{/if}--> >$value[tagname]</option>
- <!--{/loop}-->
- </select>
- </td>
- </tr>
- <!--{/if}-->
复制代码 2、cp_blog.php
在:- include_once template("cp_blog");
复制代码 之前添加:- //关联群组
- $mtags = array();
- if(!$eventid || $event['uid']==$_SGLOBAL['supe_uid']) {
- $query = $_SGLOBAL['db']->query("SELECT mtag.* FROM ".tname("tagspace")." st LEFT JOIN ".tname("mtag")." mtag ON st.tagid=mtag.tagid WHERE st.uid='$_SGLOBAL[supe_uid]' ");
- while($value=$_SGLOBAL['db']->fetch_array($query)) {
- $mtags[] = $value;
- }
- }
复制代码 3、function_blog.php
在- //标题
- $POST['subject'] = getstr(trim($POST['subject']), 80, 1, 1, 1);
- if(strlen($POST['subject'])<1) $POST['subject'] = sgmdate('Y-m-d');
- $POST['friend'] = intval($POST['friend']);
- 之后添加:
- [code]
- //圈子
- $tagid = $POST['tagid'] = intval($POST['tagid']);
复制代码 ==================================
在- $fieldarr['blogid'] = $blogid;
- $fieldarr['uid'] = $blogarr['uid'];
- inserttable('blogfield', $fieldarr);
复制代码 之后添加:- if($tagid){ //投稿到圈子
- $tsetarr = array(
- 'tagid' => $tagid,
- 'uid' => $_SGLOBAL['supe_uid'],
- 'username' => $_SGLOBAL['supe_username'],
- 'dateline' => $_SGLOBAL['timestamp'],
- 'subject' => $POST['subject'],
- 'lastpost' => $_SGLOBAL['timestamp'],
- 'lastauthor' => $_SGLOBAL['supe_username'],
- 'lastauthorid' => $_SGLOBAL['supe_uid'],
- 'topicid' => 0
- );
- $tid = inserttable('thread', $tsetarr, 1);
- $psetarr = array(
- 'tagid' => $tagid,
- 'tid' => $tid,
- 'uid' => $_SGLOBAL['supe_uid'],
- 'username' => $_SGLOBAL['supe_username'],
- 'ip' => getonlineip(),
- 'dateline' => $_SGLOBAL['timestamp'],
- 'message' => $message,
- 'isthread' => 1
- );
- //添加
- inserttable('post', $psetarr);
- //更新圈子统计
- $_SGLOBAL['db']->query("UPDATE ".tname("mtag")." SET threadnum=threadnum+1 WHERE tagid='$tagid'");
- }
复制代码 针对第二次修改的地方请查看 https://discuz.dismall.com/viewth ... ;page=3#pid11514737 |