Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Frequently Asked Question (FAQ)
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #4
RE: Frequently Asked Question (FAQ)
Thanks Smile

(03-16-2012 09:35 AM)Jumper Wrote:  would it not be better to use the standard editor to post new FAQ Threads?
Because we use one textarea (XThreads Multilne Textbox) only for this example application, maybe we can grab the MyBB editor to be used for our XThreads textarea.

You can try this:
  • Edit the faq_answer custom thread field:
    • Display Format:

      Code:
      {VALUE}<setvar faq_answer_msg>htmlspecialchars_uni({RAWVALUE})</setvar>

    • Hide Input Field: Yes
  • Edit the following templates:
    • faq_editpost_first

      HTML Code
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      23
      24
      25
      26
      27
      28
      29
      30
      31
      32
      33
      34
      35
      36
      37
      38
      39
      40
      41
      42
      43
      44
      45
      46
      47
      48
      49
      50
      51
      52
      53
      54
      55
      56
      57
      58
      59
      60
      61
      62
      63
      64
      65
      66
      67
      68
      69
      70
      71
      72
      73
      <html>
      <head>
      <title>{$mybb->settings['bbname']} - {$lang->edit_post}</title>
      {$headerinclude}
      <script type="text/javascript" src="jscripts/post.js?ver=1400"></script>
      </head>
      <body>
      {$header}
      {$preview}
      {$post_errors}
      {$attacherror}
      <form action="editpost.php?pid={$pid}&amp;processed=1" method="post" enctype="multipart/form-data" name="input">
      	<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
      	<div style="width: 60%; margin: auto auto;">
      		<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
      			<tr>
      				<td class="thead" colspan="2"><strong>{$lang->xtfaq_edit_faq}</strong></td>
      			</tr>
      			<tr>
      				<td class="trow2" colspan="2">
      					<strong>{$lang->xtfaq_q}</strong> {$prefixselect}<input type="text" class="textbox" name="subject" size="40" maxlength="85" value="{$subject}" tabindex="1" />
      				</td>
      			</tr>
      			<tr>
      				<td class="trow2" colspan="2">
      					<div class="float_left"><strong>{$lang->xtfaq_a}</strong></div>
      					<div style="margin-left: 20px"><textarea name="xthreads_faq_answer" id="message" rows="20" cols="70" tabindex="2">{$GLOBALS['tplvars']['faq_answer_msg']}</textarea></div>
      					{$codebuttons}
      				</td>
      			</tr>
      			{$extra_threadfields}
      			<tr style="display: none;">
      				<td class="trow2" valign="top"><strong>{$lang->your_message}:</strong><br /><div style="text-align: center;">{$smilieinserter}</div></td>
      				<td class="trow2">
      					<textarea name="message" id="messages" rows="20" cols="70" tabindex="3">{$message}</textarea>
      				</td>
      			</tr>
      			<tr style="display: none;">
      				<td class="trow1" valign="top"><strong>{$lang->post_options}</strong></td>
      				<td class="trow1"><span class="smalltext">
      					<label><input type="checkbox" class="checkbox" name="postoptions[signature]" value="1" tabindex="6"{$postoptionschecked['signature']} /> {$lang->options_sig}</label>
      					{$disablesmilies}</span>
      				</td>
      			</tr>
      		</table>
      	</div>
      	{$attachbox}
      	<br />
      	<div align="center"><input type="submit" class="button" name="submit" value="{$lang->update_post}" tabindex="3" accesskey="s" />  <input type="submit" class="button" name="previewpost" value="{$lang->preview_post}" tabindex="4" /></div>
      	<input type="hidden" name="action" value="do_editpost" />
      	<input type="hidden" name="posthash" value="{$posthash}" />
      	<input type="hidden" name="attachmentaid" value="" />
      	<input type="hidden" name="attachmentact" value="" />
      </form>
      <br />
      <form action="editpost.php" method="post" name="editpost">
      	<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
      	<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
      		<tr>
      			<td class="thead" colspan="3"><strong>{$lang->delete_post}</strong></td>
      		</tr>
      		<tr>
      			<td class="trow1" style="white-space: nowrap"><input type="checkbox" class="checkbox" name="delete" value="1" tabindex="9" /> <strong>{$lang->delete_q}</strong></td>
      			<td class="trow1" width="100%">{$lang->delete_1}<br /><span class="smalltext">{$lang->delete_2}</span></td>
      			<td class="trow1"><input type="submit" class="button" name="submit" value="{$lang->delete_now}" tabindex="10" /></td>
      		</tr>
      	</table>
      	<input type="hidden" name="action" value="deletepost" />
      	<input type="hidden" name="pid" value="{$pid}" />
      </form>
      {$footer}
      </body>
      </html>

    • faq_newthread

      HTML Code
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      23
      24
      25
      26
      27
      28
      29
      30
      31
      32
      33
      34
      35
      36
      37
      38
      39
      40
      41
      42
      43
      44
      45
      46
      47
      48
      49
      50
      51
      52
      53
      54
      55
      56
      57
      58
      59
      60
      61
      62
      63
      64
      <html>
      <head>
      <title>{$lang->newthread_in}</title>
      {$headerinclude}
      <script type="text/javascript" src="jscripts/post.js?ver=1400"></script>
      </head>
      <body>
      {$header}
      {$preview}
      {$thread_errors}
      {$attacherror}
      <form action="newthread.php?fid={$fid}&amp;processed=1" method="post" enctype="multipart/form-data" name="input">
      	<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
      	<div style="width: 60%; margin: auto auto;">
      		<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
      			<tr>
      				<td class="thead" colspan="2"><strong>{$lang->xtfaq_new_faq}</strong></td>
      			</tr>
      			<tr>
      				<td class="trow2" colspan="2">
      					<strong>{$lang->xtfaq_q}</strong> {$prefixselect}<input type="text" class="textbox" name="subject" size="49" maxlength="85" value="{$subject}" tabindex="1" />
      				</td>
      			</tr>
      			<tr>
      				<td class="trow2" colspan="2">
      					<div class="float_left"><strong>{$lang->xtfaq_a}</strong></div>
      					<div style="margin-left: 20px"><textarea name="xthreads_faq_answer" id="message" rows="20" cols="70" tabindex="2">{$GLOBALS['tplvars']['faq_answer_msg']}</textarea></div>
      					{$codebuttons}
      					{$multiquote_external}
      				</td>
      			</tr>
      			{$extra_threadfields}
      			<tr style="display: none;">
      				<td class="trow2" valign="top" width="20%"><strong>{$lang->your_message}</strong>{$smilieinserter}</td>
      				<td class="trow2">
      					<textarea name="message" id="messages" rows="20" cols="70" tabindex="2">{$message}</textarea>
      				</td>
      			</tr>
      			<tr style="display: none;">
      				<td class="trow1" valign="top"><strong>{$lang->post_options}</strong></td>
      				<td class="trow1"><span class="smalltext">
      					<label><input type="checkbox" class="checkbox" name="postoptions[signature]" value="1" tabindex="7"{$postoptionschecked['signature']} /> {$lang->options_sig}</label>
      					{$disablesmilies}</span>
      				</td>
      			</tr>
      			{$modoptions}
      			{$captcha}
      		</table>
      	</div>
      	{$attachbox}
      	<br />
      	<div style="text-align:center"><input type="submit" class="button" name="submit" value="{$lang->post_thread}" tabindex="4" accesskey="s" />  <input type="submit" class="button" name="previewpost" value="{$lang->preview_post}" tabindex="5" />{$savedraftbutton}</div>
      	<input type="hidden" name="action" value="do_newthread" />
      	<input type="hidden" name="posthash" value="{$posthash}" />
      	<input type="hidden" name="attachmentaid" value="" />
      	<input type="hidden" name="attachmentact" value="" />
      	<input type="hidden" name="quoted_ids" value="{$quoted_ids}" />
      	<input type="hidden" name="tid" value="{$tid}" />
      	{$editdraftpid}
      </form>
      {$forumrules}
      {$footer}
      </body>
      </html>


Scr:
Newthread + Preview:
   

Editpost + Preview:
   

03-17-2012 04:22 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Frequently Asked Question (FAQ) - RateU - 03-16-2012, 04:40 AM
RE: Frequently Asked Question (FAQ) - RateU - 03-17-2012 04:22 AM
RE: Frequently Asked Question (FAQ) - Glas - 03-23-2012, 03:56 AM
RE: Frequently Asked Question (FAQ) - Glas - 06-02-2012, 06:47 AM
RE: Frequently Asked Question (FAQ) - Glas - 06-04-2012, 04:15 AM
RE: Frequently Asked Question (FAQ) - Glas - 06-04-2012, 11:09 PM
RE: Frequently Asked Question (FAQ) - Yoda - 06-19-2018, 01:42 PM

 Standard Tools
Forum Jump: