Jump to content
TNG Community
Bill Herndon

Citation Master Mod v9 (rc1) - PHP-8 / Source Thumbnails / Context-sensitive Formatting

Recommended Posts

Bill Herndon

I have posted the first release candidate (rc1) of Citation Master v9 on the TNG Wiki.  

This is a major update that adds two new features and incorporates PHP-8 compatibility:

  • Source/Citation thumbnails for all sources that have an attached media file are displayed in the citation area of individuals and families.  (This feature can be enabled/disabled in Mod Manager parameters.)
  • Format specifications now support the ability to have different instruction sets for source displays and citations displays.  The idea here is to be able to create "short format" citations as one would find in scholarly publications, but the feature allows for any complexity for the formatting.

The Citation Master Wiki page has details and examples of the new features and Lindell-Herndon Genealogy is running the release candidate and has additional examples.

The release candidate can be downloaded here.

This update was developed against TNG 13.0.4 and may be compatible with, but has not been tested against, earlier versions from TNG 13.0 forward. 

Comments, bugs, and suggestions for additional features are very welcome.

Bill Herndon

Lindell-Herndon Genealogy

Share this post


Link to post
Share on other sites
Ken Roy

Hi Bill,

You might have taken me up on my offer to test before you posted your zip file :)

When I go to Edit Options I get an Error

1. Mon 13 Sep 2021 10:54:29 PM | edit parameters | Citation Master v13.0.0.9-rc1 | errors | TNGadm
    * editing D:/wamp64/www/tng/roy_mods/cite_master_v13.0.0.9-rc1.cfg
    * target file roy_extensions/citem_options.php parameter missing: $citem_show_thumbnails

Maybe the previous citem_options.php did not get removed from my extensions folder when I uninstalled your previous version

Share this post


Link to post
Share on other sites
Bill Herndon

Ken,

That's exactly the problem--and happened exactly the same way in my test environment.  The Mod Manager doesn't seem to be removing the previous version from the extensions folder.

Not sure if that's a Mod Manager bug or not.  Regardless, I'd copy the previous version to another location prior to installation.  And thanks for the post.  I'd intended to update the installation instructions on the Wiki article but forgot.

Bill Herndon

Share this post


Link to post
Share on other sites
Ken Roy

Bill,

Not sure what happened, but I uninstalled and re-installed and then was able to Edit Option. 

1 hour ago, Bill Herndon said:

The Mod Manager doesn't seem to be removing the previous version from the extensions folder.

Not sure if that's a Mod Manager bug or not.

do you have a protection flag on the copyfile.  I did not look.

I did have that file open in Notepad++ so maybe Windows 10 protected it  and did not allow it to get overlaid

Share this post


Link to post
Share on other sites
Bill Herndon

Ken,

I thought of the copy protection flag as well, and removed it prior to trying my own upgrade (local).  Having said that, I should check to see how it went out in the package.

k/r

Bill Herndon

Share this post


Link to post
Share on other sites
Ken Roy

You do have a section that uses %fileexists at line 924 which if I am not mistaken is what the protection flag is supposed to do.

Will look at this closer tomorrow morning when I am not so tired  and my eyes are working better

Share this post


Link to post
Share on other sites
marcirish

I have installed Citation Master Mod v9 (rc1) and it works EXCEPT it will not display a thumbnail of the document attached to the source.   Not sure it I am doing something in error, missed an instruction, or what.  Any advice would be most appreciated.

 

Marc Irish

Share this post


Link to post
Share on other sites
Bill Herndon

Marc,

I'm using some function calls from TNG (globallib.php) to make this work.  So here are some things to check:

1) In: Administration -> Mod Manager -> Citation Master -> Installed [Options] -> Edit Options... is the option $citem_show_thumbnails set to true?

If not, set it true and save the preference.  If the option doesn't appear at all then the old citem_options.php file is probably still in the extensions directory.  (Ken Roy and I have seen this happen, and it's probably due to a mistake I may have made in my configuration file.  To fix:  go to you TNG extensions folder and move you're old citem_options.php to another location to preserve it.  Then de-install and re-install Citation Master.

2) The source for which you want the thumbnail displayed in a citation (they only get shown in citations currently) must:

  • Have an image in the Documents or Photos media collections (not sure about the other collections...I happen to use documents)
  • Have a thumbnail already generated
  • Be linked to the source from the Media entry (in administration: Media >> Edit Existing Media) ...
  • ... and be flagged as the default image for that source

Hopefully this will get the feature working for you.

k/r

Bill Herndon

Share this post


Link to post
Share on other sites
Ken Roy

Bill,

2 hours ago, Bill Herndon said:

If the option doesn't appear at all then the old citem_options.php file is probably still in the extensions directory.  (Ken Roy and I have seen this happen, and it's probably due to a mistake I may have made in my configuration file. 

Your mod cfg file has

%fileexists:$extspath/citem_options.php:skip%
%copyfile2:~cite_master/etc/citem_options.php:$extspath/citem_options.php%
%label:skip%

I am not sure what the Mod Manager does when uninstalling the mod in that case.  In TNG v12, the Protect flag was added to the allow settings or options type of files to remain or be preserved across mod upgrades.  Of course if you add new options you need to provide instructions on how to replace the existing settings or options file

Quote

Protected flag

~ (the tilde) is used in %copyfile% commands to "protect" a file, that is, to prevent the Mod Manager from

  1. Removing the file when uninstalling a mod, and from
  2. Overwriting the file if it exists when a new version of the mod tries to install it.

The intent is to allow mods to share files, or to leave a file in place so settings in the file are preserved when a mod is uninstalled and later reinstalled (for example, for an upgrade).

I am not sure what happens, if you coded your cfg file with the %fileexists conditional processing.

Share this post


Link to post
Share on other sites
Ken Roy

Bill,

2 hours ago, Ken Roy said:

am not sure what happens, if you coded your cfg file with the %fileexists conditional processing.

Thinking about this some more, I strongly suspect that the way you coded your %fileexists in the cfg file behaves the same way as the protect flag since that particular conditional was added in TNG v12 to support mods that depend on other mod files.

Since your mod does not depend on other mods, I would recommend that you change your cfg file to use the Protect flag so that you are aware of the need to provide instructions on how to replace your options file if you add new options.

Share this post


Link to post
Share on other sites
marcirish
5 hours ago, Bill Herndon said:

Marc,

I'm using some function calls from TNG (globallib.php) to make this work.  So here are some things to check:

1) In: Administration -> Mod Manager -> Citation Master -> Installed [Options] -> Edit Options... is the option $citem_show_thumbnails set to true?

If not, set it true and save the preference.  If the option doesn't appear at all then the old citem_options.php file is probably still in the extensions directory.  (Ken Roy and I have seen this happen, and it's probably due to a mistake I may have made in my configuration file.  To fix:  go to you TNG extensions folder and move you're old citem_options.php to another location to preserve it.  Then de-install and re-install Citation Master.

2) The source for which you want the thumbnail displayed in a citation (they only get shown in citations currently) must:

  • Have an image in the Documents or Photos media collections (not sure about the other collections...I happen to use documents)
  • Have a thumbnail already generated
  • Be linked to the source from the Media entry (in administration: Media >> Edit Existing Media) ...
  • ... and be flagged as the default image for that source

Hopefully this will get the feature working for you.

k/r

Bill Herndon

Bill,

 

Flagging the media as Default for the Source worked!

 

marc

Share this post


Link to post
Share on other sites
Bill Herndon

I have posted the 2nd release candidate (rc2) of Citation Master V9 to the TNG Wiki.  This RC has more PHP-8 fixes, formatting updates for the 'thumbnail' feature (w/CSS that can be changed by the user), and removal of the option protection flag for 'show thumbnails' (ensures that the old citem_options.php is removed on de-install).

- Bill Herndon

Lindell-Herndon Genealogy

Share this post


Link to post
Share on other sites
Ken Roy

Bill,

You should have mentioned that you changed the default file name that is being loaded.  I initially got on my WampServer running PHP 7.4 since I am still fighting the technology changes in MediaWiki and Windows 10 Pro

Quote

[17-Sep-2021 12:27:19 UTC] PHP Warning: include(): Failed opening 'mods/cite_master/config/citem_config_v9_test.php' for inclusion (include_path='.;C:\php\pear') in D:\wamp64\www\tng\roy_extensions\citem_lib_citation.php on line 110

Source / citations on getperson.php page were then only shown with S(nnnn)

After I used Edit Option to change the location for my renamed mods folder, I then got the Source Titles.

 

 

 

Share this post


Link to post
Share on other sites
Ken Roy

Well evidently something  else changed because I am also getting the following error

Quote

[17-Sep-2021 12:27:19 UTC] PHP Warning: include(): Failed opening 'mods/cite_master/config/citem_config_v9_test.php' for inclusion (include_path='.;C:\php\pear') in D:\wamp64\www\tng\roy_extensions\citem_lib_citation.php on line 110

Sounds like you also are not allowing for users to rename the TNG mods and extensions folders.

Share this post


Link to post
Share on other sites
Bill Herndon

Ken,

No...that shouldn't be the case.  The configuration file loaded is set in the options, and you may use whatever enclosing folder--relative to the TNG root--you want to use.  Having said that, the initial value is set explicitly to the folder 'mods/config' as the default value for the RC because that is where the feature test configuration is located.

Users may rename mods or extensions, and I haven't changed anything to do with loading configuration files or libraries in quite some number of major releases.

k/r

Bill Herndon

Share this post


Link to post
Share on other sites
Ken Roy

Well Bill,

You changed the file name in the extensions/citem_options.php: $citem_config_path in the Edit Option to

mods/cite_master/config/citem_config_v9_test.php

I was not expecting that.   

I am fighting technology changes on too many fronts at the moment. 

  • Can no longer open Excel file because of McAfee live scanning. 
  • Can not get MediaWiki to work correctly on Windows 10 Pro (actually it no longer opens the Main Page)
  • Can not get Windows 10 Pro to complete its updates

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×