Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Cleanup extension deleted the wrong forum...

edited June 2006 in Vanilla 1.0 Help
I have several seperate forums running on my server, with different table prefixes but in the same database.
Now I just ran the cleanup extension to remove all the discussions and comments from one of these forums (with a custom prefix) but It left that untouched and proceeded to wipe the default LUM_ prefixed tables which I really didn't want it to do.

Is the LUM_ prefix hardcoded into the extension?


  • edited June 2006
    im asumming it is, i will check...the answer is yes it is... it starts line 230 $Sql = 'truncate table LUM_DiscussionUserWhisperFrom'; $this->Context->Database->Execute($Sql, $this->Name, 'Constructor', 'An error occurred while attempting to truncate whisper relationships.'); thats the start, also there is only about 5 or 6 prefixes to change. can someone tell me how to do the code things?
  • Shouldn't it pull the prefix from the conf file? How would I edit it to do that?
  • hehe wait til someone who knows what they are doing comes on...i will try but i dont do much php and i am new to vanilla...ill look around.
  • Hmm, i didnt realise the cleanup had been updated to work with v1, when did that happen? In any case you'd need to swap out lum_ for $this->Context->Configuration['DATABASE_TABLE_PREFIX'], I'd do it something like this but it's probably a messy way cause i'm not much use: $Sql = 'truncate table '.$this->Context->Configuration['DATABASE_TABLE_PREFIX'].'DiscussionUserWhisperFrom'; Basically it's just a search and replace on LUM_ with '.$this->Context->Configuration['DATABASE_TABLE_PREFIX'].' for those couple of values in the default.php file. Use at your own risk though (and congrats for finding this bug the hard way ;))
  • edited June 2006
    you could make it abit prettier by saying $prefix = '$this->Context->Configuration['DATABASE_TABLE_PREFIX']'; //have this somewhere above the sql queries $Sql = 'truncate table ' .$prefix. 'DiscussionUserWhisperFrom'; I personally think that it looks nicer
  • I wrote that initially, then changed it. *shrug.
  • lol :P oh well doesnt really matter both should work.
This discussion has been closed.