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 

Moving b2 to its own directory
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    boardom Forum Index -> How to ?
View previous topic :: View next topic  
Author Message
nessahead



Joined: 12 Mar 2002
Posts: 312
Location: Los Angeles, CA

PostPosted: Wed Apr 10, 2002 8:00 am    Post subject: Moving b2 to its own directory Reply with quote

I installed b2 on my server a while back but I'd like to move the b2 files that sit in the root directory to a b2 directory... it's just too cluttered in there for me =)

I was thinking I'd move the b2 files, b2-img and b2-includes to a b2 dir... does anyone know what exactly I'd have to change in the code to do this? Or is it just too complicated?

Thanks for any help =)
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
imeridian



Joined: 12 Feb 2002
Posts: 191

PostPosted: Thu Apr 11, 2002 4:10 pm    Post subject: Reply with quote

I do not have b2 in my root directory, nor does anyone else I know; the only thing that you need to change is the includes throughout your templates, to make sure they point to the right place.
Back to top
View user's profile Send private message Visit poster's website
nessahead



Joined: 12 Mar 2002
Posts: 312
Location: Los Angeles, CA

PostPosted: Thu Apr 11, 2002 11:11 pm    Post subject: Reply with quote

Did it last night and everything worked out =)
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
bansheeincanaan



Joined: 16 Mar 2002
Posts: 3

PostPosted: Wed Apr 24, 2002 6:35 am    Post subject: Reply with quote

I'm sorry, I'm somewhat dim. :? Would someone mind specifying more clearly which of the b2 files can be moved to a subdirectory (I'm assuming everything except the main directory index file and b2comments.php), and what exactly needs to be changed in the template files for this to work?

I apologize if this is a painfully newbie question; I'm not nearly as familiar with PHP as I'd like to be. :)
Back to top
View user's profile Send private message Visit poster's website
Trace



Joined: 25 Jan 2002
Posts: 23
Location: New Zealand

PostPosted: Wed Apr 24, 2002 9:56 am    Post subject: Reply with quote

I have everything in a subdirectory with the exception of b2archives.php (dodo's hacked version) and my index.php file.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
bansheeincanaan



Joined: 16 Mar 2002
Posts: 3

PostPosted: Wed Apr 24, 2002 11:57 pm    Post subject: Reply with quote

Ah, okay. Thanks. I will go looking for this hack.
Back to top
View user's profile Send private message Visit poster's website
imeridian



Joined: 12 Feb 2002
Posts: 191

PostPosted: Thu Apr 25, 2002 7:51 am    Post subject: Reply with quote

Trace... just look at your templates, your index and archives templates have php includes in them, you need to convert them (the includes) to be relative to where your b2 installation really is, versus having it assume (as is the default) that b2 is in the same directory as your index.
Back to top
View user's profile Send private message Visit poster's website
Trace



Joined: 25 Jan 2002
Posts: 23
Location: New Zealand

PostPosted: Thu Apr 25, 2002 8:11 am    Post subject: Reply with quote

I changed every reference to the templates that required it to point to the right place, and edited a couple of other files (such as b2comments.post.php) to redirect to the correct place after submission. It's not that difficult to do ... surprisingly easy infact.

Using chdir is probably the quickest cleanest way to accomplish it, but it wasn't really a suitable option for me as I use several includes - because my site is skinnable, having a clean and neat directory structure is important.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
WERUreo



Joined: 26 Apr 2002
Posts: 16
Location: Daytona Beach, Florida

PostPosted: Wed May 01, 2002 12:33 am    Post subject: Reply with quote

The way I did it, I just used a <?php include("b2/b2.php") ?> in my main page to get the blog to show. That works great for me. I had to correct some of the includes in other files also, but instead of going through all the hassle of changing directories and such, and to keep all the b2 files together.

That brings me to my question. I understand that when comments are posted, cookies are set on your computer so that the next time you want to post a comment, your name, e-mail, and url are already filled in. However, this doesn't work for me, probably because I am simply including the b2.php to my home page. Is there a way to set the cookie differently so that it will work with my set up? I'm not too familiar with how cookies are set and retrieved, so I'm not sure what I'd need to change.

If anyone needs more specific information from me about how my b2 is set up, please let me know, and I will post more pertinent information here.

Thank you in advance.

Keli'i Martin
www.werureo.com
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
sven



Joined: 08 May 2002
Posts: 30
Location: Central Valley Cali

PostPosted: Mon May 13, 2002 8:30 pm    Post subject: Smilies Don't Work Reply with quote

I moved all the files into a ./b2 directory and edited my index.php and comments.form.php to point to the ./b2 directory. Everything works except the smilies. Their path shows without ./b2 in it. If I change it in the smilies function, then the b2edit.php won't show them. So, how can I make it work for both files?
_________________
<><sven><>
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
WERUreo



Joined: 26 Apr 2002
Posts: 16
Location: Daytona Beach, Florida

PostPosted: Tue May 14, 2002 1:51 am    Post subject: Smilies Don't Work Reply with quote

sven wrote:

I moved all the files into a ./b2 directory and edited my index.php and comments.form.php to point to the ./b2 directory. Everything works except the smilies. Their path shows without ./b2 in it. If I change it in the smilies function, then the b2edit.php won't show them. So, how can I make it work for both files?


I'm not sure how you've got your smilies working or what version of b2 you are running. I'm running v0.6pre and using Fallen's smilies hack, except instead of just changing the original the_content function in b2template.functions.php, I created another separate function for the smilies, which is just the hack Fallen posted, and included calls to that function in both the the_content function and the comment_text function, both located in the b2template.functions.php file.

Hope that helps, although it might require changing the way you have your b2 set up.


Last edited by WERUreo on Wed May 15, 2002 12:44 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
sven



Joined: 08 May 2002
Posts: 30
Location: Central Valley Cali

PostPosted: Tue May 14, 2002 7:54 am    Post subject: smilies (con'd) Reply with quote

Your link to Fallen's hack is incomplete, but I can search for it.

Yes, I do have v0.6pre and I'm refering to the tag in b2template.functions.php (which would be in ./b2/b2-includes) shows as this:


Code:
<img src="b2-img/smilies/icon_arrow.gif" border="0">


So, when b2edit.php is called, it'll display the smilies properly, but because my index.php is one directory up, it will not. That's what I need to fix. I guess I could alias the smilies directory, but seeing how everyone else has made their install work, I was wondering if there's something else I'm missing.
_________________
<><sven><>
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
jaina



Joined: 13 May 2002
Posts: 5
Location: NJ, USA

PostPosted: Tue May 14, 2002 11:05 pm    Post subject: Reply with quote

I the exact same problem. I found the fix for this in Adam Walker's site.


change code: (found on <b2_root>\b2-include\b2edit.form.php)


$dir2open="./b2-img/smilies"; //dir 2 preview smilies
$dir2include="./b2/b2-img/smilies"; //dir 2 include smilies

to:

$dir2open="b2-img/smilies"; //dir 2 preview smilies
$dir2include="b2/b2-img/smilies"; //dir 2 include smilies


and code:

echo "<td><img src=\"$dir2open/$file\" onClick=\"smilie('$dir2include/$file')\"
style=\"cursor:hand\"></td>\n";

to code:

echo "<td><img src=\"$dir2open/$file\" onClick=\"smilie('$siteurl/$dir2include/$file')\"
style=\"cursor:hand\"></td>\n";
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
WERUreo



Joined: 26 Apr 2002
Posts: 16
Location: Daytona Beach, Florida

PostPosted: Wed May 15, 2002 12:55 am    Post subject: smilies (con'd) Reply with quote

sven wrote:

Your link to Fallen's hack is incomplete, but I can search for it.


Sorry about the incomplete link... I went and fixed it, but you probably already found the post on your own...

As far as the problem you're having with the smilies, here's what I did... Instead of making the link to the smilie images relative to the page, I made them absolute. In other words, instead of saying, for instance, "b2-img/smilies/icon-arrow.gif", I said "/b2/b2-img/smilies/icon-arrow.gif".

Hopefully this example won't be overkill, but here's a scenario. Let's say you've got index.php in the root directory and b2 in the b2/ directory... If you go to http://yourdomain.com/b2/b2edit.php and it has the smilie graphics written as "/b2/b2-img/smilies/icon-arrow.gif", then no matter where the file is in the directory tree, it will resolve the images to be "http://yourdomain.com/b2/b2-img/smilies/icon-arrow.gif" because you made the link for the image absolute to the site root.

Hopefully that wasn't too confusing, and I hope it helps.
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
sven



Joined: 08 May 2002
Posts: 30
Location: Central Valley Cali

PostPosted: Thu May 16, 2002 3:22 am    Post subject: Only made edits to three files... is that right? Reply with quote

I'm seeing various people state they changed various files. I only edited my index.php file in two places. The first line:

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


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



The next line was in the body itself and was for the comments. As follows:

From
Code:
<?php include ("b2comments.php"); ?>


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



I then changed in b2comments.php the form action line:

From
Code:
<form action="b2comments.post.php" method="post">


To
Code:
<form action="/b2/b2comments.post.php" method="post">



Everything seems to work fine so I'm wondering if I missed anything. Sound right by y'all?
_________________
<><sven><>
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> How to ? All times are GMT + 1 Hour
Goto page 1, 2, 3  Next
Page 1 of 3

 
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