samdamann Posted November 1, 2011 Share Posted November 1, 2011 How can I disable or hide the basic sidebar so I can have more space for a form? Ideas? Link to comment Share on other sites More sharing options...
abigail Posted November 2, 2011 Share Posted November 2, 2011 Probably, you have to change either the html or the css. I don't have the book in front of me, although I do have it, so post the code that matches that sidebar. 1 Link to comment Share on other sites More sharing options...
samdamann Posted November 16, 2011 Author Share Posted November 16, 2011 Hey Abigail, Here is the code out of the book. It lies in the footer.html file. I'm thinking I need to use a different footer so as to hide the sidebar? <?php // Show the user info or the login form: if (isset($_SESSION['user_id'])) { // Show basic user options: // Includes references to some bonus material discussed in Chapter 5! echo '<div class="title"> <h4>Manage Your Account</h4> </div> <ul> <li><a href="renew.php" title="Renew Your Account">Renew Account</a></li> <li><a href="change_password.php" title="Change Your Password">Change Password</a></li> <li><a href="favorites.php" title="View Your Favorite Pages">Favorites</a></li> <li><a href="history.php" title="View Your History">History</a></li> <li><a href="recommendations.php" title="View Your Recommendations">Recommendations</a></li> <li><a href="logout.php" title="Logout">Logout</a></li> </ul> '; // Show admin options, if appropriate: if (isset($_SESSION['user_admin'])) { echo '<div class="title"> <h4>Administration</h4> </div> <ul> <li><a href="add_page.php" title="Add a Page">Add Page</a></li> <li><a href="add_pdf.php" title="Add a PDF">Add PDF</a></li> <li><a href="#" title="Blah">Blah</a></li> </ul> '; } } else { // Show the login form: require ('includes/login_form.inc.php'); } ?> Link to comment Share on other sites More sharing options...
Jonathon Posted November 16, 2011 Share Posted November 16, 2011 remove this echo '<div class="title"> <h4>Manage Your Account</h4> </div> <ul> <li><a href="renew.php" title="Renew Your Account">Renew Account</a></li> <li><a href="change_password.php" title="Change Your Password">Change Password</a></li> <li><a href="favorites.php" title="View Your Favorite Pages">Favorites</a></li> <li><a href="history.php" title="View Your History">History</a></li> <li><a href="recommendations.php" title="View Your Recommendations">Recommendations</a></li> <li><a href="logout.php" title="Logout">Logout</a></li> </ul> '; and replace it with what you want? 1 Link to comment Share on other sites More sharing options...
abigail Posted November 17, 2011 Share Posted November 17, 2011 Jonathon gives good suggestion. Let us know if it works or not. Link to comment Share on other sites More sharing options...
samdamann Posted November 25, 2011 Author Share Posted November 25, 2011 Okay I just created a separate footer and removed the code that Jonathon states above. It works. I was just looking for a way to do this with code without creating a separate special footer... Link to comment Share on other sites More sharing options...
abigail Posted November 25, 2011 Share Posted November 25, 2011 You might be able to change the css, if there is width specified, but if that class is used other places then it will change those also. That's why you have to change the code somehow. Another idea, maybe your php could identify that page then eliminate that section of code just for that page. Link to comment Share on other sites More sharing options...
samdamann Posted November 29, 2011 Author Share Posted November 29, 2011 Hey Abigail, Identifying the page was one of the ways I was experimenting with but couldn't get it to work. Do you know what that snippet of code would be? Sam Link to comment Share on other sites More sharing options...
abigail Posted November 29, 2011 Share Posted November 29, 2011 In your index page, before you include the footer file, do this: $pag = 'home'; The reason I didn't use $page is either in case it is a reserved keyword somewhere or I already use that variable somewhere else. You can give other pages names such as: $pag = 'register'; In your footer file, do this: if (isset($pag) && ($pag=='home')) { ' only do your code when home page } You need to check if it isset because you might forget to set it in all you pages . It should be pretty easy to implement. Larry teaches it in one of his other books. Link to comment Share on other sites More sharing options...
Recommended Posts