]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Merge branch 'picwall-direct-link' into next v0.0.44beta
authornodiscc <nodiscc@gmail.com>
Sun, 15 Mar 2015 13:24:51 +0000 (14:24 +0100)
committernodiscc <nodiscc@gmail.com>
Sun, 15 Mar 2015 13:24:51 +0000 (14:24 +0100)
1  2 
index.php

diff --combined index.php
index 11f944e800d7e7923f743746ec52767c4cc2a9bf,6189e0b82c9ff4b919f65f2ef54ad1b34ff12535..1ab34193a3e8505c1a5f4f6e6ce925941210e0cc
+++ b/index.php
@@@ -1,5 -1,5 +1,5 @@@
  <?php
 -// Shaarli 0.0.43beta - Shaare your links...
 +// Shaarli 0.0.44beta - Shaare your links...
  // The personal, minimalist, super-fast, no-database Delicious clone. By sebsauvage.net
  // http://sebsauvage.net/wiki/doku.php?id=php:shaarli
  // Licence: http://www.opensource.org/licenses/zlib-license.php
@@@ -39,7 -39,7 +39,7 @@@ $GLOBALS['config']['ENABLE_RSS_PERMALIN
  // Optional config file.
  if (is_file($GLOBALS['config']['DATADIR'].'/options.php')) require($GLOBALS['config']['DATADIR'].'/options.php');
  
 -define('shaarli_version','0.0.43beta');
 +define('shaarli_version','0.0.44beta');
  define('PHPPREFIX','<?php /* '); // Prefix to encapsulate data in PHP code.
  define('PHPSUFFIX',' */ ?>'); // Suffix to encapsulate data in PHP code.
  // http://server.com/x/shaarli --> /shaarli/
@@@ -1271,7 -1271,6 +1271,6 @@@ function renderPage(
              if ($thumb!='') // Only output links which have a thumbnail.
              {
                  $link['thumbnail']=$thumb; // Thumbnail HTML code.
-                 $link['permalink']=$permalink;
                  $linksToDisplay[]=$link; // Add to array.
              }
          }
              $PAGE = new pageBuilder;
              $PAGE->assign('linkcount',count($LINKSDB));
              $PAGE->assign('token',getToken());
 +            $PAGE->assign('tags', $LINKSDB->allTags());
              $PAGE->renderPage('changetag');
              exit;
          }
          $PAGE->assign('link_is_new',false);
          $PAGE->assign('token',getToken()); // XSRF protection.
          $PAGE->assign('http_referer',(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''));
 +        $PAGE->assign('tags', $LINKSDB->allTags());
          $PAGE->renderPage('editlink');
          exit;
      }
          $PAGE->assign('link_is_new',$link_is_new);
          $PAGE->assign('token',getToken()); // XSRF protection.
          $PAGE->assign('http_referer',(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''));
 +        $PAGE->assign('tags', $LINKSDB->allTags());
          $PAGE->renderPage('editlink');
          exit;
      }
@@@ -2312,6 -2308,45 +2311,6 @@@ if (!function_exists('json_encode')) 
      }
  }
  
 -// Webservices (for use with jQuery/jQueryUI)
 -// e.g. index.php?ws=tags&term=minecr
 -function processWS()
 -{
 -    if (empty($_GET['ws']) || empty($_GET['term'])) return;
 -    $term = $_GET['term'];
 -    $LINKSDB=new linkdb(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']);  // Read links from database (and filter private links if used it not logged in).
 -    header('Content-Type: application/json; charset=utf-8');
 -
 -    // Search in tags (case insensitive, cumulative search)
 -    if ($_GET['ws']=='tags')
 -    {
 -        $tags=explode(' ',str_replace(',',' ',$term)); $last = array_pop($tags); // Get the last term ("a b c d" ==> "a b c", "d")
 -        $addtags=''; if ($tags) $addtags=implode(' ',$tags).' '; // We will pre-pend previous tags
 -        $suggested=array();
 -        /* To speed up things, we store list of tags in session */
 -        if (empty($_SESSION['tags'])) $_SESSION['tags'] = $LINKSDB->allTags();
 -        foreach($_SESSION['tags'] as $key=>$value)
 -        {
 -            if (startsWith($key,$last,$case=false) && !in_array($key,$tags)) $suggested[$addtags.$key.' ']=0;
 -        }
 -        echo json_encode(array_keys($suggested));
 -        exit;
 -    }
 -
 -    // Search a single tag (case sensitive, single tag search)
 -    if ($_GET['ws']=='singletag')
 -    {
 -        /* To speed up things, we store list of tags in session */
 -        if (empty($_SESSION['tags'])) $_SESSION['tags'] = $LINKSDB->allTags();
 -        foreach($_SESSION['tags'] as $key=>$value)
 -        {
 -            if (startsWith($key,$term,$case=true)) $suggested[$key]=0;
 -        }
 -        echo json_encode(array_keys($suggested));
 -        exit;
 -    }
 -}
 -
  // Re-write configuration file according to globals.
  // Requires some $GLOBALS to be set (login,hash,salt,title).
  // If the config file cannot be saved, an error message is displayed and the user is redirected to "Tools" menu.
@@@ -2568,6 -2603,7 +2567,6 @@@ if (isset($_SERVER["QUERY_STRING"]) && 
  if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'do=atom')) { showATOM(); exit; }
  if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'do=dailyrss')) { showDailyRSS(); exit; }
  if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'do=daily')) { showDaily(); exit; }
 -if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'ws=')) { processWS(); exit; } // Webservices (for jQuery/jQueryUI)
  if (!isset($_SESSION['LINKS_PER_PAGE'])) $_SESSION['LINKS_PER_PAGE']=$GLOBALS['config']['LINKS_PER_PAGE'];
  renderPage();
  ?>