summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJayaram R Pai2014-07-15 15:08:37 +0530
committerJayaram R Pai2014-07-15 15:08:37 +0530
commitc0c1a78adf2b96f05b71040889fc980716e6132a (patch)
treee76c2c288ef2578dff7da02ac36a92e7aa4a5019
parent5b038d3a7a70c69f31f669cd11ed0ec50c9fbbe8 (diff)
downloadtestimonials-master.tar.gz
testimonials-master.tar.bz2
testimonials-master.zip
added css and comment displayHEADmaster
-rw-r--r--css/testimonials.css23
-rw-r--r--testimonials.module22
2 files changed, 44 insertions, 1 deletions
diff --git a/css/testimonials.css b/css/testimonials.css
new file mode 100644
index 0000000..54c9d2a
--- /dev/null
+++ b/css/testimonials.css
@@ -0,0 +1,23 @@
+#testimonials-wrapper .testimonial {
+ position: relative;
+ text-align: justify;
+ margin: 25px 0 0 0;
+ padding: 0 0 10px 0;
+ background: #e5e5e5;
+ padding: 10px;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -o-border-radius: 5px;
+ border-radius: 5px;
+}
+#testimonials-wrapper .testimonial > .author {
+ text-align: right;
+ font-weight: bolder;
+ margin: 15px 0 0 0;
+ background: #ffffff;
+ padding: 10px;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -o-border-radius: 5px;
+ border-radius: 5px;
+}
diff --git a/testimonials.module b/testimonials.module
index e63820c..9c35e70 100644
--- a/testimonials.module
+++ b/testimonials.module
@@ -164,10 +164,30 @@
function testimonials_display_all() {
$page_content = "";
+ $query = "
+ SELECT * FROM testimonials
+ ORDER BY id DESC
+ ";
+ $result = pager_query($query, 4, 0, "SELECT COUNT(*) FROM testimonials");
+
+ $page_content .= "<div id='testimonials-wrapper'>";
+ while($row = db_fetch_object($result)) {
+ $page_content .= "
+ <div class='testimonial'>
+ {$row->body}
+ <div class='author'>
+ - {$row->name}, {$row->department}, {$row->university}<br>
+ ({$row->contribution}: {$row->reference})
+ </div>
+ </div>
+ ";
+ }
+ $page_content .= "</div> <!-- /#testimonials-wrapper -->";
+ $page_content .= theme("pager", NULL, 4, 0);
return $page_content;
}
function testimonials_init() {
- // for future use
+ drupal_add_css(drupal_get_path("module", "testimonials") . "/css/testimonials.css");
}
?>