4images Modifications / Modifikationen > Plugins

[Plugin] View Users PM for PM 2.0

(1/3) > >>

b.o.fan:
EDIT FROM A FORUM ADMINISTRATOR:

This plugin requires the installation of the "[MOD] Private Message System (PMS) not supported anymore!"
http://www.4homepages.de/forum/index.php?topic=5374.0
i know PM are private.
but i think i show the code from my pms-viewer.php

--- Code: ---<?php // PLUGIN_TITLE: Private Nachrichten anzeigen

$nozip = 1;
define('IN_CP', 1);

$root_path = (eregi("\/plugins\/", $PHP_SELF)) ? "./../../" : "./../";
define('ROOT_PATH', $root_path);
require(ROOT_PATH.'admin/admin_global.php');
show_admin_header();

if ($sort == "") {
$sort = "pm_id";
}

if ($order == "") {
$order = "ASC";
}

if ($number == "") {
$number = "100";
}

if ($from == "") {
$from = "0";
}

$nextfrom = $from + $number;

if ($action == "") {
global $site_db;

   echo "<form action=\"pms_viewer.php\" method=\"post\" name=\"Viewer\" id=\"Viewer\">
Sortieren nach:
  <select name=\"sort\" id=\"sort\">
<option value=\"$sort\" selected=\"selected\">$sort</option>
    <option value=\"pm_id\">pm_id</option>
    <option value=\"pm_from\">pm_from</option>
    <option value=\"pm_to\">pm_to</option>
    <option value=\"pm_subject\">pm_subject</option>
    <option value=\"pm_type\">pm_type</option>
  </select>
    <select name=\"order\" id=\"order\">
   <option value=\"$order\" selected=\"selected\">$order</option>
    <option value=\"ASC\">ASC</option>
    <option value=\"DESC\">DESC</option>
  </select>
    Beginne bei Nachricht:
  <input name=\"from\" type=\"text\" id=\"from\" value=\"$nextfrom\" size=\"4\">
  Nachrichten pro Seite:
  <input name=\"number\" type=\"text\" id=\"number\" value=\"$number\" size=\"4\">
    <input type=\"submit\" class=\"button\" name=\"Submit\" value=\"Anzeigen\">
</form>";

   echo "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td class=\"tableborder\"><table cellpadding=\"3\" cellspacing=\"1\" border=\"0\"><td class=\"tableheader\" colspan=\"4\">Private Nachrichten in der Datenbank</td>";

    $sql = "SELECT * FROM ".PM_TABLE."
           ORDER BY $sort $order
            LIMIT $from, $number";
    $result = $site_db->query($sql);
    while($row = $site_db->fetch_array($result)){

      $id = $row["pm_id"];
     $from = $row["pm_from"];
       $to = $row["pm_to"];
        $subject = $row["pm_subject"];
      $type = $row["pm_type"];
     if ($type == 0) {
     $pmtype = "<b><font color=blue>gelöscht</font></b>&nbsp;<font color=gray>(Empfänger)</font>";
     }
     if ($type == 1) {
     $pmtype = "<b><font color=blue>gelöscht</font></b>&nbsp;<font color=gray>(Absender)</font>";
     }
     if ($type == 2) {
     $pmtype = "<b><font color=green>gelesen</font></b>";
     }
     if ($type == 3) {
     $pmtype = "<b><font color=red>ungelesen</font></b>";
     }

     $sql = "SELECT ".get_user_table_field("", "user_name")."
              FROM ".USERS_TABLE."
              WHERE ".get_user_table_field("", "user_id")." LIKE '$from'";
      $result_from = $site_db->query($sql);
      if ($result_from) {
       while ($row = $site_db->fetch_array($result_from)) {
        $from_name = $row["user_name"];
       }
       $site_db->free_result($result_from);
      }
     if ($from == 0) {
      $from_name = "anonym";
      }

     $sql = "SELECT ".get_user_table_field("", "user_name")."
              FROM ".USERS_TABLE."
              WHERE ".get_user_table_field("", "user_id")." LIKE '$to'";
      $result_to = $site_db->query($sql);
      if ($result_to) {
       while ($row = $site_db->fetch_array($result_to)) {
        $to_name = $row["user_name"];
       }
       $site_db->free_result($result_to);
      }

echo <<<END
  <tr class="tablerow2" valign="top">
    <td><b>ID:</b>&nbsp;$id</td>
    <td><b>Von:</b>&nbsp;<a href="../../member.php?action=showprofile&user_id=$from" target="_blank">$from_name</a></td>
    <td><b>An:</b>&nbsp;<a href="../../member.php?action=showprofile&user_id=$to" target="_blank">$to_name</a></td>
    <td><b>Betreff:</b>&nbsp;<a href="pms_viewer.php?action=show&id=$id&from_name=$from_name&to_name=$to_name" target="_blank">$subject</a></td>
   <td>$pmtype</td>
  </tr>
END;

}
       $site_db->free_result($result);
echo "</td></tr></table></table><br><br>";
}


if ($action == "show") {
global $site_db;

     $sql = "SELECT *
              FROM ".PM_TABLE."
              WHERE pm_id = $id";
            $result = $site_db->query($sql);

    while($row = $site_db->fetch_array($result)){

     $from = $row["pm_from"];
       $ip = $row["pm_ip"];
       $to = $row["pm_to"];
        $subject = $row["pm_subject"];
      $date = format_date($config['date_format']." ".$config['time_format'], $row["pm_date"]);
      $rcvd = $row["pm_date_rcvd"];
     if ($rcvd != 0) {
     $received = format_date($config['date_format']." ".$config['time_format'], $rcvd);
     }
     $text = $row["pm_text"];
     $type = $row["pm_type"];
     if ($type == 0) {
     $pmtype = "<b><font color=blue>gelöscht</font></b>&nbsp;<font color=gray>(Empfänger)</font>";
     }
     if ($type == 1) {
     $pmtype = "<b><font color=blue>gelöscht</font></b>&nbsp;<font color=gray>(Absender)</font>";
     }
     if ($type == 2) {
     $pmtype = "<b><font color=green>gelesen</font></b>";
     }
     if ($type == 3) {
     $pmtype = "<b><font color=red>ungelesen</font></b>";
     }

echo <<<END
<table cellpadding="0" cellspacing="0" border="0" align="center"><tr><td class="tableborder"><table cellpadding="3" cellspacing="1" border="0"><td class="tableheader" colspan="4">ID: $id</td>
  <tr class="tablerow2" valign="top">
    <td><b>Von:</b>&nbsp;<a href="../../member.php?action=showprofile&user_id=$from" target="_blank">$from_name</a></td>
    <td><b>IP:</b>&nbsp;$ip</td>
    <td><b>An:</b>&nbsp;<a href="../../member.php?action=showprofile&user_id=$to" target="_blank">$to_name</a></td>
   </tr>
  <tr class="tablerow" valign="top">
      <td><b>gesendet:</b>&nbsp;$date</td>
    <td><b>gelesen:</b>&nbsp;$received</td>
   <td><b>Status:</b>&nbsp;$pmtype</td>
</tr>
     <tr class="tablerow2" valign="top">
    <td colspan="3"><b>Betreff:</b>&nbsp;$subject</td>
  </tr>
  <tr class="tablerow" valign="top">
    <td colspan="3"><b>Nachricht:</b><br>$text</td>
   </tr>
</table>
</table>
<p align="center"><a href="javascript:window.close()">[schließen]</a></p>
END;
}
       $site_db->free_result($result);
}

show_admin_footer();
?>
--- End code ---

you must name it pms_viewer.php and you must drop it into admin/plugin


log into your ACP an have fun! ^^
b.o.fan

ascanio:
Any body has make a modificatios of this file for the new version of the Private Messages MOD?

martrix:
Ah! another one who does not understand the meaning of "private" or "privacy" or just not respecting people's privacy
Sorry for that mess, but the impression of administrator-sleuths makes me feel somehow sick.

mentally:

--- Quote from: ascanio on April 12, 2005, 02:55:05 PM ---Any body has make a modificatios of this file for the new version of the Private Messages MOD?

--- End quote ---


update?

badass:
i tried this mod i got an error

Parse error: parse error in /home/www/aleali.farvista.net/dm/admin/plugins/pms_viewer.php on line 180



???
any  clues

Navigation

[0] Message Index

[#] Next page

Go to full version