PCS Game Hosting
  Forum Index    Search    Usergroups    Edit your profile    Members    Arcade    Ranks

 Reputation    Medals    Staff    Statistics    Board Rules    Forum FAQ    Private MessagesLogin, Check Messages    Log in 

Search for at
Soldier Of Fortune 2 Advanced Search

Post new topicReply to topicprinter-friendly viewThank Post
   Soldier Of Fortune 2 Forum Index » Content management system » PHP Nuke » How to hide the left blocks
 View previous topic :: View next topic  
Author Message

In Game: Teo

Joined: Sep 21, 2009
Last Visit: Dec 30, 2019
Age: 38
Posts: 1174
Location: Milan
Reputation: 5501
votes: 7
Medals: 6 (View more...)
Website Founder (Amount: 1)

Status: Offline
PostPosted: Tue Jan 08, 2013 10:54 am
PostPost subject: No icon How to hide the left blocks
Reply with quote

For some esoteric reason, you may want to hide the column with the left blocks, although it contains some crucial blocks, like the modules block (Figure 17-1), for example. To accomplish this, you have to edit the themeheader() function in the theme.php file of your theme (in the themes/YourTheme folder) and replace the line:



if ($name=='Forums') {
/* Don't display it. */
else {

Here, we check if the module is the Forums module and suppress the call to blocks(left) if it is. This will hide the left column blocks in the Forums. It is easy to include more modules, as in the following example (see Hide left blocks when viewing Forum or ANY module, Como eliminar los bloques de la izquierda, Left Blocks on Index Page only):

if ($name=='Forums' || $name=='Members_List' || $name=='Private_Messages') {
/* Don't display it. */
} else {

Don't forget to add $name to the list of global variables in themeheader():

global $user$banners$sitename$slogan$cookie$prefix$dbi$name  

Of course, if you don't find the call to blocks(left), your theme already suppresses the left column of blocks.

From a theme design point of view, the above solution does not look satisfactory: you have to hardcode the names of the modules that should not display the left blocks into the code of the theme. Since you don't know in advance which ones these are, you create a dependency relation to all existing and future modules.

A cleaner, alternative way is to declare the global $hideleft variable in themeheader() and check its value instead:

global $hideleft;
$hideleft == 1){
/* Don't display it. */
} else {

Now, for every module that you want to hide the left blocks, insert the lines

global $hideleft;
$hideleft =1

at the beginning of its code. As you see, with this method, the selection of the modules that hide the left blocks has become the job the modules' authors. The theme code can work with any module, present or future one, without changes - as any theme should.

https://www.proclanservers.com  Pissed Off  Rent your SoF2 Server   Die!   Rock
Back to top
View user's profile Send private message Send e-mail Visit poster's website Visit member's Facebook: http://www.facebook.com/ricordalo
Smiley face
Display posts from previous:
Post new topicReply to topic printer-friendly viewThank Post
Soldier Of Fortune 2 Forum Index » Content management system »  PHP Nuke
Page 1 of 1
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts TIP: Add your STEAM Profile! 0 Teo 1771 Thu Feb 26, 2015 5:59 pm
Teo View latest post
No new posts how i add bots to my server? 5 abdouraoui 7182 Fri Jan 02, 2015 10:13 pm
Punisher View latest post
No new posts good job. 3 andy918 2694 Thu Nov 29, 2012 9:58 am
andy918 View latest post
No new posts Where to download sof2 full in one file and installation?! 11 badass 10310 Sun Oct 07, 2012 11:12 pm
lasenmahav View latest post

Back to Top

SOF2.ORG Multiplayer Community © 2020 All times are UTC + 2 Hours [DST enabled]

Copyright ©