From: Kon A. <ang...@ip...> - 2002-03-17 08:10:33
|
Hi All, One of the features I needed phpesp to have was the ability of adding descriptive text in a survey without having it be a question. I've also noticed that this has also appeared in the feature requests so I decided to do this myself. Here are the steps. 1. log into the phpesp database and issue the following sql statement: " insert into question_type values(11,'Statement','N','response_text'); " 2. now edit the /admin/include/function/survey_render.inc file. A:/ go to line 85. the original line (version 1.5) is: <?php if($question['required']=='Y') { echo('<font color="#FF0000">*</font>'); } ?><A NAME="Q<?php echo($i); ?>"><?php echo($i); ?>.</A> change this line to: <?php if($question['required']=='Y') { echo('<font color="#FF0000">*</font>'); } ?> and then add the following line 4 lines: <?php if ($tid != '11') echo ("<A NAME=\"Q($i)\">($i).</A>"); ?> This ensures that the Statement does not have a Question number displayed next to it. B:/ The next step is to find the following line: <td valign="TOP" aligh="LEFT"> - this should be line 87 in the original file or line 91 if you've added the above code. change it to: <td valign="TOP" aligh="LEFT" width="95%"> This will prevent large descriptive text or statements from messing up the formatting of your survey. and that is all.. Simply create or edit a survey, go to the Question tab where you will notice the new item "Statement" in the New Field's type dropdown list and enter your statement in the Text's text field. There can not be any possible answers to this statement so you do not need to fill in the rest of the fields in the Question tab page. Enjoy ! Regards Kon Angelopoulos |