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 

PHP Layout + B2 page

 
Post new topic   Reply to topic    boardom Forum Index -> PHP help
View previous topic :: View next topic  
Author Message
Kenji



Joined: 30 Oct 2003
Posts: 4

PostPosted: Thu Oct 30, 2003 8:14 pm    Post subject: PHP Layout + B2 page Reply with quote

I'm having a problem with b2 showing up on my php layout.
Code:

<?php include ("$da.txt"); ?>
<?php include("/blog/index.php"); ?>
<?php include ("$da.txt"); ?>



It gives me an error and then the bottom half of the layout doesn't show up
Back to top
View user's profile Send private message
moose



Joined: 04 May 2003
Posts: 196
Location: Winnipeg Canada

PostPosted: Thu Oct 30, 2003 11:06 pm    Post subject: Reply with quote

what's the error?

what is $da.txt? [edit] the value
Back to top
View user's profile Send private message Visit poster's website
Kenji



Joined: 30 Oct 2003
Posts: 4

PostPosted: Fri Oct 31, 2003 2:24 am    Post subject: Reply with quote

Warning: main(.txt): failed to open stream: No such file or directory in /home/mixedup/public_html/darkabyss/index.php on line 2

Warning: main(): Failed opening '.txt' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/mixedup/public_html/darkabyss/index.php on line 2


is the error I get


http://darkabyss.mixedup.net
Back to top
View user's profile Send private message
moose



Joined: 04 May 2003
Posts: 196
Location: Winnipeg Canada

PostPosted: Fri Oct 31, 2003 3:36 am    Post subject: Reply with quote

do you mean

include("da.txt"); ??

or do you want that $da infront of the .txt.

php is trying to open ".txt." because there is no contents of the $da variable
Back to top
View user's profile Send private message Visit poster's website
Viper007Bond



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

PostPosted: Fri Oct 31, 2003 4:13 am    Post subject: Reply with quote

And you could just do this (not opening and closing PHP each time):

[php:1:cb7c8383ba]<?php
include ("da.txt");
include("/blog/index.php");
include ("da.txt");
?>[/php:1:cb7c8383ba]
_________________
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
Kenji



Joined: 30 Oct 2003
Posts: 4

PostPosted: Fri Oct 31, 2003 4:30 am    Post subject: Reply with quote

moose wrote:
do you mean

include("da.txt"); ??

or do you want that $da infront of the .txt.

php is trying to open ".txt." because there is no contents of the $da variable



Sorry about that, I got really confused when I was coding.

The code looks like this now
Code:
<?php
include ("top.txt");
include("/blog/index.php");
include ("bottom.txt");
?>


top.txt = top half of layout
bottom.txt = bottom half
/blog/index.php is where the news is located at
http://darkabyss.mixedup.net
is where you can view the site
Back to top
View user's profile Send private message
Viper007Bond



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

PostPosted: Fri Oct 31, 2003 10:05 am    Post subject: Reply with quote

The problem is that you are including a partial path. If the file is not in the current folder, you need to type the full URL:

[php:1:b148e9775d]<?php
include ("top.txt");
include("http://darkabyss.mixedup.net/blog/index.php");
include ("bottom.txt");
?>[/php:1:b148e9775d]
_________________
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
Kenji



Joined: 30 Oct 2003
Posts: 4

PostPosted: Fri Oct 31, 2003 3:42 pm    Post subject: Reply with quote

Awesome, it works now! Thanks a million!
Back to top
View user's profile Send private message
epolady



Joined: 30 Jul 2002
Posts: 800
Location: Texas

PostPosted: Fri Oct 31, 2003 8:52 pm    Post subject: Reply with quote

I would've opted to use the absolute path, instead of the URL.

For example, /home/username/public_html/blog/index.php; but then again, the problem is resolved, and I have no purpose in this thread.

Glad you got it fixed.
_________________
No more support from me. Goodbye!
Go upgrade to WordPress, you'll find better support there.
Back to top
View user's profile Send private message
Viper007Bond



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

PostPosted: Sat Nov 01, 2003 2:10 am    Post subject: Reply with quote

epolady wrote:
I would've opted to use the absolute path, instead of the URL.

For example, /home/username/public_html/blog/index.php; but then again, the problem is resolved, and I have no purpose in this thread.

Glad you got it fixed.

Yeah, I guess that would be the preferred method.
_________________
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
epolady



Joined: 30 Jul 2002
Posts: 800
Location: Texas

PostPosted: Sat Nov 01, 2003 4:54 am    Post subject: Reply with quote

I used the full URL before in my includes (didn't know any other way, lol), and every time someone would load up my page, I would have an extra visitor in my logs, and using an online script was faulty doing it thataway (2 being "online" when only 1 was). So I switched to the full path, and it all went away.

Another alternative in this case would've been
Code:
include("blog/index.php");

Without the preceeding slash.
_________________
No more support from me. Goodbye!
Go upgrade to WordPress, you'll find better support there.
Back to top
View user's profile Send private message
Tang-on



Joined: 14 Aug 2003
Posts: 23

PostPosted: Sun Nov 09, 2003 12:20 pm    Post subject: Reply with quote

My friend is having the problem.

This is the code of his site's index.php http://www.madepunk.com

Code:

<?php include('header.php'); ?>
<?php include('http://madepunk.com/b2'); ?>
<?php include('footer.php'); ?>


It seems to work perfectly, both the entry and the comment pop-up.

But when you go directly to http://www.madepunk.com/b2/index.php, the comment pop-up gives a 404 page.

This is the code of b2template.functions.php.
Code:

function comments_popup_script($width=400, $height=400, $file='b2/b2commentspopup.php', $trackbackfile='b2trackbackpopup.php', $pingbackfile='b2pingbackspopup.php') {
   global $b2commentspopupfile, $b2trackbackpopupfile, $b2pingbackpopupfile, $b2commentsjavascript;
   $b2commentspopupfile = $file;
   $b2trackbackpopupfile = $trackbackfile;
   $b2pingbackpopupfile = $pingbackfile;
   $b2commentsjavascript = 1;
   $javascript = "<script language=\"javascript\" type=\"text/javascript\">\n<!--\nfunction b2open (macagna) {\n    window.open(macagna, '_blank', 'width=$width,height=$height,scrollbars=yes,status=yes');\n}\n//-->\n</script>\n";
   echo $javascript;
}


I've tried changing b2/b2commentspopup.php to b2commentspopup.php, but then the comment pop-up on the site's index page gives 404 page instead.

How to fix this? Thanks in advance. Smile
_________________
-Tang-on Smile
Back to top
View user's profile Send private message Visit poster's website
Tang-on



Joined: 14 Aug 2003
Posts: 23

PostPosted: Sun Nov 09, 2003 10:46 pm    Post subject: Reply with quote

He has figured it out. Smile

He changed b2/b2commentspopup.php to the full URL and it works.

--closed--
_________________
-Tang-on Smile
Back to top
View user's profile Send private message Visit poster's website
fluffyland



Joined: 12 May 2004
Posts: 9

PostPosted: Wed May 12, 2004 1:16 am    Post subject: dead? Reply with quote

What do you mean, b2's 'dead'? Will this affect me if I want to use it?
_________________
Sam
http://www.fluffyland.com
Back to top
View user's profile Send private message Visit poster's website AIM Address
Sigg3



Joined: 03 Jul 2003
Posts: 906
Location: Oslo, Norway

PostPosted: Wed May 12, 2004 8:56 am    Post subject: Reply with quote

No. What he means is that the "official" developing of b2 is dead and some even think that the b2 community is dying, but I see it otherwise since alot of hosts are including b2 as a blogging tool in their packages (snif).

Wordpress is alive and kickin', and still developing. It's, from what I've heard, more reliable, stable, writer and user-friendly and all in all quite sexy.

If I only had an FTP client..
_________________
Sigg3.net - You know you're worth it! | b2 Cafelog Resource Center | Fight my BattleImp!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> PHP help All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can 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