Giter Site home page Giter Site logo

Comments (4)

Rainshaw avatar Rainshaw commented on June 9, 2024

我测试没有问题,你看下是不是你的邮件模版里的变量写乱了。

issue 先关闭了,如非上述问题,请再打开本issue

from typecho-plugin-notice.

ludoux avatar ludoux commented on June 9, 2024

@RainshawGao

我测试没有问题,你看下是不是你的邮件模版里的变量写乱了。

这个没有写乱,是默认的模板。


我不会PHP所以不知道原因,不过我现在是改了一下这个替换函数,比较丑但是我的 serverchan 和收邮件是正确的,别的没有测试过😂

public static function replace($str, $coid)
    {
        $comment = Helper::widgetById('comments', $coid);
        $date = new Typecho_Date();
        $time = $date->format('Y-m-d H:i:s');
        
        $status = array(
            "approved" => "通过",
            "waiting" => "待审",
            "spam" => "垃圾"
        );
        $str = str_replace(
            array(
            "{siteTitle}",
            "{title}",
            "{author}",
            "{ip}",
            "{mail}",
            "{permalink}",
            "{manage}",
            "{text}",
            "{time}",
            "{status}"),
            array(
            Helper::options()->title,
            $comment->title,
            $comment->author,
            $comment->ip,
            $comment->mail,
            $comment->permalink,
            Helper::options()->siteUrl . __TYPECHO_ADMIN_DIR__ . "manage-comments.php",
            $comment->text,
            $time,
            $status[$comment->status]),$str);
            
        
        if ($comment->parent) {
            $parent = Helper::widgetById('comments', $comment->parent);
            $str = str_replace(
                array(
                "{author_p}",
                "{text_p}"),
                array(
                $parent->author,
                $parent->text),$str);
        } else {
            $str = str_replace(
                array(
                "{author_p}",
                "{text_p}"),
                array(
                '',
                ''),$str);
        }
        return $str;
    }

from typecho-plugin-notice.

Rainshaw avatar Rainshaw commented on June 9, 2024

不太清楚。。。为啥需要改写这个函数叻

from typecho-plugin-notice.

ludoux avatar ludoux commented on June 9, 2024

from typecho-plugin-notice.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.