aboutsummaryrefslogtreecommitdiff
path: root/action.php
diff options
context:
space:
mode:
authorroot2014-10-05 21:15:08 +0200
committerroot2014-10-05 21:15:08 +0200
commit3833ab7e3588b4f5c05f440713f5cdf30b9029ae (patch)
tree283217af2afe917bce80f7f9ad883adfbe077abc /action.php
parent80fb01db10054baf2c4c6e70a677e429fe5c34ee (diff)
downloadjungegemeinde-3833ab7e3588b4f5c05f440713f5cdf30b9029ae.tar.gz
Improved caching methods.
Diffstat (limited to 'action.php')
-rw-r--r--action.php30
1 files changed, 17 insertions, 13 deletions
diff --git a/action.php b/action.php
index 86129ae..1e70b21 100644
--- a/action.php
+++ b/action.php
@@ -259,23 +259,27 @@ JG Adlershof";
$suffix = ".csv";
}
lredirect("download;type=".$type);
- $res = $db->doQuery("SELECT * FROM " . DBPREFIX . "member;");
- $content .= "\n";
- $count = 1;
- while ($row = $res->fetch_array() ){
+ if ( $c->exists(CACHEPREFIX . "adressliste".$suffix) ){
+ $content = $c->getValue(CACHEPREFIX . "adressliste".$suffix);
+ } else {
+ $res = $db->doQuery("SELECT * FROM " . DBPREFIX . "member;");
+ $content .= "\n";
+ $count = 1;
+ while ($row = $res->fetch_array() ){
- if ( $type == "plain" ){
- $content .= $count . " | " . $row["name"] . " | " . $row["adresse"] . " | " . $row["telefonnummer"] . " | " . $row["handynummer"] . " | " . $row["email"] . " | " . $row["geburtstag"] . "\n";
- } else {
- $content .= $count;
- for ( $i=1;$i<7;$i++){
- $content .= ';' . $row[$i];
+ if ( $type == "plain" ){
+ $content .= $count . " | " . $row["name"] . " | " . $row["adresse"] . " | " . $row["telefonnummer"] . " | " . $row["handynummer"] . " | " . $row["email"] . " | " . $row["geburtstag"] . "\n";
+ } else {
+ $content .= $count;
+ for ( $i=1;$i<7;$i++){
+ $content .= ';' . $row[$i];
+ }
+ $content .= "\n";
}
- $content .= "\n";
+ $count++;
}
- $count++;
+ $c->setKey(CACHEPREFIX . "adressliste".$suffix, $content);
}
-
ob_clean();
header("Content-Type: text/".$type."; Charset=UTF-8");
header("Content-Disposition: attachment; filename=\"JG Adressliste ".date("j.n.Y", time()).$suffix."\"");