View previous topic :: View next topic |
Author |
Message |
cjc
Joined: 24 Dec 2002 Posts: 146 Location: New York
|
Posted: Wed Mar 19, 2003 8:41 pm Post subject: |
|
|
OK, two issues:
1. I left off a ?> to close the <?php in the install file.
2. There seems to be a spurious line break in the posted code, probably from the cutting and pasting I did when I posted. The line beginning with "$q = mysql_query" should all be one line, and the mysql_error() at the end of that line should, of course, be one command, not something broken across two lines. |
|
Back to top |
|
 |
blog17
Joined: 28 Jan 2003 Posts: 144 Location: London, UK
|
|
Back to top |
|
 |
Sansnom
Joined: 31 Jan 2002 Posts: 94 Location: Paris
|
Posted: Wed Apr 09, 2003 3:18 am Post subject: in fine |
|
|
Could we have the good final version of the file ? I must made a mistake but when I follow corrections, it doesn't work ! Please Help !
Thankx _________________ http://www.sansfin.com |
|
Back to top |
|
 |
cjc
Joined: 24 Dec 2002 Posts: 146 Location: New York
|
Posted: Wed Apr 09, 2003 4:10 am Post subject: Re: in fine |
|
|
Sansnom wrote: | Could we have the good final version of the file ? I must made a mistake but when I follow corrections, it doesn't work ! Please Help !
Thankx |
OK, it should be available for download at:
http://www.cjc.org/blog/files/b2mailpost.zip |
|
Back to top |
|
 |
Edlef
Joined: 16 Mar 2002 Posts: 71
|
Posted: Sat Apr 19, 2003 9:40 am Post subject: Error? |
|
|
i've tried to install the final version, but i get this error:
Code: | Can not to execute query.SELECT post_title, cat_name, user_nickname, DATE_FORMAT(post_date, '%m/%d/%Y @ %l:%i%p') as post_date, post_content FROM b2users, b2posts, b2categories WHERE b2posts.post_category = b2categories.cat_ID AND b2posts.post_author = b2users.ID AND b2posts.ID= |
The table b2mailpostlog exists...
You can see in on my Testblog at http://graf.netbib.de
Any hints?
Thankyou and greetings
Edlef |
|
Back to top |
|
 |
cjc
Joined: 24 Dec 2002 Posts: 146 Location: New York
|
Posted: Sat Apr 19, 2003 1:29 pm Post subject: Re: Error? |
|
|
Edlef wrote: | i've tried to install the final version, but i get this error:
Code: | Can not to execute query.SELECT post_title, cat_name, user_nickname, DATE_FORMAT(post_date, '%m/%d/%Y @ %l:%i%p') as post_date, post_content FROM b2users, b2posts, b2categories WHERE b2posts.post_category = b2categories.cat_ID AND b2posts.post_author = b2users.ID AND b2posts.ID= |
The table b2mailpostlog exists...
You can see in on my Testblog at http://graf.netbib.de
Any hints?
Thankyou and greetings
Edlef |
Strange. What hacks do you have in place?
Also, create a new file in your b2 directory with the following code:
Code: |
<?
include ("b2config.php");
require_once ($b2inc.'/b2vars.php');
require_once ($b2inc.'/b2template.functions.php');
require_once ($b2inc.'/b2functions.php');
$query = "The ID is:'$p'";
print $query;
?> |
Say, you name the file foo.php. The web address would then be something like http://graf.netbib.de/foo.php.
I'd like to see if the $p variable is being passed properly, so http://graf.netbib.de/foo.php?p=4000 will generate a web page that just says "The ID is: '4000'". The problem you're getting is that the $p variable, which identifies the post you want to email, isn't being passed to the b2mailpost.php script for some reason. |
|
Back to top |
|
 |
Edlef
Joined: 16 Mar 2002 Posts: 71
|
Posted: Sat Apr 19, 2003 2:07 pm Post subject: foo.php |
|
|
Hi cjc,
i have the file foo.php on the server, and the ID is not passed correct
What makes me wonder is: I have also installed the Print-Hack, and this hack works wonderful.
Thanks for your support!
Greetings
Edlef |
|
Back to top |
|
 |
cjc
Joined: 24 Dec 2002 Posts: 146 Location: New York
|
Posted: Sat Apr 19, 2003 2:13 pm Post subject: Re: foo.php |
|
|
Edlef wrote: | Hi cjc,
i have the file foo.php on the server, and the ID is not passed correct
What makes me wonder is: I have also installed the Print-Hack, and this hack works wonderful.
Thanks for your support!
Greetings
Edlef |
I'm going to modify my code to make the variable passing a bit more explicit (as well as do a POST method; silly of me not to). I'll have something by later today, if my errands don't distract me too much. |
|
Back to top |
|
 |
Edlef
Joined: 16 Mar 2002 Posts: 71
|
Posted: Sat Apr 19, 2003 2:18 pm Post subject: WHOW |
|
|
THAT was quick!!!!
Thanks |
|
Back to top |
|
 |
cjc
Joined: 24 Dec 2002 Posts: 146 Location: New York
|
Posted: Sat Apr 19, 2003 9:53 pm Post subject: |
|
|
OK, it's a register_globals issue. I haven't written it so that it can be run with register_globals turned off (which is bad on my part).
You'll need to put the following up near the top, say, just above the $antispamtimer line:
Code: | $b2varstoreset = array('p', 'submit', 'email_from', 'email_to', 'shortmsg');
for ($i=0; $i<count($b2varstoreset); $i += 1) {
$b2var = $b2varstoreset[$i];
if (!isset($$b2var)) {
if (empty($HTTP_POST_VARS[$b2var])) {
if (empty($HTTP_GET_VARS[$b2var])) {
$$b2var = '';
} else {
$$b2var = $HTTP_GET_VARS[$b2var];
}
} else {
$$b2var = $HTTP_POST_VARS[$b2var];
}
}
} |
This will get the correct variables.
Also, for neatness, at around line 107 of the new file, you'll see a like that looks like:
Code: |
<form action="<?php echo $siteurl . '/b2mailpost.php?p=' . $p ; ?>">
|
Let's use the POST method, which is a better way of doing things. So, your line will now look like:
Code: |
<form method="post" action="<?php echo $siteurl . '/b2mailpost.php?p=' . $p ; ?>">
|
In any case, a new version of the .ZIP file is up at:
http://www.cjc.org/blog/files/b2mailpost.zip |
|
Back to top |
|
 |
Edlef
Joined: 16 Mar 2002 Posts: 71
|
Posted: Sun Apr 20, 2003 2:59 pm Post subject: GREAT!! |
|
|
Wonderful! Now it works perfect!
There is one little thing i have to checkout: the mail-dialog opens in the same window. If i press "close this window" the whole window is gone I like to have another button like "Back to the weblog"...
I think i can work it out
Anyway, 1000 thanks an greetings from Lueneburg
Edlef |
|
Back to top |
|
 |
cjc
Joined: 24 Dec 2002 Posts: 146 Location: New York
|
Posted: Sun Apr 20, 2003 8:34 pm Post subject: Re: GREAT!! |
|
|
Edlef wrote: | Wonderful! Now it works perfect!
There is one little thing i have to checkout: the mail-dialog opens in the same window. |
Take a look at: http://www.tidakada.com/board/viewtopic.php?p=12120#12120
You can set up a target for your href, so that it opens up a new window. |
|
Back to top |
|
 |
Edlef
Joined: 16 Mar 2002 Posts: 71
|
Posted: Tue Apr 22, 2003 5:31 pm Post subject: Problem |
|
|
a little problem occured: when i use the hack on my index page, everything works fine, the link spells
Code: | http://log.netbib.de/b2mailpost.php?p=78594374 |
If i use it on my archiv page or a "paged" page, the link spells
Code: | http://log.netbib.de/archives/m/b2mailpost.php?p=78594374 |
I use the "/archives/p/X instead of /?p=X"-hack ( http://tidakada.com/board/viewtopic.php?t=1273&start=0)
I think i have to change only one little thing, but what?
Thanks and greetings
Edlef |
|
Back to top |
|
 |
cjc
Joined: 24 Dec 2002 Posts: 146 Location: New York
|
Posted: Tue Apr 22, 2003 6:22 pm Post subject: |
|
|
You can hardcode the URL to b2mailpost.php into the form statement on line 152 or thereabouts. Right now, it looks like:
Code: | <form method="post" action="<?php echo $siteurl . '/b2mailpost.php?p=' . $p ; ?>"> |
For the action clause, hardcode the URL, i.e.,
Code: |
<?php echo 'http://log.netbib.de/b2mailpost.php?p=' . $p ; ?>
|
|
|
Back to top |
|
 |
Edlef
Joined: 16 Mar 2002 Posts: 71
|
Posted: Wed Apr 23, 2003 10:42 am Post subject: stupid me.... |
|
|
Thanks for the help!!
I've changed my index.php-template from relative to absolute URLs to the b2mailpost.php instead ... works fine!!
Greetings
Edlef |
|
Back to top |
|
 |
|