https://www.dreamhost.com/blog/how-to-create-your-first-wordpress-plugin/ NOT released 19/01/2025 - pp_index.php is modified to only show links to Login, Register.., Recover... if $bUsersMustLogin = true. - Fixed problem if no session user gets message "Sorry you have exceeded the number of queries allowed per day.." Problem was line 204 need intval() added: $n = intval($AdminConnection->RunScalar($sql)); Also didn't set queriesPerDay. - Fixed pp_admin.php. To run this file start with pp_admin.htm. It can only be run if the user is admin, which is set by the account table AdminLevel field=2. - Changed RecordActivity() so it records if $rather than bLimitNumberOfReports is true. - Updated descriptive text in pp_config.php regarding result formatting. - Modified /css/site.css to fix font-size in tables. - To assist debugging, the URL for pp_searchresults.php now has an optional parameter: debug=1. When this is added to the querystring, the page will return the SQL query. This can then be used in phpMyAdmin. V7.3.1 06/11/2024 - pp_connector.php changed so SQL string are now reversed. This is to prevent SQL injection detection causing the users IP address to be blocked. - Fixed pp_session.php to correctly handle $bUsersMustLogin = false; - Added option to colorize the background of pedigree cells by gender. Modified PrintPedigreeNode() by adding an extra parameter, $bMale to indicate if the cell is on the male or female side of pedigree. Added another pp_config.php option to control this: $bShowGenderAsBackgroundColor. If true, it overrides the colorize repeated ancestor option $bColorizeRepeatedAncestor and instead sets the CSS class on each cell to ismale or isfemale. To change the background color of each gender, edit the site.css file. V7.3.0 03/07/2024 - Note: almost every file has changed. Most of the admin tables have changed, i.e. account, session, activity. The reason for the change is that we are now using session cookies instead of the IP address. This makes it mobile friendly. - The account table now has an extra field, "AdminLevel". Default value is 0 for a normal user, 1 for an associate (some extra privileges), 2 for administrator. - Session is now maintained via a cookie rather than using the IP address. This fixes the problem of accessing via a mobile phone as these constantly change the IP address with each page access. - The session table, "IPAddress" field now stores the cookie value. This is a random string assigned at the start of each session. - The activity table is changed. SessionId is removed and replaced with Account. - The function PrintStartHtml() has been renamed StartHtml(). - pp_login.php is modified to call StartHtml() first so as to get the $cookieVal. - bRecordActivity is no longer used. - $bUsersMustLogin if false means the account, session and activity tables are not used. If true then: - the account table will be read to get Name, QueriesPerDay, AdminLevel - at login, the session table has a record added for the session cookie. It records the account and any parameters the user has set for this session. - the activity table will be written and the number of reports run will be limited. Any activity that causes data to be retrieved will cause an activity record to be added. This is also the only way we can reliably prevent over use. Note for people upgrading: - Modify account table to add integer field AdminLevel with default value 0. - Replace the pp_common.php, pp_login.php and pp_session.php files. - Optionally replace the /css/site.css. - Replace the activity table. Use the following: DROP TABLE `activity` CREATE TABLE `activity` ( `DateTime` datetime NOT NULL, `Account` varchar(64) NOT NULL, `Database` varchar(32) DEFAULT NULL, `Operation` varchar(32) DEFAULT NULL, `Details` varchar(64) DEFAULT NULL, PRIMARY KEY (`DateTime`,`Account`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci - replace the session table. Use the following: drop table session CREATE TABLE `session` ( `Cookie` varchar(64) NOT NULL, `DateTime` datetime NOT NULL, `Account` varchar(32) DEFAULT NULL, `Parameters` varchar(128) DEFAULT NULL, PRIMARY KEY (`Cookie`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci V7.2.2 13/03/2024 - Breaking change to pp_connector.php. Pedigree Cloud/Publisher V4.2.18 and above will only work with Connector V7.2.2. - Changed pp_connector.php so the 'sql' parameter can be get or post. - In pp_common.php, changed SafeUrlEncode() to use: return $input ? preg_replace("/'/", "%27", rawurlencode($input)) : "";// avoid deprected null parameter - In pp_common.php, changed PrintReportHeader() to check $szPhotoPath exists. - In pp_reverseped.php, changed PrintReverseNode() to check if $szPhotoPath exists. - Modified pp_connector.php by adding op=photos which returns list of photos in the image folder. Used by Pedigree Cloud for Insert Photo drop list. - Modified pp_externalped.php so it doesn't call LoadSession(). V7.2.1 05/06/2023 - Fixed problem with multiple commands in pp_connector.php. - Some users were getting the 'id is too long.' message because the code checked id's were less than 48 characters. Changed code to use $maxIdLength from pp_config.php and set it to 60. Users should add that to their pp_config.php. - Modified pp_connector.php so it doesn't call $sql = $_POST['sql'] as this causes the debugger to freak if that variable is not set. - Modified pp_common.php to change the Heredoc code so it is NOT indented as this causes it to not be correctly parsed. - Note to users when setting $DatabaseHost to a domain name rather than an IPV4 address. This may fail if the connection is IPV6 as the client IP address won;t be on the Remote MySQL access list. - Fixed problem with RecordActivity() putting a backslash in front of single quotes in the details field of the activity table. V7.2.0 11/03/2023 - Fixed private records showing reverse pedigree and trial mating. - Fixed link to private record from sire or dam in search results to pedigree, sibling, reverseped, offspring, verticalped. - Test with PHP version: 8.2.3 - The http://pedigree.cloud data service is now from the "connect" controller. Modified HostedDataConnection.RawQuery() and changed to "/Connect/RunQuery?key=". - If connecting to SQLite, the "insert ignore" SQL statement has to be changed to "insert or ignore"!! - pp_searcresults.php changed to: $nMarks = intval($record['_marks']); - CSS changes. Controls and buttons with less padding, no rounded corners. Footer text smaller. No white text. - Fixed bugs in pp_loader.php for op=count and showtable. - A lot of restyling. This mostly is changes in css/site.css but also pp_footer.php. - Debug info at https://docs.devsense.com/en/vscode/debug?from=vscode - Modified pp_config.php to add: $szSearchResultsPage = "pp_searchresults.php"; and fixed "Next 100" in pp_searchresults.php. - Changed pp_search.php and pp_searchresults.php so it has an extra search option of "Group" which is populated from $aMarkColorTooltips in pp_config.php, i.e. these are the names that appear in the legend at the bottom of the search results and various reports. The default option is "Any" but if one of the other options is chosen then the search is restricted to entries that have that bit set in the _Marks field. - Minor change to pp_trialmatingpedigree.php so it includes the marks legend. - Minor change to pp_trialmating.php so it includes gender. - Changed trialmating.php so it doesn't show subject's details. - Changed pp_stringformatter.php so it doesn't throw an exception on an invalid date. - Added [External Pedigree] link. - All report forms now check length of id parameter is less than 48. This is to partially avoid SQL and DDOS attacks. - StringFormatter completely changed. Previously the dynamic fields looked like {fieldName:format:css class} They now look like this: {b=before text;f=field name;r=format;s=css class;a=after text} Note that if a field is empty then the before and after text is not output. Note GetUntil() will get until the condition is true. Previously it was false. - $nPhotoHeight is no longer used. The width is set in the pedphoto style. - $photoField now specifies the name of the field containing the photo. - Previously the field names in a format string had to be in lower case. Now they don't. - A different format can now be specified for the first three generations so rather than just $ancestorDetailsFormat the pp_config MUST also specify $ancestorDetailsFormat123 for the first three generations. $ancestorDetailsFormat is used for all other generations. - Changed the way the stringformatter handles %.2p. It now automatically adds the % after. Also if the token variable is not a field in the resultset then it is output instead. This is a convenient way of outputting a span tag with static text and CSS class. - Fixed bug in pp_stringformatter.php which was setting the css class to title instead of $token->style. - Added a new page: pp_searchWithresults.php which has the search controls and the results on the same page. This view requires extra pp_config.php variables as follows: $countriesToSearch, $countryFieldName, $searchWithResultsHeadings, $searchWithResultsFormat - Changed styles. Now using a more boostrap like style. - CreateSession() now takes an anonymous argument. If true it doesn't update lastlogon. - Added option for a logo. In pp_config set $websiteLogo = "mysite_logo.jpg". - Added option for a watermark. In pp_config set $watermark = "my_watermark.jpg". - Fixed EscapeString() to handle null values. - Changed pp_offspring.php so it finds offspring by searching BOTH the sire and dam fields. This avoids the problem of not finding offspring if the sex of the subject is incorrect or incorrectly determined, e.g. by a user using sex values like Mare, Gelding etc. - Added $malePattern = '/^m|stallion|colt|gelding|dog/i'; to pp_config.php to allow user configurable setting of whether an entry is male. Separate choices with a pipe (|) symbol. The above example will match anything starting with "m" and also stallion|colt|gelding|dog. - Added $sireSearchPattern and $damSearchPattern to pp_config with typical values as follows: $sireSearchPattern = "sex like '%m%'"; $damSearchPattern = "sex like '%f%'"; This can be changed for horses e.g. as follows: $sireSearchPattern = "(sex = 'Stallion' or sex='Colt')"; $damSearchPattern = "(sex = 'Mare' or sex = 'Filly')"; - Fixed exception in pp_searchresults.php is sire or dam is null. - Fixed exception in pp_common.php if Photo field exists but value is null. These exceptions seem to be because PHP8.0 now deprecate passing null to many functions. V7.0.12 02/02/2022 - Fixed messages starting "There have been X changes.." to use the current table instead of pedigree. - Fixed Session->CreateSession() so it expires 1 day after session start. - Fixed search results message so it includes date of last added. V7.0.11 - 19/12/2021 - Now using PHP 8.1.1. - Minor change to GetChampionClass() so PHP 8.1 doesn't object. - Fixed bug in GetChampionClass() that was showing all records as champions. - Changed champion test in GetChampionClass() so it searches both the pretitle and posttitle fields. The pattern "/ch|cdx/i" will match pretitle or posttitle containing a "ch" or a "cdx", case insensitive. See: https://www.php.net/manual/en/reference.pcre.pattern.syntax.php - Fixed test4.php. Uncomment echo phpinfo() to run test4.php. It is commented out to avoid security concerns. V7.0.10 - 05/09/2021 - Note: this version has only been tested on PHP 7.3.2. - Minor fix for HostedDataConnection. The returned string was not decoded so e.g. colon appears as \c. - Minor fix to StringFormatter so that the static text that comes before dynamic text is now printed if the dynamic text is empty but with commas removed. This fixes the problem that "({sex})" would come out as say "(female" without the trailing paren. V7.0.9 - 04/06/2021 - Added $HostedAdmin option to pp_config.php. If false then the hosted connection will not be used for administration, i.e. the account, session and activity tables will not be accessed. - Modified Session class so it support both MySQL and SQLite. - Changed ManagedDataResult to HostedDataResult - Added [LOGIN] link. Added [ADMIN] link if the user is logged in with the administrator account as specified by the $DatabaseAdmin variable in pp_config.php. - Changed search so records with a name starting with # are not returned. - Fixed advanced search message: "Searching database .. here are the entries that match..". - Fixed flexible search so single quotes are also replaced with %. V7.0.8 - 14/05/2021 - Fixed pp_offspring showing one less litter. - Changed wording on pp_search.php. Added placeholder to search string. - Slight change to when $bShowRowsLastModifiedInSearchResults=true. It now gets the greatest of the Modified and Created datetimes. Note when a record is added, only the Created datetime is set not the Modified. - Fixed pp_session.php error with "insert into activity", duplicate key. Increased time resolution and added ignore. V7.0.7 - 12/05/2021 - Added option $bShowRowsLastModifiedInSearchResults in pp_config.php, which if true will print the number of rows and when last modified. Note: this relies on the table having the Modified and Created fields. - Automatically set copyright year. - Added option in pp_search.php to to search "Flexible". This replaces any spaces in the search string with % codes which are used in a MySQL like statement. - Changed CancelSession() so it expires the session record rather than delete it. The problem with deleting it is that the activity record is linked to the session record so deleting the session record would make the activity records not be related to a specific account or IP address. V7.0.6 22/03/2021 - Fixed problem that users can search without logging in. V7.0.5 - 21/03/2021 - Changed offspring report to order by DOB then mate. - pp_config.php now allows setting default date format via StringFormatter::$defaultDateFormat = "m/d/Y"; V7.0.4 - 20/03/2021 - Fixed numeric format using p (percent). - Fixed PedPub export not returning error messages. - Fixed $szPrivateTest in pp_config.php so it handles _marks null values. V7.0.3 - 10/03/2021 - Fixed trial mating. - Fixed PedPoint export from PedPub. V7.0.2 - 23/02/2021 - Photo tags are now only emitted if the photo field is not empty. - To support links in pedigree reports going to a specific version of pp_pedigree.php, it now uses the $szPPPedigree, $szPPVertical, $szPPReverse parameters from pp_config.php. V7.0.1 - 21/02/2021 - Deleted DataField class as it only had name and type and we now have all field values as string so type is irrelevant. The reason for the change is that mysqli only ever returns strings. Types were only needed by StringFormatter for distinguishing how to apply the format string. We now assume if the format string starts with % then it is a number otherwise it is a date. For numbers the normal sprintf format strings apply. In addition percentage format is provided by using a % code with p instead of f. In this case the number is multiplied by 100. - Champions can now optionally have the name with titles formatted, e.g. as red and bold. Set the pp_config.php $showChampionsPattern regex pattern to detect champion in the pretitle field. If it is a champion then the "champion" style is applied. This can be modified in the pp_styles.css file. V7.0.0 - 16/02/2021 - Introduced DataConnection, HostedDataConnection, DataResult, ManagedDataResult classes. This allows PedPoint to optionally connect to a MySQL database or a Managed File. - Pedigree data is now no longer case sensitive to make them compatible with SQLite - which is what Pedigree Cloud Managed Files uses. This will cause problems with a MySQL database because they are by default case insensitive so pedigree and other reports will then miss some ancestors where the case is different. - Introduced LexerSource and StringFormatter classes to allow users to specify exactly which fields are displayed and what the format of those fields is and what the CSS style is. - Removed get_magic_quotes_gpc() because its deprecated and is no longer required. - The last generation of the pedigree report only has the name and titles and no details. This is so as to reduce the overall height of the pedigree. - Offspring report changed so that offspring are grouped only by mate rather than mate and DOB. - Removed "Pedigree w/o links" as this is replaced by [Printable Version] V6.1.5 - Added [Printable Version] option to all reports. - Admin tables: account, session, activity can now optionally be stored in a separate database. Note: The createtables.txt file has now been split into createtables.txt (for just pedigree) and createtablesadmin.txt for the admin tables. Note: dbtables was removed as this is replaced with $TableNames in pp_config.php. V6.0.0 - Big change here is that the pedigree table does not store SireId and DamId but instead stores the actual Sire and Dam names. This requires the existing pedigree tables to be dropped and new ones created. Also the PedPoint export expression needs to be changed. V5.0.8 - Fixed ipaddress not in activity table. ================================== V5.1.1 - 13 Nov 2018 - Fixed CancelSession() so an incorrect login will logout the user. ================================== V5.1.0 - ?? Aug 2017 - Created Styles and Scripts folders ================================== V5.0.3 - 21 May 2017 - Added more mark colors and placed the array in pp_config.php so users can change. - Added a legend for the marks at the bottom of the search results and pedigree report. The mark legend is set in the pp_config.php file on the $aMarkColorTooltips variable. - Each mark now also has the mark legend as its tooltip. ================================== V5.0.2 - 15 May 2017 - Fixed error calls to PrintHead() - Fixed gens hardwired to 5 in pp_searchresults.php ================================== V5.0.1 - 12 Mar 2017 - Changed pp_searchresults.php to force $nGens=5. ================================== V5.0.0 - 26 Feb 2017 - Put all HTML page start and end in pp_header.php and pp_footer.php. - Added an pp_index.php ================================== Version 4.2 - Combined Pro and Lite into one package. Just use the $bUsersMustLogin in pp_config.php to set either Pro (login required) or Lite mode. Only changes are to pp_config.php and pp_session.php. ================================== Version 4.1.4 - pp_session.php - fixed call to CreateSession() for Lite which had no arguments so added two fake arguments. Version 4.1.3 - pp_login.php, pp_admin.php mysqli_close(), $link added. - Problems in pp_common.php, pp_commonped.php fixed. - pp_session, $link added to global Version 4.1.2, released 08 Feb 2015. Changes as follows: - Changed all instances of mysql to mysqli. - Changed pp_ismobile.php. Changed ALL_HTTP to HTTP_USER_AGENT. - Changed pp_common.php. Added line "global $szThisYear;" to function PrintNotice(). Added line "mysqli_set_charset('utf8',$link);" to fix problem with European characters. In PrintReportHeader(() changed $details[11] to $details[10]. - Changed pp_session.php. In CreateSession() added $bRecordActivity to the global statement. - Changed pp_config.php. Changed $nShowSireDam to $bShowSireDam. - Changed pp_trialmatingpedigree.php. Removed line "$extLink = $_GET['link'];". Added lines to create a fake entry for the offspring so it now correctly displays duplicates. - Changed pp_commonped.php. Added $szPPCorrection to global in PrintPedigreeNode(). - Changed pp_pedigree.php removed line 21 "$extLink = $_GET['link'];" - Changed pp_verticalped.php. Added $nPhotoHeight to global in PrintNode() - Changed pp_reversped.php. Added $nPhotoHeight to global in PrintNode() - Changed pp_offspring.php. Added $szPPOffspring to global in PrintNode() - Changed $Connection->EscapeString() to $Connection->EscapeString() in many files. ================================== Changes in V4.1.1 25 Sep 2013 - Changed pp_loader.php to encode . ================================== Changes in V4.1 13 Apr 2013 - List of table names and descriptions can now optionally be stored in the dbtables table. The list can still be stored in $TableNames but if thisd is blank then it will be obtained from dbtables. ================================== Changes in V4.0 24 Feb 2013 RdJ changes - Modified generated HTML to be HTML5 and CSS3 compliant. Tables now have a single border. - Modified all tags to use CSS styles or classes rather then deprecated attributes, e.g width, bgcolor, height - Fixed bugs in pedigree, vertical pedigree and sibling where closing tr tags were missing - Fixed search results next 100 link - changed pp_breeding to pp_offspring and removed full siblings. KW changes - Detection of mobile client and modifications of rendered page to allow for mobile - External pedigrees - displays a pedigree from a previously generated link - Added pp_session0.php - Added advanced search page - Added trial pedigrees - Changed photo render to fix height instead of width ================================== Changes in V2.6.0 - Changed all reports and forms to use CSS - styles are set in the pp_styles.css file - Option in pp_config.pl $nShowSireDam = 0;#set this to 1 show sire and dam in the search results ================================== Changes in V2.5.0 - Search form now has option to order by name or date of birth - Search form allows option for where seawrch string occurs within the field, specifically: begining, end, exact, anywhere - Breeding report had a limit of 200 offspring - this is now increased to 1000. - Breeding report was organised in breedings, i.e. same mate. It is now organised into litters. - Vertical pedigree added which includes the full siblings of each ancestor.