0) ? (($word_to_load > 0) ? "word" : "view") : "build"; $announcement = get_include_contents(SITE_LOCATION . '/announcement.php'); $notificationMessage = ""; if ($current_user > 0 || !isset($_SESSION['loginfailures']) || (isset($_SESSION['loginlockouttime']) && time() - $_SESSION['loginlockouttime'] >= 3600)) { // If logged in, never failed, or more than 1 hour has passed, reset login failures. $_SESSION['loginfailures'] = 0; } else { $alertlockoutmessage = "You failed logging in 10 times. To prevent request flooding and hacking attempts, you may not log in or create an account for 1 hour.\\n\\nThe last time this page was loaded, you had been locked out for " . time_elapsed(time() - $_SESSION['loginlockouttime']) . "\\n\\nRefresh the page once the hour has passed."; $hoverlockoutmessage = str_replace("\\n", "\n", $alertlockoutmessage); } require_once(SITE_LOCATION . '/php/notificationconditiontree.php'); if ($display_mode != "build") { $dbconnection = new PDO('mysql:host=' . DATABASE_SERVERNAME . ';dbname=' . DATABASE_NAME . ';charset=utf8', DATABASE_USERNAME, DATABASE_PASSWORD); $dbconnection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $dbconnection->setAttribute(PDO::ATTR_EMULATE_PREPARES, true); $dbconnection->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC); $dictionary_query = "SELECT `d`.`id`, `d`.`user`, `d`.`name`, `d`.`description`, `u`.`public_name`, `d`.`parts_of_speech`, `d`.`is_complete` "; $dictionary_query .= "FROM `dictionaries` AS `d` LEFT JOIN `users` AS `u` ON `d`.`user`=`u`.`id`"; $dictionary_query .= "WHERE `d`.`is_public`=1 AND `d`.`id`=" . $dictionary_to_load . ";"; $word_query = "SELECT `w`.`word_id`, `w`.`name`, `w`.`pronunciation`, `w`.`part_of_speech`, `w`.`simple_definition`, `w`.`long_definition` "; $word_query .= "FROM `words` AS `w` LEFT JOIN `dictionaries` AS `d` ON `w`.`dictionary`=`d`.`id` "; $word_query .= "WHERE `d`.`is_public`=1 AND `w`.`dictionary`=" . $dictionary_to_load . (($display_mode == "word") ? " AND `w`.`word_id`=" . $word_to_load : "") . " "; $word_query .= "ORDER BY IF(`d`.`sort_by_equivalent`, `w`.`simple_definition`, `w`.`name`) COLLATE utf8_unicode_ci;"; try { $dictionary_results = $dbconnection->prepare($dictionary_query); $dictionary_results->execute(); if ($dictionary_results) { $word_results = $dbconnection->prepare($word_query); $word_results->execute(); $dictionary_words = "["; if ($word_results) { $words_counted = 0; $words_total = num_rows($word_results); while ($word = fetch($word_results)) { $words_counted++; $word_name = $word['name']; $dictionary_words .= '{"name":"' . $word['name'] . '",'; $dictionary_words .= '"pronunciation":"' . $word['pronunciation'] . '",'; $dictionary_words .= '"partOfSpeech":"' . $word['part_of_speech'] . '",'; $dictionary_words .= '"simpleDefinition":"' . $word['simple_definition'] . '",'; $dictionary_words .= '"longDefinition":"' . $word['long_definition'] . '",'; $dictionary_words .= '"wordId":"' . $word['word_id'] . '"'; $dictionary_words .= '}'; if ($words_counted < $words_total) { $dictionary_words .= ','; } } } $dictionary_words .= "]"; if (num_rows($dictionary_results) === 1) { while ($dict = fetch($dictionary_results)) { $dictionary_name = $dict['name']; $dictionary_creator = $dict['public_name']; $is_owner = $current_user == $dict['user']; $the_public_dictionary = '{"name":"' . $dict['name'] . '",'; $the_public_dictionary .= '"description":"' . $dict['description'] . '",'; $the_public_dictionary .= '"createdBy":"' . $dict['public_name'] . '",'; $the_public_dictionary .= '"words":' . $dictionary_words . ','; $the_public_dictionary .= '"settings":{'; $the_public_dictionary .= '"partsOfSpeech":"' . $dict['parts_of_speech'] . '",'; $the_public_dictionary .= '"isComplete":' . (($dict['is_complete'] == 1) ? 'true' : 'false') . '},'; $the_public_dictionary .= '"id":"' . $dictionary_to_load . '"'; $the_public_dictionary .= '}'; } } } } catch (PDOException $ex) {} } ?> <?php echo (($display_mode == "word") ? ($word_name . " | ") : "") . $dictionary_name; ?> Dictionary on Lexiconga " /> Dictionary" /> Lexiconga Dictionary Builder
About Lexiconga
0) { //If logged in, show the log out button. ?> Account Settings Log Out Log In/Create Account Can't Login

Viewing

« Edit Dictionary « Go Home to Lexiconga
;"> Close
;"> Close
🔒
Settings

View Full Dictionary HideShow Description
blocknone;">
Hide Search/Filter Options
blocknone;">
;"> Check All   ;"> Uncheck All
0) { $user_email = Get_User_Email($current_user); ?>