Discuz!官方免费开源建站系统

 找回密码
 立即注册
搜索

[Autoit]联系我们 简化版[2009-11-6]

  [复制链接]
autoit 发表于 2009-11-6 11:55:56 | 显示全部楼层 |阅读模式
插件发布
插件名称: 联系我们 简化版
插件来源:
适用版本: Discuz! 7.2
语言编码: GBK简体 
最后更新时间:
插件作者: Autoit
插件简介: 页脚下的 联系我们 换成表单。适用于任何版本!!!
本帖最后由 autoit 于 2010-01-18 22:35 编辑

版主不处理垃圾ID, 所以不在分享了。。。此有问题不在任何回复。谢谢理解。 bye.






2010-1-14日更新php代码:
  1. require_once( "./include/common.inc.php" );
  2. 替换为:
  3. define('BINDDOMAIN', 'logging');
  4. require_once( "./include/common.inc.php" );
复制代码
这个是避免论坛关闭状态下不能打开的问题.

注意:此修正未更新下面附件!!!

2009-12-12日更新下面一句代码:
  1. showmessage("已成功向本站管理员发出信息,我们会尽快回覆,谢谢!",dreferer());
复制代码
如果你下的早,请自己更新这个.
1.建立contact.htm,上传到templates/default/,里面代码为:
  1. {template header}
  2. <!--{if empty($infloat)}-->
  3. <div id="nav"><a href="$indexname">$bbname</a> $navigation</div>
  4. <div id="wrap" class="wrap s_clear">
  5.         <div class="main"><div class="content nofloat">
  6. <!--{/if}-->

  7. <div class="fcontent" id="main_messaqge">

  8.         <div id="layer_reg" class="postbox s_clear">
  9.                 <h3 class="float_ctrl">
  10.                         <em id="returnmessage4">联系我们</em>
  11.                         <span>
  12.                                 <!--{if !empty($infloat)}--><a href="javascript:;" class="float_close" onclick="hideWindow('contact')" title="{lang close}">{lang close}</a><!--{/if}-->
  13.                         </span>
  14.                 </h3>

  15.                         请准确填写你的Email已便我们回覆。<br>
  16.                         如你需提问的问题只是一些论坛使用问题,请在论坛上发问。<br><br>

  17. <form action="contact.php" method=post onSubmit="return validate(this)">

  18. <label><em>昵称:</em> <!--{if $discuz_uid}--> $discuz_userss<!--{else}--> <input type="text" id="username" name="username" size="25" maxlength="15" value="" tabindex="1" class="txt" /><!--{/if}--></label><br>

  19. <label><em>邮箱:</em> <!--{if $discuz_uid}-->$email<!--{else}--><input type="text" name="email" size="25" id="email" tabindex="2" class="txt" /><!--{/if}--></label><br>

  20. <!-- <label><em>你的IP地址:</em> $onlineip</label> -->

  21. <label><em>标题:</em> <input type="text" id="sub" name="sub" tabindex="3" class="txt" size="40"></label><br>

  22. <label><em>内容:</em> <textarea name="detail" rows="8" cols="60" tabindex="4"></textarea></label><br><br>

  23. <input type="hidden" name="send" value="sendmail"><input type="submit" value="确定发送" name="smail" tabindex="5">

  24. </form>

  25.         </div>
  26. </div>

  27. <!--{if empty($infloat)}-->
  28.         </div></div>
  29. </div>
  30. <!--{/if}-->
  31. {template footer}
复制代码
2.建立contact.php,上传到论坛跟目录,里面代码为:
  1. <?php
  2. define('BINDDOMAIN', 'logging');
  3. require_once( "./include/common.inc.php" );


  4. $submix = 2;
  5. $submax = 20;
  6. $detailmix = 10;
  7. $detailmax = 1000;


  8. $name = $discuz_uid ? $discuz_user: $username;

  9.                 $timestamp = time();
  10.         $date=date('Y年m月d日 H:i:s',$timestamp);
  11.         $text="發出時間:$date \n";
  12.                 $text.="用戶名稱: $name \n";
  13.                 $text.="用戶IP: $onlineip \n";
  14.                 $text.="回覆電郵: $email \n";
  15.                 $text.="相關內容: $detail \n";
  16.         $subject="xmegret.cn - $sub";

  17. if($send=="sendmail") {
  18.         if(!strstr($email, '@') || $email != addslashes($email) || $email != htmlspecialchars($email)) {
  19.                 showmessage('抱歉,Email 格式错误,请返回修改。');
  20. }

  21. if(strlen($sub) < $submix || strlen($sub) > $submax ) {
  22.         showmessage('对不起,标题必须 '.$submix.' - '.$submax.' 之间,请返回修改。');
  23.         } elseif(strlen($detail) < $detailmix || strlen($detail) > $detailmax ) {
  24.                 showmessage('对不起,内容必须 '.$detailmix.' - '.$detailmax.' 之间,请返回修改。');
  25.         }
  26.                 sendmail($adminemail,$subject,$text);
  27.                 showmessage("已成功向本站管理员发出信息,我们会尽快回覆,谢谢!",dreferer());
  28. }


  29. include template('contact');
  30. ?>
复制代码
3.templates/default/footer.htm里的 
  1. <a href="mailto:$adminemail">
复制代码
 替换为
  1. <a href="contact.php" hidefocus="true" onclick="showWindow('contact', this.href);return false;">
复制代码
然后更新缓存。
1.jpg
2.jpg

评分

4

查看全部评分

回复

使用道具 举报

№11买空间网 发表于 2009-11-6 11:58:35 | 显示全部楼层
谢谢LZ~~~~~~~~~
回复

使用道具 举报

 楼主| autoit 发表于 2009-11-6 11:58:54 | 显示全部楼层
本帖最后由 autoit 于 2010-01-18 22:36 编辑

附件删除了。

版主不处理垃圾ID, 所以不在分享了。。。 bye.
回复

使用道具 举报

 楼主| autoit 发表于 2009-11-6 12:03:07 | 显示全部楼层
默认是发到 admin 的邮箱。 如果你想发另外邮箱或同时发到几个邮箱话。 可以直接改admin email 就可以了。
回复

使用道具 举报

snowswu 发表于 2009-11-6 12:05:54 | 显示全部楼层
不错,帮顶~~
回复

使用道具 举报

lijianbo 发表于 2009-11-6 12:28:03 | 显示全部楼层
这个不错啊!
回复

使用道具 举报

水岸心晴 发表于 2009-11-6 13:25:10 | 显示全部楼层
我测试了下.怎么发出去.收不到呢?
回复

使用道具 举报

毛豆子 发表于 2009-11-6 14:44:25 | 显示全部楼层
支持一下,顺便下载安装试试
回复

使用道具 举报

qq9688 发表于 2009-11-6 19:36:20 | 显示全部楼层
不错,支持。
回复

使用道具 举报

hzh0503 发表于 2009-11-6 19:41:39 | 显示全部楼层
不错,友情帮顶
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2025-11-24 19:28 , Processed in 0.121906 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表