How do I prevent users from changing question titles in a question2answer Script?

Bhavesh S November 29, 2013

I recently modified question2answer script on

I created a test post with self as user and posted one question. I then re-edited my question title there and I have seen its premalink was also changed while changing titles. I as a moderator/admin can change titles but I don’t want any users to changes their post’s title. Please let me know how can achieve this.

  1. Bhavesh S
    November 30, 2013 at 7:09 am

    I also asked in help forum from question2answer forum and I got answer for the same. I would like to share it here.We have to change little moditication in qa-theme.php file as below.

    Source file : qa-theme/(Your theme)/qa-theme.php

    Function :

    function form_field_rows($form, $columns, $field) {
    if(isset($field['tags']) && $field['tags'] =='name="q_title"') {
    if(qa_get_logged_in_level() < QA_USER_LEVEL_MODERATOR) {
    // Method1
    //$field['tags'] .= ' readonly="readonly"';

    // Method2
    //$field['label'] = '';
    $field['label'] = 'Title:';
    $field['type'] = 'static';

    // Method3
    //$field['label'] = '';
    //$field['tags'] .= ' type="hidden"';
    qa_html_theme_base::form_field_rows($form, $columns, $field);

    Now user will not be able to modify question titles once their question has been published on

    Source :
    Special thanks : sama