Footer - warwickfoster/qurantools GitHub Wiki

File: app/counts/count_loanwords.php

Purpose

The provided PHP code snippet generates an HTML page that displays a list of loanwords (words borrowed from other languages) in a Bible translation.

Key Features

  • Displays loanwords in a table with columns for Arabic, English transliteration, root, gloss, count, and actions.
  • Provides links to the Jeffrey's lexicon for each loanword.
  • Includes an interactive chart for each loanword.
  • Implements a page navigator for navigating through the list of loanwords.

Functionality

  • Retrieves loanword data from a database using the db_return_one_record_one_field() function.
  • Loops through the loanwords and displays them in a table row.
  • Implements a tooltip that displays a chart when hovered over.
  • Includes a page navigator based on the total number of loanwords and the number of items per page.

Additional Features

  • User preference for transliteration style (English or Buckwalter).
  • Mobile-friendly design.
  • Back-to-top button.

Usage

The PHP code can be used to generate a web page that displays a list of loanwords in a Bible translation. The user can navigate through the list using the page navigator and interact with the interactive charts.

Technical Details

  • PHP
  • HTML
  • CSS
  • JavaScript
  • MySQL database

Notes

  • The code assumes the existence of a MySQL database with tables and functions for retrieving loanword data and other necessary information.
  • The $user_preference_transliteration_style variable is used to set the transliteration style based on user preference.
  • The isMobile() function is used to determine if the user is accessing the page on a mobile device.