Change S_IS_BOT per postrow?

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
User avatar
Toxyy
Registered User
Posts: 942
Joined: Mon Oct 24, 2016 3:22 pm
Location: Namek
Contact:

Change S_IS_BOT per postrow?

Post by Toxyy »

I want to hide all the users contact information so that it can't be accessed in any way, so display: none won't do. I can't use if's through events to remove template that I don't want. It turns out that if I could enable and disable S_IS_BOT per postrow, this would hide it. But I can't seem to modify it. I've tried putting

Code: Select all

$this->template->assign_var('S_IS_BOT', 1);
in a lot of different events and it won't reflect anything, even if I call the variable in the template.

How should I go about this? Currently I have to modify viewtopic_body.html to get the results I want.

I was able to use page_header_after to change it but that only gets run once.

EDIT:

I was able to get around this by setting

Code: Select all

 $event['user_cache'] = $event['user_poster_data'] = $event['cp_row'] = NULL; 
in viewtopic_modify_post_row. The only problem is, $u_pm is assigned using the old variable and not the editable one using $post_row from the event above it in viewtopic.php. I'll make an edit right away. PR & ticket made
I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

Some of my extensions:
[3.3][BETA] Post Form Templates || [3.3][BETA] Anonymous Posts || [3.2][3.3][BETA] ACP Merge Child Forums || [3.2][BETA] Sticky Ad || [3.2][DEV] User Delete Topics || [3.3][DEV] Moderate While Searching || [3.3][RC] Short Number Twig Extension
Post Reply

Return to “Extension Writers Discussion”