View previous topic :: View next topic |
Author |
Message |
lynn
Joined: 04 Jul 2003 Posts: 63 Location: USA
|
Posted: Fri Dec 17, 2004 11:02 pm Post subject: |
|
|
Yes and I changed $siteurl to my site url as you suggested above. |
|
Back to top |
|
 |
stevem
Joined: 15 Mar 2003 Posts: 323
|
Posted: Fri Dec 17, 2004 11:07 pm Post subject: |
|
|
So again, can you hover over one of the Delete Comment links, right-click, and select Copy Shortcut and paste the result here? |
|
Back to top |
|
 |
lynn
Joined: 04 Jul 2003 Posts: 63 Location: USA
|
Posted: Sat Dec 18, 2004 4:06 pm Post subject: |
|
|
Okay.... how do I do that in Mozilla? I know I did it before somehow but I have no idea how. |
|
Back to top |
|
 |
stevem
Joined: 15 Mar 2003 Posts: 323
|
Posted: Sat Dec 18, 2004 4:18 pm Post subject: |
|
|
Right click on the link and press Copy Link Location |
|
Back to top |
|
 |
lynn
Joined: 04 Jul 2003 Posts: 63 Location: USA
|
|
Back to top |
|
 |
stevem
Joined: 15 Mar 2003 Posts: 323
|
Posted: Sun Dec 19, 2004 12:21 am Post subject: |
|
|
There is one error I noticed in the change you were asked to make which gives you an extra /. $siteurl/$PHP_SELF should have said $siteurl$PHP_SELF
But that isn't the main problem which we need to solve.
What does the line $siteurl = in b2config.php say? Is it
$siteurl = 'http://www.aeternam626.com/b2';
which is what it should say?
Can you copy this code into Notepad (or similar) and save it as test.php
Then upload it to the b2 folder and go to www.aeternam626.com/b2/test.php in your browser. Then copy what it says on that site and paste it here so we can see what is happening.
test.php
Code: | <?php
require("b2config.php");
?>
<html>
<head>
<title>Testing</title>
</head><body>
$PHP_SELF gives <?php echo $PHP_SELF ?><br>
$siteurl/$PHP_SELF gives <?php echo "$siteurl$PHP_SELF" ?>
</body>
</html> |
You can delete test.php when you're done. |
|
Back to top |
|
 |
lynn
Joined: 04 Jul 2003 Posts: 63 Location: USA
|
|
Back to top |
|
 |
stevem
Joined: 15 Mar 2003 Posts: 323
|
Posted: Tue Dec 21, 2004 2:46 pm Post subject: |
|
|
That's exactly right! That's what I expected to see.
So, next thing, could you copy and paste here the contents of your version of b2allcomments.php in case there's an error in there somewhere? |
|
Back to top |
|
 |
lynn
Joined: 04 Jul 2003 Posts: 63 Location: USA
|
Posted: Tue Dec 21, 2004 10:30 pm Post subject: |
|
|
Okay. How do you guys post stuff here and make it come up in a white box?
I might not get back to this until after Christmas but then I need to really try harder to make some of this stuff work. I think there must be something weird about my site; either that or I'm extremely incompetent because none of this stuff has worked for me. |
|
Back to top |
|
 |
stevem
Joined: 15 Mar 2003 Posts: 323
|
Posted: Tue Dec 21, 2004 10:55 pm Post subject: |
|
|
lynn wrote: | Okay. How do you guys post stuff here and make it come up in a white box? |
Paste in the code then highlight it with your mouse and press the button that says Code above where you type your message. You'll get [ code]this is a message[ /code] (without the space in the brackets)
and that's it. |
|
Back to top |
|
 |
lynn
Joined: 04 Jul 2003 Posts: 63 Location: USA
|
Posted: Mon Dec 27, 2004 3:08 pm Post subject: |
|
|
Okay, here it is.
Code: | <?php
require("b2config.php");
require("$b2inc/b2template.functions.php");
include("$b2inc/b2vars.php");
include("$b2inc/b2functions.php");
dbconnect();
get_currentuserinfo();
if (!($user_login)) exit;
if ($user_level<8) exit;
if ($action=='deletecomment') {
$standalone = 1;
require_once("./b2header.php");
if ($user_level == 0)
die ("Cheatin' uh ?");
$comment = $HTTP_GET_VARS['comment'];
$p = $HTTP_GET_VARS['p'];
$commentdata=get_commentdata($comment) or die("Oops, no comment with this ID. <a href=\"$PHP_SELF\">Go back</a> !");
if ($search!="") {
$query = "DELETE FROM $tablecomments WHERE comment_content NOT LIKE '%<trackback />%' AND comment_content LIKE '%$search%'";
} else {
$query = "DELETE FROM $tablecomments WHERE comment_ID=$comment";
}
$result = mysql_query($query) or die("Oops, no comment with this ID. <a href=\"$PHP_SELF\">Go back</a> !");
header ("Location: $PHP_SELF");
}
?>
<html>
<head>
<style type="text/css" media="screen">
@import url( layout2b.css );
</style>
<link rel="stylesheet" href="<?php echo $b2inc; ?>/b2.css" type="text/css">
<title>Comments</title>
</head><body>
<h2><?php if ($search!="") {
echo "Comments including '$search'";
} else {
echo "All Comments";
} ?>
</h2>
<div id="contentcomments">
<div class="storyContent">
<div><b><span style="color: #0099CC">::</span> <a href="index.php">return to the blog</a></b> <a href="b2edit.php">:: return to edit</a></div>
<br /><br />
<form method="post" action="<?php echo $PHP_SELF ?>">
<input type=submit name="submit" value="Show comments with" class="search">
<input type=text name="search">
<?php
$queryc = "SELECT * FROM $tablecomments WHERE comment_content NOT LIKE '%<trackback />%' AND comment_content LIKE '%$search%' ORDER BY comment_date DESC";
$resultc = mysql_query($queryc);
if ($search!="" && mysql_num_rows($resultc)>0) { ?>
<a href="http://www.aeternam626.com/b2/<?php echo $PHP_SELF."?search=".$search."&action=deletecomment" ?>" onclick="return confirm('You are about to delete all comments containing \'<?php echo $search ?>\'\nCancel to stop, OK to delete')">Delete all comments including '<?php echo $search ?>'</a>
<?php } ?>
</form><br /><br />
<?php
if ($resultc) {
// these lines are b2's motor, do not delete
while($rowc = mysql_fetch_object($resultc)) {
$commentdata = get_commentdata($rowc->comment_ID);
$posting = $rowc->comment_post_ID;
$commentauthor = $rowc->comment_author;
$postdata = get_postdata($posting);
?>
<p>
<b><?php comment_author() ?></b> ( <?php comment_author_email_link() ?>
<?php if(comment_author_url_link()=="") {$slash="";} else {$slash="/";} echo " $slash"; ?>
<?php comment_author_url_link() ?> ) (IP: <?php comment_author_IP() ?>)
<?php comment_date('D j M Y') ?> @ <?php comment_time('g:i a') ?>
<?php
echo " [ <a href=\"http://www.aeternam626.com/b2/$PHP_SELF?action=deletecomment&p=".$postdata["ID"]."&comment=".$commentdata["comment_ID"]."\" onclick=\"return confirm('You are about to delete this comment by \'".htmlentities($commentauthor)."\'\\nCancel to stop, OK to delete.')\">Delete Comment</a> ]";
?><br />
Comment was made in <b>
<?php the_title() ?> <?php echo $the_date ?> @ <?php the_time('g:i a') ?></b><br /><br />
<?php comment_text() ?>
<br /><br /></p>
<?php //end of the loop, don't delete
}
}
?>
<br /><br />
<div><b><span style="color: #0099CC">::</span> <a href="index.php">return to the blog</a></b> <a href="b2edit.php">:: return to edit</a></div>
</div></div>
</body>
</html> |
|
|
Back to top |
|
 |
stevem
Joined: 15 Mar 2003 Posts: 323
|
Posted: Mon Dec 27, 2004 3:36 pm Post subject: |
|
|
I copied what you had to my system and, you'll be pleased to know that I go the same problem. However, I got it to work by changing the line starting with
Code: | echo " [ <a href=\"http://www.aeternam626.com/b2/$PHP_SELF?action=deletecomment&p=".$postdata |
to
Code: | echo " [ <a href=\"$PHP_SELF?action=deletecomment&p=".$postdata |
or, alternatively, to
Code: | echo " [ <a href=\"http://www.aeternam626.com$PHP_SELF?action=deletecomment&p=".$postdata |
(note that /b2/ is meant to be missing in this second case)
One of the two should work I hope! |
|
Back to top |
|
 |
lynn
Joined: 04 Jul 2003 Posts: 63 Location: USA
|
Posted: Mon Dec 27, 2004 8:11 pm Post subject: |
|
|
Nope. Still doesn't work. With the first one I get a little box that says B2 could not be found and with the second one I just get a blank page whenever I try to delete a comment. |
|
Back to top |
|
 |
stevem
Joined: 15 Mar 2003 Posts: 323
|
Posted: Mon Dec 27, 2004 8:30 pm Post subject: |
|
|
OK, let's do what I should have suggested before and put the whole URL in, rather than trying to be clever. Try
Code: | echo " [ <a href=\"http://www.aeternam626.com/b2/b2comments.php?action=deletecomment&p=".$postdata |
Now if that doesn't work I will be compeletely mystified! |
|
Back to top |
|
 |
lynn
Joined: 04 Jul 2003 Posts: 63 Location: USA
|
Posted: Mon Dec 27, 2004 10:19 pm Post subject: |
|
|
It just keeps getting weirder. Now it says: "please, do not load this page directly" |
|
Back to top |
|
 |
|