boardom Forum Index boardom
b2 message board
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Tutorial: putting b2 in its own directory

 
Post new topic   Reply to topic    boardom Forum Index -> How to ?
View previous topic :: View next topic  
Author Message
Jennifer



Joined: 11 Aug 2002
Posts: 23
Location: Ronks, PA

PostPosted: Wed Jul 16, 2003 10:29 am    Post subject: Tutorial: putting b2 in its own directory Reply with quote

Hi... I wrote this tutorial because I've seen a lot of posts around asking how to do this. So... here goes.

This tutorial is useful if you'd like to have your b2 files located in a separate folder, with your index.php page being in your root directory.
PLEASE NOTE: This tutorial is written assuming that you know how to do a basic install of b2, and that you are using regular comments, not pop-ups.

1. Create a new folder named b2. Upload all b2 files except for index.php to this folder.

2. Upload index.php to your root directory.

3. Open index.php for editing.
Find this:
Code:

<?php /* Don't remove this line, it calls the b2 function files ! */ $blog=1; include ("blog.header.php"); ?>

And replace it with this:
Code:

<?php /* Don't remove this line, it calls the b2 function files ! */ $blog=1; include ("b2/blog.header.php"); ?>


Find this:
Code:

<?php include ("b2comments.php"); ?>

And replace it with this:
Code:

<?php include ("b2/b2comments.php"); ?>


If you are using your archives include, find this:
Code:

<?php include ("b2archives.php"); ?>

And replace it with this:
Code:

<?php include ("b2/b2archives.php"); ?>


4. Open b2config.php for editing.
For $siteurl (around line 16), you want to put in the URL to your site - not to the b2 folder. For example, while my b2 files are located at http://www.kiss-my-kitty.com/b2, I put http://www.kiss-my-kitty.com.

For $pathserver (around line 35), you want to put in the URL where your b2 files are located. I put http://www.kiss-my-kitty.com/b2, since that's where the b2 files are.

For $smilies_directory (around line 211), do the same as you did for $pathserver. You want to put the URL where the b2 smilies are located. Mine are at http://www.kiss-my-kitty.com/b2/b2-img/smiles.

5. Open b2archives.php for editing.
Find this:
Code:

require_once('./b2config.php');
require_once($b2inc.'/b2functions.php');


And replace it with this:
Code:

require_once('b2/b2config.php');
require_once('b2/b2-include/b2functions.php');


6. Open b2comments.php for editing.
Find this:
Code:

<form action="<?php echo $siteurl; ?>/b2comments.post.php" method="post">


And replace it with this:
Code:

<form action="<?php echo $siteurl; ?>/b2/b2comments.post.php" method="post">


7. (OPTIONAL) this only needs to be done if you are using pop-up comments, trackbacks, and pingbacks.
Open up b2template.functions.php for editing.
Find this:
Code:

function comments_popup_script($width=400, $height=400, $file='b2commentspopup.php',
$trackbackfile='b2trackbackpopup.php', $pingbackfile='b2pingbackspopup.php') {


And replace it with this:
Code:

function comments_popup_script($width=400, $height=400, $file='b2/b2commentspopup.php',
$trackbackfile='b2/b2trackbackpopup.php', $pingbackfile='b2/b2pingbackspopup.php') {


That should be it. If you have any questions, post them!
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sabotage



Joined: 15 Jul 2003
Posts: 36

PostPosted: Wed Jul 16, 2003 7:11 pm    Post subject: Reply with quote

nice tutorial, although you forgot to mention this line which should be altered in index.php:
Code:
@import url( layout2b.css );

which should be changed to:
Code:
@import url( b2/layout2b.css );


and not to forget these two links:

Code:

<a href="b2login.php">login</a><br />
<a href="b2register.php">register</a><br />


which should become this if you still want em to work =) :

Code:

<a href="b2/b2login.php">login</a><br />
<a href="b2/b2register.php">register</a><br />


seems pretty obvious why this should be done imo Razz
for those who don't know though, this makes sure you CSS styles are being used, which 'makes' the layout...
and the second thing is to make sure the login and register buttons on the default b2 menu link to the right directory.

god, i suck at explaining... =)

peace,

sabotage
Back to top
View user's profile Send private message
spirit892



Joined: 15 Jul 2003
Posts: 9
Location: PA, USA

PostPosted: Sat Sep 20, 2003 5:28 pm    Post subject: How do I... Reply with quote

How do I configure my index.php page in my root directory to be able to be edited in my b2 files directory? Is that possible?
_________________
kathleen
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Viper007Bond



Joined: 15 Aug 2003
Posts: 266
Location: Portland, Oregon, USA

PostPosted: Mon Sep 22, 2003 10:11 am    Post subject: Reply with quote

Huh? Are you talking about being able to edit your index.php on your admin page? If so, you'll have to edit "b2template.php" to point to the new URLs/paths.
_________________
http://www.viper007bond.com

If you haven't already installed b2, I advise you look into WordPress or b2evo instead as b2 is dead.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
mtwib



Joined: 09 Aug 2003
Posts: 7

PostPosted: Wed Dec 10, 2003 12:07 am    Post subject: Reply with quote

I ma running into a lot of problems becuase of this, I have several of the errors within my admin directory fixed, but there is a lot more... I am wondering if anyone has made a more comprehensive subject on this...
Back to top
View user's profile Send private message Visit poster's website
flowerglen



Joined: 27 May 2003
Posts: 24

PostPosted: Sat Jan 03, 2004 2:38 am    Post subject: Reply with quote

Viper007Bond wrote:
Huh? Are you talking about being able to edit your index.php on your admin page? If so, you'll have to edit "b2template.php" to point to the new URLs/paths.

i tried and its not working. can you tell me which lines to edit?
Back to top
View user's profile Send private message
acidgloss



Joined: 08 Oct 2003
Posts: 12
Location: Long Island NY

PostPosted: Sat Jan 03, 2004 7:02 am    Post subject: Reply with quote

In order to find and replace the sections of code your looking for - press CTRL-F on the page and locate the origional code, and then replace that code with the new updated one.
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Serveza



Joined: 13 Oct 2003
Posts: 7
Location: Canada

PostPosted: Sat Jan 10, 2004 5:17 am    Post subject: Reply with quote

I used the above method to move my blog, and it works great.

Except now I want index.php to include (using PHP includes) b2/b2.php so that my entries will show when the page first loads, and then if the user clicks "Home" they get taken back to index.php?fela=b2/b2.php. Except that link doesn't work.

This is the include code I am using, which works great when I first enter my blog (displays my current posts) and when I click on anything that's not in the b2 directory (even if I click on something that is located in another directory, the content shows up properly). Anything in the b2/ directory, isn't showing up at all. It just defaults to the main content (which is b2/b2.php). The problem is when I click on a link that should point to content in the b2 directory.

Code:

<?php
        if(isset($_GET['fela'])) {
           if(is_file(basename($_GET['fela'].".php"))) {
               include(basename($_GET['fela'].".php"));
           } else {
               include("b2/b2.php");
           }
        } else {
           include("b2/b2.php");
        }
         ?>


Works fine, as you can see here. Try clicking on "About Tinuviel" - it also works.

Now try clicking on "Archives" - notice the main page shows up again?

The link for archives is http://www.sulwyn.net/index.php?fela=about, and I've tried it under http://www.sulwyn.net/index.php?fela=s/about and it also worked. However the link for Archives, Categories and Home don't work - http://www.sulwyn.net/index.php?fela=b2/b2archives, even though they're structured the same.

Is the problem with the b2 directory? Can PHP include links just not handle numbers in the names? Is it something else I'm missing? I don't get it, because it works as a default but not when I click on the link...

Thanks in advance for any help.
_________________
Intrinziq Design || Sulwyn || Trancemissions || Muse Board
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> How to ? All times are GMT + 1 Hour
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


Powered by phpBB 2 © 2001, 2002 phpBB Group