summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorfisharebest <fisharebest@gmail.com>2011-01-01 21:41:32 +0000
committerfisharebest <fisharebest@gmail.com>2011-01-01 21:41:32 +0000
commit14eccebd9cb0c2c9902b91694fbfe89f44f87bd8 (patch)
treebc6dcd3a31b78b966fab6d0873744a2d825bb87b /includes
parent594f309cc36a8917f29b0aaa92694a8909688118 (diff)
downloadwebtrees-14eccebd9cb0c2c9902b91694fbfe89f44f87bd8.tar.gz
webtrees-14eccebd9cb0c2c9902b91694fbfe89f44f87bd8.tar.bz2
webtrees-14eccebd9cb0c2c9902b91694fbfe89f44f87bd8.zip
Diffstat (limited to 'includes')
-rw-r--r--includes/functions/functions.php2
-rw-r--r--includes/functions/functions_db.php28
-rw-r--r--includes/functions/functions_mediadb.php2
-rw-r--r--includes/session.php5
4 files changed, 34 insertions, 3 deletions
diff --git a/includes/functions/functions.php b/includes/functions/functions.php
index af0d654ddd..7c0d525ea0 100644
--- a/includes/functions/functions.php
+++ b/includes/functions/functions.php
@@ -3277,7 +3277,7 @@ function mediaFileInfo($fileName, $thumbName, $mid, $name='', $notes='', $obeyVi
$url = $fileName . "\" rel='clearbox({$LB_URL_WIDTH}, {$LB_URL_HEIGHT}, click)' rev=\"" . $mid . "::" . $GEDCOM . "::" . PrintReady(htmlspecialchars($name)) . "::" . htmlspecialchars($notes);
break 2;
case 'url_streetview':
- if (WT_SCRIPT_NAME != "media.php") {
+ if (WT_SCRIPT_NAME != "admin_media.php") {
echo '<iframe style="float:left; padding:5px;" width="264" height="176" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'. $fileName. '&amp;output=svembed"></iframe>';
}
break 2;
diff --git a/includes/functions/functions_db.php b/includes/functions/functions_db.php
index da4946032a..3c0db9aa07 100644
--- a/includes/functions/functions_db.php
+++ b/includes/functions/functions_db.php
@@ -2425,3 +2425,31 @@ function update_favorites($xref_from, $xref_to, $ged_id=WT_GED_ID) {
->execute(array($xref_to, $xref_from, $ged_name))
->rowCount();
}
+
+/**
+* count changes by today, this week, or this month for administration dashboard
+*
+* @param string $xref
+* @param string $tree
+*/
+function count_changes_today($xref, $tree) {
+ $sql="SELECT count(change_id) FROM `##change` WHERE status='accepted' AND date(change_time)= date(now()) AND xref LIKE ? '%' AND gedcom_id = ? ";
+ return
+ WT_DB::prepare($sql)
+ ->execute(array($xref, $tree))
+ ->fetchOne();
+}
+function count_changes_week($xref, $tree) {
+ $sql="SELECT count(change_id) FROM `##change` WHERE status='accepted' AND week(change_time,2)= week(now(),2) AND xref LIKE ? '%' AND gedcom_id = ? ";
+ return
+ WT_DB::prepare($sql)
+ ->execute(array($xref, $tree))
+ ->fetchOne();
+}
+function count_changes_month($xref, $tree) {
+ $sql="SELECT count(change_id) FROM `##change` WHERE status='accepted' AND month(change_time)= month(now()) AND xref LIKE ? '%' AND gedcom_id = ? ";
+ return
+ WT_DB::prepare($sql)
+ ->execute(array($xref, $tree))
+ ->fetchOne();
+}
diff --git a/includes/functions/functions_mediadb.php b/includes/functions/functions_mediadb.php
index 8efb912e94..6581ef4b86 100644
--- a/includes/functions/functions_mediadb.php
+++ b/includes/functions/functions_mediadb.php
@@ -1076,7 +1076,7 @@ function process_uploadMedia_form() {
* @param string $URL the URL the input form is to execute when the "Submit" button is pressed
* @param bool $showthumb the setting of the "show thumbnail" option (required by media.php)
*/
-function show_mediaUpload_form($URL='media.php', $showthumb=false) {
+function show_mediaUpload_form($URL, $showthumb=false) {
global $MEDIA_DIRECTORY_LEVELS, $MEDIA_DIRECTORY, $TEXT_DIRECTION;
$AUTO_GENERATE_THUMBS=get_gedcom_setting(WT_GED_ID, 'AUTO_GENERATE_THUMBS');
diff --git a/includes/session.php b/includes/session.php
index 14bb5ac67b..942befa650 100644
--- a/includes/session.php
+++ b/includes/session.php
@@ -460,7 +460,10 @@ if (WT_USER_ID) {
}
// Set the theme
-if (!defined('WT_THEME_DIR')) {
+if (substr(WT_SCRIPT_NAME, 0, 5)=='admin' || WT_SCRIPT_NAME=='module.php' && substr(safe_GET('mod_action'), 0, 5)=='admin') {
+ // Administration scripts begin with 'admin' and use a special administration theme
+ define('WT_THEME_DIR', 'themes/_administration/');
+} else {
if (get_site_setting('ALLOW_USER_THEMES')) {
// Requested change of theme?
$THEME_DIR=safe_GET('theme', get_theme_names());