MyBB Community Forums

Full Version: can it be done by core edit and adding new {$welcomeblock2} ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i am just curious about this and if it became possible to do this then i will be grateful and oblige.

i want to have a second variable "{$welcomeblock2} or {$onlyforusers}"  behave like the original {$welcomeblock} variable and it will pull all the content from "header_onlyfor_users_area" template that i have added in header template section . can be it possible to this by edit core files ?



Edited:-
(i am just curious about this and if it became possible to do this then i will be grateful and oblige.

i want to have a second header_welcomeblock_member template named header_welcomeblock_member_2 that it can actually behave like the original header_welcomeblock_member template. can be it possible to this by edit core files ?)
It's possible but probably a bad idea. Look @ https://github.com/mybb/mybb/blob/mybb_1...#L510-L554
What is the purpose of this modification ? Adding a second block for logged users ?
(2021-08-20, 07:42 AM)Crazycat Wrote: [ -> ]It's possible but probably a bad idea. Look @ https://github.com/mybb/mybb/blob/mybb_1...#L510-L554
What is the purpose of this modification ? Adding a second block for logged users ?

Yeah ! i want to add a second block for logged users.  And i already have added the template "header_welcomeblock_member_2" , but i don't how do i push this template in core that it will behave like header_welcomeblock_member , i am so not familiar with php , can you please help me ?
Should your second _member_2 be a dynamically one, so displaying or hiding on specific conditions and with a totally different content and different variables?

Or should it be just another permamnent content block for user logged in? If so, there is no need for creating another template and do code changes. Then simply put your additional content to the header_welcomeblock_member template.

What kind of content do you want to display in this second block in detail? Maybe we can find a way to achieve this with the given templates or with minimal code changes Wink

[ETS]
Quote:Then simply put your additional content to the header_welcomeblock_member template.


if i do this then where ever i mention the {$welcomeblock} it will pull unnecessarily all the contents within it. 

oh wait instead of header_welcomblock_2 i just want :- 

i have added a template just now named "regester_member_area"  in my header templtes .
i just want that should be function only for logged in users. whenever i will put the {$onlyforusers} in my header template it will pull all the contet from "header_onlyfor_users_area" template and it should be only visible to members only not guest just like {$welcomeblock}

(2021-08-20, 07:42 AM)Crazycat Wrote: [ -> ]It's possible but probably a bad idea. Look @ https://github.com/mybb/mybb/blob/mybb_1...#L510-L554
What is the purpose of this modification ? Adding a second block for logged users ?

i get it done , Thanks for pointing it out.