Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
in Q2A Core by

I want to write Automatic text immediately after each question
Does anyone know how to do it

1 Answer

+1 vote

You could check out the signatures plugin, since it does basically that, and a lot more:


Here is the example from that plugin:

        function q_view_content($q_view)
            $this->signatures = array();
            if (qa_opt('signatures_enable') && qa_opt('signatures_q_enable')) {
                $result = qa_db_read_all_assoc(
                        'SELECT signature,userid,format FROM ^usersignatures'
                foreach($result as $user) {
                    if ($user['signature']) {
                        $viewer=qa_load_viewer($user['signature'], $informat);
                        global $options;
                        $signature=$viewer->get_html($user['signature'], $informat, array(
                            'blockwordspreg' => @$options['blockwordspreg'],
                            'showurllinks' => @$options['showurllinks'],
                            'linksnewwindow' => @$options['linksnewwindow'],
                        $this->signatures['user'.$user['userid']] = $signature;
                if(@$this->signatures['user'.$q_view['raw']['userid']]) {
                     if(!isset($q_view['content'])) $q_view['content'] = '';


This is doing more than you need, it's populating an array of signatures to be used in the answers and comments as well, but it does add to $q_view['content'], which is what I assume you are looking for.