杰奇cms章节页面报错功能实现,基本思路

本文阅读 2 分钟
广告

这是交流群里面一个群友提出来的问题,而网上的这种功能是手机端插件自带的,并不属于杰奇官方版的插件。然后今天简单的研究了一下,发现直接使用杰奇后台收件箱的功能是可行的,所以就随手写了一些代码。这些代码我没有做什么安全措施,仅提供一个大概的思路,具体的自己可以去完善一下。
注意:仅限杰奇1.7官方版哦,那些用手机端插件或者二次开发的应该是用不了的。
实际效果如下:
QQ截图20181021215714.png
QQ图片20181021215912.png
代码主要写在style.html,这是目录页模板
html代码如下,加在body标签:

<div class="toerrors">
    <div class="toerrors-main">
        <form action="/toerrors.php">
            <input type="text" class="e-book" name="e-book" value="问题反馈:{?$jieqi_title?}-{?$article_title?}">
            <textarea class="e-text" name="e-text" placeholder="输入错误内容"></textarea>
            <button class="e-sub">提交</button>
        </form>
    </div>
</div>

css代码如下,加在head标签:

<style>
.toerrors{position:fixed;
width:100%;
z-index:999;
height:160px;
top:25%;}
.toerrors-main{margin:0 auto;
height:160px;
width:280px;
padding:10px;
background:#fff;
border:solid 1px #ddd;
border-radius:4px;
-webkit-box-shadow:0 1px 5px rgba(0,0,0,.2);
box-shadow:0 1px 5px rgba(0,0,0,.2);}
.toerrors-main .e-book,.toerrors-main .e-text{display:block; margin:5px 0px;
width:260px;
padding:5px 10px;}
.toerrors-main .e-text{margin-top:15px;
height:60px;
resize:none;}
.toerrors-main .e-sub{display:block;
width:60px;
margin:10px auto 0px auto;
height:25px;
background:#d44653;
color:#fff !important;
border:none;
border-radius:4px;}
</style>

php代码,这里我创建了一个toerrors.php放在根目录:

<?php
$title = "";
$content = "";
$time = time();;
if($_GET['e-book']){
    $title = $_GET['e-book'];
    $content = $_GET['e-text'];
    require_once("configs/define.php");
    @mysql_connect(constant("JIEQI_DB_HOST"), constant("JIEQI_DB_USER"),constant("JIEQI_DB_PASS"));  
    @mysql_query("SET NAMES 'gbk'");
    @mysql_select_db(constant("JIEQI_DB_NAME"));
    $sql=@mysql_query("INSERT INTO `jieqi_system_message` (`messageid`, `siteid`, `postdate`, `fromid`, `fromname`, `toid`, `toname`, `title`, `content`, `messagetype`, `isread`, `fromdel`, `todel`, `enablebbcode`, `enablehtml`, `enablesmilies`, `attachsig`, `attachment`) VALUES
('', 0, $time, 0, 'admin', 0, '', '$title', '$content', 0, 0, 0, 0, 1, 0, 1, 0, 0);");
    echo "<script>alert('提交成功');";
    echo "window.location.href='javascript:history.go(-1)';</script>";
}
?>

上面那些代码已经可以实现功能了,至于怎么通过按钮或者链接呼唤弹窗,这个js我就没写了,还有php的安全性问题,可以加群讨论下。

本文来自投稿,不代表本站立场,如若转载,请注明出处:https://www.ruletree.club/archives/856/
整理记录,js多按键组合提交表单
« 上一篇 10-18
幼衾:苏忘
下一篇 » 10-25
广告

发表评论

V注册会员 L评论等级
R3 条回复
  1. 不吃土豆Lv.1 说道:
    2018-10-28     Win 10 /    FireFox

    有1.7的微信对接吗?好像只有2X的

    1. 不暇VLv.6 说道:
      2018-10-29     Android /    Chrome

      @不吃土豆

      目前1.7的微信对接并没有人去开发,或者开发了都没有分享出来。

      1. 不吃土豆Lv.1 说道:
        2018-10-29     Win 10 /    FireFox

        @不暇

        嗯。。找半天都没。。后来网上找了个代码。。自己改了下。。将就能用

没有更多评论了

作者信息

热门文章

标签TAG

热评文章