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 

Date problem
Goto page Previous  1, 2
 
Post new topic   Reply to topic    boardom Forum Index -> Template help
View previous topic :: View next topic  
Author Message
macshack



Joined: 17 Jul 2002
Posts: 1204
Location: Phoenix, Az

PostPosted: Thu Dec 05, 2002 9:04 pm    Post subject: Reply with quote

Hi kin,

Yes, that is exactly what I was expecting. It is this string that is used in the next line of b2 code to "re-direct" the browser.

My guess is the 'header("location: .......")' gets modified by lycos before returning it to the browser. This results is a ill-formed URL that produces the 404 error and then the page you see.

As to why this just started happing, your guess is a good as mine. Mine is they made some changes to "close" a hole they fould; that being headers with location redirect.

This is clearly an issue with your provider and I'm not sure your going to find a way around it.

michael e
Back to top
View user's profile Send private message Send e-mail
kin



Joined: 01 Oct 2002
Posts: 30
Location: Belgium

PostPosted: Thu Dec 05, 2002 9:12 pm    Post subject: Reply with quote

Ok then i guess i will have to deal with this :/

I will put a message on the b2commentspopup.php saying that despite the 404 page reached, the comment will still be posted.
I don't like this but i have no other choice Neutral

Unless it would be possible to display a link that the user will click after submitting his comment ?

eg: Thanks for posting your comment, click here to return to the comments page

Anyway, thx again michael for your help, i really appreciate
_________________
~»•«~ Live'n'Log in english ~»•«~ Live'n'Log in french ~»•«~
Back to top
View user's profile Send private message Visit poster's website
macshack



Joined: 17 Jul 2002
Posts: 1204
Location: Phoenix, Az

PostPosted: Thu Dec 05, 2002 9:37 pm    Post subject: Reply with quote

kin,

That's not a bad idea. Replace the 'kilroy' code with the following...
Code:

    echo "Thanks for posting your comment, click ";
    echo '<a href="'. $HTTP_POST_VARS['redirect_to'] .$querystring_start.'p'.
        $querystring_equal.$comment_post_ID.$querystring_separator.'c'.
        $querystring_equal.'1'.'">here</a>';
    echo " to return to the comments page.";
    exit;


Try that,
michael e
Back to top
View user's profile Send private message Send e-mail
kin



Joined: 01 Oct 2002
Posts: 30
Location: Belgium

PostPosted: Thu Dec 05, 2002 10:24 pm    Post subject: Reply with quote

Wow i think we're finally done with this

It took some time but the result is there!!!

michael !!! many many thanks to you!!!

PS: can i change the bg color of that page (or bg image) and apply my own .css style without messing it up ? (b2comments.post.php)
_________________
~»•«~ Live'n'Log in english ~»•«~ Live'n'Log in french ~»•«~
Back to top
View user's profile Send private message Visit poster's website
macshack



Joined: 17 Jul 2002
Posts: 1204
Location: Phoenix, Az

PostPosted: Fri Dec 06, 2002 1:32 am    Post subject: Reply with quote

Your welcome kin.

What you want to do can be done.

I think the best way to do this is to make a html type of page with the head body and sections. Then you can surround that with some php escape tags something like this:
Code:

?>   <!-- escape to html -->
<html>
<head>
<!-- headstuff....  -->
</head>
<body>
Thanks for posting your comment, click
<a href="<?php echo $HTTP_POST_VARS['redirect_to'] .$querystring_start.'p'. $querystring_equal.$comment_post_ID.$querystring_separator.'c'. $querystring_equal.'1'; ?>">here</a> to return to the comments page<br />
</body>
</html>
<?php   /* escape back to php */
exit;


Now just insert your needed html stuff. Paste the whole thing as a replacement of the last stuff. That should do it

Kind regards,
michael e
Back to top
View user's profile Send private message Send e-mail
kin



Joined: 01 Oct 2002
Posts: 30
Location: Belgium

PostPosted: Fri Dec 06, 2002 9:54 am    Post subject: Reply with quote

Okay i will try that... when Lycos is back. It's down right now... no wonder
_________________
~»•«~ Live'n'Log in english ~»•«~ Live'n'Log in french ~»•«~
Back to top
View user's profile Send private message Visit poster's website
kin



Joined: 01 Oct 2002
Posts: 30
Location: Belgium

PostPosted: Fri Dec 06, 2002 2:36 pm    Post subject: Reply with quote

Alright... done and fixed!
I'm going to bookmark this thread, i may need it again, another b2 blog is installed on my site Very Happy

Thanks again for this wonderful support!
_________________
~»•«~ Live'n'Log in english ~»•«~ Live'n'Log in french ~»•«~
Back to top
View user's profile Send private message Visit poster's website
courtney.



Joined: 04 Apr 2003
Posts: 20
Location: usa

PostPosted: Mon Apr 07, 2003 2:00 am    Post subject: Reply with quote

hello i am having the same problem as mentioned above with the 404 error... i added the code as instructed above, after clicking on "ok" to post a comment it now takes u to a page that looks like this:
Thanks for posting your comment, click HERE to return to the comments page.
but when u click on HERE it takes u back to another 404 error page. is there any way around this?!
tc & ty for your time!!
courtney.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
macshack



Joined: 17 Jul 2002
Posts: 1204
Location: Phoenix, Az

PostPosted: Mon Apr 07, 2003 8:59 pm    Post subject: Reply with quote

Hi,

Well if I had a url that took me to a b2 page of some kind that I could post a comment, then maybe I could help.
_________________
Kind Regards,
Michael e
Back to top
View user's profile Send private message Send e-mail
courtney.



Joined: 04 Apr 2003
Posts: 20
Location: usa

PostPosted: Mon Apr 07, 2003 9:11 pm    Post subject: Reply with quote

i honestly don't know where my head is at these days, sorry about that:
http://members.lycos.co.uk/versatilecreations/
i have it set on my blogger, when you go to click on comment, it opens up in a popup box, which is right, and you are able to post your comment, however, when you go to post that comment, u get a 404 error message. well i had seen in b2 forum that someone else had the same problem and you had suggested in this thread: http://tidakada.com/board/viewtopic.php?p=8118#8118
to add the redirect to the b2comments.post.php , ok i did and it works as far when u go to click on the link HERE to go back to comments page, u get another 404 error...ughh i hope i explained this right... u can view my blogger and see what i am talking about, except i took out the redirect when u post and it just goes to a thank you page, as well i added a reload button in the main blogger page since it doesn't refresh and show any new comments added, i would prefer to have it redirect.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
macshack



Joined: 17 Jul 2002
Posts: 1204
Location: Phoenix, Az

PostPosted: Mon Apr 07, 2003 9:52 pm    Post subject: Reply with quote

Hi,

I posted a reply in the other forum. Let's pick one forum and stay in that one. Your choice. In the mean time, show me the code you used to create the "hear" link.
_________________
Kind Regards,
Michael e
Back to top
View user's profile Send private message Send e-mail
courtney.



Joined: 04 Apr 2003
Posts: 20
Location: usa

PostPosted: Mon Apr 07, 2003 10:19 pm    Post subject: Reply with quote

eekk...sorry about the double post on the same subject...
i changed everything back to this so that you can get a better understanding what the 404 error is all about, here is my b2comments.post.php file:
<?php

# if you want to change the paths here, remember to put your new path BEFORE $b2inc,
# like this: "b2/$b2inc/b2functions.php"

require("b2config.php");
require("$b2inc/b2template.functions.php");
include("$b2inc/b2vars.php");
include("$b2inc/b2functions.php");

dbconnect();

function add_magic_quotes($array) {
foreach ($array as $k => $v) {
if (is_array($v)) {
$array[$k] = add_magic_quotes($v);
} else {
$array[$k] = addslashes($v);
}
}
return $array;
}

if (!get_magic_quotes_gpc()) {
$HTTP_GET_VARS = add_magic_quotes($HTTP_GET_VARS);
$HTTP_POST_VARS = add_magic_quotes($HTTP_POST_VARS);
$HTTP_COOKIE_VARS = add_magic_quotes($HTTP_COOKIE_VARS);
}

$author = trim($HTTP_POST_VARS["author"]);
$email = trim($HTTP_POST_VARS["email"]);
$url = trim($HTTP_POST_VARS["url"]);
$comment = trim($HTTP_POST_VARS["comment"]);
$original_comment = $comment;
$comment_autobr = $HTTP_POST_VARS["comment_autobr"];
$comment_post_ID = $HTTP_POST_VARS["comment_post_ID"];

if ($require_name_email && ($email == "" || $email == "@" || $author == "" || $author == "name")) { //original fix by Dodo, and then Drinyth
echo "Error: please fill the required fields (name, email)";
exit;
}
if ($comment == "comment" || $comment == "") {
echo "Error: please type a comment";
exit;
}

$user_ip = $REMOTE_ADDR;
$user_domain = gethostbyaddr($user_ip);
$time_difference = get_settings("time_difference");
$now = date("Y-m-d H:i:s",(time() + ($time_difference * 3600)));

$author = strip_tags($author);
$email = strip_tags($email);
if (strlen($email) < 6) {
$email = '';
}
$url = trim(strip_tags($url));
$url = ((!stristr($url, '://')) && ($url != '')) ? 'http://'.$url : $url;
if (strlen($url) < 7) {
$url = '';
}
$comment = strip_tags($comment, $comment_allowed_tags);
$comment = balanceTags($comment, 1);
$comment = convert_chars($comment);
$comment = format_to_post($comment);

$comment_author = $author;
$comment_author_email = $email;
$comment_author_url = $url;

$author = addslashes($author);
$email = addslashes($email);
$url = addslashes($url);

/* flood-protection */
$query = "SELECT * FROM $tablecomments WHERE comment_author_IP='$user_ip' ORDER BY comment_date DESC LIMIT 1";
$result = mysql_query($query);
$ok=1;
if (!empty($result)) {
while($row = mysql_fetch_object($result)) {
$then=$row->comment_date;
}
$time_lastcomment=mysql2date("U","$then");
$time_newcomment=mysql2date("U","$now");
if (($time_newcomment - $time_lastcomment) < 30)
$ok=0;
}
/* end flood-protection */

if ($ok) {

$query = "INSERT INTO $tablecomments VALUES ('0','$comment_post_ID','$author','$email','$url','$user_ip','$now','$comment','0')";
$result = mysql_query($query);
if (!$result)
die ("There is an error with the database, it can't store your comment...<br>Contact the <a href=\"mailto:$admin_email\">webmaster</a>");

if ($comments_notify) {

$notify_message = "New comment on your post #$comment_post_ID.\r\n\r\n";
$notify_message .= "author : $comment_author (IP: $user_ip , $user_domain)\r\n";
$notify_message .= "e-mail : $comment_author_email\r\n";
$notify_message .= "url : $comment_author_url\r\n";
$notify_message .= "comment: \n".stripslashes($original_comment)."\r\n\r\n";
$notify_message .= "You can see all comments on this post there: \r\n";
$notify_message .= $siteurl.'/'.$blogfilename.$querystring_start.'p'.$querystring_equal.$comment_post_ID.$querystring_separator.'c'.$querystring_equal.'1'."\r\n\r\n";

$postdata = get_postdata($comment_post_ID);
$authordata = get_userdata($postdata["Author_ID"]);
$recipient = $authordata["user_email"];
$subject = "comment on post #$comment_post_ID \"".$postdata["Title"]."\"";

@mail($recipient, $subject, $notify_message, "From: b2@".$HTTP_SERVER_VARS['SERVER_NAME']."\r\n"."X-Mailer: b2 $b2_version - PHP/" . phpversion());

}

if ($email == "") {
$email = " "; // this to make sure a cookie is set for 'no email'
}
if ($url == "") {
$url = " "; // this to make sure a cookie is set for 'no url'
}
setcookie("comment_author",$author, time()+30000000);
setcookie("comment_author_email",$email, time()+30000000);
setcookie("comment_author_url",$url, time()+30000000);

header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
?> <!-- escape to html -->
<html>
<head>
<!-- headstuff.... -->
<style type="text/css" media="screen">
@import url( ../layout2b.css );
</style>
</head>
<body>
<div class="storyContent">Thanks for posting your comment, click
<a href="<?php echo $HTTP_POST_VARS['redirect_to'] .$querystring_start.'p'. $querystring_equal.$comment_post_ID.$querystring_separator.'c'. $querystring_equal.'1'; ?>">here</a> to return to the comments page</div><br />
</body>
</html>
<?php /* escape back to php */
exit;
$location = (!empty($HTTP_POST_VARS['redirect_to'])) ? $HTTP_POST_VARS['redirect_to'] : $HTTP_SERVER_VARS["HTTP_REFERER"];
header("Location: $location");

} else {
die("Sorry, you can only post a new comment every 30 seconds");
}

?>

like i said i changed it back to this on my blogger, i took out the thank you page and added this redirect. i would rather have the redirect back to the comments post page if at all possible.
ty again for your help and tc!!!
courtney.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
macshack



Joined: 17 Jul 2002
Posts: 1204
Location: Phoenix, Az

PostPosted: Mon Apr 07, 2003 11:05 pm    Post subject: Reply with quote

Hi,

Because you said that you had followed the referenced thread, I think you may have changed 'b2commentspopup.php' in the processs.

In the code for 'b2commentspopup.php' find the line (about line 77) with:
Code:

<input type="hidden" name="redirect_to" value= ..........

and tell me if it references 'commentspopup.php'. If it does, it should be 'b2commentspopup.php'. (the redirect value to where we are to go back to)
Then let's try that.
_________________
Kind Regards,
Michael e
Back to top
View user's profile Send private message Send e-mail
courtney.



Joined: 04 Apr 2003
Posts: 20
Location: usa

PostPosted: Mon Apr 07, 2003 11:17 pm    Post subject: Reply with quote

*YAYAYAYAY!!!!!!!!!!!! it works!!!!!! whoooooo hooooo!!! ty so much !!!!!!! yaya
Back to top
View user's profile Send private message Send e-mail Visit poster's website
macshack



Joined: 17 Jul 2002
Posts: 1204
Location: Phoenix, Az

PostPosted: Mon Apr 07, 2003 11:22 pm    Post subject: Reply with quote

Hi courtney,

Glad to be of help. Smile
_________________
Kind Regards,
Michael e
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> Template help All times are GMT + 1 Hour
Goto page Previous  1, 2
Page 2 of 2

 
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