1
0

Update GreyDragon support to 3.1.0.

This commit is contained in:
rWatcher 2011-10-12 20:11:56 -04:00
parent b21689eb14
commit 04d195787b
10 changed files with 544 additions and 368 deletions

View File

@ -1,135 +0,0 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<?
// The g-info block was taken from album.html.php and $theme->album_top() was changed to $theme->dynamic_top().
// $item->title and $item->description have been changed to $title and $description.
//
// The g-album-grid block was also taken from album.html.php. The section for uploading new photos to an empty album
// has been removed. Also, $theme->context_menu has been removed as well (it was crashing the page).
?>
<div id="g-album-header">
<?= $theme->dynamic_top() ?>
<h1><?= $theme->bb2html(html::purify($title), 1) ?></h1>
</div>
<?= $theme->add_paginator("top"); ?>
<? if (($theme->album_descmode == "top") and ($description)): ?>
<div id="g-info"><div class="g-description"><?= $theme->bb2html(html::purify($description), 1) ?></div></div>
<? endif; ?>
<? if (isset($filter_text) && (module::get_var("tag_albums", "tag_index_filter"))): ?>
<div id="g-tags-filter">
<br/ >
<center><?= $filter_text; ?></center>
</div>
<? endif ?>
<div class="g-album-grid-container">
<ul id="g-album-grid" class="<?= $theme->get_grid_column_class(); ?>">
<? if (count($children)): ?>
<? foreach ($children as $i => $child): ?>
<?
// This code is based on grey dragon's get_thumb_element function.
$thumb_item = $child;
$is_portrait = ($thumb_item->thumb_height > $thumb_item->thumb_width);
$item_class = $child->is_album() ? "g-album" : "g-photo";
$content = '<li id="g-item-id-' . $child->id . '" class="g-item ' . $item_class . ' ' . $theme->thumb_type;
if ($child->is_album()):
$_thumb_descmode = $theme->thumb_descmode_a;
else:
$_thumb_descmode = $theme->thumb_descmode;
endif;
$content .= ($_thumb_descmode == "bottom")? " g-expanded" : " g-default";
$content .= ($is_portrait)? " g-portrait" : " g-landscape";
$content .= '">' . $theme->thumb_top($child);
if ($theme->thumb_topalign):
$_shift = "";
else:
if (($theme->crop_factor == 1) and (!$is_portrait)):
$_shift = 'style="margin-top: ' . intval(($theme->_thumb_size_y - $thumb_item->thumb_height) / 2) . 'px;"';
else:
if (($theme->crop_factor > 0) and ($is_portrait)):
$_shift = 'style="margin-top: -' . intval(($thumb_item->thumb_height - $theme->_thumb_size_y) / 2) . 'px;"';
else:
$_shift = "";
endif;
endif;
endif;
// $ss = 'z-index: 22; opacity: 1; -ms-transform: rotate(' . (-15 + rand(0, 31)) . 'deg);'; style="' . $ss . '"
$content .= '<div class="g-thumbslide"><p class="g-thumbcrop">';
$content .= '<a '. $_shift . ' class="g-thumblink" href="' . $child->url() . '">';
if ($thumb_item->has_thumb()):
$content .= $thumb_item->thumb_img();
else:
$content .= '<img title="No Image" alt="No Image" src="' . $theme->url("images/missing-img.png") . '"/>';
endif;
$content .= '</a></p>';
if (($theme->thumb_metamode != "hide") and ($_thumb_descmode == "overlay_bottom")):
$_thumb_metamode = "merged";
else:
$_thumb_metamode = $theme->thumb_metamode;
endif;
if (($_thumb_descmode == "overlay") or ($_thumb_descmode == "overlay_top") or ($_thumb_descmode == "overlay_bottom")):
$content .= '<ul class="g-description ';
if ($_thumb_descmode == "overlay_top"):
$content .= 'g-overlay-top';
endif;
if ($_thumb_descmode == "overlay_bottom"):
$content .= 'g-overlay-bottom';
endif;
$content .= '"><li class="g-title">' . $theme->bb2html(html::purify($child->title), 2) . '</li>';
if ($_thumb_metamode == "merged"):
$content .= $theme->thumb_info($child);
endif;
$content .= '</ul>';
endif;
if (($_thumb_metamode == "default") and ($_thumb_descmode != "overlay_bottom")):
$content .= '<ul class="g-metadata">' . $theme->thumb_info($child) . '</ul>';
endif;
if ($_thumb_descmode == "bottom"):
$content .= '<ul class="g-description">';
$content .= '<li class="g-title">' . $theme->bb2html(html::purify($child->title), 2) . '</li>';
if ($_thumb_metamode == "merged"):
$content .= $theme->thumb_info($child);
endif;
$content .= '</ul>';
endif;
/*
if ($addcontext):
$_text = $this->context_menu($child, "#g-item-id-{$child->id} .g-thumbnail");
$content .= (stripos($_text, '<li>'))? $_text : null;
endif;
*/
$content .= '</div>';
$content .= $theme->thumb_bottom($child);
$content .= '</li>';
print $content;
// End rWatcher Edit.
?>
<? endforeach ?>
<? else: ?>
<li><?= t("There aren't any photos here yet!") ?></li>
<? endif; ?>
</ul>
</div>
<?= $theme->dynamic_bottom() ?>
<? if (($theme->album_descmode == "bottom") and ($description)): ?>
<div id="g-info"><div class="g-description"><?= $theme->bb2html(html::purify($description), 1) ?></div></div>
<? endif; ?>
<?= $theme->add_paginator("bottom"); ?>

View File

@ -19,7 +19,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<? $theme->load_sessioninfo(); ?>
<!-- <?= $theme->themename ?> v.<?= $theme->themeversion ?> (ColorPack: <?= $theme->colorpack ?>) - Copyright (c) 2009-2011 Serguei Dosyukov - All Rights Reserved -->
<!-- <?= $theme->themename ?> v.<?= $theme->themeversion ?> (<?= $theme->colorpack ?> : <?= $theme->framepack ?>) - Copyright (c) 2009-2011 Serguei Dosyukov - All Rights Reserved -->
<html xmlns="http://www.w3.org/1999/xhtml" <?= $theme->html_attributes() ?> xml:lang="en" lang="en" <?= ($theme->is_rtl)? "dir=rtl" : null; ?> >
<?
$item = $theme->item();
@ -55,10 +55,6 @@
<meta name="msnbot" content="noindex, nofollow, noarchive, nosnippet, noodp" />
<meta name="teoma" content="noindex, nofollow, noarchive" />
<? endif; ?>
<? if ($theme->blendpagetrans): ?>
<meta http-equiv="Page-Enter" content="blendtrans(duration=0.5)" />
<meta http-equiv="Page-Exit" content="blendtrans(duration=0.5)" />
<? endif; ?>
<!-- Internet Explorer 9 Meta tags : Start -->
<meta name="application-name" content="<?= $_title; ?>" />
<meta name="msapplication-tooltip" content="<?= t("Start"); ?> <?= $_title; ?>" />
@ -74,7 +70,6 @@
<meta name="msapplication-task" content="name=<?= t("Admin") ?>: <?= t("Dashboard") ?>; action-uri=<?= url::site("admin"); ?>; icon-uri=favicon.ico" />
<? endif; ?>
<!-- Internet Explorer 9 Meta tags : End -->
<link rel="shortcut icon" href="<?= $theme->favicon ?>" type="image/x-icon" />
<? if ($theme->appletouchicon): ?>
<link rel="apple-touch-icon" href="<?= $theme->appletouchicon; ?>"/>
@ -100,22 +95,12 @@
<?= $theme->head() ?>
<? /* Theme specific CSS/JS goes last so that it can override module CSS/JS */ ?>
<?= $theme->script("animation.js"); ?>
<?= $theme->script("ui.support.js"); ?>
<? // Theme specific CSS/JS goes last so that it can override module CSS/JS ?>
<?= $theme->theme_js_inject(); ?>
<?= $theme->theme_css_inject(); ?>
<!-- LOOKING FOR YOUR CSS? It's all been combined into the link below -->
<?= $theme->get_combined("css"); ?>
<?= $theme->css_link("colorpacks/" . $theme->colorpack . "/colors.css", FALSE); ?>
<?= $theme->css_link("framepacks/" . $theme->framepack . "/frame.css", FALSE); ?>
<? if ($theme->custom_css_path != ""): ?>
<?= $theme->css_link($theme->custom_css_path, TRUE); ?>
<? endif; ?>
<!-- LOOKING FOR YOUR JAVASCRIPT? It's all been combined into the link below -->
<?= $theme->get_combined("script") ?>
<?= $theme->get_combined("css"); // LOOKING FOR YOUR CSS? It's all been combined into the link ?>
<?= $theme->custom_css_inject(TRUE); ?>
<?= $theme->get_combined("script") // LOOKING FOR YOUR JAVASCRIPT? It's all been combined into the link ?>
<!--[if IE 6]>
<link rel="stylesheet" href="<?= $theme->url("css/old_ie.css") ?>" type="text/css" media="screen,print,projection" />
@ -128,24 +113,18 @@
$item = $theme->item();
else:
$item = item::root();
endif;
if ($theme->is_rtl):
$body_class = "rtl";
else:
$body_class = "";
endif;
if ($theme->viewmode == "mini"):
$body_class .= "viewmode-mini";
endif; ?>
<body <?= $theme->body_attributes() ?><?= ($theme->show_root_page)? ' id="g-rootpage"' : null; ?> <?= ($body_class)? 'class="' . $body_class . '"' : null; ?>>
<?= $theme->page_top() ?>
<body <?= $theme->body_attributes() ?><?= ($theme->show_root_page)? ' id="g-rootpage"' : null; ?> <?= $theme->get_bodyclass(); ?>>
<div class="QOverlay" style="left: 0px; top: 0px; width: 100%; height: 100%; position: fixed;">
</div>
<?= $theme->page_top() ?>
<?= $theme->site_status() ?>
<? if (((!$user->guest) or ($theme->show_guest_menu)) and ($theme->mainmenu_position == "bar")): ?>
<style type="text/css"> html { margin-top: 30px !important; } </style>
<div id="g-site-menu" class="g-<?= $theme->mainmenu_position; ?>">
<?= $theme->site_menu($theme->item() ? "#g-item-id-{$theme->item()->id}" : "") ?>
</div>
<? endif ?>
<? endif; ?>
<div id="g-header">
<?= $theme->header_top() ?>
<? if ($theme->viewmode != "mini"): ?>
@ -175,40 +154,45 @@
// The rest of this file is the original page.html.php file from the Grey Dragon theme.
?>
<? if (empty($breadcrumbs)): ?>
<? // This block is the original breadcrumb code ?>
<? if (empty($parents)): ?>
<?= $theme->breadcrumb_menu($theme, null); ?>
<? else: ?>
<?= $theme->breadcrumb_menu($theme, $parents); ?>
<? endif; ?>
<? // End Original Breadcrumb code, begin modified code. ?>
<? else: ?>
<?
// This is based on the libraries/My_Theme_View.php -> breadcrumb_menu function.
$breadcrumb_content = "";
if ($this->breadcrumbs_position == "hide"):
else:
$limit_title_length = module::get_var("gallery", "visible_title_length", 999);
$breadcrumb_content .= '<ul class="g-breadcrumbs g-' . module::get_var("th_greydragon", "breadcrumbs_position", "default") . '">';
$breadcrumb_content .= '<ul class="g-breadcrumbs g-' . $this->breadcrumbs_position . '">';
$i = 0;
foreach ($breadcrumbs as $breadcrumb):
if ($breadcrumb->url):
$breadcrumb_content .= '<li ' . (($i == 0)? " class=\"g-first\"" : null) . '>';
$breadcrumb_content .= '<a href="' . $breadcrumb->url . '">';
$breadcrumb_content .= text::limit_chars($theme->bb2html(html::purify($breadcrumb->title), 2), $limit_title_length);
$breadcrumb_content .= '</a></li>';
else:
$breadcrumb_content .= '<li class="g-active ' . (($i == 0)? " g-first" : null) . '">' . text::limit_chars($theme->bb2html(html::purify($breadcrumb->title), 2), $limit_title_length) . '</li>';
endif;
if ($breadcrumb->url):
$breadcrumb_content .= '<li ' . (($i == 0)? " class=\"g-first\"" : null) . '>';
$breadcrumb_content .= (($i > 0)? " :: " : null );
$breadcrumb_content .= '<a href="' . $breadcrumb->url . '">';
$breadcrumb_content .= text::limit_chars($theme->bb2html(html::purify($breadcrumb->title), 2), $limit_title_length);
$breadcrumb_content .= '</a></li>';
else:
$breadcrumb_content .= '<li class="g-active ' . (($i == 0)? " g-first" : null) . '"> '. (($i > 0)? " :: " : null ) . text::limit_chars($theme->bb2html(html::purify($breadcrumb->title), 2), $limit_title_length) . '</li>';
endif;
$i++;
endforeach;
$breadcrumb_content .= '</ul>';
endif;
print $breadcrumb_content;
// End Edit.
print $breadcrumb_content;
?>
<? endif; // End Edit. ?>
<? endif; ?>
<?= $theme->custom_header(); ?>
</div>
<? if (($theme->page_subtype != "login") and ($theme->page_subtype != "reauthenticate") and ($theme->sidebarvisible == "top")): ?>

View File

@ -59,7 +59,7 @@
endfor;
else:
// End rWatcher Mod.
switch ($page_type) {
case "collection":
if (isset($item)):
@ -189,7 +189,7 @@
<? if (isset($parent_url)): ?>
<a title="<?= t("up") ?>" id="g-navi-parent" href="<?= $parent_url ?>"><span class="ui-icon ui-icon-parent">&nbsp;</span></a>
<? elseif (isset($parent)): ?>
<a title="<?= t("up") ?>" id="g-navi-parent" href="<?= $parent->url() ?>"><span class="ui-icon ui-icon-parent">&nbsp;</span></a>
<a title="<?= t("up") ?>" id="g-navi-parent" href="<?= $parent->url("show={$item->id}"); ?>"><span class="ui-icon ui-icon-parent">&nbsp;</span></a>
<? else: ?>
<span class="ui-icon ui-icon-parent-d">&nbsp;</span>
<? endif ?>

View File

@ -56,8 +56,8 @@
<div id="g-photo">
<?= $theme->resize_top($item) ?>
<? $_resizewidth = $item->resize_width;
// rWatcher Modification.
//ORIGINAL LINE $siblings = $item->parent()->children();
$siblings = "";
if (isset($dynamic_siblings)) {
$siblings = $dynamic_siblings;
@ -66,7 +66,7 @@
}
// End rWatcher Modification
?>
<div class="g-resize" style="margin-left: -<?= intval($_resizewidth / 2); ?>px; ">
<? $script = "<script type=\"text/javascript\">\n";
$script .= " if (document.images) {\n";

View File

@ -0,0 +1,239 @@
<?php defined("SYSPATH") or die("No direct script access."); ?>
<?
// Used album.html.php as starting point.
// The g-info block was taken from album.html.php and $theme->album_top() was changed to $theme->dynamic_top().
// $item->title and $item->description have been changed to $title and $description.
//
// The g-album-grid block was also taken from album.html.php. The section for uploading new photos to an empty album
// has been removed. Also, $theme->context_menu has been removed as well (it was crashing the page).
?>
<div id="g-album-header">
<?= $theme->dynamic_top() ?>
<h1><?= $theme->bb2html(html::purify($title), 1) ?></h1>
</div>
<?= $theme->add_paginator("top"); ?>
<? if (($theme->album_descmode == "top") and ($description)): ?>
<div id="g-info"><div class="g-description"><?= $theme->bb2html(html::purify($description), 1) ?></div></div>
<? endif; ?>
<? if (isset($filter_text) && (module::get_var("tag_albums", "tag_index_filter"))): ?>
<div id="g-tags-filter">
<br/ >
<center><?= $filter_text; ?></center>
</div>
<? endif ?>
<div class="g-album-grid-container">
<ul id="g-album-grid" class="<?= $theme->get_grid_column_class(); ?>">
<?
if (count($children)):
$siblings = $all_siblings;
if (($theme->disablephotopage) && (count($siblings) > count($children))):
$j = 0;
foreach ($siblings as $i => $sibling):
//if ($sibling->rand_key == $children[$j]->rand_key):
if ($sibling->id == $children[$j]->item_id):
//echo $theme->get_thumb_element($sibling, !$theme->hidecontextmenu);
echo rw_get_thumb_element($children[$j], $theme);
if ($j + 1 < count($children)):
$j++;
endif;
else:
echo $theme->get_thumb_link($sibling);
//echo rw_get_thumb_link($sibling, $theme);
endif;
endforeach;
else:
foreach ($children as $i => $child):
//echo $theme->get_thumb_element($child, !$theme->hidecontextmenu);
echo rw_get_thumb_element($child, $theme);
endforeach;
endif;
else: ?>
<li><?= t("There aren't any photos here yet!") ?></li>
<? endif; ?>
</ul>
</div>
<?= $theme->dynamic_bottom() ?>
<? if (($theme->album_descmode == "bottom") and ($description)): ?>
<div id="g-info"><div class="g-description"><?= $theme->bb2html(html::purify($description), 1) ?></div></div>
<? endif; ?>
<?= $theme->add_paginator("bottom"); ?>
<?
function rw_get_thumb_link($item, $theme) {
// This code is based on grey dragon's get_thumb_link function.
// Change all $this to $theme
if ($item->is_album()):
return "";
endif;
/*
if (access::can("view_full", $item)):
$direct_link = $item->file_url();
else:
$direct_link = $item->resize_url();
endif;*/
$direct_link = $child->full_or_resize_url();
return '<a title="' . $theme->bb2html(html::purify($item->title), 2) . '" style="display: none;" class="g-sb-preview" rel="g-preview" href="' . $direct_link . '">&nbsp;</a>';
}
function rw_get_thumb_element($child, $theme) {
// This code is based on grey dragon's get_thumb_element function.
// Change all $item to $child
// Change all $this to $theme
$thumb_item = $child;
if ($theme->thumb_random):
if ($child->is_album() && ($rnd = item::random_query()->where("parent_id", "=", $child->id)->find()) && $rnd->loaded()):
$thumb_item = $rnd;
endif;
endif;
$item_class = $child->is_album() ? "g-album" : "g-photo";
$content = '<li id="g-item-id-' . $child->id . '" class="g-item ' . $item_class . ' ' . $theme->thumb_type;
if ($child->is_album()):
$_thumb_descmode = $theme->thumb_descmode_a;
else:
$_thumb_descmode = $theme->thumb_descmode;
endif;
$content .= ($_thumb_descmode == "bottom")? " g-expanded" : " g-default";
if ($thumb_item->has_thumb()):
$is_portrait = ($thumb_item->thumb_height > $thumb_item->thumb_width);
$_shift = "";
switch ($theme->thumb_imgalign):
case "center":
if (($theme->crop_factor == 1) and (!$is_portrait)):
$_shift = 'style="margin-top: ' . intval(($theme->_thumb_size_y - $thumb_item->thumb_height) / 2) . 'px;"';
elseif ($theme->crop_factor > 0):
$_shift = 'style="margin-top: -' . intval(($thumb_item->thumb_height - $theme->_thumb_size_y) / 2) . 'px;"';
endif;
break;
case "bottom":
if (($theme->crop_factor == 1) and (!$is_portrait)):
$_shift = 'style="margin-top: ' . intval($theme->_thumb_size_y - $thumb_item->thumb_height) . 'px;"';
elseif ($theme->crop_factor > 0):
$_shift = 'style="margin-top: -' . intval($thumb_item->thumb_height - $theme->_thumb_size_y) . 'px;"';
endif;
break;
case "fit":
break;
case "top":
default:
break;
endswitch;
else:
$is_portrait = FALSE;
$_shift = 'style="margin-top: 0px;"';
endif;
$content .= ($is_portrait)? " g-portrait" : " g-landscape";
$content .= '">' . $theme->thumb_top($child);
$content .= '<div class="g-thumbslide">';
$thumb_content = '<p class="g-thumbcrop">';
$use_direct_link = (($theme->disablephotopage) && (!$child->is_album()));
$class_name = "g-thumblink";
if ($use_direct_link):
$class_name .= ' g-sb-preview" rel="g-preview';
//if (access::can("view_full", $child)):
//$direct_link = $child->file_url();
//else:
$direct_link = $child->full_or_resize_url();
//endif;
else:
$direct_link = $child->url();
endif;
if ($use_direct_link && module::is_active("exif") && module::info("exif")):
$thumb_content .= '<a class="g-meta-exif-link g-dialog-link" href="' . url::site("exif/show/{$child->id}") . '" title="' . t("Photo details")->for_html_attr() . '">&nbsp;</a>';
endif;
$thumb_content .= '<a title="' . $theme->bb2html(html::purify($child->title), 2) . '" '. $_shift . ' class="' . $class_name . '" href="' . $direct_link . '">';
if ($thumb_item->has_thumb()):
if (($theme->crop_factor > 1) && ($theme->thumb_imgalign == "fit")):
if ($thumb_item->thumb_height > $theme->_thumb_size_y):
if ($is_portrait):
$_max = $theme->_thumb_size_y;
else:
$_max = intval($theme->_thumb_size_x * ($theme->_thumb_size_y / $thumb_item->thumb_height));
endif;
else:
$_max = $theme->_thumb_size_x;
endif;
$_max = min($thumb_item->thumb_width, $_max);
$thumb_content .= $thumb_item->thumb_img(array(), $_max);
else:
$thumb_content .= $thumb_item->thumb_img();
endif;
else:
$thumb_content .= '<img title="No Image" alt="No Image" src="' . $theme->url("images/missing-img.png") . '"/>';
endif;
$thumb_content .= '</a></p>';
if (($theme->thumb_metamode != "hide") and ($_thumb_descmode == "overlay_bottom")):
$_thumb_metamode = "merged";
else:
$_thumb_metamode = $theme->thumb_metamode;
endif;
if (($_thumb_descmode == "overlay") or ($_thumb_descmode == "overlay_top") or ($_thumb_descmode == "overlay_bottom")):
$thumb_content .= '<ul class="g-description ';
if ($_thumb_descmode == "overlay_top"):
$thumb_content .= 'g-overlay-top';
endif;
if ($_thumb_descmode == "overlay_bottom"):
$thumb_content .= 'g-overlay-bottom';
endif;
$thumb_content .= '"><li class="g-title">' . $theme->bb2html(html::purify($child->title), 2) . '</li>';
if ($_thumb_metamode == "merged"):
$thumb_content .= $theme->thumb_info($child);
endif;
$thumb_content .= '</ul>';
endif;
if (($_thumb_metamode == "default") and ($_thumb_descmode != "overlay_bottom")):
$thumb_content .= '<ul class="g-metadata">' . $theme->thumb_info($child) . '</ul>';
endif;
if ($_thumb_descmode == "bottom"):
$thumb_content .= '<ul class="g-description">';
$thumb_content .= '<li class="g-title">' . $theme->bb2html(html::purify($child->title), 2) . '</li>';
if ($_thumb_metamode == "merged"):
$thumb_content .= $theme->thumb_info($item);
endif;
$thumb_content .= '</ul>';
endif;
/*
if ($addcontext):
$_text = $this->context_menu($item, "#g-item-id-{$item->id} .g-thumbnail");
$thumb_content .= (stripos($_text, '<li>'))? $_text : null;
endif;
*/
try {
$view = new View("frame.html");
$view->thumb_content = $thumb_content;
$content .= $view;
} catch (Exception $e) {
$content .= $thumb_content;
}
$content .= '</div>';
$content .= $theme->thumb_bottom($child);
$content .= '</li>';
return $content;
//print $content;
// End of modified function code.
}
?>

View File

@ -1,135 +0,0 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<?
// The g-info block was taken from album.html.php and $theme->album_top() was changed to $theme->dynamic_top().
// $item->title and $item->description have been changed to $title and $description.
//
// The g-album-grid block was also taken from album.html.php. The section for uploading new photos to an empty album
// has been removed. Also, $theme->context_menu has been removed as well (it was crashing the page).
?>
<div id="g-album-header">
<?= $theme->dynamic_top() ?>
<h1><?= $theme->bb2html(html::purify($title), 1) ?></h1>
</div>
<?= $theme->add_paginator("top"); ?>
<? if (($theme->album_descmode == "top") and ($description)): ?>
<div id="g-info"><div class="g-description"><?= $theme->bb2html(html::purify($description), 1) ?></div></div>
<? endif; ?>
<? if (isset($filter_text) && (module::get_var("tag_albums", "tag_index_filter"))): ?>
<div id="g-tags-filter">
<br/ >
<center><?= $filter_text; ?></center>
</div>
<? endif ?>
<div class="g-album-grid-container">
<ul id="g-album-grid" class="<?= $theme->get_grid_column_class(); ?>">
<? if (count($children)): ?>
<? foreach ($children as $i => $child): ?>
<?
// This code is based on grey dragon's get_thumb_element function.
$thumb_item = $child;
$is_portrait = ($thumb_item->thumb_height > $thumb_item->thumb_width);
$item_class = $child->is_album() ? "g-album" : "g-photo";
$content = '<li id="g-item-id-' . $child->id . '" class="g-item ' . $item_class . ' ' . $theme->thumb_type;
if ($child->is_album()):
$_thumb_descmode = $theme->thumb_descmode_a;
else:
$_thumb_descmode = $theme->thumb_descmode;
endif;
$content .= ($_thumb_descmode == "bottom")? " g-expanded" : " g-default";
$content .= ($is_portrait)? " g-portrait" : " g-landscape";
$content .= '">' . $theme->thumb_top($child);
if ($theme->thumb_topalign):
$_shift = "";
else:
if (($theme->crop_factor == 1) and (!$is_portrait)):
$_shift = 'style="margin-top: ' . intval(($theme->_thumb_size_y - $thumb_item->thumb_height) / 2) . 'px;"';
else:
if (($theme->crop_factor > 0) and ($is_portrait)):
$_shift = 'style="margin-top: -' . intval(($thumb_item->thumb_height - $theme->_thumb_size_y) / 2) . 'px;"';
else:
$_shift = "";
endif;
endif;
endif;
// $ss = 'z-index: 22; opacity: 1; -ms-transform: rotate(' . (-15 + rand(0, 31)) . 'deg);'; style="' . $ss . '"
$content .= '<div class="g-thumbslide"><p class="g-thumbcrop">';
$content .= '<a '. $_shift . ' class="g-thumblink" href="' . $child->url() . '">';
if ($thumb_item->has_thumb()):
$content .= $thumb_item->thumb_img();
else:
$content .= '<img title="No Image" alt="No Image" src="' . $theme->url("images/missing-img.png") . '"/>';
endif;
$content .= '</a></p>';
if (($theme->thumb_metamode != "hide") and ($_thumb_descmode == "overlay_bottom")):
$_thumb_metamode = "merged";
else:
$_thumb_metamode = $theme->thumb_metamode;
endif;
if (($_thumb_descmode == "overlay") or ($_thumb_descmode == "overlay_top") or ($_thumb_descmode == "overlay_bottom")):
$content .= '<ul class="g-description ';
if ($_thumb_descmode == "overlay_top"):
$content .= 'g-overlay-top';
endif;
if ($_thumb_descmode == "overlay_bottom"):
$content .= 'g-overlay-bottom';
endif;
$content .= '"><li class="g-title">' . $theme->bb2html(html::purify($child->title), 2) . '</li>';
if ($_thumb_metamode == "merged"):
$content .= $theme->thumb_info($child);
endif;
$content .= '</ul>';
endif;
if (($_thumb_metamode == "default") and ($_thumb_descmode != "overlay_bottom")):
$content .= '<ul class="g-metadata">' . $theme->thumb_info($child) . '</ul>';
endif;
if ($_thumb_descmode == "bottom"):
$content .= '<ul class="g-description">';
$content .= '<li class="g-title">' . $theme->bb2html(html::purify($child->title), 2) . '</li>';
if ($_thumb_metamode == "merged"):
$content .= $theme->thumb_info($child);
endif;
$content .= '</ul>';
endif;
/*
if ($addcontext):
$_text = $this->context_menu($child, "#g-item-id-{$child->id} .g-thumbnail");
$content .= (stripos($_text, '<li>'))? $_text : null;
endif;
*/
$content .= '</div>';
$content .= $theme->thumb_bottom($child);
$content .= '</li>';
print $content;
// End rWatcher Edit.
?>
<? endforeach ?>
<? else: ?>
<li><?= t("There aren't any photos here yet!") ?></li>
<? endif; ?>
</ul>
</div>
<?= $theme->dynamic_bottom() ?>
<? if (($theme->album_descmode == "bottom") and ($description)): ?>
<div id="g-info"><div class="g-description"><?= $theme->bb2html(html::purify($description), 1) ?></div></div>
<? endif; ?>
<?= $theme->add_paginator("bottom"); ?>

View File

@ -19,7 +19,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<? $theme->load_sessioninfo(); ?>
<!-- <?= $theme->themename ?> v.<?= $theme->themeversion ?> (ColorPack: <?= $theme->colorpack ?>) - Copyright (c) 2009-2011 Serguei Dosyukov - All Rights Reserved -->
<!-- <?= $theme->themename ?> v.<?= $theme->themeversion ?> (<?= $theme->colorpack ?> : <?= $theme->framepack ?>) - Copyright (c) 2009-2011 Serguei Dosyukov - All Rights Reserved -->
<html xmlns="http://www.w3.org/1999/xhtml" <?= $theme->html_attributes() ?> xml:lang="en" lang="en" <?= ($theme->is_rtl)? "dir=rtl" : null; ?> >
<?
$item = $theme->item();
@ -55,10 +55,6 @@
<meta name="msnbot" content="noindex, nofollow, noarchive, nosnippet, noodp" />
<meta name="teoma" content="noindex, nofollow, noarchive" />
<? endif; ?>
<? if ($theme->blendpagetrans): ?>
<meta http-equiv="Page-Enter" content="blendtrans(duration=0.5)" />
<meta http-equiv="Page-Exit" content="blendtrans(duration=0.5)" />
<? endif; ?>
<!-- Internet Explorer 9 Meta tags : Start -->
<meta name="application-name" content="<?= $_title; ?>" />
<meta name="msapplication-tooltip" content="<?= t("Start"); ?> <?= $_title; ?>" />
@ -74,7 +70,6 @@
<meta name="msapplication-task" content="name=<?= t("Admin") ?>: <?= t("Dashboard") ?>; action-uri=<?= url::site("admin"); ?>; icon-uri=favicon.ico" />
<? endif; ?>
<!-- Internet Explorer 9 Meta tags : End -->
<link rel="shortcut icon" href="<?= $theme->favicon ?>" type="image/x-icon" />
<? if ($theme->appletouchicon): ?>
<link rel="apple-touch-icon" href="<?= $theme->appletouchicon; ?>"/>
@ -100,22 +95,12 @@
<?= $theme->head() ?>
<? /* Theme specific CSS/JS goes last so that it can override module CSS/JS */ ?>
<?= $theme->script("animation.js"); ?>
<?= $theme->script("ui.support.js"); ?>
<? // Theme specific CSS/JS goes last so that it can override module CSS/JS ?>
<?= $theme->theme_js_inject(); ?>
<?= $theme->theme_css_inject(); ?>
<!-- LOOKING FOR YOUR CSS? It's all been combined into the link below -->
<?= $theme->get_combined("css"); ?>
<?= $theme->css_link("colorpacks/" . $theme->colorpack . "/colors.css", FALSE); ?>
<?= $theme->css_link("framepacks/" . $theme->framepack . "/frame.css", FALSE); ?>
<? if ($theme->custom_css_path != ""): ?>
<?= $theme->css_link($theme->custom_css_path, TRUE); ?>
<? endif; ?>
<!-- LOOKING FOR YOUR JAVASCRIPT? It's all been combined into the link below -->
<?= $theme->get_combined("script") ?>
<?= $theme->get_combined("css"); // LOOKING FOR YOUR CSS? It's all been combined into the link ?>
<?= $theme->custom_css_inject(TRUE); ?>
<?= $theme->get_combined("script") // LOOKING FOR YOUR JAVASCRIPT? It's all been combined into the link ?>
<!--[if IE 6]>
<link rel="stylesheet" href="<?= $theme->url("css/old_ie.css") ?>" type="text/css" media="screen,print,projection" />
@ -128,24 +113,18 @@
$item = $theme->item();
else:
$item = item::root();
endif;
if ($theme->is_rtl):
$body_class = "rtl";
else:
$body_class = "";
endif;
if ($theme->viewmode == "mini"):
$body_class .= "viewmode-mini";
endif; ?>
<body <?= $theme->body_attributes() ?><?= ($theme->show_root_page)? ' id="g-rootpage"' : null; ?> <?= ($body_class)? 'class="' . $body_class . '"' : null; ?>>
<?= $theme->page_top() ?>
<body <?= $theme->body_attributes() ?><?= ($theme->show_root_page)? ' id="g-rootpage"' : null; ?> <?= $theme->get_bodyclass(); ?>>
<div class="QOverlay" style="left: 0px; top: 0px; width: 100%; height: 100%; position: fixed;">
</div>
<?= $theme->page_top() ?>
<?= $theme->site_status() ?>
<? if (((!$user->guest) or ($theme->show_guest_menu)) and ($theme->mainmenu_position == "bar")): ?>
<style type="text/css"> html { margin-top: 30px !important; } </style>
<div id="g-site-menu" class="g-<?= $theme->mainmenu_position; ?>">
<?= $theme->site_menu($theme->item() ? "#g-item-id-{$theme->item()->id}" : "") ?>
</div>
<? endif ?>
<? endif; ?>
<div id="g-header">
<?= $theme->header_top() ?>
<? if ($theme->viewmode != "mini"): ?>
@ -175,40 +154,45 @@
// The rest of this file is the original page.html.php file from the Grey Dragon theme.
?>
<? if (empty($breadcrumbs)): ?>
<? // This block is the original breadcrumb code ?>
<? if (empty($parents)): ?>
<?= $theme->breadcrumb_menu($theme, null); ?>
<? else: ?>
<?= $theme->breadcrumb_menu($theme, $parents); ?>
<? endif; ?>
<? // End Original Breadcrumb code, begin modified code. ?>
<? else: ?>
<?
// This is based on the libraries/My_Theme_View.php -> breadcrumb_menu function.
$breadcrumb_content = "";
if ($this->breadcrumbs_position == "hide"):
else:
$limit_title_length = module::get_var("gallery", "visible_title_length", 999);
$breadcrumb_content .= '<ul class="g-breadcrumbs g-' . module::get_var("th_greydragon", "breadcrumbs_position", "default") . '">';
$breadcrumb_content .= '<ul class="g-breadcrumbs g-' . $this->breadcrumbs_position . '">';
$i = 0;
foreach ($breadcrumbs as $breadcrumb):
if ($breadcrumb->url):
$breadcrumb_content .= '<li ' . (($i == 0)? " class=\"g-first\"" : null) . '>';
$breadcrumb_content .= '<a href="' . $breadcrumb->url . '">';
$breadcrumb_content .= text::limit_chars($theme->bb2html(html::purify($breadcrumb->title), 2), $limit_title_length);
$breadcrumb_content .= '</a></li>';
else:
$breadcrumb_content .= '<li class="g-active ' . (($i == 0)? " g-first" : null) . '">' . text::limit_chars($theme->bb2html(html::purify($breadcrumb->title), 2), $limit_title_length) . '</li>';
endif;
if ($breadcrumb->url):
$breadcrumb_content .= '<li ' . (($i == 0)? " class=\"g-first\"" : null) . '>';
$breadcrumb_content .= (($i > 0)? " :: " : null );
$breadcrumb_content .= '<a href="' . $breadcrumb->url . '">';
$breadcrumb_content .= text::limit_chars($theme->bb2html(html::purify($breadcrumb->title), 2), $limit_title_length);
$breadcrumb_content .= '</a></li>';
else:
$breadcrumb_content .= '<li class="g-active ' . (($i == 0)? " g-first" : null) . '"> '. (($i > 0)? " :: " : null ) . text::limit_chars($theme->bb2html(html::purify($breadcrumb->title), 2), $limit_title_length) . '</li>';
endif;
$i++;
endforeach;
$breadcrumb_content .= '</ul>';
endif;
print $breadcrumb_content;
// End Edit.
print $breadcrumb_content;
?>
<? endif; // End Edit. ?>
<? endif; ?>
<?= $theme->custom_header(); ?>
</div>
<? if (($theme->page_subtype != "login") and ($theme->page_subtype != "reauthenticate") and ($theme->sidebarvisible == "top")): ?>

View File

@ -59,7 +59,7 @@
endfor;
else:
// End rWatcher Mod.
switch ($page_type) {
case "collection":
if (isset($item)):
@ -189,7 +189,7 @@
<? if (isset($parent_url)): ?>
<a title="<?= t("up") ?>" id="g-navi-parent" href="<?= $parent_url ?>"><span class="ui-icon ui-icon-parent">&nbsp;</span></a>
<? elseif (isset($parent)): ?>
<a title="<?= t("up") ?>" id="g-navi-parent" href="<?= $parent->url() ?>"><span class="ui-icon ui-icon-parent">&nbsp;</span></a>
<a title="<?= t("up") ?>" id="g-navi-parent" href="<?= $parent->url("show={$item->id}"); ?>"><span class="ui-icon ui-icon-parent">&nbsp;</span></a>
<? else: ?>
<span class="ui-icon ui-icon-parent-d">&nbsp;</span>
<? endif ?>

View File

@ -56,8 +56,8 @@
<div id="g-photo">
<?= $theme->resize_top($item) ?>
<? $_resizewidth = $item->resize_width;
// rWatcher Modification.
//ORIGINAL LINE $siblings = $item->parent()->children();
$siblings = "";
if (isset($dynamic_siblings)) {
$siblings = $dynamic_siblings;
@ -66,7 +66,7 @@
}
// End rWatcher Modification
?>
<div class="g-resize" style="margin-left: -<?= intval($_resizewidth / 2); ?>px; ">
<? $script = "<script type=\"text/javascript\">\n";
$script .= " if (document.images) {\n";

View File

@ -0,0 +1,239 @@
<?php defined("SYSPATH") or die("No direct script access."); ?>
<?
// Used album.html.php as starting point.
// The g-info block was taken from album.html.php and $theme->album_top() was changed to $theme->dynamic_top().
// $item->title and $item->description have been changed to $title and $description.
//
// The g-album-grid block was also taken from album.html.php. The section for uploading new photos to an empty album
// has been removed. Also, $theme->context_menu has been removed as well (it was crashing the page).
?>
<div id="g-album-header">
<?= $theme->dynamic_top() ?>
<h1><?= $theme->bb2html(html::purify($title), 1) ?></h1>
</div>
<?= $theme->add_paginator("top"); ?>
<? if (($theme->album_descmode == "top") and ($description)): ?>
<div id="g-info"><div class="g-description"><?= $theme->bb2html(html::purify($description), 1) ?></div></div>
<? endif; ?>
<? if (isset($filter_text) && (module::get_var("tag_albums", "tag_index_filter"))): ?>
<div id="g-tags-filter">
<br/ >
<center><?= $filter_text; ?></center>
</div>
<? endif ?>
<div class="g-album-grid-container">
<ul id="g-album-grid" class="<?= $theme->get_grid_column_class(); ?>">
<?
if (count($children)):
$siblings = $all_siblings;
if (($theme->disablephotopage) && (count($siblings) > count($children))):
$j = 0;
foreach ($siblings as $i => $sibling):
//if ($sibling->rand_key == $children[$j]->rand_key):
if ($sibling->id == $children[$j]->item_id):
//echo $theme->get_thumb_element($sibling, !$theme->hidecontextmenu);
echo rw_get_thumb_element($children[$j], $theme);
if ($j + 1 < count($children)):
$j++;
endif;
else:
echo $theme->get_thumb_link($sibling);
//echo rw_get_thumb_link($sibling, $theme);
endif;
endforeach;
else:
foreach ($children as $i => $child):
//echo $theme->get_thumb_element($child, !$theme->hidecontextmenu);
echo rw_get_thumb_element($child, $theme);
endforeach;
endif;
else: ?>
<li><?= t("There aren't any photos here yet!") ?></li>
<? endif; ?>
</ul>
</div>
<?= $theme->dynamic_bottom() ?>
<? if (($theme->album_descmode == "bottom") and ($description)): ?>
<div id="g-info"><div class="g-description"><?= $theme->bb2html(html::purify($description), 1) ?></div></div>
<? endif; ?>
<?= $theme->add_paginator("bottom"); ?>
<?
function rw_get_thumb_link($item, $theme) {
// This code is based on grey dragon's get_thumb_link function.
// Change all $this to $theme
if ($item->is_album()):
return "";
endif;
/*
if (access::can("view_full", $item)):
$direct_link = $item->file_url();
else:
$direct_link = $item->resize_url();
endif;*/
$direct_link = $child->full_or_resize_url();
return '<a title="' . $theme->bb2html(html::purify($item->title), 2) . '" style="display: none;" class="g-sb-preview" rel="g-preview" href="' . $direct_link . '">&nbsp;</a>';
}
function rw_get_thumb_element($child, $theme) {
// This code is based on grey dragon's get_thumb_element function.
// Change all $item to $child
// Change all $this to $theme
$thumb_item = $child;
if ($theme->thumb_random):
if ($child->is_album() && ($rnd = item::random_query()->where("parent_id", "=", $child->id)->find()) && $rnd->loaded()):
$thumb_item = $rnd;
endif;
endif;
$item_class = $child->is_album() ? "g-album" : "g-photo";
$content = '<li id="g-item-id-' . $child->id . '" class="g-item ' . $item_class . ' ' . $theme->thumb_type;
if ($child->is_album()):
$_thumb_descmode = $theme->thumb_descmode_a;
else:
$_thumb_descmode = $theme->thumb_descmode;
endif;
$content .= ($_thumb_descmode == "bottom")? " g-expanded" : " g-default";
if ($thumb_item->has_thumb()):
$is_portrait = ($thumb_item->thumb_height > $thumb_item->thumb_width);
$_shift = "";
switch ($theme->thumb_imgalign):
case "center":
if (($theme->crop_factor == 1) and (!$is_portrait)):
$_shift = 'style="margin-top: ' . intval(($theme->_thumb_size_y - $thumb_item->thumb_height) / 2) . 'px;"';
elseif ($theme->crop_factor > 0):
$_shift = 'style="margin-top: -' . intval(($thumb_item->thumb_height - $theme->_thumb_size_y) / 2) . 'px;"';
endif;
break;
case "bottom":
if (($theme->crop_factor == 1) and (!$is_portrait)):
$_shift = 'style="margin-top: ' . intval($theme->_thumb_size_y - $thumb_item->thumb_height) . 'px;"';
elseif ($theme->crop_factor > 0):
$_shift = 'style="margin-top: -' . intval($thumb_item->thumb_height - $theme->_thumb_size_y) . 'px;"';
endif;
break;
case "fit":
break;
case "top":
default:
break;
endswitch;
else:
$is_portrait = FALSE;
$_shift = 'style="margin-top: 0px;"';
endif;
$content .= ($is_portrait)? " g-portrait" : " g-landscape";
$content .= '">' . $theme->thumb_top($child);
$content .= '<div class="g-thumbslide">';
$thumb_content = '<p class="g-thumbcrop">';
$use_direct_link = (($theme->disablephotopage) && (!$child->is_album()));
$class_name = "g-thumblink";
if ($use_direct_link):
$class_name .= ' g-sb-preview" rel="g-preview';
//if (access::can("view_full", $child)):
//$direct_link = $child->file_url();
//else:
$direct_link = $child->full_or_resize_url();
//endif;
else:
$direct_link = $child->url();
endif;
if ($use_direct_link && module::is_active("exif") && module::info("exif")):
$thumb_content .= '<a class="g-meta-exif-link g-dialog-link" href="' . url::site("exif/show/{$child->id}") . '" title="' . t("Photo details")->for_html_attr() . '">&nbsp;</a>';
endif;
$thumb_content .= '<a title="' . $theme->bb2html(html::purify($child->title), 2) . '" '. $_shift . ' class="' . $class_name . '" href="' . $direct_link . '">';
if ($thumb_item->has_thumb()):
if (($theme->crop_factor > 1) && ($theme->thumb_imgalign == "fit")):
if ($thumb_item->thumb_height > $theme->_thumb_size_y):
if ($is_portrait):
$_max = $theme->_thumb_size_y;
else:
$_max = intval($theme->_thumb_size_x * ($theme->_thumb_size_y / $thumb_item->thumb_height));
endif;
else:
$_max = $theme->_thumb_size_x;
endif;
$_max = min($thumb_item->thumb_width, $_max);
$thumb_content .= $thumb_item->thumb_img(array(), $_max);
else:
$thumb_content .= $thumb_item->thumb_img();
endif;
else:
$thumb_content .= '<img title="No Image" alt="No Image" src="' . $theme->url("images/missing-img.png") . '"/>';
endif;
$thumb_content .= '</a></p>';
if (($theme->thumb_metamode != "hide") and ($_thumb_descmode == "overlay_bottom")):
$_thumb_metamode = "merged";
else:
$_thumb_metamode = $theme->thumb_metamode;
endif;
if (($_thumb_descmode == "overlay") or ($_thumb_descmode == "overlay_top") or ($_thumb_descmode == "overlay_bottom")):
$thumb_content .= '<ul class="g-description ';
if ($_thumb_descmode == "overlay_top"):
$thumb_content .= 'g-overlay-top';
endif;
if ($_thumb_descmode == "overlay_bottom"):
$thumb_content .= 'g-overlay-bottom';
endif;
$thumb_content .= '"><li class="g-title">' . $theme->bb2html(html::purify($child->title), 2) . '</li>';
if ($_thumb_metamode == "merged"):
$thumb_content .= $theme->thumb_info($child);
endif;
$thumb_content .= '</ul>';
endif;
if (($_thumb_metamode == "default") and ($_thumb_descmode != "overlay_bottom")):
$thumb_content .= '<ul class="g-metadata">' . $theme->thumb_info($child) . '</ul>';
endif;
if ($_thumb_descmode == "bottom"):
$thumb_content .= '<ul class="g-description">';
$thumb_content .= '<li class="g-title">' . $theme->bb2html(html::purify($child->title), 2) . '</li>';
if ($_thumb_metamode == "merged"):
$thumb_content .= $theme->thumb_info($item);
endif;
$thumb_content .= '</ul>';
endif;
/*
if ($addcontext):
$_text = $this->context_menu($item, "#g-item-id-{$item->id} .g-thumbnail");
$thumb_content .= (stripos($_text, '<li>'))? $_text : null;
endif;
*/
try {
$view = new View("frame.html");
$view->thumb_content = $thumb_content;
$content .= $view;
} catch (Exception $e) {
$content .= $thumb_content;
}
$content .= '</div>';
$content .= $theme->thumb_bottom($child);
$content .= '</li>';
return $content;
//print $content;
// End of modified function code.
}
?>