aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/TakeATour/tours/2_7_0/config.inc.php
diff options
context:
space:
mode:
authorflop25 <flop25@piwigo.org>2014-07-15 18:03:00 +0000
committerflop25 <flop25@piwigo.org>2014-07-15 18:03:00 +0000
commit69c4a00dae2048dc685c6b1328f1a9e24335ce1f (patch)
tree757ab1d16471acc4c78bd76139649746cda642d7 /plugins/TakeATour/tours/2_7_0/config.inc.php
parent0efcdefe415f0d5bd440b20be4518b5ec6c4c2c3 (diff)
Take A Tour:
-only 2 files per tour.tpl -allow external tours -absolute url when ending the tour -better code, commented wiki updated (2.7 technical changes) git-svn-id: http://piwigo.org/svn/trunk@29046 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'plugins/TakeATour/tours/2_7_0/config.inc.php')
-rw-r--r--plugins/TakeATour/tours/2_7_0/config.inc.php39
1 files changed, 39 insertions, 0 deletions
diff --git a/plugins/TakeATour/tours/2_7_0/config.inc.php b/plugins/TakeATour/tours/2_7_0/config.inc.php
index 0165eb215..76b671632 100644
--- a/plugins/TakeATour/tours/2_7_0/config.inc.php
+++ b/plugins/TakeATour/tours/2_7_0/config.inc.php
@@ -1,3 +1,42 @@
<?php
+/**********************************
+ * REQUIRED PATH TO THE TPL FILE */
+$TOUR_PATH = PHPWG_PLUGINS_PATH.'TakeATour/tours/2_7_0/tour.tpl';
+
+/*********************************/
+
+
+/**********************
+ * Preparse part *
+ **********************/
+ $template->assign('TAT_index', make_index_url(array('section' => 'categories')));
+ $template->assign('TAT_search', get_root_url().'search.php');
+
+ //picture id
+ if (isset($_GET['page']) and preg_match('/^photo-(\d+)(?:-(.*))?$/', $_GET['page'], $matches))
+ {
+ $_GET['image_id'] = $matches[1];
+ }
+ check_input_parameter('image_id', $_GET, false, PATTERN_ID);
+ if (isset($_GET['image_id']) and pwg_get_session_var('TAT_image_id')==null)
+ {
+ $template->assign('TAT_image_id', $_GET['image_id']);
+ pwg_set_session_var('TAT_image_id', $_GET['image_id']);
+ }
+ elseif (is_numeric(pwg_get_session_var('TAT_image_id')))
+ {
+ $template->assign('TAT_image_id', pwg_get_session_var('TAT_image_id'));
+ }
+ else
+ {
+ $query = '
+ SELECT id
+ FROM '.IMAGES_TABLE.'
+ ORDER BY RAND()
+ LIMIT 1
+ ;';
+ $row = pwg_db_fetch_assoc(pwg_query($query));
+ $template->assign('TAT_image_id', $row['id']);
+ }
?> \ No newline at end of file