diff options
author | Fabio Comuni <fabrix.xm@gmail.com> | 2011-10-24 13:02:38 +0200 |
---|---|---|
committer | Fabio Comuni <fabrix.xm@gmail.com> | 2011-10-24 13:02:38 +0200 |
commit | 306036c62613fd849a80c83c50cd220f75e64c90 (patch) | |
tree | 71140cb3ff83f3f9183284defbda67c2da49f94e /include/oembed.php | |
parent | d80c0da3c0bf2ab599f5d013d5c947823d917363 (diff) | |
download | volse-hubzilla-306036c62613fd849a80c83c50cd220f75e64c90.tar.gz volse-hubzilla-306036c62613fd849a80c83c50cd220f75e64c90.tar.bz2 volse-hubzilla-306036c62613fd849a80c83c50cd220f75e64c90.zip |
cache api
Diffstat (limited to 'include/oembed.php')
-rw-r--r-- | include/oembed.php | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/include/oembed.php b/include/oembed.php index a8f6636ff..d40ceb3fd 100644 --- a/include/oembed.php +++ b/include/oembed.php @@ -8,12 +8,9 @@ function oembed_replacecb($matches){ function oembed_fetch_url($embedurl){ - $r = q("SELECT v FROM `cache` WHERE k='%s'", - dbesc($embedurl)); + $txt = Cache::get($embedurl); - if(count($r)){ - $txt = $r[0]['v']; - } else { + if(is_null($txt)){ $txt = ""; // try oembed autodiscovery @@ -44,10 +41,8 @@ function oembed_fetch_url($embedurl){ if ($txt[0]!="{") $txt='{"type":"error"}'; //save in cache - /*q("INSERT INTO `cache` VALUES ('%s','%s','%s')", - dbesc($embedurl), - dbesc($txt), - dbesc(datetime_convert()));*/ + Cache::set($embedurl,$txt); + } $j = json_decode($txt); @@ -154,4 +149,5 @@ function oembed_html2bbcode($text) { } } -?> + + |