SimplePortal

Customization => Blocks and Modifications => Block Requests => Topic started by: SimianSteam on May 09, 2014, 01:58:47 PM

Title: Info Center Block?
Post by: SimianSteam on May 09, 2014, 01:58:47 PM
I searched a bit and found stuff that skirted around this, but nothing that completely addressed it.

Is there any way to embed the entire Info Center into a block? I'm talking about the one that's standard in SMF and shows Forum Stats, Users Online, etc, etc.
Title: Re: Info Center Block?
Post by: AngelinaBelle on May 09, 2014, 04:11:02 PM
You could do this.  You could use the code from the board index.php to generate the information, and call the template functions to format it.

It really sounds like you are doing a total theme re-design, though.
You could develop a new theme that puts the info center in a different location.

But you want to put it in a side bar?
Title: Re: Info Center Block?
Post by: SimianSteam on May 09, 2014, 04:22:53 PM
You could do this.  You could use the code from the board index.php to generate the information, and call the template functions to format it.

It really sounds like you are doing a total theme re-design, though.
You could develop a new theme that puts the info center in a different location.

But you want to put it in a side bar?

Footer. It's actually kind of the opposite of a theme. Rather than try to tweak all the components of a theme with this setup I could move stuff where ever I wanted with a few button clicks. Want the Info Center in the sidebar instead of the footer? 30 seconds. Want to have a different banner shown in various subforums? 30 seconds.

You see what I'm getting at?
Title: Re: Info Center Block?
Post by: Chen Zhen on May 09, 2014, 05:02:47 PM
Edit the BoardIndex.template.php file within every theme folder.
Find the following code:
Code: [Select]
template_info_center();

Put remark tags in front of it so the function all is ignored.

ie.
Code: [Select]
// template_info_center();

  This function name may actually vary since a theme's author does not have to use a uniform function name compared to the default theme. However I have noticed that most theme author's use the same function name when a custom  BoardIndex.template.php file exists.



Then you create a custom php block, hide/disable the title and body and then call the function within the code entered for that block:
Code: [Select]
template_info_center();

In most cases it is designed to look proper using the theme's full width therefore I do not think it will look very nice in a side block without some tweaking.
Title: Re: Info Center Block?
Post by: SimianSteam on May 09, 2014, 09:08:17 PM
Edit the BoardIndex.template.php file within every theme folder.
Find the following code:
Code: [Select]
template_info_center();

Put remark tags in front of it so the function all is ignored.

ie.
Code: [Select]
// template_info_center();

  This function name may actually vary since a theme's author does not have to use a uniform function name compared to the default theme. However I have noticed that most theme author's use the same function name when a custom  BoardIndex.template.php file exists.



Then you create a custom php block, hide/disable the title and body and then call the function within the code entered for that block:
Code: [Select]
template_info_center();

In most cases it is designed to look proper using the theme's full width therefore I do not think it will look very nice in a side block without some tweaking.

Thank you! I'll give it a shot as soon as the forum dies down for the night and I can risk editing php templates without bothering people.
Title: Re: Info Center Block?
Post by: AngelinaBelle on May 10, 2014, 08:06:27 AM
You can always do your testing in a test instance of your forum. That should sVe some hassle for your users.  Then you can quickly copy the changed files over to the "real" forum
Title: Re: Info Center Block?
Post by: SimianSteam on May 10, 2014, 11:18:21 PM
You can always do your testing in a test instance of your forum. That should sVe some hassle for your users.  Then you can quickly copy the changed files over to the "real" forum

Good point. I've actually got 4 different installs running on my server. One is an "Open Testbed" for users of my current forum (Hosted on ProBoards) to see what I'm working on, the other four are to break. :D
Title: Re: Info Center Block?
Post by: AngelinaBelle on May 12, 2014, 01:41:33 PM
Sounds like you know how to move this forward, then.
Also -- remember, for advice on custom SMF coding (which is exactly what you are doing), you can also get some pretty supplementary good advice on the SMF custom coding boards at simplemachines.org.

Enjoy!
SimplePortal 2.3.8 © 2008-2024, SimplePortal