1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-22 06:03:27 +02:00

Latest batch of global bashing and notice removal, remove unneeded files

This commit is contained in:
e107steved
2009-12-18 20:49:56 +00:00
parent 17b98ac017
commit 716ddc3c58
14 changed files with 106 additions and 228 deletions

View File

@@ -9,8 +9,8 @@
* PM plugin - main user interface
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/pm/pm.php,v $
* $Revision: 1.15 $
* $Date: 2009-12-17 22:47:20 $
* $Revision: 1.16 $
* $Date: 2009-12-18 20:49:55 $
* $Author: e107steved $
*/
@@ -20,7 +20,7 @@
*
* @package e107_plugins
* @subpackage pm
* @version $Id: pm.php,v 1.15 2009-12-17 22:47:20 e107steved Exp $;
* @version $Id: pm.php,v 1.16 2009-12-18 20:49:55 e107steved Exp $;
*/
@@ -240,19 +240,20 @@ class pm_extended extends private_message
$pm_info['pm_read'] = $now;
$this->pm_mark_read($pmid, $pm_info);
}
$txt .= $this->e107->tp->parseTemplate($PM_SHOW, true);
$txt = $this->e107->tp->parseTemplate($PM_SHOW, true);
$this->e107->ns->tablerender(LAN_PM, $txt);
if (!$comeFrom)
{
if ($pm_info['pm_from'] == USERID) { $comeFrom = 'outbox'; }
}
// Need to show inbox or outbox from start
if ($comeFrom == 'outbox')
{ // Show Outbox
$this->e107->ns->tablerender(LAN_PM." - ".LAN_PM_26, $this->show_outbox($pm_proc_id), 'PM');
$this->e107->ns->tablerender(LAN_PM." - ".LAN_PM_26, $this->show_outbox(), 'PM');
}
else
{ // Show Inbox
$this->e107->ns->tablerender(LAN_PM." - ".LAN_PM_25, $this->show_inbox($pm_proc_id), 'PM');
$this->e107->ns->tablerender(LAN_PM.' - '.LAN_PM_25, $this->show_inbox(), 'PM');
}
}
@@ -306,7 +307,7 @@ class pm_extended extends private_message
return LAN_PM_12;
}
$pm_info = pm_getInfo('outbox');
$pm_info = $this->pmManager->pm_getInfo('outbox');
if($pm_info['outbox']['total'] != $_POST['numsent'])
{
return LAN_PM_14;
@@ -392,9 +393,9 @@ class pm_extended extends private_message
$totalsize += $_FILES['file_userfile']['size'][$fid];
}
if(intval($this->pmPrefs['pm_limit']) > 0)
if(intval($this->pmPrefs['pm_limits']) > 0)
{
if($this->pmPrefs['pm_limit'] == '1')
if($this->pmPrefs['pm_limits'] == '1')
{
if($pm_info['outbox']['total'] == $pm_info['outbox']['limit'])
{
@@ -443,7 +444,7 @@ class pm_extended extends private_message
*/
function pm_user_lookup()
{
global $sql;
$sql = e107::getDb();
$query = "SELECT * FROM #user WHERE user_name REGEXP '^".$_POST['keyword']."' ";
if($sql -> db_Select_gen($query))

View File

@@ -9,8 +9,8 @@
* PM plugin - base class API
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/pm/pm_class.php,v $
* $Revision: 1.11 $
* $Date: 2009-12-17 22:47:20 $
* $Revision: 1.12 $
* $Date: 2009-12-18 20:49:55 $
* $Author: e107steved $
*/
@@ -20,7 +20,7 @@
*
* @package e107_plugins
* @subpackage pm
* @version $Id: pm_class.php,v 1.11 2009-12-17 22:47:20 e107steved Exp $;
* @version $Id: pm_class.php,v 1.12 2009-12-18 20:49:55 e107steved Exp $;
*/
if (!defined('e107_INIT')) { exit; }
@@ -109,10 +109,12 @@ class private_message
*/
function add($vars)
{
$tp = $this->e107->tp;
$vars['options'] = '';
$pmsize = 0;
$attachlist = '';
$pm_options = '';
$ret = '';
if(isset($vars['receipt']) && $vars['receipt']) {$pm_options .= '+rr+'; }
if(isset($vars['uploaded']))
{
@@ -128,8 +130,8 @@ class private_message
}
$pmsize += strlen($vars['pm_message']);
$pm_subject = trim($this->e107->tp->toDB($vars['pm_subject']));
$pm_message = trim($this->e107->tp->toDB($vars['pm_message']));
$pm_subject = trim($tp->toDB($vars['pm_subject']));
$pm_message = trim($tp->toDB($vars['pm_message']));
if (!$pm_subject && !$pm_message && !$attachlist)
{ // Error - no subject, no message body and no uploaded files
@@ -161,7 +163,7 @@ class private_message
{
$toclass .= $u['user_name'].", ";
}
if(check_class($pm_prefs['notify_class'], $u['user_class']))
if(check_class($this->pmPrefs['notify_class'], $u['user_class']))
{
$vars['to_info'] = $u;
$this->pm_send_notify($u['user_id'], $vars, $pmid, count($a_list));
@@ -182,7 +184,7 @@ class private_message
{
if($pmid = $this->e107->sql->db_Insert('private_msg', "0, '".intval($vars['from_id'])."', '".$tp -> toDB($vars['to_info']['user_id'])."', '".intval($sendtime)."', '0', '{$pm_subject}', '{$pm_message}', '0', '0', '".$tp -> toDB($attachlist)."', '".$tp -> toDB($pm_options)."', '".intval($pmsize)."'"))
{
if(check_class($pm_prefs['notify_class'], $vars['to_info']['user_class']))
if(check_class($this->pmPrefs['notify_class'], $vars['to_info']['user_class']))
{
set_time_limit(30);
$this->pm_send_notify($vars['to_info']['user_id'], $vars, $pmid, count($a_list));
@@ -499,11 +501,11 @@ class private_message
$limit = intval($limit);
if ($limit < 2) { $limit = 10; }
$from = intval($from);
if($total_messages = $this->e107->sql->db_Count("private_msg", "(*)", "WHERE pm_to='{$uid}' AND pm_read_del=0"))
if($total_messages = $this->e107->sql->db_Count('private_msg', '(*)', "WHERE pm_to='{$uid}' AND pm_read_del=0"))
{
$qry = "
SELECT pm.*, u.user_image, u.user_name FROM #private_msg AS pm
LEFT JOIN #user AS u ON u.user_id = pm.pm_from
SELECT pm.*, u.user_image, u.user_name FROM `#private_msg` AS pm
LEFT JOIN `#user` AS u ON u.user_id = pm.pm_from
WHERE pm.pm_to='{$uid}' AND pm.pm_read_del=0
ORDER BY pm.pm_sent DESC
LIMIT ".$from.", ".$limit."
@@ -511,8 +513,8 @@ class private_message
if($this->e107->sql->db_Select_gen($qry))
{
$ret['messages'] = $this->e107->sql->db_getList();
$ret['total_messages'] = $total_messages;
}
$ret['total_messages'] = $total_messages; // Should always be defined
return $ret;
}
return FALSE;

View File

@@ -9,8 +9,8 @@
* Private messenger plugin - default preferences (used if no stored values)
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/pm/pm_default.php,v $
* $Revision: 1.3 $
* $Date: 2009-12-17 22:47:20 $
* $Revision: 1.4 $
* $Date: 2009-12-18 20:49:55 $
* $Author: e107steved $
*/
@@ -22,7 +22,7 @@
*
* @package e107_plugins
* @subpackage pm
* @version $Id: pm_default.php,v 1.3 2009-12-17 22:47:20 e107steved Exp $;
* @version $Id: pm_default.php,v 1.4 2009-12-18 20:49:55 e107steved Exp $;
*/
if (!defined('e107_INIT')) { exit; }
@@ -45,7 +45,8 @@ function pm_set_default_prefs()
'attach_size' => 500,
'sendall_class' => e_UC_ADMIN,
'multi_class' => e_UC_ADMIN,
'allow_userclass' => '1'
'allow_userclass' => '1',
'pm_limits' => '0'
);
return $ret;
}

View File

@@ -9,8 +9,8 @@
* PM plugin - template file
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/pm/pm_template.php,v $
* $Revision: 1.8 $
* $Date: 2009-12-17 22:47:20 $
* $Revision: 1.9 $
* $Date: 2009-12-18 20:49:55 $
* $Author: e107steved $
*/
@@ -20,15 +20,15 @@
*
* @package e107_plugins
* @subpackage pm
* @version $Id: pm_template.php,v 1.8 2009-12-17 22:47:20 e107steved Exp $;
* @version $Id: pm_template.php,v 1.9 2009-12-18 20:49:55 e107steved Exp $;
*/
if (!defined('e107_INIT')) { exit; }
global $sc_style;
global $sc_style; // Needed for the PM_REPLY shortcode!
define('PM_READ_ICON', "<img src='".e_PLUGIN_ABS."/pm/images/read.png' class='icon S16' alt='".LAN_PM_111."' />");
define('PM_UNREAD_ICON', "<img src='".e_PLUGIN_ABS."/pm/images/unread.png' class='icon S16' alt='".LAN_PM_27."' />");
if (!defined('PM_READ_ICON')) define('PM_READ_ICON', "<img src='".e_PLUGIN_ABS."/pm/images/read.png' class='icon S16' alt='".LAN_PM_111."' />");
if (!defined('PM_UNREAD_ICON')) define('PM_UNREAD_ICON', "<img src='".e_PLUGIN_ABS."/pm/images/unread.png' class='icon S16' alt='".LAN_PM_27."' />");
$sc_style['PM_ATTACHMENT_ICON']['pre'] = " ";

View File

@@ -1,109 +0,0 @@
<?php
/*
* e107 website system
*
* Copyright (C) 2008-2009 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
*
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/pm/pm_update.php,v $
* $Revision: 1.5 $
* $Date: 2009-11-18 01:05:53 $
* $Author: e107coders $
*/
if (!defined('e107_INIT')) { exit; }
set_time_limit(300);
include_lan(e_PLUGIN."pm/languages/admin/".e_LANGUAGE.".php");
$sql->db_Update("plugin", "plugin_name=".ADLAN_PM." WHERE plugin_path='pm'");
require_once(e_HANDLER.'plugin_class.php');
$plugin = new e107plugin;
$sql -> db_Select_gen("
CREATE TABLE ".MPREFIX."private_msg (
pm_id int(10) unsigned NOT NULL auto_increment,
pm_from int(10) unsigned NOT NULL default '0',
pm_to varchar(250) NOT NULL default '',
pm_sent int(10) unsigned NOT NULL default '0',
pm_read int(10) unsigned NOT NULL default '0',
pm_subject text NOT NULL,
pm_text text NOT NULL,
pm_sent_del tinyint(1) unsigned NOT NULL default '0',
pm_read_del tinyint(1) unsigned NOT NULL default '0',
pm_attachments text NOT NULL,
pm_option varchar(250) NOT NULL default '',
pm_size int(10) unsigned NOT NULL default '0',
PRIMARY KEY (pm_id)
) TYPE=MyISAM AUTO_INCREMENT=1 ;");
$sql -> db_Select_gen("
CREATE TABLE ".MPREFIX."private_msg_block (
pm_block_id int(10) unsigned NOT NULL auto_increment,
pm_block_from int(10) unsigned NOT NULL default '0',
pm_block_to int(10) unsigned NOT NULL default '0',
pm_block_datestamp int(10) unsigned NOT NULL default '0',
pm_block_count int(10) unsigned NOT NULL default '0',
PRIMARY KEY (pm_block_id)
) TYPE=MyISAM AUTO_INCREMENT=1 ;");
//$plugin -> manage_plugin_prefs('add', 'plug_sc', 'pm', 'SENDPM'); // Obsolete pref
pm_convert();
function pm_convert()
{
global $sql, $uinfo;
$sql2 =& new db;
$count = 0;
if($sql->db_Select("pm_messages","*"))
{
while($row = $sql->db_Fetch())
{
$from = pm_convert_uid($row['pm_from_user']);
$to = pm_convert_uid($row['pm_to_user']);
$size = strlen($row['pm_message']);
if($sql2->db_Insert("private_msg", "0, '".intval($from)."', '{$to}', '".intval($row['pm_sent_datestamp'])."', '".intval($row['pm_rcv_datestamp'])."', '{$row['pm_subject']}', '{$row['pm_message']}', '0', '0', '', '', '".intval($size)."'"))
{
//Insertion of new PM successful, delete old
$sql2->db_Delete("pm_messages", "pm_id='{$row['pm_id']}'");
$count++;
}
}
}
}
function pm_convert_uid($name)
{
global $uinfo, $tp;
$sqlu =& new db;
$name = trim($name);
if(!array_key_exists($uinfo[$name]))
{
if($sqlu->db_Select("user", "user_id", "user_name LIKE '".$tp -> todb($name, TRUE)."'"))
{
$row = $sqlu->db_Fetch();
$uinfo[$name] = $row['user_id'];
}
else
{
if($sqlu->db_Select("user", "user_id", "user_loginname LIKE '".$tp -> todb($name, TRUE)."'"))
{
$row = $sqlu->db_Fetch();
$uinfo[$name] = $row['user_id'];
}
else
{
return FALSE;
}
}
}
return $uinfo[$name];
}
?>

View File

@@ -1,38 +0,0 @@
<?php
/*
* e107 website system
*
* Copyright (C) 2008-2009 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
*
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/pm/pm_update_check.php,v $
* $Revision: 1.3 $
* $Date: 2009-11-18 01:05:53 $
* $Author: e107coders $
*/
if (!defined('e107_INIT')) { exit; }
include_lan(e_PLUGIN."pm/languages/admin/".e_LANGUAGE.".php");
$dbupdatep['pm_07'] = LAN_UPDATE_8." .617 ".ADLAN_PM_58." ".LAN_UPDATE_9." .7 ".ADLAN_PM_58;
function update_pm_07($type) {
global $sql, $mySQLdefaultdb;
if ($type == 'do') {
include_once(e_PLUGIN.'pm/pm_update.php');
} else {
if ($sql -> db_Select("plugin", "*", "plugin_path = 'pm_menu' AND plugin_installflag='1'")) {
if ($sql -> db_Count('pm_messages', '(*)')) {
return FALSE;
} else {
return TRUE;
}
} else {
return TRUE;
}
}
}
?>