vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Keep PM's in database permanently, even if deleted by user (https://vborg.vbsupport.ru/showthread.php?t=159475)

ceedee 10-04-2007 04:20 PM

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 :)

Analogpoint 10-04-2007 04:29 PM

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.

WhaLberg 10-04-2007 04:45 PM

And some minor database changes might do this.

Marco van Herwaarden 10-05-2007 06:21 AM

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); 


Hornstar 10-08-2007 01:40 AM

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.


All times are GMT. The time now is 07:02 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00984 seconds
  • Memory Usage 1,721KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete