render_mood_picker(self::get_emojis_with_labels(), $user->mood); $vars = [ 'config' => $config, 'moodPicker' => $moodPicker, ]; $this->render("mood.php", $vars); } public function handleMood(){ if ($_SERVER['REQUEST_METHOD'] === 'POST' and isset($_POST['mood'])) { // ensure that the session is valid before proceeding if (!Session::validateCsrfToken($_POST['csrf_token'])) { die('Invalid CSRF token'); } // Get the data we need $config = Config::load(); $user = User::load(); $mood = $_POST['mood']; // set the mood $user->mood = $mood; $user = $user->save(); // go back to the index and show the updated mood header('Location: ' . $config->basePath); exit; } } private static function get_emojis_with_labels(): array { return [ 'faces' => [ ['๐Ÿ˜€', 'grinning face'], ['๐Ÿ˜„', 'grinning face with smiling eyes'], ['๐Ÿ˜', 'beaming face with smiling eyes'], ['๐Ÿ˜†', 'grinning squinting face'], ['๐Ÿ˜…', 'grinning face with sweat'], ['๐Ÿ˜‚', 'face with tears of joy'], ['๐Ÿคฃ', 'rolling on the floor laughing'], ['๐Ÿ˜Š', 'smiling face with smiling eyes'], ['๐Ÿ˜‡', 'smiling face with halo'], ['๐Ÿ™‚', 'slightly smiling face'], ['๐Ÿ™ƒ', 'upside-down face'], ['๐Ÿ˜‰', 'winking face'], ['๐Ÿ˜Œ', 'relieved face'], ['๐Ÿ˜', 'smiling face with heart-eyes'], ['๐Ÿฅฐ', 'smiling face with hearts'], ['๐Ÿ˜˜', 'face blowing a kiss'], ['๐Ÿ˜—', 'kissing face'], ['๐Ÿ˜š', 'kissing face with closed eyes'], ['๐Ÿ˜‹', 'face savoring food'], ['๐Ÿ˜›', 'face with tongue'], ['๐Ÿ˜œ', 'winking face with tongue'], ['๐Ÿ˜', 'squinting face with tongue'], ['๐Ÿคช', 'zany face'], ['๐Ÿฆธ', 'superhero'], ['๐Ÿฆน', 'supervillain'], ['๐Ÿง™', 'mage'], ['๐Ÿง›', 'vampire'], ['๐ŸงŸ', 'zombie'], ['๐Ÿงž', 'genie'], ], 'gestures' => [ ['๐Ÿ‘‹', 'waving hand'], ['๐Ÿ––', 'vulcan salute'], ['๐Ÿ‘Œ', 'OK hand'], ['๐ŸคŒ', 'pinched fingers'], ['โœŒ๏ธ', 'victory hand'], ['๐Ÿคž', 'crossed fingers'], ['๐ŸคŸ', 'love-you gesture'], ['๐Ÿค˜', 'sign of the horns'], ['๐Ÿค™', 'call me hand'], ['๐Ÿ‘', 'thumbs up'], ['๐Ÿ‘Ž', 'thumbs down'], ['โœŠ', 'raised fist'], ['๐Ÿ‘Š', 'oncoming fist'], ], 'nature' => [ ['โ˜€๏ธ', 'sun'], ['โ›…', 'sun behind cloud'], ['๐ŸŒง๏ธ', 'cloud with rain'], ['๐ŸŒจ๏ธ', 'cloud with snow'], ['โ„๏ธ', 'snowflake'], ['๐ŸŒฉ๏ธ', 'cloud with lightning'], ['๐ŸŒช๏ธ', 'tornado'], ['๐ŸŒˆ', 'rainbow'], ['๐Ÿ”ฅ', 'fire'], ['๐Ÿ’ง', 'droplet'], ['๐ŸŒŠ', 'water wave'], ['๐ŸŒซ๏ธ', 'fog'], ['๐ŸŒฌ๏ธ', 'wind face'], ['๐Ÿ‚', 'fallen leaf'], ['๐ŸŒต', 'cactus'], ['๐ŸŒด', 'palm tree'], ['๐ŸŒธ', 'cherry blossom'], ], 'animals' => [ ['๐Ÿถ', 'dog face'], ['๐Ÿฑ', 'cat face'], ['๐Ÿญ', 'mouse face'], ['๐Ÿน', 'hamster face'], ['๐Ÿฐ', 'rabbit face'], ['๐ŸฆŠ', 'fox face'], ['๐Ÿป', 'bear face'], ['๐Ÿผ', 'panda face'], ['๐Ÿจ', 'koala'], ['๐Ÿฏ', 'tiger face'], ['๐Ÿฆ', 'lion face'], ['๐Ÿฎ', 'cow face'], ['๐Ÿท', 'pig face'], ['๐Ÿธ', 'frog face'], ['๐Ÿต', 'monkey face'], ['๐Ÿ”', 'chicken'], ['๐Ÿง', 'penguin'], ['๐Ÿฆ', 'bird'], ['๐Ÿฃ', 'hatching chick'], ['๐Ÿบ', 'wolf face'], ['๐Ÿฆ„', 'unicorn face'], ], 'hearts' => [ ['โค๏ธ', 'red heart'], ['๐Ÿงก', 'orange heart'], ['๐Ÿ’›', 'yellow heart'], ['๐Ÿ’š', 'green heart'], ['๐Ÿ’™', 'blue heart'], ['๐Ÿ’œ', 'purple heart'], ['๐Ÿ–ค', 'black heart'], ['๐Ÿค', 'white heart'], ['๐ŸคŽ', 'brown heart'], ['๐Ÿ’–', 'sparkling heart'], ['๐Ÿ’—', 'growing heart'], ['๐Ÿ’“', 'beating heart'], ['๐Ÿ’ž', 'revolving hearts'], ['๐Ÿ’•', 'two hearts'], ['๐Ÿ’˜', 'heart with arrow'], ['๐Ÿ’', 'heart with ribbon'], ['๐Ÿ’”', 'broken heart'], ['โฃ๏ธ', 'heart exclamation'], ], 'activities' => [ ['๐Ÿšด', 'person biking'], ['๐Ÿšต', 'person mountain biking'], ['๐Ÿƒ', 'person running'], ['๐Ÿ‹๏ธ', 'person lifting weights'], ['๐ŸŠ', 'person swimming'], ['๐Ÿ„', 'person surfing'], ['๐Ÿšฃ', 'person rowing boat'], ['๐Ÿคธ', 'person cartwheeling'], ['๐Ÿง˜', 'person in lotus position'], ['๐Ÿง—', 'person climbing'], ['๐Ÿ•๏ธ', 'camping'], ['๐ŸŽฃ', 'fishing pole'], ['๐ŸŽฟ', 'skis'], ['๐Ÿ‚', 'snowboarder'], ['๐Ÿ›น', 'skateboard'], ['๐Ÿงบ', 'basket'], ['๐ŸŽฏ', 'bullseye'], ], 'hobbies' => [ ['๐Ÿ“š', 'books'], ['๐Ÿ“–', 'open book'], ['๐ŸŽง', 'headphone'], ['๐ŸŽต', 'musical note'], ['๐ŸŽค', 'microphone'], ['๐ŸŽท', 'saxophone'], ['๐ŸŽธ', 'guitar'], ['๐ŸŽน', 'musical keyboard'], ['๐ŸŽบ', 'trumpet'], ['๐ŸŽป', 'violin'], ['๐Ÿช•', 'banjo'], ['โœ๏ธ', 'writing hand'], ['๐Ÿ“', 'memo'], ['๐Ÿ“ท', 'camera'], ['๐ŸŽจ', 'artist palette'], ['๐Ÿงต', 'thread'], ['๐Ÿงถ', 'yarn'], ['๐Ÿชก', 'sewing needle'], ['๐Ÿ“น', 'video camera'], ['๐ŸŽฌ', 'clapper board'], ], 'food' => [ ['๐ŸŽ', 'red apple'], ['๐ŸŒ', 'banana'], ['๐Ÿ‡', 'grapes'], ['๐Ÿ“', 'strawberry'], ['๐Ÿ‰', 'watermelon'], ['๐Ÿ', 'pineapple'], ['๐Ÿฅญ', 'mango'], ['๐Ÿ‘', 'peach'], ['๐Ÿ’', 'cherries'], ['๐Ÿ…', 'tomato'], ['๐Ÿฅฆ', 'broccoli'], ['๐Ÿฅ•', 'carrot'], ['๐ŸŒฝ', 'ear of corn'], ['๐Ÿฅ”', 'potato'], ['๐Ÿž', 'bread'], ['๐Ÿฅ', 'croissant'], ['๐Ÿฅ–', 'baguette bread'], ['๐Ÿง€', 'cheese wedge'], ['๐Ÿ•', 'pizza'], ['๐Ÿ”', 'hamburger'], ['๐ŸŸ', 'french fries'], ['๐ŸŒญ', 'hot dog'], ['๐Ÿฃ', 'sushi'], ], 'vibes' => [ ['๐Ÿ’ค', 'zzz'], ['๐Ÿคฏ', 'exploding head'], ['๐Ÿ˜ฑ', 'face screaming in fear'], ['๐Ÿฅต', 'hot face'], ['๐Ÿฅถ', 'cold face'], ['๐Ÿคฌ', 'face with symbols on mouth'], ['๐Ÿคจ', 'face with raised eyebrow'], ], 'tech' => [ ['๐Ÿ’ป', 'laptop'], ['๐Ÿ“ž', 'telephone receiver'], ['๐Ÿ”‹', 'battery'], ['๐Ÿ’ฟ', 'optical disk'], ['๐Ÿ•น๏ธ', 'joystick'], ['๐Ÿ”', 'magnifying glass tilted left'], ['๐Ÿ“ˆ', 'chart increasing'], ], 'travel' => [ ['โœˆ๏ธ', 'airplane'], ['๐Ÿš—', 'automobile'], ['๐Ÿš•', 'taxi'], ['๐Ÿšฒ', 'bicycle'], ['๐Ÿ›ด', 'kick scooter'], ['โ›ต', 'sailboat'], ], //'custom' => get_user_emojis($db), ]; } } ?>