]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Merge remote-tracking branch 'virtualtam/test/link-db' into next
authornodiscc <nodiscc@gmail.com>
Tue, 23 Jun 2015 12:38:43 +0000 (14:38 +0200)
committernodiscc <nodiscc@gmail.com>
Tue, 23 Jun 2015 12:38:43 +0000 (14:38 +0200)
Conflicts:
index.php

1  2 
index.php

diff --cc index.php
index b44ec4630e59924129bd33e0c1d4c8621bfe9d7c,ed18c7f948c9de773c7bd90150e804371afa30ba..d0dd5306eb41d28d713079db721986d0a2b3436d
+++ b/index.php
@@@ -947,7 -702,7 +702,7 @@@ function showRSS(
      $cached = $cache->cachedVersion(); if (!empty($cached)) { echo $cached; exit; }
  
      // If cached was not found (or not usable), then read the database and build the response:
-     $LINKSDB=new linkdb(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']);  // Read links from database (and filter private links if user it not logged in).
 -    $LINKSDB = new LinkDB(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']);
++    $LINKSDB = new LinkDB(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']); // Read links from database (and filter private links if user it not logged in).
  
      // Optionally filter the results:
      $linksToDisplay=array();
@@@ -1022,7 -780,7 +777,7 @@@ function showATOM(
      $cached = $cache->cachedVersion(); if (!empty($cached)) { echo $cached; exit; }
      // If cached was not found (or not usable), then read the database and build the response:
  
-     $LINKSDB=new linkdb(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']);  // Read links from database (and filter private links if used it not logged in).
 -    $LINKSDB = new LinkDB(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']);
++    $LINKSDB = new LinkDB(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']);  // Read links from database (and filter private links if used it not logged in).
  
  
      // Optionally filter the results:
@@@ -1104,7 -865,7 +859,7 @@@ function showDailyRSS(
      $cache = new pageCache(pageUrl(),startsWith($query,'do=dailyrss') && !isLoggedIn());
      $cached = $cache->cachedVersion(); if (!empty($cached)) { echo $cached; exit; }
      // If cached was not found (or not usable), then read the database and build the response:
-     $LINKSDB=new linkdb(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']);  // Read links from database (and filter private links if used it not logged in).
 -    $LINKSDB = new LinkDB(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']);
++    $LINKSDB = new LinkDB(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']);  // Read links from database (and filter private links if used it not logged in).
  
      /* Some Shaarlies may have very few links, so we need to look
         back in time (rsort()) until we have enough days ($nb_of_days).
  // "Daily" page.
  function showDaily()
  {
-     $LINKSDB=new linkdb(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']);  // Read links from database (and filter private links if used it not logged in).
 -    $LINKSDB = new LinkDB(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']);
++    $LINKSDB = new LinkDB(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']);  // Read links from database (and filter private links if used it not logged in).
  
  
      $day=Date('Ymd',strtotime('-1 day')); // Yesterday, in format YYYYMMDD.
      }
  
      $linksToDisplay=$LINKSDB->filterDay($day);
 -    if ($GLOBALS['config']['HIDE_PUBLIC_LINKS'] && !isLoggedIn())
 -        $linksToDisplay = array();
      // We pre-format some fields for proper output.
      foreach($linksToDisplay as $key=>$link)
      {
  // Render HTML page (according to URL parameters and user rights)
  function renderPage()
  {
-     $LINKSDB=new linkdb(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']);  // Read links from database (and filter private links if used it not logged in).
 -    $LINKSDB = new LinkDB(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']);
++    $LINKSDB = new LinkDB(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']);  // Read links from database (and filter private links if used it not logged in).
  
      // -------- Display login form.
      if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'do=login'))
@@@ -1817,7 -1583,7 +1571,7 @@@ HTML
  function importFile()
  {
      if (!(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'])) { die('Not allowed.'); }
-     $LINKSDB=new linkdb(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']);  // Read links from database (and filter private links if used it not logged in).
 -    $LINKSDB = new LinkDB(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']);
++    $LINKSDB = new LinkDB(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']);   // Read links from database (and filter private links if used it not logged in).
      $filename=$_FILES['filetoupload']['name'];
      $filesize=$_FILES['filetoupload']['size'];
      $data=file_get_contents($_FILES['filetoupload']['tmp_name']);