Glossary for SMF 2.1

Started by GL700Wing, September 15, 2024, 03:41:07 PM

Previous topic - Next topic

GL700Wing

#40
Quote from: Kindred on September 30, 2024, 11:42:03 AM
Quote from: live627 on September 29, 2024, 07:20:04 PMI loaded your test glossary and ran your version of the mod to end up with a 14 second load time! Also "credit" had a different tooltip than the rest of the line A credit for your thoughts'

on test2.turtleshellprod.com, I have an extensive glossary added...    and it performs a really quick load for me on the glossary page.
I don't think the issue is with the time it takes a large main Glossary list to load for a Glossary administrator but rather the time it takes to display topics (particularly those with more than a few messages) containing multiple keywords in every message when a large Glossary list has to be processed.

Note: This is not a noticeable issue when only keywords enclosed in the Glossary BBcode are processed.

That said, the Glossary list I use for testing has a combination of almost 1,300 keywords/synonyms and if a Glossary this size was required in a production environment and the impact it had on the time it takes to display messages was unacceptable my recommendation would be to start with enabling the option 'Only show tooltip for each keyword once per message' and then, if necessary, enable the option 'Only show tooltips for keywords inside a Glossary BBCode tag'.

Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

live627

Quote from: Kindred on September 30, 2024, 11:42:03 AM
Quote from: live627 on September 29, 2024, 07:20:04 PMI loaded your test glossary and ran your version of the mod to end up with a 14 second load time! Also "credit" had a different tooltip than the rest of the line A credit for your thoughts'

on test2.turtleshellprod.com, I have an extensive glossary added...    and it performs a really quick load for me on the glossary page.
6 seconds on your test topic

GL700Wing

#42
Quote from: live627 on September 30, 2024, 10:50:17 PM6 seconds on your test topic
FYI: The Glossary on that forum contains almost 1,100 keywords.

Also, another SMF user with whom I worked extensively when updating this mod has a Glossary of ~100 keywords and when I use that Glossary list on my test forum there is no noticeable delay in the page load times.  Users of this mod may have to decide from the outset whether or not to enforce the use of the Glossary BBCode tag depending on their server configuration/capability, the size of their Glossary and/or the activity level of their forum.  In addition, the requirement to use the Glossary BBCode tag may need to enabled at a later time if the message processing/load times become unacceptable.

Finally, and if the use of the use of the Glossary BBCode tag is not required, enabling the 'Only show tooltip for each keyword once per message' and/or disabling the 'Show keyword and synonyms below definition in tooltip will reduce message processing/load times.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Kindred

I consistently get 2.7-2.9 seconds for that topic....
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

live627

ok...? Fighting over numbers gets us nowhere. The fact is that there is a performance issue
that MUST be addressed.

@GL700Wing here is another draft of my parsing algorithm. Thanks to your test data, I discovered that many of the matching failures were due to the word boundary. I also reorganized the code into classes/modules so that I wouldn't get lost.

GL700Wing

#45
Quote from: live627 on October 01, 2024, 03:29:50 AMok...? Fighting over numbers gets us nowhere. The fact is that there is a performance issue
that MUST be addressed.

@GL700Wing here is another draft of my parsing algorithm. Thanks to your test data, I discovered that many of the matching failures were due to the word boundary. I also reorganized the code into classes/modules so that I wouldn't get lost.
WOW!! All I can say is wow!! and many, many thanks!

You certainly a very knowledgeable and skilled programmer!

If it's okay with you I would like to add you as an additional author for this mod to acknowledge your amazing contribution.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

live627

Sure thing. Go ahead.

GL700Wing

Version 1.4 : 24-Oct-24
o Parsing code for processing Glossary keywords in messages completely rewritten by live627 - it's now amazingly fast!
o Added mod setting to give option to convert the line separator character(s) in the description to line breaks when editing the keyword.
o Glossary list:
   ~ Added option to enable tooltips to only be shown when individual keywords (and their synonyms) are inside the Glossary BBCode tag - previously this was only available as a global setting.
   ~ Convert the line separator character(s) in the description to line breaks when displaying keywords if the associated mod setting is enabled.
   ~ Show the total number of keywords and synonyms (plus numbers of keywords/synonyms with non-default settings).
   ~ Show non-default settings for keywords (ie, not approved, not shown as tooltips, case sensitive, and tag only) below settings icons.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

JessyKa

Hello @GL700Wing
I tested your mod and liked it a lot.
But there is one thing why I can not use it as attended: the idea was to offer additional information and offer a link to a wiki article if available.
The mod does not allow to klick into the mouseover-window. Therefore no link can be clicked.
I fully understand that. It is just a feedback.
Thanks for your work!
Jessy

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

szinski

I just installed this mod on one of my test forums and am seeing the following error:

/public_html/forum/Sources/Glossary.php (Line 1005)
Undefined variable $current_synonyms

Happens when I try to add a synonym.

GL700Wing

Version 1.5 : 16-Nov-24
o Bug fix for issue with synonyms that occurred when adding the very first synonym to a Glossary.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

cookdandbombd

#52
Nice mod! I've updated and am still getting an error, however:

https://www.cookdandbombd.co.uk/forums/index.php?topic=111556.0
 /var/www/cookdandbombd.co.uk/forums/Sources/Glossary.php (Line 1739)  Backtrace information

Type of error: Undefined
Error messageSelect
8: Undefined index: synonym


GL700Wing

Version 1.6 : 26-Nov-24
o Bug fix for incorrect array element name.


Thanks @cookdandbombd for reporting this issue.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

cookdandbombd

Thanks for the prompt fix.

If I could make a suggestion, it would be great to have a "select unapproved" option.  At the minute it's a bit cumbersome to find the new entries, so I just end up using "select all".

The suggested addition would allow me to quickly review the new ones and then approve them too.

Kindred

v1.6 installed....

2: Undefined array key "glossary_elements"

generated 3 times for every view

9
Dec 13, 2024, 01:16 PM
Guest
...
b943d71330f179dc22746802bc0058fc
.../index.php?action=glossary&sa=categories%27
/.../Themes/default/Glossary.template.php (Line 223)
Backtrace information

Type of error: Undefined
Error message 2: Undefined array key "glossary_elements"
8
Dec 13, 2024, 01:16 PM
Guest
...
b943d71330f179dc22746802bc0058fc
.../index.php?action=glossary&sa=categories%27
/.../Sources/Glossary.php (Line 932)
Backtrace information

Type of error: Undefined
Error message 2: Undefined array key "glossary_elements"
7
Dec 13, 2024, 01:16 PM
Guest
...
b943d71330f179dc22746802bc0058fc
.../index.php?action=glossary&sa=categories%27
/.../Sources/Glossary.php (Line 931)
Backtrace information

Type of error: Undefined
Error message 2: Undefined array key "glossary_elements"
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

GL700Wing

Quote from: Kindred on December 17, 2024, 06:24:04 AMv1.6 installed....
2: Undefined array key "glossary_elements"
Try as I might I cannot reproduce this error - I've tried with a brand new install (ie, no glossary items or categories) and two combinations (ie, some glossary items and no categories, some categories and no glossary items).

Also, and even if there are no glossary items or categories defined, when you click on 'Categories' the 'glossary_elements' key should contain the following:
<table id="table_full_table" width="100%"><tr><td colspan="3"><a href="javascript:Display_glossary_for_letter('all')"><b><u>All</u></b></a></td></tr></table><input type="hidden" id="full_list_of_ids" value="">
Displayed as:
You cannot view this attachment.

Would you please provide a screen capture of the mod settings you are using.  Also, how many glossary items and categories are defined when this error occurs?
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Kindred

This is on my test site... so hundreds of definitions.
Have not changed the settings, just reinstalled the mod.

Did you create an account on my site? If you have one,  I'll promote it to admin
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

GL700Wing

Quote from: Kindred on December 17, 2024, 08:27:07 PMThis is on my test site... so hundreds of definitions.
Have not changed the settings, just reinstalled the mod.
Strange that it started after you reinstalled the mod - were you using the same version previously?

QuoteDid you create an account on my site? If you have one,  I'll promote it to admin
Yep - I have logged in using a testing account you gave me access to but it doesn't have admin privileges.

Also, and even though it may be logging error messages, I can see items using both the default (ie, alphanumeric) and category view options.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Kindred

your testing account is upgraded with access...

but wait.....


I just checked the URL that they used...   it has &sa=categories%27

%27 is the single quote...


So - either it's a bad link from somewhere or they are trying some sort of injection that is getting interrupted and cleaned....
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: