MyBB Community Forums

Full Version: How does myBB fill in the template variables?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi

MyBB 1.4 here.

I am doing some heavy modding on the templates, and I was wondering where these variables are getting processed.

For example when previewing a new thread, the subject field is pre-populated by the variable subject posted from the form.. the template has this in the field:

{$subject}

I've been searching the newthread.php and the functions_post.php but i cant seem to figure out where this takes place

To explain a bit about what im doing... i am adding code that manipulates user input when creating/editing posts.. i've figured out how to properly display my manipulated data in the

PREVIEW portion
functions_post.php

line 529
Quote: $post['message'] = $parser->parse_message($post['message'], $parser_options) . "my text";

as well as the actual saving of data into database
line 307
Quote:"message" => $mybb->input['message'] . "my text",


Hope somone can help..
A technique you can use for searching for things you need to change is to search for the template name in a file. For example, if the template you're looking to edit is called "previewpost", then if you search for it in newthread.php, you'll find the eval line (eventually). Any variable that is in the template must be defined before this line.

I'm not sure if it's the one you're looking for, but you could try editing the $subject variable around line 719...