View previous topic :: View next topic |
Author |
Message |
Kenji
Joined: 30 Oct 2003 Posts: 4
|
Posted: Thu Oct 30, 2003 8:14 pm Post subject: PHP Layout + B2 page |
|
|
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 |
|
 |
moose
Joined: 04 May 2003 Posts: 196 Location: Winnipeg Canada
|
Posted: Thu Oct 30, 2003 11:06 pm Post subject: |
|
|
what's the error?
what is $da.txt? [edit] the value |
|
Back to top |
|
 |
Kenji
Joined: 30 Oct 2003 Posts: 4
|
Posted: Fri Oct 31, 2003 2:24 am Post subject: |
|
|
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 |
|
 |
moose
Joined: 04 May 2003 Posts: 196 Location: Winnipeg Canada
|
Posted: Fri Oct 31, 2003 3:36 am Post subject: |
|
|
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 |
|
 |
Viper007Bond
Joined: 15 Aug 2003 Posts: 266 Location: Portland, Oregon, USA
|
Posted: Fri Oct 31, 2003 4:13 am Post subject: |
|
|
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 |
|
 |
Kenji
Joined: 30 Oct 2003 Posts: 4
|
Posted: Fri Oct 31, 2003 4:30 am Post subject: |
|
|
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 |
|
 |
Viper007Bond
Joined: 15 Aug 2003 Posts: 266 Location: Portland, Oregon, USA
|
Posted: Fri Oct 31, 2003 10:05 am Post subject: |
|
|
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 |
|
 |
Kenji
Joined: 30 Oct 2003 Posts: 4
|
Posted: Fri Oct 31, 2003 3:42 pm Post subject: |
|
|
Awesome, it works now! Thanks a million! |
|
Back to top |
|
 |
epolady
Joined: 30 Jul 2002 Posts: 800 Location: Texas
|
Posted: Fri Oct 31, 2003 8:52 pm Post subject: |
|
|
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 |
|
 |
Viper007Bond
Joined: 15 Aug 2003 Posts: 266 Location: Portland, Oregon, USA
|
Posted: Sat Nov 01, 2003 2:10 am Post subject: |
|
|
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 |
|
 |
epolady
Joined: 30 Jul 2002 Posts: 800 Location: Texas
|
Posted: Sat Nov 01, 2003 4:54 am Post subject: |
|
|
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 |
|
 |
Tang-on
Joined: 14 Aug 2003 Posts: 23
|
Posted: Sun Nov 09, 2003 12:20 pm Post subject: |
|
|
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.  _________________ -Tang-on  |
|
Back to top |
|
 |
Tang-on
Joined: 14 Aug 2003 Posts: 23
|
Posted: Sun Nov 09, 2003 10:46 pm Post subject: |
|
|
He has figured it out.
He changed b2/b2commentspopup.php to the full URL and it works.
--closed-- _________________ -Tang-on  |
|
Back to top |
|
 |
fluffyland
Joined: 12 May 2004 Posts: 9
|
Posted: Wed May 12, 2004 1:16 am Post subject: dead? |
|
|
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 |
|
 |
Sigg3
Joined: 03 Jul 2003 Posts: 906 Location: Oslo, Norway
|
Posted: Wed May 12, 2004 8:56 am Post subject: |
|
|
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 |
|
 |
|