Jump to content
TNG Community
Michel KIRSCH

Group Custom Events Mod

Recommended Posts

Michel KIRSCH

Hi All,

Jürgen (JPB) has asking for a Mod that Hide/show Associations when there are many Associations for the same person. (Edit).

My ancestor was very popular and rich. Therefore, he was very often (~ 26x) called upon as a godfather and witness.

TNG creates a separate line for each Association, which are sorted according to the input and not according to date.

This is the answer : a Mod to test...

Michel

 

hide_associations_v13.0.3.beta1.zip

Share this post


Link to post
Share on other sites
JPB

Thank you Michel for listening to my question.

I have tested the Mod, it works great. No conflict with my other mods.

Please change the german text to:

"Es gibt xxx Verbindungen. Klicken Sie auf den linken Pfeil, um sie anzuzeigen."

Could there be a sorting option on the admin input? For example, as with the Notes.

notes.jpg

For me, people who find a solution like this within a very short time are a veritable miracle.

You are top, thank you very much.

Jürgen

 

Share this post


Link to post
Share on other sites
ton van lil

Michel

No conflicts here. Mod works splendid.

May be mod could work for other Custom events such as  Residence where there is more than one per person.

Thanks

Ton van Lil

Share this post


Link to post
Share on other sites
Michel KIRSCH
12 hours ago, JPB said:

Could there be a sorting option on the admin input? For example, as with the Notes

Jürgen,

Why not... Will search for that... When I have time...!

The next version will sort the Associations on alphabetical Name order ascending. EDIT (and integrate your translation)
But you can think to add a year in the relationship, so a sort on the date becomes possible when sorting on the associations...
Must be studied...

Michel

Share this post


Link to post
Share on other sites
Michel KIRSCH
12 hours ago, ton van lil said:

May be mod could work for other Custom events such as  Residence

Ton, thanks for your interest

Yes it's possible, but it must be another Mod...

may be a Mod for regrouping events on demand...?

For tomorrow... or later !

Michel

Share this post


Link to post
Share on other sites
ton van lil

Michel

A mod for regrouping events on demand sounds wunderful.

Good night

Ton

Share this post


Link to post
Share on other sites
JPB
vor 8 Stunden schrieb Michel KIRSCH:

But you can think to add a year in the relationship

Good morning Michel,

that is how I have done it so far. Prefixed a date and somehow let sort in phpMyAdmin. It becomes difficult if there were several processes in one year or one month or I still found a connection after later research ...

I have already tried to adjust this input field in the file admin-associations.php as it is in the file admin-notes.php, but I lack the necessary knowledge.

If anyone can make it happen, I think it's you. It's a pity that Darrin is not interested in such positive additions, I had once asked him for such an adjustment years ago.

Have a nice sunday

Jürgen

Share this post


Link to post
Share on other sites
Michel KIRSCH
On 3/14/2021 at 12:42 AM, ton van lil said:

A mod for regrouping events on demand sounds wunderful.

Ton,

you can try this new Mod : Regroup events v13.0.3.1.

To download on : https://tng.lythgoes.net/wiki/index.php?title=Regroup_events  

Let me know if it is useful :-)

Michel

Before :

Regroup-without-all_displayed.jpg

 

After :

800px-Regroup-with-all_hidden.JPG

Share this post


Link to post
Share on other sites
Michel KIRSCH
On 3/13/2021 at 10:30 AM, JPB said:

Could there be a sorting option on the admin input?

Jürgen, Will work on this now....

Michel

Share this post


Link to post
Share on other sites
ton van lil

Michel

Mist this post. This is the mod I am waiting for.

I cannot install it jet cause of an error. I am running TNG 13.03.

image.png

I uninstalled all my mods but error stays.

What can I do best.

Greeting

Ton

Share this post


Link to post
Share on other sites
JPB

Hi Michel,

I tested the Regroup- Mod with all my Mods installed.

There is a conflict with the Relate Mod (getperson line 174).

I changed the code to:

=========== getperson.php ===============

%target:getperson.php%

%location:%
	}

	if(!$tngconfig['sortbydate'])
%end:%

%replace:%
	}

// BEGIN regroup events Mod - Michel Kirsch - #1
	$events = regroup_events($events); // function is in personlib.php
// END regroup events Mod - Michel Kirsch

	if(!$tngconfig['sortbydate'])
%end:%

===================================

After installing I noticed that the dates in the new block are all in English???

Jürgen

Share this post


Link to post
Share on other sites
JPB

I did a few more tests (sorry, I do not want to criticize, I hope to help).

With a clean TNG installation without all Mods, the Mod installs fine.

@ Ton: perhaps you need a new personlib.php?

What does not work is the sorting when an inaccurate date is specified (to, at).

It is possible to assign media to the residence. But they are no longer visible, only the first image is displayed at the end of the block.

And then the language switching does not work ...

Jürgen

Share this post


Link to post
Share on other sites
ton van lil

Tried with new personlib.php. Mod did install, but not working properly.

I think there is a conflict with Display Jobs and Facts.

Try tomorrow again.

Greetings Ton

Share this post


Link to post
Share on other sites
Michel KIRSCH
7 hours ago, JPB said:

changed the code to:

Jürgen,

the change of code you propose have the same effect then the original code  insert before (see below).

So I don't understand why your code works and mine not...

Michel

%target:getperson.php%

%location:%
	if(!$tngconfig['sortbydate'])
		ksort( $events );
%end:%

%insert:before%

// BEGIN regroup events Mod - Michel Kirsch - #1
	$events = regroup_events($events); // function is in personlib.php
// END regroup events Mod - Michel Kirsch

%end:%

%end:%

Share this post


Link to post
Share on other sites
Michel KIRSCH
4 hours ago, JPB said:

And then the language switching does not work ...

Jürgen,

the mod doesn't touch any other code than regrouping the events you designate in your list (RESI and OCCU by default.)

If the language switching doesn't works, it doesn't work without the Mod...

Do you define the translations in each language for the event you try to regroup?

events multilanguage.JPG

 

 

Share this post


Link to post
Share on other sites
JPB

because of the Relate Mod:

	if(!$tngconfig['sortbydate'])
		//relate mod
	$persontext .= "<tr><td valign='top' class='fieldnameback fieldname' ><span class='fieldname'>$text[relationship]</span><img src='img/tng_sort_desc.gif' id='relate' class='toggleicon relateicon' alt='' onclick=\"togglelink('$personID','$tree',1);\" title='$text[expand]'/></td><td colspan='2' class='databack' id='relate1'>"
	.getAnchorName($personID,$tree)."
	</td></tr>\n";
		//end relate mod
		ksort( $events );

Therefore the "location:" does not exist as desired.

But that would not be a problem for me, I can change that myself.

Jürgen

Share this post


Link to post
Share on other sites
JPB

I have now installed the mod on my public site.

Look here and try to switch the language:

https://bourdeaux.de/getperson.php?personID=I1665&tree=bx01

The picture to Amsterdam belongs to the top and the last line "to Oct 1657 - Soubise, FR-17" should be the first line.

Even if I collapse the box, it makes no difference.

 

Share this post


Link to post
Share on other sites
Michel KIRSCH
18 minutes ago, JPB said:

But that would not be a problem for me, I can change that myself

No Jürgen. That will be a problem for every user using the Relate Mod.

I've modified in my code for the next version. Thanks for the tip

Michel

Share this post


Link to post
Share on other sites
Michel KIRSCH
1 hour ago, ton van lil said:

I think there is a conflict with Display Jobs and Facts.

Ton, be careful if you modifiy OCCU (jobs) with Jobs and Facts and with my mod.

If you are only interested by the RESI tag, adapt your list in the parameters. I set RESI and OCCU as default tags, but you must modify the list at your convenience.

Michel

 

Share this post


Link to post
Share on other sites
JPB

Here you can see Isaac's page without your Mod.

All images are visible, the order is correct and the language switching is ok.

I leave the mod installed, but now have to turn off, sorry.

assoc_bx.jpg

Share this post


Link to post
Share on other sites
Michel KIRSCH
5 hours ago, JPB said:

What does not work is the sorting when an inaccurate date is specified

Seen. Will search...

Michel

Share this post


Link to post
Share on other sites
Michel KIRSCH
42 minutes ago, JPB said:

All images are visible

Jürgen, how do you encode your image in the event?

42 minutes ago, JPB said:

the order is correct

OK will search...

43 minutes ago, JPB said:

language switching is ok

In my case, the language switching works with the Mod installed (see my screen shot above) or not

Share this post


Link to post
Share on other sites
bhemph
47 minutes ago, Michel KIRSCH said:

Jürgen, how do you encode your image in the event?

Michel, when you have media assigned to a person you click on the edit button next to the person and can then assign the media to a specific event for that person.

Share this post


Link to post
Share on other sites
Michel KIRSCH
4 hours ago, bhemph said:

Michel, when you have media assigned to a person you click on the edit button next

Thanks. Just find it 2 minutes ago ! :-)

 

Share this post


Link to post
Share on other sites
JPB

Bonjour Michel,

in the morning I have looked at the situation again on my test page (without any other Mod installed).

If I enter an exact date, the sorting is ok.
If I prefix the date with something (for example "from 1901 to 1902" or "aft 1903" etc.), the entry is moved to the end.
To display an inaccurate date in another language TNG does automatically change the language of the entry (if I enter the date in English!). Unfortunately not when the Mod is installed.

Too bad, I don't understand enough about these processes to really be able to help.

I'm not at the PC all day (... otherwise I get trouble with my wife), but will stay attentive.

Jürgen

Share this post


Link to post
Share on other sites
Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×