Jump to content
TNG Community
mahesh

TNG Shortcode Constructor FOR Wordpress.

Recommended Posts

mahesh

Hi All,

I would like to share this Shortcode Constructor with you.

TNG Shortcode Constructor is a stripped down version of The TngApi V3.3 plugin for Wordpress.  You may download latest release here.

TngApi V3.3, a stand-alone plugin,  published in 2015, integrates smoothly with       TNG to display genealogy data in Wordpress pages. It's main attraction was the ability of the user to add / amend family data and ability of the administrator to perform one-click transfer of this data to tng database. With changes to MySQL, my extremely limited knowledge of mySQL  and changes to TNG database structure , I have found it virtually imposible to support this feature.
(I understand that, now, a TNG mod, the Family Group Worksheet ,has the facility for administrators to merge data in to TNG database.)

Plan is to have the TNG Shortcode Constructor do everything the TngApi did, except update TNG data.

  • Plugin obtains it's credentials from TNG setup.

  • Plugin shares it's variables with TngApi

  • Plugin Settings are in Wordpress Admin>Settings

It implements Privacy Credentials in the TNG General SetUp>Privacy  and User , if logged in.

I have kicked it off with the following shortcodes from the TngApi.

  • TngWp_birthdays List birthdays for the selected month.
  • TngWp_danniversaries List death anniversaries for the selected month.
  • TngWp_gone (Gone But Not Forgotten). Gives birth dates and deat hdates for yesterday, today and tomorrow. It is encapsulated in a DIV and it may be possible to include that in your content. ( I have used similar in my Home Page)
  • TngWp_LandingPage This is similar to 'TngWp_gone' but has user name, birthdays, marriage anniversaries and death anniversaries added.
  • TngWp_manniversaries List of marriage anniversaries for the selected month.
  • TngWp_MyShortcode Template for adding your own shortcode
  • TngWp_submitImage Upload images from Wordpress. Image will be stored in a TNG Media Collection specified by you.

I am not sure whether this is helpful or whether it will work but I am hoping that we may start having contributions of variety of shortcodes to add to this constructor, for the TNG community to share.
If you would like to know how to add your own shortcode, lots more details on GitHub Repository, here

This very much a project that can evolve so please free to Fork and submit Pull  requests if you would like to make changes to the Plugin.

I would really love to have your feedback, so if you download, let me know

Thanks.

(PS; I still have not got the hang of formating this post😫. Hence several edits)

 

Edited by mahesh
Changed download link to latest release.

Share this post


Link to post
Share on other sites
cmalvache

Dear Mahesh,

I'm interessed on your plugin

I tried to activate your version (1.0) on my wordpress (6.0) and Php 8.0.20.

I have this error:
 

Error thrown

Class "TngWp_Shortcode_Gone" not found

Any idea ?

Thank 

Cédric

Share this post


Link to post
Share on other sites
mahesh
56 minutes ago, cmalvache said:

Dear Mahesh,

I'm interessed on your plugin

I tried to activate your version (1.0) on my wordpress (6.0) and Php 8.0.20.

I have this error:
 

Error thrown

Class "TngWp_Shortcode_Gone" not found

Any idea ?

Thank 

Cédric

That's strange Cédric. I just downloaded the plugin and did a fresh install with No errors.

Was there more information about the error?

Share this post


Link to post
Share on other sites
mahesh
5 hours ago, cmalvache said:

Class "TngWp_Shortcode_Gone" not found

Any idea ?

Thank 

Cédric

Just to add:

Only error I can simulate is if plugin can not find gone.php in  \plugins\TngApi_shortcodeConstructor\TngWp\Shortcode\ folder.

Fatal error: Uncaught Error: Class "TngWp_Shortcode_Gone" not found
in C:\wamp64\www\wordpress\wp-content\plugins\TngApi_shortcodeConstructor-1.0 test\tng-shortcode-constructor.php on line 77

Share this post


Link to post
Share on other sites
cfj

Dear Mahesh, I'm also interessed in your plugin and tested it.

I got error when I tried to activate the plugin in WP

Warning: include(/path/wp-content/plugins/TngApi_shortcodeConstructor-1.0/TngWp/Shortcode/Gone.php): failed to open stream: No such file or directory in /path/wp-content/plugins/TngApi_shortcodeConstructor-1.0/autoload.php on line 22

 

Share this post


Link to post
Share on other sites
mahesh
On 7/9/2022 at 4:36 PM, cmalvache said:

Class "TngWp_Shortcode_Gone" not found

Any idea ?

Thank 

Cédric

 

4 hours ago, cfj said:

I got error when I tried to activate the plugin in WP


Warning: include(/path/wp-content/plugins/TngApi_shortcodeConstructor-1.0/TngWp/Shortcode/Gone.php): failed to open stream: No such file or directory in /path/wp-content/plugins/TngApi_shortcodeConstructor-1.0/autoload.php on line 22

 

Thanks. A msilly mistake by me. Sorry, Can I plead a relapse due to a senior momment?

File gone.php in TngWp/Shortcode/

should be named

Gone.php

Would you be able to make that change?

 

Share this post


Link to post
Share on other sites
cfj

Thank you . I change the filename and the plugin works, but non-english letters as Norwegian Æ, Ø, Å or Swedish Ä, Ö are shown as diamond question marks �

Share this post


Link to post
Share on other sites
mahesh
2 hours ago, cfj said:

Thank you . I change the filename and the plugin works, but non-english letters as Norwegian Æ, Ø, Å or Swedish Ä, Ö are shown as diamond question marks �

I am glad tht's sorted

I am not sure why that is. I can not test as I do not have non-english letters in my database

BTW, Which Shortcode did you try?

Share this post


Link to post
Share on other sites
fluffy82
36 minutes ago, mahesh said:

I am not sure why that is. I can not test as I do not have non-english letters in my database

It's a general issue, not related to your plugin.

I have the same in my lists (without your plugin). I used the ones Heather provided years ago, and I later wrote my own code in a WordPress "extended text" widget, but the result is always the same. Special characters are diamond question marks. My website's collation is correctly set and so is the database. I have no idea why the � keep turning up.

Share this post


Link to post
Share on other sites
cfj
55 minutes ago, mahesh said:

BTW, Which Shortcode did you try?

I tried:

TngWp_manniversaries

TngWp_gone

TngWp_LandingPage

 

 

Share this post


Link to post
Share on other sites
mahesh
28 minutes ago, cfj said:

I tried:

TngWp_manniversaries
TngWp_gone
TngWp_LandingPage

I am not sure what is happenning here. As @fluffy82 ihas suggested, it may have to do with the local setup. I do not have any data with special characters in my database. I pasted some characters (sent by you) in the gone.html.php and that shows up fine.

image.png

I am  really a novice in this coding thing. But I am sure there's an answer.

I have updated the Tng Shortcode Constructor to release V1.01,  correcting my current, stupid errors.

Share this post


Link to post
Share on other sites
mahesh
22 hours ago, fluffy82 said:

It's a general issue, not related to your plugin.

I have the same in my lists (without your plugin). I used the ones Heather provided years ago, and I later wrote my own code in a WordPress "extended text" widget, but the result is always the same. Special characters are diamond question marks. My website's collation is correctly set and so is the database. I have no idea why the � keep turning up.

fluffy82, that got me thinking. After some tests I found that WP dB displayed correctly. TNG DB in WP wrapper kept turning up ��. Sadly this means that my TngApi published, some 7 years ago, has the same issue. And no one's complained 😢
As I said before, my knowledge of mysql is next to nothing BUT couple of hours on Google and I think I won the lottery.

A simple  function to specify default character set to work within the plugin ,

$db->set_charset("utf8");

seems to have fixed the issue. - I hope ☺️.

22 hours ago, cfj said:

I tried:
TngWp_manniversaries
TngWp_gone
TngWp_LandingPage

I thought this was an HTML issue but its turned out to be DB collation issue. I think it's fixed and I have an updated to version 1.02

I would really appreciate it you would could try out the Latest release and see if that's fixed the problem.


Share this post


Link to post
Share on other sites
cfj
15 hours ago, mahesh said:

I thought this was an HTML issue but its turned out to be DB collation issue. I think it's fixed and I have an updated to version 1.02

I would really appreciate it you would could try out the Latest release and see if that's fixed the problem.

Thank you @mahesh

The plugin works with Norwegian and Swedish letters 😀

 

Screenshot -TNG-WP-Plugin.png

Share this post


Link to post
Share on other sites
mahesh
2 hours ago, cfj said:

Thank you @mahesh

The plugin works with Norwegian and Swedish letters 😀

 

That's great @cfj. Thanks for downloading and reinstalling again.again.

I learnt something new so thanks for that as well.

Share this post


Link to post
Share on other sites
RickM

@mahesh

Am loving this.. Going to come back to you with some issues etc.. This is really amazing.. I'm sure it could be expanded..

 

Magic Stuff

Share this post


Link to post
Share on other sites
mahesh
On 7/30/2022 at 10:23 AM, RickM said:

@mahesh
Am loving this.. Going to come back to you with some issues etc.. This is really amazing.. I'm sure it could be expanded..

Magic Stuff

Coming from you, @RickM, that's great compliment. Thank you. Please do share any issues, suggestions, recommendations.

I am hoping that this will be a community project with members submitting their own ideas to share.
One way would be to Pull or Fork the gitgub repository to add your own short codes.

By the way, We floated this idea, back in 2015, with the release of TngApi V3. The add-on was tngCustom. But it did not catch-on.

I think this one will.☺️.

To DO list FOR Next Version. Current Version here

  1. Add Privacy Credentials for Assigned Tree  (I have only one tree)
  2. Add Privacy Credentials for LDS Data (I do not use LDS data)
  3. Add Branch selection ( I do not have branches in my tree)
  4. Shortcode for Family Page similar to TngApi
  5. Shortcode widjet for TNG Person Search similar to TngApi
  6. Add Prefix - Suffix to Name
  7. Include Family Privacy tag.
Edited by mahesh
Add link to plugin and modify ToDo List

Share this post


Link to post
Share on other sites
RickM

Mahesh,

No, I'm but a simple person who sees potential in things. You have done the hard yards.. The Accolade to You is well deserved..

Not sure I get the Github thing.. I will work with you one way or another..

A quick thought with the Marriage Anniversaries.. Would be better IF the Yrs Married were calculated to the first spouses death rather than to todays date. I do have sql code (courtesy of Michel Kirsch) that does this should you require it..

 

Share this post


Link to post
Share on other sites
edglimited
7 hours ago, RickM said:

Not sure I get the Github thing.. I will work with you one way or another..

 

Rick, Github works along the lines of many contributors adding / editing lines of software code to a project to achieve an outcome. If the project you are involved in, is'nt going the way you thought it was, you can use what's called a Fork request. Which means you can download and you then own a copy of that software code. That then allows you to make your own edits etc, which others can now view and if interested, they can join your project and add / edit etc. A Pull request, lets you tell others about changes you've pushed to a branch in a repository on GitHub. Once a pull request is opened, you can discuss and review the potential changes with collaborators and add follow-up commits before your changes are merged into the base branch.

As an example, TNG would be the base branch, you might be working on the getperson branch, with several others, I could be working on the genlib branch with several hundred people.

I currently work on Github, with several projects. One of those is MacFamTree by Synium Software.. Another I was with, was the use of a non-gender choice for coding into genealogy software. You may remember that, we discussed it here.. I have met a lot of good people on Github, including the original coder for MyHeritage.com  an excellent guy to chat with.

To give you an idea, of what goes on, click the link and scroll down to view the showcase video.
Show Case Video

Share this post


Link to post
Share on other sites
RickM

Cheers Drew,

I'll check the Video out..

Share this post


Link to post
Share on other sites
edglimited

I should point out, the link (this ver of MacFamTree) is the end result of some contributions from those working on Github. Not all ideas and coding have been accepted or implemented by Synium. MacFam is still work in progress, but as you will see by the link, it's far ahead of whats available in the marketplace. There is a workaround being done for Windows. MacFam already works on Linux, using a workaround app. 😉

I have'nt added a link for Github, or given a detailed example of how it works, but if you go to Youtube and search "how does github work" it gives you a general idea etc.

Share this post


Link to post
Share on other sites
mahesh
20 hours ago, RickM said:

A quick thought with the Marriage Anniversaries.. Would be better IF the Yrs Married were calculated to the first spouses death rather than to todays date. I do have sql code (courtesy of Michel Kirsch) that does this should you require it.

An idea worth exploring, @RickM

For me, present format works because in my small database, over 75% are living indivduals due to lack of past records (Colonial rule - winge, winge ).

It is easy enough to do. No need for SQL.  We can either have another customized shortcode or add a column to current one.

I would be interested in what others think.

Share this post


Link to post
Share on other sites
mahesh
On 8/1/2022 at 12:02 AM, edglimited said:

Rick, Github works along the lines of many contributors adding / editing lines of software code to a project to achieve an outcome. If the project you are involved in, is'nt going the way you thought it was, you can use what's called a Fork request. Which means you can download and you then own a copy of that software code. That then allows you to make your own edits etc, which others can now view and if interested, they can join your project and add / edit etc. A Pull request, lets you tell others about changes you've pushed to a branch in a repository on GitHub. Once a pull request is opened, you can discuss and review the potential changes with collaborators and add follow-up commits before your changes are merged into the base branch.

Thank you Drew for such a detailed explanation. Appereciated.

Share this post


Link to post
Share on other sites
Martin J Mosley

I just want to say that I’m watching this thread with interest. I have several tng/wp sites, and have experimented with several approaches to displaying tng data within wp.

I’m not a fan of the standard getperson.php layout either.

I’d like to encourage all your efforts, and if I can help in any way, then I’ll be pleased to do so.

Share this post


Link to post
Share on other sites
mahesh
17 hours ago, Martin J Mosley said:

I just want to say that I’m watching this thread with interest. I have several tng/wp sites, and have experimented with several approaches to displaying tng data within wp.
I’m not a fan of the standard getperson.php layout either.
I’d like to encourage all your efforts, and if I can help in any way, then I’ll be pleased to do so.

Thanks for heads up, Martin. Let hope that with your help, we can come up with something that you are looking for.

About seven years ago, my son and I published TngApi Plugin for Wordpress (V 3). There, we created a family page which met my requirements. The plugin also included a TngApi Custom, which had the original shortcodes which include in the Shortcode Constructor.

You may have a look at the family page at my demo site. See if the family page is the type of display you had in mind. The page requires you to log in. I am messaging you the credentials.

Martin, I am hoping this is going to be a community project. Hopefully we can come up with customized layouts.  

BTW, I am not an expert in coding. Necessity forced me to learn when my son stopped supporting the plugin - he got bored!

Please post here, what you would like to see.

I am sure we have enough experts on this forum to get things rolling.

Edited by mahesh
remove white space

Share this post


Link to post
Share on other sites
edglimited
On 8/3/2022 at 1:08 AM, mahesh said:

Thank you Drew for such a detailed explanation. Appereciated.

It's all good, here to help, if I can.

I can honestly say 100% and with hand on heart, that I am without doubt, the Worlds leading expert, on knowing absolutely nothing, about Wordpress. So I wont be much use to you. In all honesty, I much prefer LiveSite when used with TNG. I did use e107 for awhile, but did'nt suit my needs.

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

×