The following warnings occurred:
Warning [2] Undefined array key "threadviews_countguests" - Line: 745 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php 745 errorHandler->error_callback
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 830 postParser->parse_message
/showthread.php 916 build_postbit
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 861 postParser->parse_message
/showthread.php 916 build_postbit
Warning [2] Undefined property: MyLanguage::$thread_modes - Line: 46 - File: showthread.php(1650) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php(1650) : eval()'d code 46 errorHandler->error_callback
/showthread.php 1650 eval




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Glossary plugin?
#2
(2014-08-12, 02:48:24)atstarr Wrote: I apologize if this should go in plugins not feature requests -- but anyone working on a glossary plugin?  I could certainly just do a page with a long glossary but would be nice to have a plugin to manage this.  I.e. have a word or phrase, with the possibility of multiple definitions, and perhaps images of links to examples.

Thanks

Yes this should be in the Plugins/ General Questions subforum, as the scope is probably too broad to include in the core. 
Although not its primary purpose; you could do this with GS Custom Settings, eg create a tab named 'glossary', and create a setting for each word, set the description to the word description, and the lookup 'word_x' where x is a number. You can reorder them alphabetically in the UI in Edit mode. If you're going to frequently update the list, you need to first return the settings in a for loop, and sort them with PHP sort() to avoid having to reset the numbers. 

[Image: ZxZESZK.png]

In your PHP template you could do something like:

PHP Code:
<?php $amount_of_words 8
for (
$i 1$i $amount_of_words$i++) { 

  $word 
return_setting('glossary''gloss_' $i'label');
  if ($i 0)
    $wordPrev return_setting('glossary''gloss_' . ($i 1), 'label');
  if ($i === || ($i && strtolower($wordPrev{0}) !== strtolower($word{0}))) {
    if ($i 0) echo '</dl>';
    echo '<h3>' strtoupper($word{0}) . '</h3>';
    echo '<dl>';
  }
  echo '<dt>' $word '</dt><dd>' return_setting('glossary''gloss_' $i'descr') . '</dd>';
  if ($i === $amount_of_words-1) echo '</dl>';
?>



This script outputs an HTML definition list with subtitles for each letter (glossary data from http://pc.net/glossary/):


[Image: ccdWkek.png]
Reply


Messages In This Thread
Glossary plugin? - by atstarr - 2014-08-12, 02:48:24
RE: Glossary plugin? - by Tyblitz - 2015-04-30, 04:03:45
RE: Glossary plugin? - by shawn_a - 2015-04-30, 05:00:51



Users browsing this thread: 3 Guest(s)