aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/TakeATour/tours/2_7_0
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/TakeATour/tours/2_7_0')
-rw-r--r--plugins/TakeATour/tours/2_7_0/config.inc.php39
-rw-r--r--plugins/TakeATour/tours/2_7_0/config_preparse.inc.php31
-rw-r--r--plugins/TakeATour/tours/2_7_0/tour.tpl2
3 files changed, 40 insertions, 32 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
diff --git a/plugins/TakeATour/tours/2_7_0/config_preparse.inc.php b/plugins/TakeATour/tours/2_7_0/config_preparse.inc.php
deleted file mode 100644
index 87aa6227b..000000000
--- a/plugins/TakeATour/tours/2_7_0/config_preparse.inc.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
- $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
diff --git a/plugins/TakeATour/tours/2_7_0/tour.tpl b/plugins/TakeATour/tours/2_7_0/tour.tpl
index e62390f57..eea93b55e 100644
--- a/plugins/TakeATour/tours/2_7_0/tour.tpl
+++ b/plugins/TakeATour/tours/2_7_0/tour.tpl
@@ -3,7 +3,7 @@
var tour = new Tour({
name: "2_7_0",
orphan: true,
- onEnd: function (tour) {window.location = "admin.php?page=plugin-TakeATour&tour_ended=2_7_0"},
+ onEnd: function (tour) {window.location = "{/literal}{$ABS_U_ADMIN}{literal}admin.php?page=plugin-TakeATour&tour_ended=2_7_0"},
template: "<div class='popover'> <div class='arrow'></div> <h3 class='popover-title'></h3> <div class='popover-content'></div> <div class='popover-navigation'> <div class='btn-group'> <button class='btn btn-sm btn-default' data-role='prev'>&laquo; {/literal}{'Prev'|@translate|@escape:'javascript'}{literal}</button> <button class='btn btn-sm btn-default' data-role='next'>{/literal}{'Next '|@translate|@escape:'javascript'}{literal} &raquo;</button> </div> <button class='btn btn-sm btn-default' data-role='end'>{/literal}{'End tour'|@translate|@escape:'javascript'}{literal}</button> </div> </div>",
});
{/literal}{if $TAT_restart}tour.restart();{/if}{literal}