com web/php: Removes unnecessary code: include/layout.inc ug.php
| From: | Hannes Magnusson | Date: | Mon, 24 Mar 2014 06:15:27 +0000 |
| Subject: | com web/php: Removes unnecessary code: include/layout.inc ug.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-18601@lists.php.net to get a copy of this message | ||
Commit: 3e0eb4f6e336cac4a2a319072ea0042b3f2aff93
Author: Andreas Heigl <andreas@heigl.org> Mon, 24 Mar 2014 07:15:27 +0100
Parents: 1ac8ba63b833887574e5cb45ac23b2968dbc7dc8
Branches: master
Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=3e0eb4f6e336cac4a2a319072ea0042b3f2aff93
Log:
Removes unnecessary code
Changed paths:
M include/layout.inc
M ug.php
Diff:
diff --git a/include/layout.inc b/include/layout.inc
index 235e6fc..4441dd3 100644
--- a/include/layout.inc
+++ b/include/layout.inc
@@ -606,12 +606,6 @@ function get_near_usergroups()
function get_usergroups_in($country, &$allcountries = array()) {
$filename = $_SERVER["DOCUMENT_ROOT"] . "/backend/usergroups.json";
- // get the complete list of usergroups once a day
- if (! file_exists($filename) || (time()-24*60*60) > filemtime($filename)) {
- $data = file_get_contents('http://php..ug/api/rest/listtype.json/1');
- file_put_contents($filename, $data);
- }
-
$matches = array();
$data = json_decode(file_get_contents($filename), true);
foreach($data["groups"] as $group) {
diff --git a/ug.php b/ug.php
index b0a8b59..d485eaf 100644
--- a/ug.php
+++ b/ug.php
@@ -28,14 +28,7 @@ function ug_get_more_info($group) {
$url = $group["icalendar_url"];
$filename = "backend/events/" . md5($url);
- if (! file_exists($filename) || (time()-24*60*60) > filemtime($filename)) {
- if (strncmp("webcal://", $url, strlen("webcal://")) == 0) {
- $url = str_replace("webcal://", "http://", $url);
- }
- $data = file_get_contents($url);
- file_put_contents("backend/events/" . md5($group["icalendar_url"]),
$data);
- }
- // */
+
/* Broken icalendar link */
if (!file_exists($filename)) {
return null;