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 

List of all comments
Goto page Previous  1, 2, 3, 4, 5, 6  Next
 
Post new topic   Reply to topic    boardom Forum Index -> Hacks
View previous topic :: View next topic  
Author Message
lynn



Joined: 04 Jul 2003
Posts: 63
Location: USA

PostPosted: Fri Dec 17, 2004 11:02 pm    Post subject: Reply with quote

Yes and I changed $siteurl to my site url as you suggested above.
Back to top
View user's profile Send private message Visit poster's website
stevem



Joined: 15 Mar 2003
Posts: 323

PostPosted: Fri Dec 17, 2004 11:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
lynn



Joined: 04 Jul 2003
Posts: 63
Location: USA

PostPosted: Sat Dec 18, 2004 4:06 pm    Post subject: Reply with quote

Okay.... how do I do that in Mozilla? I know I did it before somehow but I have no idea how.
Back to top
View user's profile Send private message Visit poster's website
stevem



Joined: 15 Mar 2003
Posts: 323

PostPosted: Sat Dec 18, 2004 4:18 pm    Post subject: Reply with quote

Right click on the link and press Copy Link Location
Back to top
View user's profile Send private message
lynn



Joined: 04 Jul 2003
Posts: 63
Location: USA

PostPosted: Sat Dec 18, 2004 11:32 pm    Post subject: Reply with quote

Here it is:


http://www.aeternam626.com/b2///b2/b2allcomments.php?action=deletecomment&p=22&comment=36407

I do see one possible problem - the ///b2 should not be there but I have no idea why it's there.
Back to top
View user's profile Send private message Visit poster's website
stevem



Joined: 15 Mar 2003
Posts: 323

PostPosted: Sun Dec 19, 2004 12:21 am    Post subject: Reply with quote

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
View user's profile Send private message
lynn



Joined: 04 Jul 2003
Posts: 63
Location: USA

PostPosted: Tue Dec 21, 2004 2:03 pm    Post subject: Reply with quote

It says:

$PHP_SELF gives /b2/test.php
$siteurl/$PHP_SELF gives http://aeternam626.com/b2/b2/test.php
Back to top
View user's profile Send private message Visit poster's website
stevem



Joined: 15 Mar 2003
Posts: 323

PostPosted: Tue Dec 21, 2004 2:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
lynn



Joined: 04 Jul 2003
Posts: 63
Location: USA

PostPosted: Tue Dec 21, 2004 10:30 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
stevem



Joined: 15 Mar 2003
Posts: 323

PostPosted: Tue Dec 21, 2004 10:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
lynn



Joined: 04 Jul 2003
Posts: 63
Location: USA

PostPosted: Mon Dec 27, 2004 3:08 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
stevem



Joined: 15 Mar 2003
Posts: 323

PostPosted: Mon Dec 27, 2004 3:36 pm    Post subject: Reply with quote

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
View user's profile Send private message
lynn



Joined: 04 Jul 2003
Posts: 63
Location: USA

PostPosted: Mon Dec 27, 2004 8:11 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
stevem



Joined: 15 Mar 2003
Posts: 323

PostPosted: Mon Dec 27, 2004 8:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
lynn



Joined: 04 Jul 2003
Posts: 63
Location: USA

PostPosted: Mon Dec 27, 2004 10:19 pm    Post subject: Reply with quote

It just keeps getting weirder. Now it says: "please, do not load this page directly"
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> Hacks All times are GMT + 1 Hour
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 4 of 6

 
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