View Issue Details

IDProjectCategoryView StatusLast Update
0000372XMB1Bugspublic2010-12-23 02:02
ReporterJohn Briggs Assigned Tomiqrogroove  
PrioritynormalSeveritytweakReproducibilityhave not tried
Status closedResolutionfixed 
Target Version1.9.11.10Fixed in Version1.9.11.10 
Summary0000372: Copy Recent Changes From forumdisplay.php to Other Files?
DescriptionNeed to look at memcp.php and today.php, decide which patches for forumdisplay should apply to similar scripts, and make those changes. See 0000370 and 0000368.
TagsNo tags attached.
MySQL Version
PHP Version
Web Server
Browser
Flags
Original Reporter
SVN Revision2384

Activities

2010-04-25 07:30

 

proposedfix.txt (1,109 bytes)   
add in cp.php where members are deleted.

below this

$db->query("DELETE FROM ".X_PREFIX."members WHERE uid=$delete");

					$qf = $db->query("SELECT fid, lastpost FROM ".X_PREFIX."forums WHERE lastpost LIKE '%|$dbname|%'");
					while($result = $db->fetch_array($qf)) {
						$newlastpost = str_replace("|$dbname|", "|Anonymous|", $db->escape_var($result['lastpost']));
						$db->query("UPDATE ".X_PREFIX."forums SET lastpost='$newlastpost' WHERE fid={$result['fid']}");
					}
					$db->free_result($qf);

					$qt = $db->query("SELECT tid, lastpost FROM ".X_PREFIX."threads WHERE lastpost LIKE '%|$dbname|%'");
					while($result = $db->fetch_array($qt)) {
						$newlastpost = str_replace("|$dbname|", "|Anonymous|", $db->escape_var($result['lastpost']));
						$db->query("UPDATE ".X_PREFIX."threads SET lastpost='$newlastpost' WHERE tid={$result['tid']}");
					}
					$db->free_result($qt);
					
					$db->query("UPDATE ".X_PREFIX."posts SET author='Anonymous' WHERE author='$dbname'");
					$db->query("UPDATE ".X_PREFIX."threads SET author='Anonymous' WHERE author='$dbname'");
proposedfix.txt (1,109 bytes)   

John Briggs

2010-04-25 07:30

reporter   ~0000250

Add this if you delete member but want to keep posts. This actually resolves the entire situation from what I tested. There may be conditions I have not foreseen though. You may be able to code it better in cp.php than I did. Saves all that trouble.

Proposed fix attached.

miqrogroove

2010-04-25 11:33

administrator   ~0000251

I think the attachment makes a nice "hack" for XMB. Some boards would appreciate the added behavior. Some would not. Some would need a second tool to "convert" posts by authors who were already deleted.

John Briggs

2010-04-25 15:08

reporter   ~0000252

all easy. as for being a hack. that's an opinion. either way, it lacks logic when deleting a member. A good hard look at the cp.php portion needs to be done.

miqrogroove

2010-05-15 21:16

administrator   ~0000259

As discussed, cp.php not modified because proposed behavior would not fix the display of links that are already broken. The proposed changes can be developed within the community for hacks and future versions.

memcp.php and today.php are now aligned with forumdisplay.php.

Issue History

Date Modified Username Field Change
2010-04-08 10:35 miqrogroove New Issue
2010-04-08 10:36 miqrogroove Reporter miqrogroove => John Briggs
2010-04-25 07:30 John Briggs File Added: proposedfix.txt
2010-04-25 07:30 John Briggs Note Added: 0000250
2010-04-25 11:33 miqrogroove Note Added: 0000251
2010-04-25 15:08 John Briggs Note Added: 0000252
2010-05-15 19:40 miqrogroove Status new => assigned
2010-05-15 19:40 miqrogroove Assigned To => miqrogroove
2010-05-15 21:16 miqrogroove SVN Revision => 2384
2010-05-15 21:16 miqrogroove Note Added: 0000259
2010-05-15 21:16 miqrogroove Status assigned => resolved
2010-05-15 21:16 miqrogroove Fixed in Version => 1.9.11.10
2010-05-15 21:16 miqrogroove Resolution open => fixed
2010-12-23 02:02 miqrogroove Status resolved => closed