MyBB Community Forums

Full Version: How To Make {$thread['subject']} On Thread Preview?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

When I Preview a New Thread, it just says Preview, but I would like to add {$thread['subject']} on the end of the word Preview.

But it doesn't work, it only works on New Replies, NOT New Threads. Does anyone know how to make it work on New Threads?

Look at the picture below:[Image: 2rh7fvk.png]

EDIT: I tried to add {$post['subject']} to the "previewpost" template too, but it doesn't work.
You need to edit the postbit/_classic templates.
(2014-02-24, 05:18 AM)Omar G. Wrote: [ -> ]You need to edit the postbit/_classic templates.

No, I need to add {$post['subject']} or {$thread['subject']} in:

Ungrouped Templates > previewpost template, not the postbit template.

But no subject title appears when I put it in the previewpost template. Does anyone know how to put that code in the previewpost template?
(2014-02-24, 07:31 AM)Greg Winston Wrote: [ -> ]
(2014-02-24, 05:18 AM)Omar G. Wrote: [ -> ]You need to edit the postbit/_classic templates.

No, I need to add {$post['subject']} or {$thread['subject']} in:

Ungrouped Templates > previewpost template, not the postbit template.

But no subject title appears when I put it in the previewpost template. Does anyone know how to put that code in the previewpost template?

That hook isn't coded to work in that template. You can make it work in the this template with a few edits to the core files.
(2014-02-24, 12:21 PM)MyBB Monster Wrote: [ -> ]
(2014-02-24, 07:31 AM)Greg Winston Wrote: [ -> ]
(2014-02-24, 05:18 AM)Omar G. Wrote: [ -> ]You need to edit the postbit/_classic templates.

No, I need to add {$post['subject']} or {$thread['subject']} in:

Ungrouped Templates > previewpost template, not the postbit template.

But no subject title appears when I put it in the previewpost template. Does anyone know how to put that code in the previewpost template?

That hook isn't coded to work in that template. You can make it work in the this template with a few edits to the core files.

Ok, how can I code a hook to work in the "previewpost" template by editing core files?
(2014-02-24, 07:31 AM)Greg Winston Wrote: [ -> ]
(2014-02-24, 05:18 AM)Omar G. Wrote: [ -> ]You need to edit the postbit/_classic templates.

No, I need to add {$post['subject']} or {$thread['subject']} in:

Ungrouped Templates > previewpost template, not the postbit template.

But no subject title appears when I put it in the previewpost template. Does anyone know how to put that code in the previewpost template?

The previewpost template calls in the postbit/_classic templates IIRC so...

<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="clear: both; border-bottom-width: 0;">
<tr>
<td class="thead" colspan="2"><strong>{$lang->post_preview}</strong></td>
</tr>
</table>
{$postbit}
<br />

 716                  $attachcache[0][$attachment['aid']] = $attachment;
 717              }
 718  
 719              $postbit = build_postbit($post, 1);
 720              eval("\$preview = \"".$templates->get("previewpost")."\";");
 721          }
(2014-02-25, 04:17 AM)Omar G. Wrote: [ -> ]
(2014-02-24, 07:31 AM)Greg Winston Wrote: [ -> ]
(2014-02-24, 05:18 AM)Omar G. Wrote: [ -> ]You need to edit the postbit/_classic templates.

No, I need to add {$post['subject']} or {$thread['subject']} in:

Ungrouped Templates > previewpost template, not the postbit template.

But no subject title appears when I put it in the previewpost template. Does anyone know how to put that code in the previewpost template?

The previewpost template calls in the postbit/_classic templates IIRC so...

<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="clear: both; border-bottom-width: 0;">
<tr>
<td class="thead" colspan="2"><strong>{$lang->post_preview}</strong></td>
</tr>
</table>
{$postbit}
<br />

 716                  $attachcache[0][$attachment['aid']] = $attachment;
 717              }
 718  
 719              $postbit = build_postbit($post, 1);
 720              eval("\$preview = \"".$templates->get("previewpost")."\";");
 721          }

I don't quite understand what exactly to do in the post above. I would just like to put "{$thread['subject']}" next to "{$lang->post_preview}" so it looks like "{$lang->post_preview}{$thread['subject']}" in the "previewpost" template.

A step-by-step helpful comment would be lovely, if you can.