Jump to content
TNG Community

template 8


coolshooter

Recommended Posts

How to change the data font size setting for template 8 ?

(the font size is too small for this template)

The Calibri font is the culprit. Have a look at my site and see if the font size is large enough for you. With the help of Jeff Robison I have removed Calibri in templates/template8/mytngstyle.css

Link to comment
Share on other sites

coolshooter

The Calibri font is the culprit. Have a look at my site and see if the font size is large enough for you. With the help of Jeff Robison I have removed Calibri in templates/template8/mytngstyle.css

Thanks a lot, I removed "calibri font" and now it's ok .

Link to comment
Share on other sites

Graham,

Unrelated, but would you share the code for third paragraph in your "Welcome" section where you pull the stats in? Is it as simple as copying the "echo" statements from statistics.php, or do I need the query as well?

I assume pages that do this are getting the last GEDCOM import date. Is there a way to get the date from the most recently modified person? I'm using TNG as my primary software, so the last import was 2009.

Link to comment
Share on other sites

....would you share the code for third paragraph in your "Welcome" section where you pull the stats in? Is it as simple as copying the "echo" statements from statistics.php, or do I need the query as well?

I assume pages that do this are getting the last GEDCOM import date. Is there a way to get the date from the most recently modified person? I'm using TNG as my primary software, so the last import was 2009.

The code from the 'Welcome' section of my home page that lists the stats is:

<p>Our database, last updated <?php echo "$lastimportdate" ?>, contains details of <?php echo $totalpeople" ?> individual people, including <?php echo "$uniquesurnames" ?> unique surnames making up <?php echo "$totalfamilies" ?> families! </p>
The following queries are placed at the start of the index.php:
$query = "SELECT count(id) as pcount FROM $people_table $wherestr";  
$result =  mysql_query($query) or die ("$text[cannotexecutequery]: $query");  
$row = mysql_fetch_assoc( $result );
$totalpeople = number_format ($row[pcount]); mysql_free_result($result);

$query = "SELECT count(id) as fcount FROM $families_table $wherestr";
$result = mysql_query($query) or die ("$text[cannotexecutequery]: $query");
$row = mysql_fetch_assoc( $result );  
$totalfamilies = number_format($row[fcount]);  mysql_free_result($result);
  
$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 = mysql_query($query) or die ("$text[cannotexecutequery]: $query");  
$uniquesurnames = number_format(mysql_num_rows($result));  mysql_free_result($result);

$query = "SELECT DATE_FORMAT(lastimportdate,\"%e %b %Y\") as lastimportdate2 FROM $trees_table";
$result = mysql_query($query) or die ($text['cannotexecutequery'] . ": $query");
$treerow = mysql_fetch_array( $result, MYSQL_ASSOC );
$lastimportdate = $treerow['lastimportdate2'];

As you are not importing you could use a query to derive the maximum (most recent) change date from your tng_people table.

Sorry, but I don't have the SQL experience to help with that one.

Link to comment
Share on other sites

The code from the 'Welcome' section of my home page that lists the stats is:

<p>Our database, last updated <?php echo "$lastimportdate" ?>, contains details of <?php echo $totalpeople" ?> individual people, including <?php echo "$uniquesurnames" ?> unique surnames making up <?php echo "$totalfamilies" ?> families! </p>
The following queries are placed at the start of the index.php:
$query = "SELECT count(id) as pcount FROM $people_table $wherestr";  
$result =  mysql_query($query) or die ("$text[cannotexecutequery]: $query");  
$row = mysql_fetch_assoc( $result );
$totalpeople = number_format ($row[pcount]); mysql_free_result($result);

$query = "SELECT count(id) as fcount FROM $families_table $wherestr";
$result = mysql_query($query) or die ("$text[cannotexecutequery]: $query");
$row = mysql_fetch_assoc( $result );  
$totalfamilies = number_format($row[fcount]);  mysql_free_result($result);
  
$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 = mysql_query($query) or die ("$text[cannotexecutequery]: $query");  
$uniquesurnames = number_format(mysql_num_rows($result));  mysql_free_result($result);

$query = "SELECT DATE_FORMAT(lastimportdate,\"%e %b %Y\") as lastimportdate2 FROM $trees_table";
$result = mysql_query($query) or die ($text['cannotexecutequery'] . ": $query");
$treerow = mysql_fetch_array( $result, MYSQL_ASSOC );
$lastimportdate = $treerow['lastimportdate2'];

As you are not importing you could use a query to derive the maximum (most recent) change date from your tng_people table.

Sorry, but I don't have the SQL experience to help with that one.

Thanks Graham!

I just placed your code on my site under "Latest News".

Bryan

Link to comment
Share on other sites

  • 3 years later...

Hi all,

  1. Is this code compatible with TNG 10.1.1?
  2. Were exactly at the start of the index.php file does 2nd lot of code sit? ie. after the <?php, and before the ?

Thanks, Merv

Link to comment
Share on other sites

It should work - the main thing is that all the instances of 

mysql_xxxxx (where xxxxx is query or result etc)

need to be replaced with

tng_xxxxx

Roger

Link to comment
Share on other sites

On 09/12/2015 at 0:26 AM, theKiwi said:

It should work - the main thing is that all the instances of 

mysql_xxxxx (where xxxxx is query or result etc)

need to be replaced with

tng_xxxxx

Roger

Thanks for reply Roger,

I replaced all the coding as instructed and placed the queries at the start of the index.php file (after the "<?php" line and before the "$flags['noicons'] = 1;" line. However I get an error message... Fatal error: Call to undefined function mytng_query() in /home/whakapap/public_html/templates/template8/index.php on line 4.

I must be doing something wrong?

Merv

Link to comment
Share on other sites

1 hour ago, Merv said:

Thanks for reply Roger,

I replaced all the coding as instructed and placed the queries at the start of the index.php file (after the "<?php" line and before the "$flags['noicons'] = 1;" line. However I get an error message... Fatal error: Call to undefined function mytng_query() in /home/whakapap/public_html/templates/template8/index.php on line 4.

I must be doing something wrong?

Merv

Read Roger's instructions again. You have replaced mysql_query with mytng_query instead of tng_query. Also, all instances of mysql_fetch need to be changed to tng_fetch.

 

Link to comment
Share on other sites

whoops... replaced the code again... but now I get... Fatal error: Call to undefined function tng_query() in /home/whakapap/public_html/templates/template8/index.php on line 4.  Here's the first part of the code that I have used...

$query = "SELECT count(id) as pcount FROM $people_table $wherestr";  
$result =  tng_query($query) or die ("$text[cannotexecutequery]: $query");  
$row = tng_fetch_assoc( $result ); 
$totalpeople = number_format ($row[pcount]); tng_free_result($result); 

 

Link to comment
Share on other sites

I tried my code in the same place as yours and it works with no problem. It sounds like something is missing on your site setup, but I have no idea what it could be.

Link to comment
Share on other sites

6 minutes ago, Hiraeth said:

I tried my code in the same place as yours and it works with no problem. It sounds like something is missing on your site setup, but I have no idea what it could be.

Thanks Graham and Co... Your help is appreciated. I will leave this one on the backburner for a while :)

Link to comment
Share on other sites

backtracking... I found a quotation mark missing in the original body code. I then installed both sets of code and it is now working. I think the missing quotation mark sent me in the wrong tangent when I started to alter the query codes to try and get this working?.

I have not included the last updated date because I think it points to the last import date. If someone could share last update query code it would be appreciated :)

www.whakapapaonline.com

Cap.png

Link to comment
Share on other sites

36 minutes ago, theKiwi said:

No, you should remove the " mark that follows $totalpeople and that should work - you don't need to quote then $variables.

Roger

Thanks Roger, I removed the quotation mark and that works :)

Going on another tangent here... but did you see my post re your " In Memoriam Display "?

Cap.png

Link to comment
Share on other sites

Merv

As Roger says, the quotation marks around the $variables are not necessary. But as you discovered if you use the quotation marks then you must have them before and after the variable.

Link to comment
Share on other sites

  • 1 year later...

Hi,

Picking up on this old topic, curious as to how Bryan added this to the Latest News section of his site? 

I too use template 8 and when I include the below code in my template 8 setup file, the variables are not retained or passed to the index.php page.

On 2012-4-27 at 3:50 PM, Hiraeth said:

 

The code from the 'Welcome' section of my home page that lists the stats is:

 

 

<p>Our database, last updated <?php echo "$lastimportdate" ?>, contains details of <?php echo $totalpeople" ?> individual people, including <?php echo "$uniquesurnames" ?> unique surnames making up <?php echo "$totalfamilies" ?> families! </p>

 

 

Thanks

Link to comment
Share on other sites

The 'Welcome' code is designed to be in the body of your template8/index.php (see Bryan Larson's post above) and not in  admin > setup > template settings.

Also all the instances of mysql_xxxxx (where xxxxx is query or result etc) need to be replaced with tng_xxxxx in current versions (v11+) of TNG.

There was also an error (rogue double quote) in the original Welcome screen code (see above).

If you cover both these areas it should work on your site.

Link to comment
Share on other sites

I just did some testing, and, with some tweaking for fonts,etc.,  the 'Welcome' code can work on other templates as well.  I do periodic (entire tree) gedcom imports and until now, have been manually updating the welcome text with the latest stats.  However, I was also including the nbr of photos, docs, headstones,notes, etc., but perhaps this will suffice, since not sure how to grab those other stats.

Thanks!

Link to comment
Share on other sites

I have an About Us page which includes Quick Site Stats that I update manually each time I do a  new gedcom import. It's not an inconvenience to do this manually but perhaps I can incorporate this code to do it automatically but might be more work than worthwhile considering it probably? would require constructing a table.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
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.

×
×
  • Create New...