From 4c7b7ec41937b56b08b66e9579e111c0c5bdb048 Mon Sep 17 00:00:00 2001 From: Olivier van Helden Date: Tue, 7 Jan 2025 11:53:22 -0400 Subject: [PATCH] * minimum PHP version 5.7 * updated README --- .minphp | 5 +++++ README.md | 26 ++++++++++++++++++++++---- bin/index.php | 0 includes/functions.php | 2 +- index.php | 24 +++++++++++++++++++++++- offline.php | 4 ++-- 6 files changed, 53 insertions(+), 8 deletions(-) create mode 100644 .minphp create mode 100644 bin/index.php diff --git a/.minphp b/.minphp new file mode 100644 index 0000000..0a8f74e --- /dev/null +++ b/.minphp @@ -0,0 +1,5 @@ +............W......... 22 / 22 (100%) + + +File,Line,Column,Type,Message,Source,Severity,Fixable +"/home/magic/domains/w4os.org/www/helpers/bin/index.php",1,1,warning,"No PHP code was found in this file and short open tags are not allowed by this install of PHP. This file may be using short open tags but PHP does not allow them.",Internal.NoCodeFound,5,0 diff --git a/README.md b/README.md index 89f8b29..3c42c46 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,25 @@ # OpenSimulator Helpers -![Version 2.4.0](https://badgen.net/badge/Version/2.4.0/blue) ![Stable 2.4.0](https://badgen.net/badge/Stable/2.4.0/green) ![Requires PHP 7.3](https://badgen.net/badge/PHP/7.3/7884bf) ![License AGPLv3](https://badgen.net/badge/License/AGPLv3/552b55) +![Version 2.4.0](https://badgen.net/badge/Version/2.4.0/blue) +![Stable 2.4.0](https://badgen.net/badge/Stable/2.4.0/green) +![Requires PHP 5.7](https://badgen.net/badge/PHP/5.7/7884bf) +![License AGPLv3](https://badgen.net/badge/License/AGPLv3/552b55) -- Project URL: -- Donate: +Collection of PHP scripts to complement OpenSimulator features. ## Description -Helpers required to enable common functionalties like search, currency, events in OpenSimulator grids. +Collection of PHP scripts to enable OpenSimulator features that are not implemented in the core, like search, currency, events in OpenSimulator grids (see Features below). + +Most files are used directly by viewer to allow features not implemented in OpenSimulator, like classifieds, events, etc. They were initially based on a collection of different projects (see Credits below), but were entirely rewritten to use an unified code and set of parameters, as well as for integration in larger projects like [w4os OpenSim WordPress Interface](https://w4os.org/). Formerly known as Flexible Helper Scripts. +- Project URL: +- Donate: + ### Features - **In-world Search**: enable standard search in the viewer for places, land for sale, events and classifieds. @@ -22,6 +29,17 @@ Formerly known as Flexible Helper Scripts. - **Multi-grid**: can be used for standalone or closed grid as well as to provide a cross-grid search engine - **Unified library**: rewritten to allow easier integration in bigger projects +### Roadmap + +- [ ] Avatar authentication +- [ ] Avatar registration +- [ ] Web profiles +- [ ] Web assets server +- [ ] Web search +- [ ] Grid info +- [ ] Grid status +- [ ] Splash page + ## Installation ### Option 1: Just enable in-world search (don't install this) diff --git a/bin/index.php b/bin/index.php new file mode 100644 index 0000000..e69de29 diff --git a/includes/functions.php b/includes/functions.php index bebe357..51b8a07 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -431,7 +431,7 @@ function osAdminNotice( $message, $error_code = 0, $die = false ) { $function, empty( $error_code ) ? '' : " Error $error_code", $message, - $file, + $file ); error_log( $message ); if ( $die == true ) { diff --git a/index.php b/index.php index 36bfa89..e860bb2 100644 --- a/index.php +++ b/index.php @@ -1 +1,23 @@ - + * @link https://github.com/magicoli/opensim-helpers + * @license AGPLv3 + */ + +// Get version from .version file. +if( file_exists( '.version' ) ) { + $version = file_get_contents( '.version' ); +} + +// Get version from .git/HEAD file. +if( file_exists( '.git/HEAD' ) ) { + $version .= ' (git ' . trim(preg_replace('%.*/%', '', file_get_contents( '.git/HEAD' ) ) ) . ')'; +} +echo $version; +die(); diff --git a/offline.php b/offline.php index 5332918..11c9096 100644 --- a/offline.php +++ b/offline.php @@ -61,7 +61,7 @@ switch ( $method ) { 'SELECT imviaemail, email FROM usersettings WHERE useruuid = :useruuid', array( 'useruuid' => $xml->toAgentID, - ), + ) ); if ( $emailinfo ) { @@ -170,7 +170,7 @@ switch ( $method ) { 'SELECT ID, Message FROM ' . OFFLINE_MESSAGE_TBL . ' WHERE PrincipalID = :PrincipalID', array( 'PrincipalID' => $xml->Guid, - ), + ) ); if ( $pendingmessages ) { $delivered = array();