Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's
Author Message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Thu Oct 30, 2003 6:01 am Reply with quote

To hide the left blocks for all modules, you need to edit your theme.php file. Find this code
Code:
blocks(left);
and comment it out
Code:
//blocks(left);


To hide the left block for a specific module, you need to edit theme.php and do 2 things. First of all, in the themeheader() function, add the variable $name to the global statement. Then, find this code
Code:
blocks(left);
and change it to
Code:
    if ($name=="MODULE_NAME") {}

    else blocks(left);
where MODULE_NAME is the name of the module to hide the blocks. For example, to hide the left blocks when viewing the Member List, you would code
Code:
    if ($name=="Members_List") {}

    else blocks(left);


Note that you will have to do this for every theme that you use
 
View user's profile Send private message
msimonds
Regular
Regular



Joined: Jul 15, 2003
Posts: 56
Location: Dallas

PostPosted: Thu Oct 30, 2003 8:53 pm Reply with quote

don't forget that you have to use put the $name variable in the global under the function

function themeheader() {
global $sitename, $pagetitle, $slogan, $prefix, $dbi, $user, $cookie, $banners, $anonymous, $user, $name;



Thought that had to be in place also
 
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Raven







PostPosted: Thu Oct 30, 2003 8:55 pm Reply with quote

Raven wrote:
To hide the left block for a specific module, you need to edit theme.php and do 2 things. First of all, in the themeheader() function, add the variable $name to the global statement.
Did I use invisible ink again Laughing ?
 
msimonds







PostPosted: Thu Oct 30, 2003 9:02 pm Reply with quote

woops sorry long day, and actually i have a theme that wont work on... tried a few different things and it still will not work


look at this !!!


Code:
function themeheader() {

   global $sitename, $pagetitle, $slogan, $prefix, $dbi, $user, $cookie, $banners, $anonymous, $user, $name;
   if (is_user($user)) {
   cookiedecode($user);
   $username = $cookie[1];
   $welcome = "Welcome, $username!";
   $menu = "<a href=index.php>Home</a> - <a href=modules.php?name=Your_Account>Your Account</a> - <a href=forums.html>Forums</a> - <a href=modules.php?name=Your_Account&op=logout>Logout</a>";
    } else {
   $welcome = "Welcome, Guest!";
   $menu = "<a href=modules.php?name=Your_Account>Login</a> - <a href=account-new_user.html>Sign Up</a>";
    }
   
    if ($banners) {
   include ("banners.php");
   }
   echo "<br><body bgcolor=ffffff font=000000>
        <table align=center width=100% border=0 cellpadding=0 cellspacing=0>
        <tr valign=middle><td width=151><a href=index.php><img src=themes/Yahoo/images/logo.jpg border=0></a></td>
        <td width=100% align=right><a href=index.php></a><hr size='1'></td>
        </tr>
        </table>
        <table align=center width=100% border=0 cellpadding=8 cellspacing=0>
        <tr><td valign=middle>";
   //if ($banners) {
   //include ("banners.php");
   //}
   echo "</td></tr></table>
        <table align=center width=100% cellpadding=2 cellspacing=0 border=0>
        <tr><td width=50% align=left bgcolor=EEEEEE><b>$welcome</b></td>
        <td nowrap width=50% align=right bgcolor=EEEEEE>$menu</td>
        </tr><tr>
        <td colspan=2 width=100% bgcolor=6996E0 align=left><font class=title>$sitename ";
   if ($pagetitle == ""){
   echo "";
   } else {
   echo "$pagetitle";
   }
   echo "</font></td></tr></table><font class=tiny><br></font>
        <table align=center width=100% cellpadding=0 cellspacing=0 border=0>
        <tr><td width=180 valign=top bgcolor=EEEEEE>";
   if ($name=='Forums') {
    /* Don't display it. */
   }
   else {
    blocks(left);
   }
   echo "<td width=6 bgcolor=ffffff><img src=themes/Yahoo/images/pixel.gif width=6 height=1></td>
        <td bgcolor=ffffff valign=top>";
}
 
Raven







PostPosted: Thu Oct 30, 2003 9:10 pm Reply with quote

That's because that theme is not written like standard nuke themes. This fix assumes that the theme.php is written as a standard nuke theme.php.
 
msimonds







PostPosted: Thu Oct 30, 2003 9:16 pm Reply with quote

not written by me....... thought that was the problem
 
twelves
Regular
Regular



Joined: Aug 22, 2003
Posts: 84

PostPosted: Sun Feb 29, 2004 10:38 am Reply with quote

Is their a way to remove the Left and right blocks for a module?

(I looked at this thread, not just the left, but both.)

This is a custom module for serving documents and I thought it was great because the comments and ratings are on the bottom. I would like to turn this into a Guitar Tab module!

(As you can see the needed comments and ratings are on the bottom and leaving the much needed realistate for the removed left and side blocks for the proper pagination the guitar tab requires)

I am talking to this guy that produced the Recipe module and he said he is going to re write the descriptions to include documents. I may just do this my self and change the Breakfast, Meat, Food names to Country, Rock, Hard Rock, Classic Rock and change the icons to Guitar related Tab indexes.

Going to be just great!

How can I remove BOTH left and right blocks?

From this Module only.

Peace
Wink
 
View user's profile Send private message Visit poster's website
chatserv
Member Emeritus



Joined: May 02, 2003
Posts: 1389
Location: Puerto Rico

PostPosted: Sun Feb 29, 2004 2:12 pm Reply with quote

Open the module's index file and change:
$index = 1;
to:
$index = 0;

If it doesn't have the code just insert it near the start:
$index = 0;
 
View user's profile Send private message Visit poster's website
twelves







PostPosted: Sun Feb 29, 2004 2:31 pm Reply with quote

Yes, thanks very much. Right blocks GONE!
[ Only registered users can see links on this board! Get registered or login! ]

And to get the left removed?


Guitar tab can be very wide,

Thank you very much.
 
chatserv







PostPosted: Sun Feb 29, 2004 2:43 pm Reply with quote

Have you tried what's described above?
add $name to the themeheader global line and change:
Code:
    blocks(left);

to:
Code:
    if ($name=='Recipes') {

   }
   else {
    blocks(left);
   }

???
 
twelves







PostPosted: Sun Feb 29, 2004 2:55 pm Reply with quote

I will try again.

But from what I see the main issue with the shrinking text with guitar tab is
the way the user pastes the text. (Like the smallish box I am typing in "Quick Reply" that is the main issue with shrunken miss paginated guitar tabs.
[ Only registered users can see links on this board! Get registered or login! ]

I bet the above fix will work. And I will email the author about the small input box for the text.

Thanks.

Jay.
 
Nukeum66
Life Cycles Becoming CPU Cycles



Joined: Jul 30, 2003
Posts: 551
Location: Neurotic, State, USA

PostPosted: Sun Feb 29, 2004 6:33 pm Reply with quote

I just use a 2 1/2in. wide strip of tape placed vertically on the left side of my monitor, works great! Laughing

_________________
Scott Johnson MIS Ubuntu/Linux 11.10 
View user's profile Send private message Visit poster's website
twelves







PostPosted: Tue Mar 02, 2004 9:22 am Reply with quote

O yes, I don't know how I skipped that. Thanks again from Noob Planet.
Worked 100% as described.
[ Only registered users can see links on this board! Get registered or login! ]

Now I am going to try to figure out how to edit the Text input box to have FULL
size Pagination.

Looks good so far. Next im going to edit the SQL file to reflect Guitar related words. Mr. Green
 
Wazock
New Member
New Member



Joined: Nov 27, 2004
Posts: 16

PostPosted: Tue Jul 19, 2005 3:31 pm Reply with quote

How do i do this for other modules? say i wanted two or three modules not to display left blocks but wanted the rest of the site to show left blocks.

I have tried to repeat the above method but returns a blank white page.

I have my forum like above and wanted another module that i have made not to show left blocks too.

Thnx in advance.
 
View user's profile Send private message
chatserv







PostPosted: Tue Jul 19, 2005 3:56 pm Reply with quote

Code:
    if ($name=='Module1' || $name=='Module2' || $name=='Module3') { 

   }
   else {
    blocks(left);
   }

Or:
Code:
    if ($name!='Module1' || $name!='Module2' || $name!='Module3') { 

    blocks(left);
   }
 
Wazock







PostPosted: Tue Jul 19, 2005 7:57 pm Reply with quote

Thanks man works great much apreciated Smile

Looks so simple put like that Sad

Oh well cant all be geniuses.
 
manunkind
Client



Joined: Apr 26, 2004
Posts: 368
Location: Albuquerque, NM

PostPosted: Fri May 19, 2006 8:52 pm Reply with quote

Quick question:

This doesn't seem to work for me with any compound names that have an underscore in them. For example.....Forums work fine, Content works fine. But Members_List, Web_Links, etc will not work.

Any ideas? (This is for removing the left blocks, not the right)

Using this type of code:

Code:
if ($name=='Module1' || $name=='Module2' || $name=='Module3') { 

   }
   else {
    blocks(left);
   }
 
View user's profile Send private message Visit poster's website
Raven







PostPosted: Fri May 19, 2006 10:31 pm Reply with quote

Try a period instead of an underscore.
 
manunkind







PostPosted: Sat May 20, 2006 5:51 am Reply with quote

Still doesn't work. Here is the exact code I am using:

Code:
if ($name=="Forums" || $name=="PHP_Manual" || $name=="Amazon" ||  $name=="Content") { 

}
else {
blocks(left);
}


All single words work fine. Nothing with an underscore will work.
 
Raven







PostPosted: Sat May 20, 2006 6:03 am Reply with quote

Try
Code:


global name;
if ($name=="Forums" || $name=="PHP_Manual" || $name=="Amazon" ||  $name=="Content") {
}
else {
blocks(left);
}
 
manunkind







PostPosted: Sat May 20, 2006 6:09 am Reply with quote

Thanks Raven. Your previous post pointed me in the right direction and I got it working. It turns out you can use spaces in there instead of the underscore. For example, my previous code above now works by doing this:

Code:
if ($name=="Forums" || $name=="PHP Manual" || $name=="Amazon" ||  $name=="Content") { 

}
else {
blocks(left);
}


All compound names are working for me now if I include a space as the underscore in the if/else statement.
 
Raven







PostPosted: Sat May 20, 2006 6:31 am Reply with quote

Bang Head - oops, I forgot that $name was already transformed. Good job!
 
manunkind







PostPosted: Sat May 20, 2006 10:55 am Reply with quote

Dumb luck. Smile

Thanks for pointing me in the right direction earlier.
 
manunkind







PostPosted: Thu May 25, 2006 6:04 am Reply with quote

Another quick question.....how do I remove these left blocks only when I am reading an article? I know I can add "News" to my above code, but that removes them from the home page as well. I want them there, but not when I click to read a full article.

Any ideas?
 
manunkind







PostPosted: Thu May 25, 2006 7:39 pm Reply with quote

Stumper? Smile

I'm just thinking of being more search engine friendly. When they hit an article now they have to go through all the block code before it gets to the meat of the content. Removing the left blocks when viewing an article will put them right into the meat almost instantly.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's

View next topic
View previous topic
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 can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©