7cc3fc2dfa0689d6bf5aa0f11b7436b9a9f1b6ec
[mirrors/Kyberia-bloodline.git] / wwwroot / inc / smarty / node_methodz / function.get_movement_params.php
1 <?php
2
3 function smarty_function_get_movement_params($params,&$smarty) {
4 $children_count=$params['children_count'];
5
6 if (isset($_POST['listing_amount']) &&
7 (is_numeric($_POST['listing_amount']))) {
8 $listing_amount=$_POST['listing_amount'];
9 } elseif (!empty($_SESSION['listing_amount'])) {
10 $listing_amount=$_SESSION['listing_amount'];
11 } else $listing_amount=DEFAULT_LISTING_AMOUNT;
12
13 $smarty->assign('listing_amount',$listing_amount);
14
15 if (isset($_POST['get_children_offset']) &&
16 (is_numeric($_POST['get_children_offset']))) {
17 $offset=$_POST['get_children_offset'];
18
19 //movement forward and backward
20 if ($_POST['get_children_move']=='<') {
21 $offset=$offset-$listing_amount;
22 if ($offset<0) $offset=0;
23 }
24 elseif ($_POST['get_children_move']=='>') {
25
26 $offset=$offset+$listing_amount;
27 }
28
29 elseif ($_POST['get_children_move']=='>>') {
30 $offset=$children_count-$listing_amount;
31 if ($offset<0) $offset=0;
32 }
33
34 elseif ($_POST['get_children_move']=='<<') {
35 $offset=0;
36 }
37
38
39 }
40
41 else $offset=0;
42 $smarty->assign('offset',$offset);
43
44 }
45 ?>
This page took 0.262946 seconds and 3 git commands to generate.