[xiph-commits] r14912 - in branches/dir.xiph.org: . inc
balbinus at svn.xiph.org
balbinus at svn.xiph.org
Sun May 18 06:23:30 PDT 2008
Author: balbinus
Date: 2008-05-18 06:23:30 -0700 (Sun, 18 May 2008)
New Revision: 14912
Modified:
branches/dir.xiph.org/inc/prepend.php
branches/dir.xiph.org/search.php
Log:
Small fixes.
Modified: branches/dir.xiph.org/inc/prepend.php
===================================================================
--- branches/dir.xiph.org/inc/prepend.php 2008-05-18 12:55:30 UTC (rev 14911)
+++ branches/dir.xiph.org/inc/prepend.php 2008-05-18 13:23:30 UTC (rev 14912)
@@ -99,5 +99,6 @@
include_once(dirname(__FILE__).'/lib.dir.php');
include_once(dirname(__FILE__).'/lib.utils.php');
include_once(dirname(__FILE__).'/lib.apilog.php');
+include_once(dirname(__FILE__).'/lib.statslog.php');
?>
Modified: branches/dir.xiph.org/search.php
===================================================================
--- branches/dir.xiph.org/search.php 2008-05-18 12:55:30 UTC (rev 14911)
+++ branches/dir.xiph.org/search.php 2008-05-18 13:23:30 UTC (rev 14912)
@@ -46,7 +46,7 @@
}
$search_string .= $k.'%';
- $search_in[] = '"'.mysql_real_escape_string($k).'"';
+ $search_in[] = '"'.$db->escape($k).'"';
if (++$count >= 3)
{
@@ -100,40 +100,40 @@
false, 60);
}
- // Now assign the results to a template var
- if ($results !== false && $results !== array())
- {
- $n_results = count($results);
- $results_pages = ceil($n_results / MAX_RESULTS_PER_PAGE);
- if ($page_n > $results_pages)
- {
- $page_n = 0;
- }
- $pages = array();
- if ($results_pages < PAGES_IN_PAGER)
- {
- $pages = range(1, $results_pages);
- }
- elseif ($page_n > PAGES_IN_PAGER)
- {
- $pages = range($page_n + 1 - PAGES_IN_PAGER, $pages_n + 1 + PAGES_IN_PAGER);
- }
- elseif ($page_n + PAGES_IN_PAGER > $results_pages)
- {
- $pages = range($results_pages - PAGES_IN_PAGER + 1, $results_pages);
- }
- else
- {
- $pages = range(1, PAGES_IN_PAGER);
- }
- $offset = $page_n * MAX_RESULTS_PER_PAGE;
- $results = array_slice($results, $offset,
- MAX_RESULTS_PER_PAGE);
- $tpl->assign_by_ref('results', $results);
- $tpl->assign_by_ref('results_pages', $pages);
- $tpl->assign_by_ref('results_pages_total', $results_pages);
- $tpl->assign('results_page_no', $page_n + 1);
- }
+ // Now assign the results to a template var
+ if ($results !== false && $results !== array())
+ {
+ $n_results = count($results);
+ $results_pages = ceil($n_results / MAX_RESULTS_PER_PAGE);
+ if ($page_n > $results_pages)
+ {
+ $page_n = 0;
+ }
+ $pages = array();
+ if ($results_pages < PAGES_IN_PAGER)
+ {
+ $pages = range(1, $results_pages);
+ }
+ elseif ($page_n > PAGES_IN_PAGER)
+ {
+ $pages = range($page_n + 1 - PAGES_IN_PAGER, $pages_n + 1 + PAGES_IN_PAGER);
+ }
+ elseif ($page_n + PAGES_IN_PAGER > $results_pages)
+ {
+ $pages = range($results_pages - PAGES_IN_PAGER + 1, $results_pages);
+ }
+ else
+ {
+ $pages = range(1, PAGES_IN_PAGER);
+ }
+ $offset = $page_n * MAX_RESULTS_PER_PAGE;
+ $results = array_slice($results, $offset,
+ MAX_RESULTS_PER_PAGE);
+ $tpl->assign_by_ref('results', $results);
+ $tpl->assign_by_ref('results_pages', $pages);
+ $tpl->assign_by_ref('results_pages_total', $results_pages);
+ $tpl->assign('results_page_no', $page_n + 1);
+ }
}
}
More information about the commits
mailing list