warnings cleanup
[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
5 if (isset($_POST['listing_amount']) &&
6 (is_numeric($_POST['listing_amount']))) {
7 $listing_amount=$_POST['listing_amount'];
8 } elseif (!empty($_SESSION['listing_amount'])) {
9 $listing_amount=$_SESSION['listing_amount'];
10 } else $listing_amount=DEFAULT_LISTING_AMOUNT;
11
12 $smarty->assign('listing_amount',$listing_amount);
13
14 if (isset($_POST['get_children_offset']) &&
15 (is_numeric($_POST['get_children_offset']))) {
16 $offset=$_POST['get_children_offset'];
17
18 //movement forward and backward
19 if ($_POST['get_children_move']=='<') {
20 $offset=$offset-$listing_amount;
21 if ($offset<0) $offset=0;
22 }
23
24 elseif ($_POST['get_children_move']=='>') {
25 $offset=$offset+$listing_amount;
26 }
27
28 elseif ($_POST['get_children_move']=='>>') {
29 $offset=$children_count-$listing_amount;
30 if ($offset<0) $offset=0;
31 }
32
33 elseif ($_POST['get_children_move']=='<<') {
34 $offset=0;
35 }
36
37
38 }
39
40 else $offset=0;
41 $smarty->assign('offset',$offset);
42
43 }
44 ?>
This page took 0.270327 seconds and 4 git commands to generate.