MyBB Community Forums

Full Version: Custom Group Viewing
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
[attachment=20677]

Okay, so the red areas are something i've been thinking about. Above the shoutbox within that table i'm going to use as a forum announcements/information block. As for the advertisement area, i want that to only be viewable to guests, so people that register with my forums will not have to be bothered with advertisements. I want to be able to do this with pure coding, i don't want any more plugins.

My Questions:

1. How would i code the advertisement area to only be viewable for guests?

2. How would i code an announcement in the table area above the shoutbox that only a guest can see (same as #1), and then a different one for members once they log in that only members can see.
you would need to alter global.php to populate the variables for the footer.

near the end of the file, just above the call to the global_end hook, add the code to test user Id of usergroup/additional groups and populate a variable containing the ad or an empty string. that variable is then used in the footer template. the variable in global.php would be put through an eval() using the standard $templates->get method. just make the template in the ACP for the ad table row or whatever you are using.

Then is the user is logged in or meets your criteria for no ads, the variable = '', else eval(varaible = templates->get(your footer ad)

do the same for the announcements you want
Use the My Advertisement plugin
(2010-12-06, 05:00 AM)pavemen Wrote: [ -> ]you would need to alter global.php to populate the variables for the footer.

near the end of the file, just above the call to the global_end hook, add the code to test user Id of usergroup/additional groups and populate a variable containing the ad or an empty string. that variable is then used in the footer template. the variable in global.php would be put through an eval() using the standard $templates->get method. just make the template in the ACP for the ad table row or whatever you are using.

Then is the user is logged in or meets your criteria for no ads, the variable = '', else eval(varaible = templates->get(your footer ad)

do the same for the announcements you want

thank you paveman Smile

(2010-12-06, 11:19 AM)E-Hero Kyle Wrote: [ -> ]Use the My Advertisement plugin

uhm, no.
Well, it works for the guests only ads.
(2010-12-06, 01:30 PM)E-Hero Kyle Wrote: [ -> ]Well, it works for the guests only ads.

i know, but i have much more control over custom coded advertisements. (like jquery rotating, lightbox settings, ect...)
Works the same