Browse Source

Merge branch 'master' of https://github.com/visuddhinanda/mint

Bhikkhu-Kosalla 5 years ago
parent
commit
33032fa426
1 changed files with 3 additions and 2 deletions
  1. 3 2
      app/dict/redis_sys_rgl_part.php

+ 3 - 2
app/dict/redis_sys_rgl_part.php

@@ -2,13 +2,14 @@
 require_once "../path.php";
 require_once "../redis/function.php";
 
-if (PHP_SAPI == "cli") {
+if (PHP_SAPI == "cli" || isset($_COOKIE["userid"])) 
+{
 	$redis = redis_connect();
 	if ($redis != false) {
 		$dbh = new PDO(_DICT_DB_REGULAR_, "", "", array(PDO::ATTR_PERSISTENT => true));
 		$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
 		
-		$query = "SELECT pali,parent,parts from "._TABLE_DICT_REGULAR_." where 1 group by pali";
+		$query = "select * from (SELECT pali,parts from "._TABLE_DICT_REGULAR_." where 1  order by confidence DESC ) where 1 group by pali";
 		$stmt = $dbh->query($query);
 		while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
 			# code...