diff --git a/diylc-server-api/v1/getAnnouncements.php b/diylc-server-api/v1/getAnnouncements.php index a2346d0e..db770718 100644 --- a/diylc-server-api/v1/getAnnouncements.php +++ b/diylc-server-api/v1/getAnnouncements.php @@ -13,30 +13,29 @@ $password=$dbProperties->getProperty("pass"); $database=$dbProperties->getProperty("db"); $mysqli = new mysqli(localhost,$username,$password,$database); -function ip_details($IPaddress) +function ip_details($IPaddress) { - $json = file_get_contents("http://ip-api.com/json/{$IPaddress}"); - $details = json_decode($json); - return $details; -} + $json = file_get_contents("http://ip-api.com/json/{$IPaddress}"); + $details = json_decode($json); + return $details; +} $ip = $_SERVER["REMOTE_ADDR"]; $location = ip_details($ip); -$sql= "INSERT INTO diylc_usage_log (ip, country) VALUES ('".$ip."', '".$location->country."')"; +$userAgent = addslashes($_SERVER['HTTP_USER_AGENT']); + +$sql= "INSERT INTO diylc_usage_log (ip, country, os) VALUES ('".$ip."', '".$location->country."', '".$userAgent."')"; $mysqli->query($sql); $userId=$_REQUEST["userId"]; if ($userId) { $sql= "INSERT INTO diylc_user_stats (id, country) VALUES ('".$userId."', '".$location->country."') ON DUPLICATE KEY UPDATE last_seen = CURRENT_TIMESTAMP, counter = counter + 1"; - $mysqli->query($sql); + $mysqli->query($sql); } $mysqli->close(); ?> -{"list":{"org.diylc.announcements.Announcement":[{"title":"Greetings, fellow DIY'ers!","text":"If you need a custom component or feature implemented in DIYLC, do not hesitate to get in touch.
I can implement custom components for a reasonable fee and paid component requests will be
automatically put on the top of the queue for the next version.

Write to bancika@gmail.com.

Cheers! ","date":"2019-03-04"}, -{"title":"Calling translators","text":"If you wish to contribute by translating DIYLC interface to your language, please get in touch through bancika@gmail.com. Thanks!","date":"2020-04-22"}, -{"title":"Configuration issues!","text":"In case you recently experienced any issues with losing configuration (variants, recent files, etc), you may be affected by a bug that was discovered and fixed today.
DIYLC was using .diylc and diylc user directories simultaneously which caused issues with persistence of the configuration.
If you are affected, please upgrade to DIYLC v4.21.3 and then try copying config.xml file from .diylc to diylc directory in your user directory.
Note: make sure to backup existing files prior to overwriting!

Sorry for inconvenience and stay safe!","date":"2022-02-22"}, -{"title":"Your DIY files are needed :)","text":"In order to increase reliability and decrease the number of regression bugs in DIYLC, I have started building a regression test suite.
The idea is to build a framework that would automatically run any future release candidate version against a base of known DIY files,
trying to open each file, export it to PNG, save it back to another file and then validate that the outputs are as expected.
In order for this to be effective, we need a decent number of DIY files - old and new.
Ideally, we should cover all the use cases - guitar pedals, schematics, guitar wirings, amplifiers, tube stuff, etc. More is more here.
If you wish to contribute some of your cool projects, please send them over to bancika@gmail.com.
Thanks in advance!","date":"2022-03-02"}, -{"title":"Good news, everyone!","text":"As we are approaching DIYLC's sweet sixteen birthday, I'm happy to say that DIYLC is still growing - both in terms of features and the the user base.
By examining traffic statistics of DIYLC back-end, I can roughly estimate that we have more than doubled DIYLC user base in the last 5 years!
And growth trends are still pointing up. Thank you all for your ever growing support. DIYLC is still very much alive and I'm adding cool new features.

All the best!","date":"2022-03-24"} +{"list":{"org.diylc.announcements.Announcement":[ + ]}} \ No newline at end of file