Improve legibility for inserting reaction types on update
authorJoshua Rüsweg <josh@bastelstu.be>
Mon, 6 Aug 2018 14:44:03 +0000 (16:44 +0200)
committerJoshua Rüsweg <josh@bastelstu.be>
Mon, 6 Aug 2018 14:44:03 +0000 (16:44 +0200)
See #2508

wcfsetup/install/files/acp/update-com.woltlab.wcf_3.2_reactionUpdate.php

index a8117dbd7e0d037b48f9d4f814cf106b82c4d909..d20936ec42ddeddd1c8f6d74229182761fd7b592 100644 (file)
@@ -24,8 +24,16 @@ OptionEditor::import([
 try {
        WCF::getDB()->beginTransaction();
        
+       $reactionTypes = <<<DATA
+('wcf.reactionType.title1', 1, 1, 'like.svg'), 
+('wcf.reactionType.title2', 1, 2, 'haha.svg'), 
+('wcf.reactionType.title3', -1, 3, 'sad.svg'),
+('wcf.reactionType.title4', 0, 4, 'confused.svg'),
+('wcf.reactionType.title5', 1, 5, 'thanks.svg'),
+DATA;
+       
        // add reaction columns 
-       $statement = WCF::getDB()->prepareStatement(str_replace('wcf1_', 'wcf'.WCF_N.'_', 'INSERT INTO wcf1_reaction_type (title, type, showOrder, iconFile) VALUES (\'wcf.reactionType.title1\', 1, 1, \'like.svg\'), (\'wcf.reactionType.title2\', 1, 2, \'haha.svg\'), (\'wcf.reactionType.title3\', -1, 3, \'sad.svg\'), (\'wcf.reactionType.title4\', 0, 4, \'confused.svg\'), (\'wcf.reactionType.title5\', 1, 5, \'thanks.svg\')'));
+       $statement = WCF::getDB()->prepareStatement(str_replace('wcf1_', 'wcf'.WCF_N.'_', 'INSERT INTO wcf1_reaction_type (title, type, showOrder, iconFile) VALUES '. $reactionTypes));
        $statement->execute();
        
        // update current likes