Jump to content
TNG Community
Sign in to follow this  
stores

Surname Cloud

Recommended Posts

stores

Hello all, a little coding help requested...

I added the Surname Cloud to my offline TNG 11.1.2 site this week and i am now looking for the appropriate code to insert into the index.php so that it will automatically calculate the unique surnames in the tree so i don't have to manually update it each time i update the tree.

Surname Cloud.jpg

Share this post


Link to post
Share on other sites
tngrlkrz

The hover tool tips update anytime you access the code.  Or are you referring to the text top100 of xxxx? .  If so, code from statistics.php will give you the total surnames.  Insert it into your index.php and echo the variable $uniquesurnames to display an updated surname count.

$query = "SELECT ucase( lastname) as lastname, count( ucase( lastname ) ) as lncount
FROM $people_table WHERE ucase(lastname) LIKE \"$urlfirstchar%\" $wherestr2 GROUP BY lastname ORDER by lastname";  
$result = tng_query($query) or die ("$text[cannotexecutequery]: $query");  
$uniquesurnames = number_format(tng_num_rows($result));  tng_free_result($result);

 

Ron

Share this post


Link to post
Share on other sites
stores

I was referring to the text top100 of xxxx? It works like a charm... Thank you Ron

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
Sign in to follow this  

×