Connections Counter

From TNG_Wiki
Jump to navigation Jump to search
Restricted Downloads of Connections Counter are restricted to logged in users. If you do not have a user account on the TNG Wiki use the Request Account link to request a user account Restricted
Caution If you have trouble downloading with Google Chrome, Vivaldi, Brave or other Chromium based browser, try using a right-click and select Open in new Window, then F5, or use another browser such as Firefox


Caution


Ambox notice.png The latest version of this mod uses the guidelines for TNG v12+ cust_text.php files. If you are using TNGv12+, and any cust_text.php file in this mod is marked with a Bad Target error, you need to update your cust_text.php files before you can install this mod. [Show instructions]

If you upgraded to TNGv12+, and did not update your cust_text.php files as instructed in the upgrade readme script, then you must use the TNG Mod Manager to update them. To do so:

  1. Go to Mod Manager, and select its "Recommended Updates" tab.
    (If the "Recommended Updates" tab is not visible, then go to the Mod Manager Options tab, select "Display Settings", and turn on the "Recommended Updates" tab.)
  2. Click the "Update" button in the "Recommended Updates" tab.
    Installed mods do not interfere with the update, and if you already have (or think you may have) run this update, it will not hurt for you to run it again.

[See details in the TNGv12 Change Impacts Article][Hide the instructions]

TNG 14.0
TNG 13.0
TNG 12.0


Connections Counter
Summary Compte les connexions à votre site.
Validation
Mod Updated 24 Sep 2023
Download link For
TNG 12.0
TNG 13.0
TNG 14.0
TNG 14.0.3
Connections counter v12.0.2.1k
Download stats Montrer les statistiques
Author(s) Michel Kirsch
Homepage Racines luxo-hennuyeres
Mod Support TNG Community Forums
Contact Developer MyMail
Latest Mod 12.0.2.1k for TNG v12+
Min TNG V 12+
Max TNG V n.c.
Files modified
process_login.php
admin_utilities.php
admin_backup.php
admin_restore.php
admin_optimize.php
customconfig.php
templates/template[1 to 18]/index.php
Related Mods
Notes

Purpose of the Mod

This mod inserts a connection counter at the bottom of your home page. It counts successful connections as well as attempts to connect to blocked accounts.
If a user stays on your site for 5 days, this obviously only counts as one connection! It is therefore not a visit counter!
However, you can use it as a visit counter on one or more pages of your site by inserting a few lines of code (see below)

Functioning

At first use, the program creates a table named tng_hits in your database.
Each time a user of your site successfully connects, the table is updated with the name of the page (here "connect"), the user name, his number of connections and the date of his last connection.
It also records connection attempts to accounts that you have blocked.
Each time you visit the home page of your site, the counter is updated with the total number of connections of all users who have logged in.

You can easily use the existing code as a visit counter on your pages.
For example, you want to know how many visits your "Relationship" page receives (this is a tab on the main page)

  • Edit your "relateform.php" file
  • add these five lines below at the bottom of the file, just before the last line which is "tng_footer( xxxx);"


//====== begin of code =====
include_once ("tng_conn_counter.php");
$xxpagexx = "relateForm";
count_page_user("$xxpagexx", "");
$visites = get_total_visits("$xxpagexx");
echo "<center> Visits for this page : <b>" . $visites . "</b></center>" ;
//======= end of code =======


Don't forget to modify the page name ($xxpagexx = "....";) if you use the counter on another page!
You understand that if you copy this code on different page of your site, the page name must be unique for each page...
Don't forget that if you copy this code on a frequently visited page (for example getperson.php) your counter will quickly panic (Well... It still depends on how many people visit your site...)
if you are a little PHP-DIY, you will quickly understand what you can make with this little table...
See the result :
page "relationship"

Development

Written by : [MichelKirsch] de Charleroi - Hainaut - Belgium

Requirements

A TNG v 12.0.2 installation in working order.

IMPORTANT : Before installing

Before installing, it is judicious to make a backup copy of the following files (they will be modified by this mod)::

admin_backup.php
admin_optimize.php
admin_restore.php
admin_utilities.php
customconfig.php
process_login.php
your complete "templates" folder (unless you prefer to make a backup copy of each of the 18 "index.php" files separately :-()

INSTALLATION

Unzip the received file directly in the "mods" sub directory of your TNG installation. You do not have to create the table manually. It is created automatically at the first execution. On the other hand for the uninstall, it is necessary to manually delete the tng_hits table (It's a very little table : it may stay...)
If demanded, i'll write the code to delete it semi-automatically...

Upgrade

  • Uninstall and Delete the current Mod.
  • Keep your tng_hits table
  • Proceed as for an installation with the new Mod

Known Problems

None at this day...

In the event of a problem

  • Try using the Mod Manager Remove capability
  • Open an issue in the [TNG Community Forums]
  • Copy the backup of the affected files back to your TNG directory

Historic of modifications

Version Release Date Contents
V12.0.2.1k 24 Sep 2023 Ready for TNG 14.0.3
V12.0.2.1j 02 Nov 2022 Fix a "Partially installed" status when Email User Login is installed.
V12.0.2.1h 04 Jan 2022 Add text variable for "Connections".
V12.0.2.1g 23 aug 2020 Multilingual EN (default) - FR.
V12.0.2.1f 09 dec 2019 Modifify text color for templates 08 and 17 where counter was not visible enough.
V12.0.2.1e 18 nov 2019 Little changes to permits ALL operations (Backup/Restore/Optimize) on tng_hits table, like for tng tables.
V12.0.2.1d 16 nov 2019 No changes but complies with mod's naming conventions.
V12.0.2.1c 16 nov 2019 First online version.

Sites using this mod

If you download and install this mod, please add your TNG site to the table below: If you have a problem to do it, send me a mail...

URL User Note Mod-Version TNG-Version User-language
Racines luxo-hennuyeres Michel Kirsch Developper of the Mod 12.0.2.1k 14.0.3 FR/EN/NL/D/SP
Inez & Leifs familjeträd Leif Johnson Public site v12.0.2.1k v14.0.3 SE, EN
Généalogie des familles Meresse et Facon Philippe Meresse v12.0.2.1f 12.2 AN/FR/NL
Auf den Spuren meiner Vorfahren UHaase v12.0.2.1f 12.2 EN
Généalogie des Malvache Cmalvache v12.0.2.1d 12.2 FR
Our Family History Chezzy2 v12.0.2.1f 12.0.2 ES
The Schmit Family Kaasneef v12.0.2.1f 12.2 DE/EN/NL
Site Jgrantham v12.0.2.1f
Backus Family History Dbackus2 v12.0.2.1f 12.2 EN
PARISHES, Genealogy BETTENDROFFER-POECKES etc Cbettend v12.0.2.1f 12.2
Die Geschichte unserer Familie Astrometeo v12.0.2.1f 12.2 DE
jdewberry.net JDewberry v12.0.2.1g 13.0.3 EN
Les Lapierre d'Amérique Public/Private v12.0.2.1g v13.0.4 FR/EN
Genealogy Bastiaanssen Jan Bastiaanssen Public / Private 12.0.2.1h 13.1.2 NL, EN, ES
La Saga BIGEY François B. Public 12.0.2.1j 13.1.2 FR

Snapshot

This is a snapshot of the modified template 10 home page.

The discreet counter is placed at the bottom center of each home page

YACC Accueil