Product Info
Rating:
(4 Ratings)
Read reviews
Page 9 of 29
Plugin Hooks
The easiest way to understand how the SIMAnswers plugin system works is look through the files of the SIMAnswers Core plugin (plg_simanswers_core.zip). After installation, the files are located in /plugins/simanswers/core
.
If you need professional service to help you create your own hook with other 3rd party extensions, please contact us for a free quote.
To create your own plugin that works with SIMAnswers, first create the manifest XML file:
<?xml version="1.0" encoding="utf-8"?>
<extension version="3.0" method="upgrade" type="plugin" group="simanswers">
<name>Example</name>
<author>Mike Feng</author>
<creationDate>Jan 2017</creationDate>
<copyright>Copyright (C) 2017 simbunch.com</copyright>
<license>GNU General Public License version 2 or later</license>
<authorEmail>This email address is being protected from spambots. You need JavaScript enabled to view it.</authorEmail>
<authorUrl>www.johnsmith.com</authorUrl>
<version>1.0.0</version>
<isapplication>true</isapplication>
<description>This is the description for this plugin</description>
<files>
<filename plugin="example">example.php</filename>
<filename>index.html</filename>
</files>
<languages>
<language tag="en-GB">en-GB.plg_simanswers_example.ini</language>
<language tag="en-GB">en-GB.plg_simanswers_example.sys.ini</language>
</languages>
</extension>
Create a example.php
where all the plugin hooks will go in. For example, you can refer to core.php
in the Core plugin. Begin the class declaration with:
<?php defined('_JEXEC') or die('Restricted access'); class plgSIMAnswersExample extends JPlugin { protected $autoloadLanguage = true; function __construct(&$subject, $config) { parent::__construct($subject, $config); require_once JPATH_ROOT.'/components/com_simanswers/helpers/core.php'; } } ?>
The hook functions include:
- onNewQuestion
- Called when a new question is posted.
- onNewAnswer
- Called when a new answer is posted to a question.
- onSelectBestAnswer
- Called when a user (admin or owner) selects a best answer.
- onFollowUser
- Called when a user follows another user.
- onQuestionUpdated
- Called when an update is added to a question.
- onQuestionExpired
- Called when a question expires.
- onBeforeQuestionDelete
- Called just before a question is deleted. Return true to proceed with delete, return false to prevent delete.
- onContentReported
- Called when a content is being reported for violation.
Product Reviews Rate this product
Guest rated Your review is awaiting approval.
lovely
Posted on 30 November 2018|Was this review helpful to you? Yes No
|
|
liki (1) rated
I have been using SimANSWERS for over a year on our educational website. It's an excellent component that comes in handy for Questions and Answers. The display is attractive, it is very easy to use and we have been using it to help students and our visitors on many educational topics.
Posted on 21 June 2012|1 of 1 people found this helpful. Was this review helpful to you? Yes No
I have never experienced any trouble with it and if you need help, just send an e-mail and their knowledgeable staff is available to help. |
|
richard (1) rated
Support here is excellent and you have timely updates. I have been using SimAnswers for over a year and they have been more than helpful. My questions have always been answered on time.
Posted on 13 June 2012|1 of 1 people found this helpful. Was this review helpful to you? Yes No
|
|
Joshua Lewis (1) rated
This is certainly a well thought out component, and is quite interesting. I especially like the "Interesting list" where users can in a sense "like" a post. Well done!
Posted on 27 June 2011|1 of 1 people found this helpful. Was this review helpful to you? Yes No
|