 |
boardom b2 message board
|
View previous topic :: View next topic |
Author |
Message |
Marije
Joined: 08 Jul 2004 Posts: 6 Location: Somewhere...
|
Posted: Thu Jul 08, 2004 6:08 am Post subject: Comments in different directory |
|
|
Okay, my B2 is installed in a separate directory to my main site. I have the blog as a PHP include on the index file of the main site, but when I click on 'comments', it'll display 'page not found' because it's trying to look for 'commentspopupwhatever.php' in the directory my main site is in.
My question is; how/ where do I edit the settings so the comments link to the b2 directory?
Thanks. If you need the code, just ask  |
|
Back to top |
|
 |
Sigg3
Joined: 03 Jul 2003 Posts: 428 Location: Oslo, Norway
|
Posted: Thu Jul 08, 2004 1:09 pm Post subject: |
|
|
Using the include causes these sort of tricky tricks things.. Let's see..
Maybe you should activate the b2commentspopup in an alternative fashion? How about an ordinary <a href=""> link? I thinK
Code: | <a href="/yourdir/b2commentspopup.php?p=<?php the_ID() ?>&c=1" target="_blank">link</a> |
the_ID is the number of the post, you see, and as long as this is kept within the b2loop.
To open as a pop-up (and I'm merely idling here) you could do this:
Code: | <A href="javascript:;" onClick="OpenBrWindow('/yourdir/b2commentspopup.php?p=<?php the_ID() ?>&c=1','Comments','toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes','400','350','true')"> |
Now, the last three variables: width, height, the pop-up is centered acc. to screen (true/false).
(if you use this last one, remember to add this in the <head>)
Code: | <script language="JavaScript1.2">
/*
Open Centered Popup Window Script-
© DHTML Shock (www.dhtmlshock.com)
To add more shock to your site, visit www.DHTML Shock.com
*/
function OpenBrWindow(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0
if(window.screen)if(isCenter)if(isCenter=="true"){
var myLeft = (screen.width-myWidth)/2;
var myTop = (screen.height-myHeight)/2;
features+=(features!='')?',':'';
features+=',left='+myLeft+',top='+myTop;
}
window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}
</script> |
I stole the idea from http://www.dhtmlshock.com _________________ Sigg3 dot net - because you're worth it! | b2 Cafelog Resource Center |
|
Back to top |
|
 |
Marije
Joined: 08 Jul 2004 Posts: 6 Location: Somewhere...
|
Posted: Thu Jul 08, 2004 1:44 pm Post subject: |
|
|
Thanks for your reply.
Does this mean I have to do it manually for each entry, or does it automatically detect the ID if I put <?php the_ID() ?> in there?
Sorry, I'm a b2 newbie. |
|
Back to top |
|
 |
Sigg3
Joined: 03 Jul 2003 Posts: 428 Location: Oslo, Norway
|
Posted: Fri Jul 09, 2004 8:21 am Post subject: |
|
|
Whatever variable written to be inside the b2loop which is PLACED within the b2loop will be co-ordinated with the data in the designated databases.
In other words: the id will change for each post by itself:)
It's wonderful, isn't it?
I'm not sure wether this is the best solution, I see it as an alternative solution. Should work as good as anything, tho.
(The b2-loop is the cluster of codes concerning the actual print of the blog. Variables and such can be found at http://cafelog.com/readme.html) _________________ Sigg3 dot net - because you're worth it! | b2 Cafelog Resource Center |
|
Back to top |
|
 |
Marije
Joined: 08 Jul 2004 Posts: 6 Location: Somewhere...
|
Posted: Sun Jul 11, 2004 12:28 pm Post subject: |
|
|
It's not working...
Code: |
Posted at <?php the_time() ?>. <A href="javascript:;" onClick="OpenBrWindow('b2/b2commentspopup.php?p=<?php the_ID()
?>&c=1','Comments','toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes','400','350','true')">Comments</a> |
Located here: http://soulmirror.net/b2 |
|
Back to top |
|
 |
Sigg3
Joined: 03 Jul 2003 Posts: 428 Location: Oslo, Norway
|
|
Back to top |
|
 |
Marije
Joined: 08 Jul 2004 Posts: 6 Location: Somewhere...
|
Posted: Mon Jul 12, 2004 8:30 am Post subject: |
|
|
I tried other options myself, and changed the script. But the code you gave me, didn't work.
Thanks anyway |
|
Back to top |
|
 |
Sigg3
Joined: 03 Jul 2003 Posts: 428 Location: Oslo, Norway
|
|
Back to top |
|
 |
Marije
Joined: 08 Jul 2004 Posts: 6 Location: Somewhere...
|
Posted: Tue Jul 13, 2004 9:35 am Post subject: |
|
|
Weird..
It's okay, I figured another way out.  |
|
Back to top |
|
 |
Sigg3
Joined: 03 Jul 2003 Posts: 428 Location: Oslo, Norway
|
|
Back to top |
|
 |
|
|
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
|