Provide zblog template_zblog them_wordpress template download and customization

Zblogphp comes with a complete set of js framework comment interfaces

Tianxing Studio 2020-12-04 15:56 Zblogphp Tutorial three thousand and fifty-seven 0 Comments


Zblogphp has launched its own js front-end framework since version 1.5: Z-BlogPHP JavaScript Framework; Some commonly used events on the front end are encapsulated and built into the zblogphp.js file.

The js of the theme only needs to be simply called according to the regulations, which greatly simplifies the process and unifies the standards.

Share some use cases in the following official git library:

 //Verification rules for comment fields. The submitted content must have a test field zbp.options.comment.inputs.test = {     required: true,     getter: function () {         return 'ZBPJF'     },     validator: function (text, callback) {         if (text !== 'ZBPJF') {             callback(new Error('No ZBPJF! '))         } else { //Null means no problem             callback(null)         }     } } //Hanging interface //Get comment data zbp.plugin.on("comment.get", "ZBPJFExample", function (postId, page) { Console. log ('Start trying to comment on data ') }) //Get comment data zbp.plugin.on("comment.got", "ZBPJFExample", function (formData, data, textStatus, jqXhr) { Console. log ('Get comment data ')     console.log(data) }) //The comment start interface can only read and modify formData zbp.plugin.on("comment.post.start", "ZBPJFExample", function (formData) { Console. log ('Start commenting! ') }) //Comment on the interface in verification zbp.plugin.on("comment.post.validate", "ZBPJFExample", function (formData) { Console. log ('Comments are being verified! ') }) //Comment verification failure interface zbp.plugin.on('comment.post.validate.error', 'ZBPJFExample', function (error, formData) { Console. log ('Comment verification failed: '+error. code) }) //Comment Verification Successful Interface zbp.plugin.on('comment.post.validate.success', 'ZBPJFExample', function (formData) { Console. log ('Comments verified successfully! ') }) //Comment sent successfully interface zbp.plugin.on('comment.post.success', 'ZBPJFExample', function (formData, data, textStatus, jqXhr) { Console. log ('Comments sent successfully! ') Console.log ("System returned data:");     console.log(data) }) //Comment sending failure interface zbp.plugin.on('comment.post.error', 'ZBPJFExample', function (error, formData, data, textStatus, jqXhr) { Console. log ('Comment sending failed, error: '+error. code)     console.log(error) }) //Comment sending end interface //Whether successful or failed, the end of comment sending will be triggered zbp.plugin.on('comment.post.done', 'ZBPJFExample', function (error, formData, data, textStatus, jqXhr) { Console. log ('End of sending comments') }) //Comment reply interface, which may be invalid in the theme used for the old version //In addition, you can unbind system related events through zbp. plugin. unbind ("comment. reply", "system default"). zbp.plugin.on("comment.reply.start", "ZBPJFExample", function (id) { Console. log ("reply comment ID:"+id); }); //If the comment reply interface is cancelled, it may be invalid in the theme used for the old version. If the system is unbound, the event may be invalid. //Themes may be required zbp.plugin.on("comment.reply.cancel", "ZBPJFExample", function (id) { Console.log ("Cancel reply comment"); });

If you are interested in it, you can test it directly in your own code. There is still some playability.


Can't find a tutorial that can solve your problem?

You can try to search or ask questions directly online. We also provide charging technical support. If you need it, you can contact us online.

Online questions Online Service

welcome you Comment: Cancel Reply

 Please fill in the verification code
  • Latest articles
  • Hot article ranking
  • Most Comments
Label aggregation