From e8d016a1b229517eff7bfc28cc7d3c83dc7a1607 Mon Sep 17 00:00:00 2001 From: Jayaram Pai Date: Fri, 20 Jun 2014 14:02:17 +0530 Subject: added pagination --- cloud_comments.module | 11 ++++++----- css/cloud_comments.css | 0 js/cloud_comments.js | 0 js/jquery.min.js | 0 4 files changed, 6 insertions(+), 5 deletions(-) mode change 100644 => 100755 css/cloud_comments.css mode change 100644 => 100755 js/cloud_comments.js mode change 100644 => 100755 js/jquery.min.js diff --git a/cloud_comments.module b/cloud_comments.module index 7bbbdad..467cd52 100755 --- a/cloud_comments.module +++ b/cloud_comments.module @@ -43,8 +43,9 @@ function cloud_comments_all() { ); $page_content = ""; - $query = "SELECT * FROM {scilab_cloud_comment}"; - $query_result = db_query($query); + $query = "SELECT scc.*, tcc.number AS chapter_no, tce.number AS example_no FROM scilab_cloud_comment scc LEFT JOIN textbook_companion_chapter tcc ON tcc.id = scc.chapter LEFT JOIN textbook_companion_example tce ON tce.id = scc.example ORDER BY scc.date DESC"; + $query_result = pager_query($query, 5, 0 ); + //$query_result = db_query($query); while ($row = db_fetch_object($query_result)) { @@ -65,7 +66,7 @@ function cloud_comments_all() { $qr = db_query($q, $row->chapter); $obj = db_fetch_object($qr); $chapter = $obj->name?$obj->name:"None"; - $page_content .= t("
Comment:
") . $row->comment . t("