During one of my works, I needed the ID of the user who viewed the topic page. I found a way to do this simply. I opened the /
viewtopic.php file located in the phpBB root and found the following line (786):
Code: Select all
'TOPIC_POSTER' => $topic_data['topic_poster'],
and I added the following code to the next line:
Code: Select all
'USER_IDD' => $user->data['user_id'],
After saving the file, when I used the
{USER_IDD}
code in the /template/
viewtopic_body.html file of my style, I could now get the user ID of the user viewing the page.
Best.