Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
Ajax Shoutbox V3
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Mods in Progress

2023-05-27 18:58:49
The JS is really old.

It uses document.getElementById(...) which is legacy supported in most browser engines for a long time to come, but this is most likely the problem on a new browser like Chrome/Edge/Opera. I would replace with document.querySelector(...)

Try on Firefox first before editing the JS, as they have their own browser engine that has nothing to do with Chromium project. That will rule that out before updating anything.
2024-03-31 12:38:19
sanity check for the delete feature. Im sure if you use this you know that if you hit the X to delete a shout, it just deletes and if you made a mistake, you cannot go back. This is a check for that
In ajshoutbox.js find
function delup(id) {
        newWin=window.open('chatedit.php?del='+id,'delete','height=500,width=490,resizable=yes,scrollbars=yes');
        if (window.focus) {newWin.focus()}
}

replace with
function delup(id) {
 if (confirm("Are you sure you want to delete this message?")) {
     newWin = window.open('chatedit.php?del=' + id, 'delete', 'height=500,width=490,resizable=yes,scrollbars=yes');
     if (window.focus) {
         newWin.focus();
     }
 }
}

TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Last edited by MicroMonkey on 2024-03-31 14:01:13
2024-04-14 17:04:21
found a better way instead of the delete button opening a new window for no reason, here is an ajax version. Has a confirmation box after deletion, you can change that if you want.
function delup(id) {
 if (confirm("Are you sure you want to delete this message?")) {
     var xhr = new XMLHttpRequest();
     xhr.open("GET", "chatedit.php?del=" + id, true);
     xhr.onreadystatechange = function() {
         if (xhr.readyState === 4 && xhr.status === 200) {
             alert("Message deleted successfully");
         } else if (xhr.readyState === 4 && xhr.status !== 200) {
             alert("Failed to delete message");
         }
     };
     xhr.send();
 }
}

TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
2024-04-20 14:36:22
ajShoutHistory.php, find
   if (isset($_GET['del'])){

       if (is_numeric($_GET['del'])){
               $query = "SELECT * FROM ajshoutbox WHERE id=".$_GET['del'];
               $result = SQL_Query_exec($query);
       }else{
               echo "invalid msg id STOP TRYING TO INJECT SQL";
               exit;
       }

       $row = mysqli_fetch_row($result);
             
       if ((get_user_class() >= 4) || ($CURUSER['username'] == $row[1]) ){  
               $query = "DELETE FROM ajshoutbox WHERE id=".$_GET['del'];
               //write_log("<B>".SHOUTBOX_DEL."   ".$CURUSER['username']."</b>");
               SQL_Query_exec($query);  
       }
}


Replace with
if (isset($_GET['del'])) {
  if (is_numeric($_GET['del'])) {
      $delId = intval($_GET['del']); // Convert to integer for security

      // Check if the message ID exists in the database
      $query = "SELECT * FROM ajshoutbox WHERE id=$delId";
      $result = SQL_Query_exec($query);

      if (mysqli_num_rows($result) == 0) {
          echo "Message with ID $delId not found.";
          exit;
      }

      $row = mysqli_fetch_row($result);

      // Perform further actions only if the user has sufficient privileges or owns the message
      if (get_user_class() >= 4 || $CURUSER['username'] == $row[1]) {
          // Check if the delete confirmation
          if (isset($_POST['confirm_delete'])) {
              $query = "DELETE FROM ajshoutbox WHERE id=$delId";
              SQL_Query_exec($query);
              echo "Message with ID $delId deleted successfully.";
          } else {
              // Display confirmation
              echo "<form method='post' style='font-size: 16px; color: #333; text-align: center;'>
                      <p style='font-size: 18px; color: #f00;'>Are you sure you want to delete this message?</p>
                      <input type='submit' name='confirm_delete' value='Yes' style='font-size: 16px; color: #fff; background-color: #007bff; border: none; padding: 8px 16px; cursor: pointer;'>
                      <button type='button' onclick='window.history.back()' style='font-size: 16px; color: #fff; background-color: #6c757d; border: none; padding: 8px 16px; cursor: pointer;'>No</button>
                    </form>";
          }
      } else {
          echo "You do not have permission to delete this message.";
      }
  } else {
      echo "Invalid message ID. STOP TRYING TO INJECT SQL!";
      exit;
  }
}

TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
2024-10-17 22:58:47
in sendshout.php find
function addData($name,$text,$uid) {
 require_once("backend/functions.php");   # getting table prefix
 $now = get_date_time();
   $sql = "INSERT INTO ajshoutbox (date,name,text,uid) VALUES ('".$now."','".$name."','".$text."','".$uid."')";
   $conn = getDBConnection();
   $results = SQL_Query_exec($sql, $conn);
   if (!$results || empty($results)) {
       # echo 'There was an error creating the entry';
       end;
   }
}

replace with
function addData($name, $text, $uid) {
   require_once "backend/functions.php";
   
   $now = get_date_time();
   $conn = getDBConnection();

   $sql = "INSERT INTO ajshoutbox (date, name, text, uid) VALUES (?, ?, ?, ?)";

   if ($stmt = $conn->prepare($sql)) {
       $stmt->bind_param("ssss", $now, $name, $text, $uid);
       if (!$stmt->execute()) {
           echo 'There was an error creating the entry';
       }
       $stmt->close();
   }
       echo 'There was an error preparing the query';

   $conn->close();
}

TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
2025-08-01 19:39:23
disregard
Last edited by Obiwan on 2025-08-01 20:08:27
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728