file: listener.php,
Код: Выделить всё
static public function getSubscribedEvents()
{
return array(
'core.viewtopic_modify_post_row' => 'viewtopic_modify_post_row',
);
}
public function viewtopic_modify_post_row($event)
{
$row = $event['row'];
$poster_id = (int) $row['user_id'];
$this->template->assign_vars([
'POST_USER_ID' => $poster_id,
]);
}
file: vendorname/extensionname/styles/all/template/event/viewtopic_body_postrow_custom_fields_after.html
Код: Выделить всё
{%- if POST_USER_ID -%}<dd><strong>{{ lang('POST_USER_ID') }}{{ lang('COLON') }}</strong> {{ POST_USER_ID }}</dd>{%- endif -%}
now on viewtopic.php, all the different user's posts show the same POST_USER_ID.
it shows the user-id of the last post of each page for all the posts.
why? and how can i fix this to show the exact user-id of each post?
thank you,