diff --git a/modules/rescue/helpers/rescue_task.php b/modules/rescue/helpers/rescue_task.php
index c094cf5d..253c6592 100644
--- a/modules/rescue/helpers/rescue_task.php
+++ b/modules/rescue/helpers/rescue_task.php
@@ -36,25 +36,25 @@ class rescue_task_Core {
$total = $task->get("total");
if (empty($total)) {
$task->set("total", $total = Database::instance()->count_records("items"));
- $task->set("stack", array(array(1, self::LEFT)));
+ $task->set("stack", "1:" . self::LEFT);
$task->set("ptr", 1);
$task->set("completed", 0);
}
$ptr = $task->get("ptr");
- $stack = $task->get("stack");
+ $stack = explode(" ", $task->get("stack"));
$completed = $task->get("completed");
// Implement a depth-first tree walk using a stack. Not the most efficient, but it's simple.
while ($stack && microtime(true) - $start < 1.5) {
- list($id, $state) = array_pop($stack);
+ list($id, $state) = explode(":", array_pop($stack));
switch ($state) {
case self::LEFT:
self::set_left($id, $ptr++);
$item = ORM::factory("item", $id);
- array_push($stack, array($id, self::RIGHT));
+ array_push($stack, $id . ":" . self::RIGHT);
foreach (self::children($id) as $child) {
- array_push($stack, array($child->id, self::LEFT));
+ array_push($stack, $child->id . ":" . self::LEFT);
}
break;
@@ -65,7 +65,7 @@ class rescue_task_Core {
}
}
- $task->set("stack", $stack);
+ $task->set("stack", implode(" ", $stack));
$task->set("ptr", $ptr);
$task->set("completed", $completed);
diff --git a/modules/rwinfo/helpers/rwinfo_installer.php b/modules/rwinfo/helpers/rwinfo_installer.php
new file mode 100644
index 00000000..fd0359ae
--- /dev/null
+++ b/modules/rwinfo/helpers/rwinfo_installer.php
@@ -0,0 +1,24 @@
+item()) {
+ if ($theme->item->id == 1) {
+ return ;
+ }
+
+ $block = new Block();
+ $block->css_id = "gMetadata";
+ $block->title = $theme->item()->is_album() ? t("Album Info") : t("Photo Info");
+ $block->content = new View("rwinfo_block.html");
+ return $block;
+ }
+ }
+
+ static function thumb_info($theme, $item) {
+ $results = "";
+ if ($item->view_count) {
+ $results .= "
";
+ $results .= t("Views: %view_count", array("view_count" => $item->view_count));
+ $results .= "";
+ }
+
+ if (module::is_active("tag")) {
+ $tagsItem = ORM::factory("tag")
+ ->join("items_tags", "tags.id", "items_tags.tag_id")
+ ->where("items_tags.item_id", $item->id)
+ ->find_all();
+ if (count($tagsItem) > 0) {
+ $results .= "";
+ $results .= t("Tags:") . " ";
+ for ($counter=0; $counter" . html::clean($tagsItem[$counter]->name) . ", ";
+ } else {
+ $results .= "" . html::clean($tagsItem[$counter]->name) . "";
+ }
+ }
+ $results .= "";
+ }
+ }
+
+ if ($item->owner) {
+ $results .= "";
+ if ($item->owner->url) {
+ $results .= t("By: %owner_name", array("owner_name" => "owner->url}\">{$item->owner->full_name}"));
+ } else {
+ $results .= t("By: %owner_name", array("owner_name" => "{$item->owner->full_name}"));
+ }
+ $results .= "";
+ }
+ return $results;
+ }
+}
\ No newline at end of file
diff --git a/modules/rwinfo/module.info b/modules/rwinfo/module.info
new file mode 100644
index 00000000..7bbf8e37
--- /dev/null
+++ b/modules/rwinfo/module.info
@@ -0,0 +1,3 @@
+name = "rWInfo"
+description = "Display extra information about photos and albums"
+version = 1
diff --git a/modules/rwinfo/notes.txt b/modules/rwinfo/notes.txt
new file mode 100644
index 00000000..38a3ed67
--- /dev/null
+++ b/modules/rwinfo/notes.txt
@@ -0,0 +1,5 @@
+Drop Title and Description (they're displayed elsewhere in the default theme, no reason to show them twice on the same page)
+Hide the info sidebar for the root album (without title and description there really isn't anything worth displaying here)
+Display date created for albums only (and continue to display the capture date for everything else)
+Display tags in the info sidebar (if the tags module is active).
+Display tags when mousing over the thumbnails (if tags module is active).
diff --git a/modules/rwinfo/views/rwinfo_block.html.php b/modules/rwinfo/views/rwinfo_block.html.php
new file mode 100644
index 00000000..b657bb82
--- /dev/null
+++ b/modules/rwinfo/views/rwinfo_block.html.php
@@ -0,0 +1,55 @@
+
+