Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-04-2007, 04:20 PM
ceedee ceedee is offline
 
Join Date: Sep 2003
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Keep PM's in database permanently, even if deleted by user

Hi all,

I am currently running the "Read PM's" mod on my forum which is great. However if a user deletes a PM it of course deletes it from the database, and therefore Read PM's can't see it.

Is there anyone out there who can create a mod for the PM system such that when a user deletes a PM, it just hides it from them (as though it were deleted, but it permanently remains in the database)? It also needs to make the system that counts how many PMs a user has ignore the 'hidden' PMs so that they don't constantly get warned about being at their PM storage limit.

That would be wonderful if one of you could write something that does that!

Cheers,

Chris
Reply With Quote
  #2  
Old 10-04-2007, 04:29 PM
Analogpoint's Avatar
Analogpoint Analogpoint is offline
 
Join Date: Feb 2007
Posts: 656
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

From a technical standpoint, that would be no big deal, but I don't know, you might have some legal/privacy issues with it, unless you fully disclose what's going on.
Reply With Quote
  #3  
Old 10-04-2007, 04:45 PM
WhaLberg's Avatar
WhaLberg WhaLberg is offline
 
Join Date: Nov 2006
Location: Dersaadet
Posts: 569
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

And some minor database changes might do this.
Reply With Quote
  #4  
Old 10-05-2007, 06:21 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A PM consists of 2 database entries:
- 1 pmtext row, containing the PM-text and sender/receipant details
- 1 row in the 'pm' table for each sender (Send Items) and 1 row for each receipant.

When someone deletes a PM, only the row in the 'pm' table gets deleted. Once an hour ./includes/cron/cleanup2.php is ran, which will delete all pmtext rows that don't have a row in the 'pm' table anymore.

To keep all PM (text), you could simply remove the coding from cleanup2.php that cleans the pmtext table:
PHP Code:
// Orphaned pmtext records are removed after one hour.
// When we delete PMs we only delete the pm record, leaving
// the pmtext record alone for this script to clean up
$pmtexts $vbulletin->db->query_read("
 SELECT pmtext.pmtextid
 FROM " 
TABLE_PREFIX "pmtext AS pmtext
 LEFT JOIN " 
TABLE_PREFIX "pm AS pm USING(pmtextid)
 WHERE pm.pmid IS NULL
"
);
if (
$vbulletin->db->num_rows($pmtexts))
{
 
$pmtextids '0';
 while (
$pmtext $vbulletin->db->fetch_array($pmtexts))
 {
  
$pmtextids .= ",$pmtext[pmtextid]";
 }
 
$vbulletin->db->query_write("DELETE FROM " TABLE_PREFIX "pmtext WHERE pmtextid IN($pmtextids)");
}
$vbulletin->db->free_result($pmtexts); 
Reply With Quote
  #5  
Old 10-08-2007, 01:40 AM
Hornstar Hornstar is offline
 
Join Date: Jun 2005
Location: Australia
Posts: 2,469
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I doubt read pm mod would work if the above was done, you would need to search through your database manually instead of using the read pm mod if you do this, unless you get the read pm mod modified. may be wrong tho.
Reply With Quote
Reply


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 10:34 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.05476 seconds
  • Memory Usage 2,202KB
  • Queries Executed 11 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete