Announcement

Collapse
No announcement yet.

Thread title changed incorrectly

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Thread title changed incorrectly

    When a moderator edits a post and changes the title of a thread, the thread's title is not updated with what the moderator enters, but rather with the title of the thread that follows it.

    Has any body come across this problem? And, if so, what could be the solution?

  • #2
    problem corrected

    I discovered that the same problem exists for posts titles. Somehow, the new title that the user enters get changed before reaching the update statement. I don't know anything about PHP, but fortunately, I was able to correct the problem. Here is the solution:
    1. In "global.php", in the beginning of the file:

      Change
      PHP Code:
      <?php
      if (isset($explain)) {
      To:
      PHP Code:
      <?php
      $newtitle 
      $title;

      if (isset(
      $explain)) {
    2. In "editpost.php", in the "start update post" section:

      Change
      PHP Code:
        $DB_site->query("UPDATE post SET title='".addslashes(htmlspecialchars($title))."',pagetext='".addslashes($message)."',allowsmilie='$allowsmilie',showsignature='$signature',iconid='$iconid'$editedbysql$attachmentsql WHERE postid='$postid'"); 
      To:
      PHP Code:
        $DB_site->query("UPDATE post SET title='".addslashes(htmlspecialchars($newtitle))."',pagetext='".addslashes($message)."',allowsmilie='$allowsmilie',showsignature='$signature',iconid='$iconid'$editedbysql$attachmentsql WHERE postid='$postid'"); 
    3. In "postings.php", in the "start update thread" section:

      Change:
      PHP Code:
        $DB_site->query("UPDATE thread SET visible='$visible',open='$open',title='".addslashes(htmlspecialchars($title))."',iconid='".addslashes($iconid)."',notes='".addslashes($notes)."' WHERE threadid='$threadid'"); 
      To:
      PHP Code:
        $DB_site->query("UPDATE thread SET visible='$visible',open='$open',title='".addslashes(htmlspecialchars($newtitle))."',iconid='".addslashes($iconid)."',notes='".addslashes($notes)."' WHERE threadid='$threadid'"); 

    Comment


    • #3
      Do you have anything in your phpinclude template? Because I edit threads all the time here and have no problem.

      Comment


      • #4
        I included the code for last10 posts hack

        I added the following code to install the last10 posts hack:

        PHP Code:
        ob_start(); 
        include_once(
        "./last10.php"); 
        $latestposts ob_get_contents(); 
        ob_end_clean(); 
        Could this be the problem?

        Comment


        • #5
          It's very likely. I haven't seen the code, but there's a good possibility there's a $title variable.

          Comment


          • #6
            You are right!

            Your assumption was correct. I took out that extra code from phpinclude and things worked fine. However, I still don't understand why.

            Comment


            • #7
              The $title variable was overwriting the one used by vB -- you'd either have to compensate for it in vB or the script. Personally, I would've chosen the script, but either works

              Comment

              Related Topics

              Collapse

              Working...
              X