This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

Custom Integration with TNG - advice needed
#1

Hi Steven, I'm preparing a second installation of Commentics into my second website. It's a personal genealogy website (Chambers Family Ancestry) that uses TNG software (The Next Generation of Genealogy Site Building). The program is written mostly in PHP and is a huge piece of software.

To my knowledge there are no other TNG websites that has Commentics added in. Thus I'll be the first.

I will be installing the Comments on the Individual persons only pages (a total of 961 people). The PHP page that generates the Individual person (such as my Great Great Great Grandfather - Charles Hamilton Chambers) is called getperson.php and I have isolated the PHP script that calls in just the name only.

What I need advice with is: when creating a new Comments page, Commentics is set up to pull in the page Title <title>. However, in TNG the automatically generated page title will be far too much information to use with Commentics.

For example, if I were to install Commentics at Chambers Family Ancestry, it would pull in the title of each person such as:
Code:
<title>CHAMBERS, Charles Hamilton b. 18 Apr 1829 Blount County, Tennessee, United States d. 20 Sep 1880 Blount County, Tennessee, United States: Chambers Family Ancetsry</title>

I want Commentics to import only the name of the person without all the other data.

My question is, exactly where in Commentics can I change the specific script to call in a custom page Title?

Any advice will be most appreciated.

Also, one more question. I see a lot of nice and important changes coming in the next version of Commentics. When do you suppose you'll be releasing this next version?
Reply
#2

Hi,

The code which retrieves the <title> is in /comments/includes/functions/page.php, lines 176 to 212. The part of the code where it actually has the <title> stored as a variable, $match[1], is line 202. So this is where you could do something with it.

However I wonder whether using the <title> is the best way. Two problems with the <title> are that firstly it's slow to retrieve because it requires the script to effectively open the page to look at its source code before loading the rest of Commentics. Secondly the <title> can change and it's important for whatever you use as the $cmtx_page_id to be consistent. Granted, if you're extracting a name from it then it's going to stay the same.

If possible, I think it's always better to use the system's internal ID. For example, I noticed on the site that you linked to, it has this in the URL: personID=I235

So maybe the following would be an option?

PHP Code:
<?php 
$cmtx_page_id
= $_GET['personID'];

I suppose you could be wanting to use the <title> for the $cmtx_reference value. Even so, I imagine there must be a way to get the person's name through an internal variable or a call to the database. Trying to extract it from the <title> tag seems a bit hit and miss. That's if I'm understanding what you are trying to do anyway.

Have you completed the interview?
Reply
#3

Generally I tend to release a new version every 3 or 4 months, although I'm trying to increase the amount of time between each version because I know the upgrade procedure is currently quite rudimentary and a lot of people find it to be a pain if they've made customizations. The last release was in February so I think it will be June at the very earliest. There are still a lot of things that I plan to do for v2.4. I only feel about 1/4 of the way into it.

Have you completed the interview?
Reply
#4

Thanks Steven. This is exactly what I'm after. You've provided some excellent advice and should be extremely helpful in pointing the way to get this smoothly integrated without pulling teeth.

I need to play with the code a bit and get it running and experiment with smoothing it out.

I am sure that if I can get it running flawlessly, there will be countless other TNG based websites that want the instructions for integration also. So If I can get this worked out I'll write a review, recommendation, and instruction for installing Commentics into TNG (on the TNG forums).

I'l post back with an update.

Thanks Man!!!

(24-Apr-2013, 08:57 PM)Steven Wrote:  Hi,

The code which retrieves the <title> is in /comments/includes/functions/page.php, lines 176 to 212. The part of the code where it actually has the <title> stored as a variable, $match[1], is line 202. So this is where you could do something with it.

However I wonder whether using the <title> is the best way. Two problems with the <title> are that firstly it's slow to retrieve because it requires the script to effectively open the page to look at its source code before loading the rest of Commentics. Secondly the <title> can change and it's important for whatever you use as the $cmtx_page_id to be consistent. Granted, if you're extracting a name from it then it's going to stay the same.

If possible, I think it's always better to use the system's internal ID. For example, I noticed on the site that you linked to, it has this in the URL: personID=I235

So maybe the following would be an option?

PHP Code:
<?php 
$cmtx_page_id
= $_GET['personID'];

I suppose you could be wanting to use the <title> for the $cmtx_reference value. Even so, I imagine there must be a way to get the person's name through an internal variable or a call to the database. Trying to extract it from the <title> tag seems a bit hit and miss. That's if I'm understanding what you are trying to do anyway.
Reply
#5

Yeah let me know and I'll add it to the Implementations page.

Have you completed the interview?
Reply
#6

(25-Apr-2013, 11:49 AM)Steven Wrote:  Yeah let me know and I'll add it to the Implementations page.

Okay. Good news. I have it all up and running perfectly. So how would you like me to submit to you the instructions to integrate Commentics into TNG?

I can write a steps list with description and include some files, then compress them and upload for you to go over with suggestions?
Reply
#7

Submit them as an attachment here if you like.

Have you completed the interview?
Reply
#8

(26-Apr-2013, 07:56 PM)Steven Wrote:  Submit them as an attachment here if you like.

LOL. Funny thing is that I've really been motivated to work on this non-stop. I have a very nice little package put together, and a web page written.

I have not as of yet made this web page available to other TNG users. I needed to first give you an opportunity to suggest any additions or changes. But it's ready to go.

Here is where TNG users will be pointed to: Commentics for TNG

Wink
Reply
#9

Very nice. The instructions are clear and from what I can tell the code parts seem fine.

A few spelling mistakes and typos here and there but that's hardly important.

I did notice that the 'sort by' feature on your live version doesn't seem to be working quite right. After selecting the oldest, the resulting page doesn't show the Commentics script.

Just wondered also, did you receive the wiki email a few days ago about your new account? You mentioned that you wanted to create some content for the 'Get help for this page' links in the admin panel.

Have you completed the interview?
Reply
#10

(27-Apr-2013, 12:16 PM)Steven Wrote:  Very nice. The instructions are clear and from what I can tell the code parts seem fine.

A few spelling mistakes and typos here and there but that's hardly important.

I did notice that the 'sort by' feature on your live version doesn't seem to be working quite right. After selecting the oldest, the resulting page doesn't show the Commentics script.

Just wondered also, did you receive the wiki email a few days ago about your new account? You mentioned that you wanted to create some content for the 'Get help for this page' links in the admin panel.

Thanks Steven. I'll have to re-read all the text again and hunt for spelling and punctuation errors. I really need to replace my keyboard.

Yea, that is strange about the Sort Order bugging out like that. On the first installation of Commentics on my personal website, everything works just fine. However, I'm using static pages there. But on the Chambers Ancestry website, those are dynamic pages. I've just played with the Sort By options and mo matter what the comments disappear. So I've disabled all options other than Newest. I did notice that if I change the Sort by, the page auto refreshes and the comments are gone; but if I click on the back button the comments are then shown with the sort order I just selected.

As for the Commentics WiKi, yep, I did get the email and will be adding some content there for you. Thanks.
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by Ben
24-Aug-2023, 02:16 AM
Last Post by nsuomine
20-Jan-2023, 08:32 AM
Last Post by Steven
23-Jan-2019, 02:07 PM
Last Post by news
18-Dec-2017, 09:15 AM

Forum Jump:


Users browsing this thread: 17 Guest(s)