现在用户写了日志后无法直接发布到群组,很不方便,经常发生重复劳动。
建议管理员将程序升级到UChome2.0,然后按以下办法修改就能解决上述问题。
就不提供修改后的文件了,直接说方法:
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'");
- }
作者:王门走卒
特别声明:本文为艺术头条自媒体平台“艺术号”作者上传并发布,仅代表该作者观点。艺术头条仅提供信息发布平台。