summaryrefslogtreecommitdiff
path: root/modules/comment
diff options
context:
space:
mode:
Diffstat (limited to 'modules/comment')
-rw-r--r--modules/comment/helpers/comment_installer.php64
-rw-r--r--modules/comment/helpers/comment_theme.php4
-rw-r--r--modules/comment/module.info2
-rw-r--r--modules/comment/views/admin_block_recent_comments.html.php2
-rw-r--r--modules/comment/views/admin_comments.html.php4
-rw-r--r--modules/comment/views/comment.html.php2
-rw-r--r--modules/comment/views/comments.html.php4
7 files changed, 44 insertions, 38 deletions
diff --git a/modules/comment/helpers/comment_installer.php b/modules/comment/helpers/comment_installer.php
index b1cfcdc0..f54913c3 100644
--- a/modules/comment/helpers/comment_installer.php
+++ b/modules/comment/helpers/comment_installer.php
@@ -20,38 +20,42 @@
class comment_installer {
static function install() {
$db = Database::instance();
- $version = module::get_version("comment");
+ $db->query("CREATE TABLE IF NOT EXISTS {comments} (
+ `author_id` int(9) default NULL,
+ `created` int(9) NOT NULL,
+ `guest_email` varchar(128) default NULL,
+ `guest_name` varchar(128) default NULL,
+ `guest_url` varchar(255) default NULL,
+ `id` int(9) NOT NULL auto_increment,
+ `item_id` int(9) NOT NULL,
+ `server_http_accept_charset` varchar(64) default NULL,
+ `server_http_accept_encoding` varchar(64) default NULL,
+ `server_http_accept_language` varchar(64) default NULL,
+ `server_http_accept` varchar(128) default NULL,
+ `server_http_connection` varchar(64) default NULL,
+ `server_http_host` varchar(64) default NULL,
+ `server_http_referer` varchar(255) default NULL,
+ `server_http_user_agent` varchar(128) default NULL,
+ `server_query_string` varchar(64) default NULL,
+ `server_remote_addr` varchar(32) default NULL,
+ `server_remote_host` varchar(64) default NULL,
+ `server_remote_port` varchar(16) default NULL,
+ `state` varchar(15) default 'unpublished',
+ `text` text,
+ `updated` int(9) NOT NULL,
+ PRIMARY KEY (`id`))
+ ENGINE=InnoDB DEFAULT CHARSET=utf8;");
- if ($version == 0) {
- $db->query("CREATE TABLE IF NOT EXISTS {comments} (
- `author_id` int(9) default NULL,
- `created` int(9) NOT NULL,
- `guest_email` varchar(128) default NULL,
- `guest_name` varchar(128) default NULL,
- `guest_url` varchar(255) default NULL,
- `id` int(9) NOT NULL auto_increment,
- `item_id` int(9) NOT NULL,
- `server_http_accept_charset` varchar(64) default NULL,
- `server_http_accept_encoding` varchar(64) default NULL,
- `server_http_accept_language` varchar(64) default NULL,
- `server_http_accept` varchar(128) default NULL,
- `server_http_connection` varchar(64) default NULL,
- `server_http_host` varchar(64) default NULL,
- `server_http_referer` varchar(255) default NULL,
- `server_http_user_agent` varchar(128) default NULL,
- `server_query_string` varchar(64) default NULL,
- `server_remote_addr` varchar(32) default NULL,
- `server_remote_host` varchar(64) default NULL,
- `server_remote_port` varchar(16) default NULL,
- `state` char(15) default 'unpublished',
- `text` text,
- `updated` int(9) NOT NULL,
- PRIMARY KEY (`id`))
- ENGINE=InnoDB DEFAULT CHARSET=utf8;");
+ block_manager::add("dashboard_center", "comment", "recent_comments");
+ module::set_var("comment", "spam_caught", 0);
+ module::set_version("comment", 2);
+ }
- block_manager::add("dashboard_center", "comment", "recent_comments");
- module::set_var("comment", "spam_caught", 0);
- module::set_version("comment", 1);
+ static function upgrade($version) {
+ if ($version == 1) {
+ $db = Database::instance();
+ $db->query("ALTER TABLE {comments} CHANGE `state` `state` varchar(15) default 'unpublished'");
+ module::set_version("comment", 2);
}
}
diff --git a/modules/comment/helpers/comment_theme.php b/modules/comment/helpers/comment_theme.php
index d9f1acf4..89b2f57c 100644
--- a/modules/comment/helpers/comment_theme.php
+++ b/modules/comment/helpers/comment_theme.php
@@ -19,8 +19,8 @@
*/
class comment_theme_Core {
static function head($theme) {
- $url = url::file("modules/comment/js/comment.js");
- return "<script src=\"$url\" type=\"text/javascript\"></script>\n";
+ $theme->script("modules/comment/js/comment.js");
+ return "";
}
static function photo_bottom($theme) {
diff --git a/modules/comment/module.info b/modules/comment/module.info
index 08a800a6..946f1d39 100644
--- a/modules/comment/module.info
+++ b/modules/comment/module.info
@@ -1,3 +1,3 @@
name = Comments
description = Allows users and guests to leave comments on photos and albums.
-version = 1
+version = 2
diff --git a/modules/comment/views/admin_block_recent_comments.html.php b/modules/comment/views/admin_block_recent_comments.html.php
index edaa19ae..af4d946e 100644
--- a/modules/comment/views/admin_block_recent_comments.html.php
+++ b/modules/comment/views/admin_block_recent_comments.html.php
@@ -2,7 +2,7 @@
<ul>
<? foreach ($comments as $i => $comment): ?>
<li class="<?= ($i % 2 == 0) ? "gEvenRow" : "gOddRow" ?>">
- <img src="<?= $comment->author()->avatar_url(32, $theme->url("images/avatar.jpg", true)) ?>"
+ <img src="<?= $comment->author()->avatar_url(32, $theme->theme_url("images/avatar.jpg", true)) ?>"
class="gAvatar"
alt="<?= p::clean($comment->author_name()) ?>"
width="32"
diff --git a/modules/comment/views/admin_comments.html.php b/modules/comment/views/admin_comments.html.php
index e749fde0..453cf849 100644
--- a/modules/comment/views/admin_comments.html.php
+++ b/modules/comment/views/admin_comments.html.php
@@ -106,7 +106,7 @@
<tr id="gComment-<?= $comment->id ?>" class="<?= ($i % 2 == 0) ? "gEvenRow" : "gOddRow" ?>">
<td>
<a href="#">
- <img src="<?= $comment->author()->avatar_url(40, $theme->url("images/avatar.jpg", true)) ?>"
+ <img src="<?= $comment->author()->avatar_url(40, $theme->theme_url("images/avatar.jpg", true)) ?>"
class="gAvatar"
alt="<?= p::clean($comment->author_name()) ?>"
width="40"
@@ -163,6 +163,7 @@
</a>
</li>
<? endif ?>
+ <!--
<li>
<a href="javascript:reply(<?=$comment->id?>)"
class="gButtonLink ui-state-default ui-icon-left">
@@ -177,6 +178,7 @@
<?= t("Edit") ?>
</a>
</li>
+ -->
<li>
<a href="javascript:set_state('deleted',<?=$comment->id?>)"
class="gButtonLink ui-state-default ui-icon-left">
diff --git a/modules/comment/views/comment.html.php b/modules/comment/views/comment.html.php
index ce52951b..6d2cc592 100644
--- a/modules/comment/views/comment.html.php
+++ b/modules/comment/views/comment.html.php
@@ -2,7 +2,7 @@
<li id="gComment-<?= $comment->id; ?>">
<p class="gAuthor">
<a href="#">
- <img src="<?= $comment->author()->avatar_url(40, $theme->url("images/avatar.jpg", true)) ?>"
+ <img src="<?= $comment->author()->avatar_url(40, $theme->theme_url("images/avatar.jpg", true)) ?>"
class="gAvatar"
alt="<?= p::clean($comment->author_name()) ?>"
width="40"
diff --git a/modules/comment/views/comments.html.php b/modules/comment/views/comments.html.php
index 95f07baf..d9405e5f 100644
--- a/modules/comment/views/comments.html.php
+++ b/modules/comment/views/comments.html.php
@@ -10,13 +10,13 @@
<li id="gComment-<?= $comment->id ?>">
<p class="gAuthor">
<a href="#">
- <img src="<?= $comment->author()->avatar_url(40, $theme->url("images/avatar.jpg", true)) ?>"
+ <img src="<?= $comment->author()->avatar_url(40, $theme->theme_url("images/avatar.jpg", true)) ?>"
class="gAvatar"
alt="<?= p::clean($comment->author_name()) ?>"
width="40"
height="40" />
</a>
- <?= t("on %date <a href=#>%name</a> said",
+ <?= t('on %date <a href="#">%name</a> said',
array("date" => date("Y-M-d H:i:s", $comment->created),
"name" => p::clean($comment->author_name()))); ?>
</p>