coolshooter Posted April 23, 2012 Report Share Posted April 23, 2012 How to change the data font size setting for template 8 ?(the font size is too small for this template)Thanks...CD Quote Link to comment Share on other sites More sharing options...
Hiraeth Posted April 23, 2012 Report Share Posted April 23, 2012 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 Quote Link to comment Share on other sites More sharing options...
coolshooter Posted April 26, 2012 Author Report Share Posted April 26, 2012 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.cssThanks a lot, I removed "calibri font" and now it's ok . Quote Link to comment Share on other sites More sharing options...
cmhbob Posted April 27, 2012 Report Share Posted April 27, 2012 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. Quote Link to comment Share on other sites More sharing options...
Hiraeth Posted April 27, 2012 Report Share Posted April 27, 2012 ....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. Quote Link to comment Share on other sites More sharing options...
bsl20b50 Posted April 27, 2012 Report Share Posted April 27, 2012 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 Quote Link to comment Share on other sites More sharing options...
cmhbob Posted April 27, 2012 Report Share Posted April 27, 2012 Thanks much! Quote Link to comment Share on other sites More sharing options...
Merv Posted December 9, 2015 Report Share Posted December 9, 2015 Hi all,Is this code compatible with TNG 10.1.1?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 Quote Link to comment Share on other sites More sharing options...
theKiwi Posted December 9, 2015 Report Share Posted December 9, 2015 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 Quote Link to comment Share on other sites More sharing options...
Merv Posted December 10, 2015 Report Share Posted December 10, 2015 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 Quote Link to comment Share on other sites More sharing options...
Hiraeth Posted December 10, 2015 Report Share Posted December 10, 2015 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. Quote Link to comment Share on other sites More sharing options...
Merv Posted December 10, 2015 Report Share Posted December 10, 2015 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); Quote Link to comment Share on other sites More sharing options...
Hiraeth Posted December 10, 2015 Report Share Posted December 10, 2015 This works with no problem on my site (TNG v10.1.3). What do you have before that code in your index.php? Quote Link to comment Share on other sites More sharing options...
Merv Posted December 10, 2015 Report Share Posted December 10, 2015 I have the code right at top of the page with the "<?php" on the line before it (excluding the quotation marks) Quote Link to comment Share on other sites More sharing options...
Hiraeth Posted December 10, 2015 Report Share Posted December 10, 2015 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. Quote Link to comment Share on other sites More sharing options...
Merv Posted December 10, 2015 Report Share Posted December 10, 2015 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 Quote Link to comment Share on other sites More sharing options...
Merv Posted December 10, 2015 Report Share Posted December 10, 2015 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 Quote Link to comment Share on other sites More sharing options...
theKiwi Posted December 11, 2015 Report Share Posted December 11, 2015 No, you should remove the " mark that follows $totalpeople and that should work - you don't need to quote then $variables. Roger Quote Link to comment Share on other sites More sharing options...
Merv Posted December 11, 2015 Report Share Posted December 11, 2015 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 "? Quote Link to comment Share on other sites More sharing options...
Hiraeth Posted December 11, 2015 Report Share Posted December 11, 2015 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. Quote Link to comment Share on other sites More sharing options...
Merv Posted December 11, 2015 Report Share Posted December 11, 2015 Thanks again Graham. It is surprising how 1 quotation mark can make the whole page nonfunctional.. well it did mine. Another lesson learnt. Quote Link to comment Share on other sites More sharing options...
kempons Posted April 26, 2017 Report Share Posted April 26, 2017 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 Quote Link to comment Share on other sites More sharing options...
Hiraeth Posted April 26, 2017 Report Share Posted April 26, 2017 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. Quote Link to comment Share on other sites More sharing options...
tngrlkrz Posted April 26, 2017 Report Share Posted April 26, 2017 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! Quote Link to comment Share on other sites More sharing options...
DelG Posted April 26, 2017 Report Share Posted April 26, 2017 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.