Author Topic: [MOD] Private Message System (PMS) not supported anymore!  (Read 126946 times)

0 Members and 1 Guest are viewing this topic.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[MOD] Private Message System (PMS)
« Reply #15 on: May 01, 2003, 08:48:25 PM »
Found little bug (already updated the package)
when u edit messages in the Outbox, it wouldnt update recipent if u change it.
so, in pms.php find:
Code: [Select]
           SET pms_date = $time, pms_subject = '$subject', pms_text = '$message', pms_bbcode = $bbcode, pms_html = $html, pms_ip = '".$session_info['session_ip']."'
Replace with:
Code: [Select]
           SET pms_date = $time, pms_to = $user_id, pms_subject = '$subject', pms_text = '$message', pms_bbcode = $bbcode, pms_html = $html, pms_ip = '".$session_info['session_ip']."'
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[MOD] Private Message System (PMS)
« Reply #16 on: May 01, 2003, 10:59:53 PM »
Quote from: Cr@zy Sash
no i mean just a admin function maybe put as plugin in admin panel...

Great idea!

here u go the plugin:

Update 05-04-2003 8pm (EST)

---------| Installation |----------------

Create /admin/plugins/pms_to_members.php
with this code:
Code: [Select]
<?php // PLUGIN_TITLE&#58; Send PMs to members

$nozip 1;
define&#40;'IN_CP', 1&#41;;
$root_path = &#40;eregi&#40;"\/plugins\/", $PHP_SELF&#41;&#41; ? "./../../" &#58; "./../";
define&#40;'ROOT_PATH', $root_path&#41;;
require&#40;ROOT_PATH.'admin/admin_global.php'&#41;;
if &#40;$action == ""&#41; &#123;
  
$action "pmsusers";
&
#125;

show_admin_header&#40;&#41;;

if &#40;$action == "sendpms"&#41; &#123;
  
$error = array&#40;&#41;;
  
$stealth = &#40;$HTTP_POST_VARS['stealth'&#93;&#41; ? 1 &#58; 0;
  
$subject stripslashes&#40;trim&#40;$HTTP_POST_VARS['subject'&#93;&#41;&#41;;
  
$message stripslashes&#40;trim&#40;$HTTP_POST_VARS['message'&#93;&#41;&#41;;

  
if &#40;$subject == ""&#41; &#123;
    
$error['subject'&#93; = 1;
  
&#125;
  
if &#40;$message == ""&#41; &#123;
    
$error['message'&#93; = 1;
  
&#125;
  
if &#40;!isset&#40;$HTTP_POST_VARS['pms'&#93;&#41; || empty&#40;$HTTP_POST_VARS['pms'&#93;&#41;&#41; &#123;
    
$error['pms'&#93; = 1;
  
&#125;
  
if &#40;empty&#40;$error&#41;&#41; &#123;
    
$pms $HTTP_POST_VARS['pms'&#93;;
include&#40;ROOT_PATH.'includes/email.php'&#41;;
foreach &#40;$pms as $key&#41; &#123;
if &#40;$key&#41; &#123;
$sql "INSERT INTO ".PMS_TABLE."
&#40;pms_date, pms_to, pms_from, pms_subject, pms_type, pms_text, pms_bbcode, pms_html, pms_ip&#41;
VALUES
&#40;"
.time&#40;&#41;.", ".$key.", ".&#40;&#40;$stealth&#41; ? 0 &#58; $user_info['user_id'&#93;&#41;.", '".$subject."', ".PMS_UNREAD.", '".$message."', 1, 1, '0'&#41;";
$result $site_db->query&#40;$sql&#41;;
$result_error = &#40;$result&#41; ? $result_error &#58; $result_error++;
$user_to get_user_info&#40;$key&#41;;
if &#40;$user_to['user_pms_email'&#93;&#41;&#123;
     @set_time_limit&#40;1200&#41;;
$site_email = new Email&#40;&#41;;
// $pms_url = "http&#58;//come.no-ip.com/pms.php?action=view&mode=inbox&id=".$site_db->get_insert_id&#40;&#41;;
$pms_url $script_url."/pms.php?action=view&mode=inbox&id=".$site_db->get_insert_id&#40;&#41;;
$site_email->set_to&#40;$user_to['user_email'&#93;&#41;;
$site_email->set_subject&#40;$lang['pms_email_new'&#93;&#41;;
$site_email->register_vars&#40;array&#40;
  "user_name" => $user_to['user_name'&#93;,
//   "site_url" => "http&#58;//come.no-ip.com",
  "site_url" => $script_url,
  "url" => $pms_url,
  "site_name" => $config['site_name'&#93;
&#41;&#41;;
$site_email->set_body&#40;"pms_notify", $config['language_dir_default'&#93;&#41;;
$site_email->send_email&#40;&#41;;
&#125;
&#125;
&#125;
    
echo &#40;!$result_error&#41; ? "Messages sent successfully" &#58; "Error sending messages";
    
echo "<p>";
    
show_text_link&#40;$lang['back'&#93;, "javascript&#58;history.back&#40;1&#41;"&#41;;
  
&#125;
  
else &#123;
    
$msg sprintf&#40;"<span class=\"marktext\">%s</span>", $lang['lostfield_error'&#93;&#41;;
    
$action "pmsusers";
  &
#125;
&#125;

if &#40;$action == "pmsusers"&#41; &#123;
  
if &#40;$msg != ""&#41; &#123;
    
printf&#40;"<b>%s</b>\n", $msg&#41;;
  
&#125;
  
show_form_header&#40;"pms_to_members.php", "sendpms"&#41;;
  
show_table_header&#40;"Send PMs", 2&#41;;
  
show_input_row&#40;"Subject", "subject", "", 45&#41;;
  
show_textarea_row&#40;"Message", "message", "", 60, 20&#41;;

  
$select "<select name=\"pms[&#93;\" size=\"15\" multiple=\"multiple\">\n";

  
$sql "SELECT ".get_user_table_field&#40;"", "user_id"&#41;.get_user_table_field&#40;", ", "user_level"&#41;.get_user_table_field&#40;", ", "user_name"&#41;."
          
FROM ".USERS_TABLE."
          
WHERE ".get_user_table_field&#40;"", "user_id"&#41;." <> ".GUEST." AND ".get_user_table_field&#40;"", "user_id"&#41;." <> ".$user_info['user_id'&#93;."
          
ORDER BY ".get_user_table_field&#40;"", "user_level"&#41;." DESC".get_user_table_field&#40;"", "user_name"&#41;." ASC";
  
$result = $site_db->query&#40;$sql&#41;;

  
$level = 1000;
  while &#40;
$row = $site_db->fetch_array&#40;$result&#41;&#41; &#123;
    
$user_level = $row[$user_table_fields['user_level'&#93;&#93;;
    if &#40;
$level != $user_level && $user_level == ADMIN&#41; &#123;
      
$select .= "<option value=\"0\">__________________________</option>\n";
      
$select .= "<option value=\"0\" class=\"dropdownmarker\">".$lang['userlevel_admin'&#93;."</option>\n";
    
&#125;
    
elseif &#40;$level != $user_level && $user_level == USER&#41; &#123;
      
$select .= "<option value=\"0\">__________________________</option>\n";
      
$select .= "<option value=\"0\" class=\"dropdownmarker\">".$lang['userlevel_registered'&#93;."</option>\n";
    
&#125;
    
elseif &#40;$level != $user_level && $user_level == USER_AWAITING&#41; &#123;
      
$select .= "<option value=\"0\">__________________________</option>\n";
      
$select .= "<option value=\"0\" class=\"dropdownmarker\">".$lang['userlevel_registered_awaiting'&#93;."</option>\n";
    
&#125;
    
$user_id $row[$user_table_fields['user_id'&#93;&#93;;
    
$user_name $row[$user_table_fields['user_name'&#93;&#93;;
    
$selected = &#40;isset&#40;$HTTP_POST_VARS['pms'&#93;&#41; && !in_array&#40;$user_id, $HTTP_POST_VARS['pms'&#93;&#41;&#41; ? "" &#58; " selected=\"selected\"";
    
$select .= "<option value=\"".$user_id."\"".$selected.">&raquo; ".$user_name."</option>\n";
    
$level $user_level;
  &
#125;
  
$select .= "</select>\n";

  
$title $lang['select_email_user'&#93;;
  
if &#40;isset&#40;$error['pms'&#93;&#41;&#41; &#123;
    
$title sprintf&#40;"<span class=\"marktext\">%s *</span>", $title&#41;;
  
&#125;
  
$stealth = &#40;isset&#40;$HTTP_POST_VARS['stealth'&#93;&#41;&#41; ? " checked" &#58; "";
  
show_custom_row&#40;$title, $select&#41;;
  
show_custom_row&#40;"", "<input type=\"checkbox\" name=\"stealth\" value=\"1\"".$stealth."> Stealth mode. If u check this, member wont know from who the message came"&#41;;
  
show_form_footer&#40;"Send", "", 2&#41;;
&#125;

show_admin_footer&#40;&#41;;
?>



if u did everything correctly, u'll find new link at the left-bottom in the Admin Control Panel.


If u already installed the MOD and whant use "Stealth" mode, u'll need do small correction in the MOD (I have updated the original MOD):

in pms.php find:
Code: [Select]
$user_id = $result['pms_from'];
$reply = 1;

Replace with:
Code: [Select]
$user_id = ($result['pms_from']) ? $result['pms_from'] : 0;
$reply = ($user_id) ? 1 : 0;
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline jackie911

  • Newbie
  • *
  • Posts: 41
    • View Profile
Great !!
« Reply #17 on: May 02, 2003, 03:15:05 AM »
Great Thanks to ALL.

 :lol:

Offline O.K.

  • Pre-Newbie
  • Posts: 2
    • View Profile
[MOD] Private Message System (PMS)
« Reply #18 on: May 03, 2003, 07:22:06 PM »
I think it would be great to send e-mail notification to user which received private message. And the other thing is pop-up window, when user logins, if she / he has got a new private message. :)

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[MOD] Private Message System (PMS)
« Reply #19 on: May 03, 2003, 08:20:02 PM »
yes, I just updated the original post.
U will need redo almost all steps :(
even run pms_install.php script one time (if u see some errors about tables dublication, just ignore them)
also, the plugin was updated too.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline matthew

  • Newbie
  • *
  • Posts: 22
    • View Profile
    • http://www.seclusion.org
[MOD] Private Message System (PMS)
« Reply #20 on: May 04, 2003, 04:05:18 AM »
So far some things seem to be working. I already had a phpbb forum and its displaying when I have message there in the popup. However when I try to click on the PM field in the comment section or profile, I get the following:

Fatal error: Call to undefined function: get_smiles_text() in /home/test/public_html/pms.php on line 222

Any ideas?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[MOD] Private Message System (PMS)
« Reply #21 on: May 04, 2003, 04:22:07 AM »
ops...
either redownload the package and replace your pms.php
or open pms.php find:
Code: [Select]
     "smiles_text" => get_smiles_text()delete it, and also delete coma ( , ) at the end of line above that one.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline matthew

  • Newbie
  • *
  • Posts: 22
    • View Profile
    • http://www.seclusion.org
[MOD] Private Message System (PMS)
« Reply #22 on: May 04, 2003, 04:48:30 AM »
Thanks V@no, works great!

Offline Bomba

  • Full Member
  • ***
  • Posts: 202
    • View Profile
[MOD] Private Message System (PMS)
« Reply #23 on: May 05, 2003, 12:11:45 AM »
and what about the picture comments, can they be forward to picture owner inbox?
i think it would be really cool :)

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[MOD] Private Message System (PMS)
« Reply #24 on: May 05, 2003, 12:59:55 AM »
Quote from: Bomba
and what about the picture comments, can they be forward to picture owner inbox?
i think it would be really cool :)

and what do want to do with comments posted by guests?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Bomba

  • Full Member
  • ***
  • Posts: 202
    • View Profile
[MOD] Private Message System (PMS)
« Reply #25 on: May 05, 2003, 01:40:53 AM »
in my gallery, guests are not allowed to comment
only registed members can

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[MOD] Private Message System (PMS)
« Reply #26 on: May 05, 2003, 02:05:08 AM »
Fixed little bug, that didnt sort correctly messages by recipient/sender name.
in pms.php find:
Code: [Select]
$order_by = "pms_".$sort." ".$sort_order.", pms_".$sort_default." ".$sort_order;Replace with:
Code: [Select]
$order_by = (($sort == $box_table) ? "u.user_name" : "pms_".$sort)." ".$sort_order.", pms_".$sort_default." ".$sort_order;
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline jackie911

  • Newbie
  • *
  • Posts: 41
    • View Profile
Runtime Error
« Reply #27 on: May 05, 2003, 06:05:13 PM »
I used the smile text for bbcode.  Unfortunately, there are some errors.
I'm not an expert, please help me to debug it.

http://jackie.net/barndisco.com/album/pms.php?action=new

Jackie
jackie911@so-net.com.hk

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Runtime Error
« Reply #28 on: May 05, 2003, 06:24:01 PM »
Quote from: jackie911
I used the smile text for bbcode.  Unfortunately, there are some errors.
I'm not an expert, please help me to debug it.


Nothing personaly, but next time I wont even click :roll:


I'm not sure what u did, but I have tryed your site yesterday and it was working perfectly!
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline jackie911

  • Newbie
  • *
  • Posts: 41
    • View Profile
Re: Runtime Error
« Reply #29 on: May 05, 2003, 07:57:33 PM »
Where can I insert this code to pms.php

Code: [Select]
"smiles_text" => get_smiles_text()


Quote from: V@no
Quote from: jackie911
I used the smile text for bbcode.  Unfortunately, there are some errors.
I'm not an expert, please help me to debug it.


Nothing personaly, but next time I wont even click :roll:


I'm not sure what u did, but I have tryed your site yesterday and it was working perfectly!