Skip to content

Commit

Permalink
Assign more topic related Smarty variables
Browse files Browse the repository at this point in the history
Assign more topic related Smarty variables on view topic page, allowing
for templates to display the topic title and author.
  • Loading branch information
samerton committed Jul 15, 2016
1 parent 6cc9d8b commit 5b82093
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pages/forum/view_topic.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@
$topic = $queries->getWhere("topics", array("id", "=", $tid));
$topic = $topic[0];

// Assign author + title to Smarty variables
$smarty->assign(array(
'TOPIC_TITLE' => htmlspecialchars($topic->topic_title),
'TOPIC_AUTHOR_USERNAME' => htmlspecialchars($user->idToName($topic->topic_creator)),
'TOPIC_AUTHOR_MCNAME' => htmlspecialchars($user->idToMCName($topic->topic_creator))
));

// Get all posts in the topic
$posts = $queries->getWhere("posts", array("topic_id", "=", $tid));

Expand Down

0 comments on commit 5b82093

Please sign in to comment.