[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Librefm-commits] [1201] don't rerun the query if the page is cached
From: |
Clint Adams |
Subject: |
[Librefm-commits] [1201] don't rerun the query if the page is cached |
Date: |
Tue, 05 May 2009 02:39:34 +0000 |
Revision: 1201
http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1201
Author: clint
Date: 2009-05-05 02:39:33 +0000 (Tue, 05 May 2009)
Log Message:
-----------
don't rerun the query if the page is cached
Modified Paths:
--------------
trunk/nixtape/admin/report/mbid-mismatch.php
Modified: trunk/nixtape/admin/report/mbid-mismatch.php
===================================================================
--- trunk/nixtape/admin/report/mbid-mismatch.php 2009-05-05 02:19:36 UTC
(rev 1200)
+++ trunk/nixtape/admin/report/mbid-mismatch.php 2009-05-05 02:39:33 UTC
(rev 1201)
@@ -19,23 +19,25 @@
*/
-require_once('../../database.php');
-require_once('../../templating.php');
-require_once('../../data/sanitize.php');
+require_once($install_path . '/database.php');
+require_once($install_path . '/templating.php');
+require_once($install_path . '/data/sanitize.php');
-$res = $mdb2->query("SELECT t.id, t.artist, t.album, t.name, t.mbid as tmbid,
st.mbid as stmbid FROM Scrobble_Track st JOIN Track t ON lower(t.name)=st.name
AND lower(t.album)=st.album AND lower(t.artist)=st.artist AND t.mbid<>st.mbid");
+$smarty->caching = 2;
+$smarty->cache_lifetime = 43200;
-$aEntries = array();
-$i = 0;
+if(!$smarty->is_cached('mbid-mismatch-report.tpl')) {
+ $res = $mdb2->query("SELECT t.id, t.artist, t.album, t.name, t.mbid as
tmbid, st.mbid as stmbid FROM Scrobble_Track st JOIN Track t ON
lower(t.name)=st.name AND lower(t.album)=st.album AND lower(t.artist)=st.artist
AND t.mbid<>st.mbid");
-while (($row = $res->fetchRow(MDB2_FETCHMODE_ASSOC))) {
- $trow = sanitize($row);
- $aEntries[$i++] = $trow;
+ $aEntries = array();
+ $i = 0;
+
+ while (($row = $res->fetchRow(MDB2_FETCHMODE_ASSOC))) {
+ $trow = sanitize($row);
+ $aEntries[$i++] = $trow;
+ }
+ $smarty->assign("entries", $aEntries);
}
-$smarty->assign("entries", $aEntries);
-
-$smarty->caching = 2;
-$smarty->cache_lifetime = 43200;
$smarty->display("mbid-mismatch-report.tpl");
?>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Librefm-commits] [1201] don't rerun the query if the page is cached,
Clint Adams <=