Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases

Reply
 
Thread Tools
Delete PM sent before user reads it Details »»
Delete PM sent before user reads it
Version: 1.0, by pie pie is offline
Developer Last Online: Dec 2005 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 03-23-2005 Last Update: 05-26-2005 Installs: 24
DB Changes
 
No support by the author.

Update:
27th May 2005 -
Counters update on deletion. PM is now authenticated to user.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 03-28-2005, 06:25 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by why-not
How about adding a userid to the query! Sure it would be difficult to know who has unread PM(s), but all one has to do is start sending requests with PM ids and they can delete all unread PM(s) even ones that are not theirs! Then you should also check the request, because allowing what you allow, can end up with anyone reading any table they want or even delete your whole database! Nice idea, but it needs to be made secure!

Sonia
How would you do that exactly?
Reply With Quote
  #23  
Old 03-28-2005, 06:29 PM
nexialys
Guest
 
Posts: n/a
Default

the best way would be to have a dropdown with multiple choices where you select the users that need to be deleted from the list of receiving the pm ... so if there is only one receiver, the dropdown will be a single choice... if we choose nobody, no pm will be deleted...
Reply With Quote
  #24  
Old 03-29-2005, 01:30 AM
pie pie is offline
 
Join Date: May 2003
Location: Devon, England
Posts: 226
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by why-not
How about adding a userid to the query! Sure it would be difficult to know who has unread PM(s), but all one has to do is start sending requests with PM ids and they can delete all unread PM(s) even ones that are not theirs! Then you should also check the request, because allowing what you allow, can end up with anyone reading any table they want or even delete your whole database! Nice idea, but it needs to be made secure!

Sonia
Very good point... I have to say silly me for not doing it.

Quote:
That is the only draw back stoping me from using it.
Theres nothing that can be done about that, unfortunatly you can't pull back emails. I could do a "This PM has been deleted" error message if you guys'd prefer.

Quote:
the best way would be to have a dropdown with multiple choices where you select the users that need to be deleted from the list of receiving the pm ... so if there is only one receiver, the dropdown will be a single choice... if we choose nobody, no pm will be deleted...
Thats a good idea, the fact that it could be for mulitple users completly slipped my mind. I'd probally do checkboxes rather than a list purely because i find checkboxes easier and I want them as easy as possible.
Reply With Quote
  #25  
Old 03-29-2005, 04:06 PM
Dennis Olson Dennis Olson is offline
 
Join Date: Jul 2004
Location: Wisconsin
Posts: 137
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A couple of points:

1) The delete function LEAVES the tracking notice in your tracking folder. How can that be removed at the same time? (After all, you don't need the tracking notice anymore).

2) You create the following phrase:

Phrase Type: Private Messaging
Varname: was_deleted
Text: You deleted it!


but in your EVAL statement, you use:

eval(print_standard_redirect('deleted_private_mess ages_successfully'));

Thus never referencing that phrase....
Reply With Quote
  #26  
Old 03-29-2005, 05:16 PM
pie pie is offline
 
Join Date: May 2003
Location: Devon, England
Posts: 226
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dennis Olson
A couple of points:

1) The delete function LEAVES the tracking notice in your tracking folder. How can that be removed at the same time? (After all, you don't need the tracking notice anymore).

2) You create the following phrase:

Phrase Type: Private Messaging
Varname: was_deleted
Text: You deleted it!


but in your EVAL statement, you use:

eval(print_standard_redirect('deleted_private_mess ages_successfully'));

Thus never referencing that phrase....
Yes. This hack is still not 100% Featured, I will be adding it so that in the Sent Messages folder, it'll show that it was deleted and thus didn't get through.
Reply With Quote
  #27  
Old 04-03-2005, 03:16 AM
DivisionByZero's Avatar
DivisionByZero DivisionByZero is offline
 
Join Date: Dec 2002
Location: South Bend, Indiana
Posts: 485
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dennis Olson
A couple of points:

1) The delete function LEAVES the tracking notice in your tracking folder. How can that be removed at the same time? (After all, you don't need the tracking notice anymore).
I would like to leave the tracking message just to remind the sender that he deleted it. But, I would like to have the "Delete Their PM!" link removed. The way it stands now, if the sender deletes the PM, the "Delete Their PM" link is still active. This could be gotten rid of to prevent an error message.
Reply With Quote
  #28  
Old 04-03-2005, 05:03 AM
DivisionByZero's Avatar
DivisionByZero DivisionByZero is offline
 
Join Date: Dec 2002
Location: South Bend, Indiana
Posts: 485
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, in the meantime, while pie works on the authenticate_sender_before_delete scheme, I added a quick fix to it. It's simple.. It replaces the entire request routine and here it is:

PHP Code:
if ($_REQUEST['do'] == "deleteunread")
{
$pm $_GET['pm'];

// check to see if it is still unread and the user hasn't dilly-dallied
        
$pmquery $DB_site->query("SELECT * FROM " TABLE_PREFIX "pm WHERE pmid='$pm'");
        
$pmnum $DB_site->num_rows($pmquery);

        if (
$pmnum == 0)
        {
            
$idname $vbphrase['private_message'];
            eval(
print_standard_error('invalidid'));
        }

     
$pmquery $DB_site->query("SELECT * FROM " TABLE_PREFIX "pm WHERE pmid=$pm AND messageread=0");
        if (
$DB_site->num_rows($pmquery) == 0)
        {
            eval(
print_standard_error('hasbeenread'));
        }
        
// check to the actual sender of the PM is the one trying to delete it. Done by chris
        
$suspectuser $bbuserinfo['userid'];
    
$senderquery $DB_site->query("SELECT userid FROM " TABLE_PREFIX "pmreceipt WHERE pmid=$pm AND readtime=0");
        
$senderresult mysql_fetch_assoc($senderquery);
        if (
$senderresult['userid'] == $suspectuser) {

        
$receiptSql "UPDATE " TABLE_PREFIX "pmreceipt SET deleted=1 WHERE pmid=$pm";
        
$DB_site->query($receiptSql);

        
$deletePmSql "DELETE FROM " TABLE_PREFIX "pm WHERE pmid=" $pm;
        
$DB_site->query($deletePmSql);        

        
$url "private.php?$session[sessionurl]do=trackpm";
        eval(
print_standard_redirect('deleted_private_messages_successfully'));
        }
        else {
        
$idname $vbphrase['private_message'];
        eval(
print_standard_error('invalidid'));
        }

Reply With Quote
  #29  
Old 04-03-2005, 05:18 AM
DivisionByZero's Avatar
DivisionByZero DivisionByZero is offline
 
Join Date: Dec 2002
Location: South Bend, Indiana
Posts: 485
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

To replace the "Delete Their PM!" link if the PM has already been deleted by the sender, do the following:

In private.php, find

PHP Code:
 $pmreceipts $DB_site->query("
        SELECT
            pmreceipt.*, pmreceipt.pmid AS receiptid
        FROM " 
TABLE_PREFIX "pmreceipt AS pmreceipt
        WHERE pmreceipt.userid = 
$bbuserinfo[userid]
        ORDER BY pmreceipt.sendtime DESC
    "
); 
Replace with:
PHP Code:
    $pmreceipts $DB_site->query("
        SELECT
            deleted, pmreceipt.*, pmreceipt.pmid AS receiptid
        FROM " 
TABLE_PREFIX "pmreceipt AS pmreceipt
        WHERE pmreceipt.userid = 
$bbuserinfo[userid]
        ORDER BY pmreceipt.sendtime DESC
    "
); 
The pm_receiptsbit template replacement string should be changed to:
HTML Code:
		<td class="alt2"><span class="smallfont"><if condition="$show['readpm']">$receipt[read_date] <span class="time">$receipt[read_time]</span><else /><em>$vbphrase[unread_date]<br /><if condition="$receipt[deleted] == '0'"><a href="private.php?$sesion[sessionurl]do=unsend&amp;pm=$receipt[receiptid]">$vbphrase[deleteunread]</a><else />$vbphrase[was_deleted]</if></em></if></td>
Reply With Quote
  #30  
Old 04-12-2005, 10:05 PM
pie pie is offline
 
Join Date: May 2003
Location: Devon, England
Posts: 226
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You saying you want an Undelete?
Reply With Quote
  #31  
Old 04-12-2005, 11:29 PM
DivisionByZero's Avatar
DivisionByZero DivisionByZero is offline
 
Join Date: Dec 2002
Location: South Bend, Indiana
Posts: 485
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, i noticed now if a user deletes the PM WITHOUT reading it, the receipt should be processed as "confirmed" and not have the "delete their pm" availability anymore.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:32 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06184 seconds
  • Memory Usage 2,329KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_html
  • (3)bbcode_php
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete