Completed
Push — master ( 56603d...bee6fb )
by Michael
01:18
created

slides.php (13 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/*
3
 You may not change or alter any portion of this comment or credits
4
 of supporting developers from this source code or any supporting source code
5
 which is considered copyrighted (c) material of the original comment or credit authors.
6
7
 This program is distributed in the hope that it will be useful,
8
 but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
*/
11
/**
12
 * presenter module for xoops
13
 *
14
 * @copyright       XOOPS Project (https://xoops.org)
15
 * @license         GPL 2.0 or later
16
 * @package         presenter
17
 * @since           2.5.5
18
 * @author          XOOPS Development Team <[email protected]> - <https://xoops.org>
19
 */
20
require_once __DIR__ . '/header.php';
21
$GLOBALS['xoopsOption']['template_main'] = 'presenter_slides.tpl';
22
//$GLOBALS['xoopsOption']['template_main'] = 'presenter_iframe.tpl';
0 ignored issues
show
Unused Code Comprehensibility introduced by
75% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
23
require_once XOOPS_ROOT_PATH . '/header.php';
24
$start = presenter_CleanVars($_REQUEST, 'start', 0);
25
// Define Stylesheet
26
$xoTheme->addStylesheet($style);
27
// Get Handler
28
$slidesHandler = xoops_getModuleHandler('slides', 'presenter');
29
$nb_slides     = $GLOBALS['xoopsModuleConfig']['userpager'];
30
31
$criteria     = new CriteriaCompo();
32
$slides_count = $slidesHandler->getCount($criteria);
33
$slides_arr   = $slidesHandler->getAll($criteria);
34
foreach (array_keys($slides_arr) as $i) {
35
    $slides['slides_id']      = $slides_arr[$i]->getVar('slides_id');
36
    $slides['slides_cid']     = $slides_arr[$i]->getVar('slides_cid');
37
    $slides['slides_uid']     = $slides_arr[$i]->getVar('slides_uid');
38
    $slides['slides_title']   = $slides_arr[$i]->getVar('slides_title');
39
    $slides['slides_content'] = $slides_arr[$i]->getVar('slides_content');
40
41
    $slides['css_id']    = $slides_arr[$i]->getVar('css_id');
42
    $slides['css_class'] = $slides_arr[$i]->getVar('css_class');
43
44
    $slides['slides_transition_x'] = $slides_arr[$i]->getVar('slides_transition_x');
45
    $slides['slides_transition_y'] = $slides_arr[$i]->getVar('slides_transition_y');
46
    $slides['slides_transition_z'] = $slides_arr[$i]->getVar('slides_transition_z');
47
    $slides['slides_rotation_x']   = $slides_arr[$i]->getVar('slides_rotation_x');
48
    $slides['slides_rotation_y']   = $slides_arr[$i]->getVar('slides_rotation_y');
49
    $slides['slides_rotation_z']   = $slides_arr[$i]->getVar('slides_rotation_z');
50
    $slides['slides_scale_x']      = $slides_arr[$i]->getVar('slides_scale_x');
51
    $slides['slides_scale_y']      = $slides_arr[$i]->getVar('slides_scale_y');
52
    $slides['slides_scale_z']      = $slides_arr[$i]->getVar('slides_scale_z');
53
    $slides['slides_created']      = $slides_arr[$i]->getVar('slides_created');
54
    $slides['slides_published']    = $slides_arr[$i]->getVar('slides_published');
55
    $slides['slides_position']     = $slides_arr[$i]->getVar('slides_position');
56
    $slides['slides_online']       = $slides_arr[$i]->getVar('slides_online');
57
    $slides['slides_type']         = $slides_arr[$i]->getVar('slides_type');
58
    $slides['slides_notes']        = strip_tags($slides_arr[$i]->getVar('slides_notes'));
59
    $slides['slides_mp3']          = $slides_arr[$i]->getVar('slides_mp3');
60
    $slides['slides_time']         = $slides_arr[$i]->getVar('slides_time');
61
    $slides['slides_status']       = $slides_arr[$i]->getVar('slides_status');
62
    $slides['slides_waiting']      = $slides_arr[$i]->getVar('slides_waiting');
63
    $slides['slides_online']       = $slides_arr[$i]->getVar('slides_online');
64
    $GLOBALS['xoopsTpl']->append('slides', $slides);
65
    $keywords[] = $slides_arr[$i]->getVar('slides_name');
66
67
    //    $GLOBALS['xoopsTpl']->assign('slides_title', $slides_arr[$i]->getVar('slides_title'));
0 ignored issues
show
Unused Code Comprehensibility introduced by
82% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
68
    //    $GLOBALS['xoopsTpl']->assign('slides_content', $slides_arr[$i]->getVar('slides_content'));
0 ignored issues
show
Unused Code Comprehensibility introduced by
82% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
69
    //    $GLOBALS['xoopsTpl']->assign('slides_transition_x', $slides_arr[$i]->getVar('slides_transition_x'));
0 ignored issues
show
Unused Code Comprehensibility introduced by
82% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
70
    //    $GLOBALS['xoopsTpl']->assign('slides_transition_y', $slides_arr[$i]->getVar('slides_transition_y'));
0 ignored issues
show
Unused Code Comprehensibility introduced by
82% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
71
    //    $GLOBALS['xoopsTpl']->assign('slides_transition_z', $slides_arr[$i]->getVar('slides_transition_z'));
0 ignored issues
show
Unused Code Comprehensibility introduced by
82% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
72
    //    $GLOBALS['xoopsTpl']->assign('slides_rotation_x', $slides_arr[$i]->getVar('slides_rotation_x'));
0 ignored issues
show
Unused Code Comprehensibility introduced by
82% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
73
    //    $GLOBALS['xoopsTpl']->assign('slides_rotation_y', $slides_arr[$i]->getVar('slides_rotation_y'));
0 ignored issues
show
Unused Code Comprehensibility introduced by
82% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
74
    //    $GLOBALS['xoopsTpl']->assign('slides_rotation_z', $slides_arr[$i]->getVar('slides_rotation_z'));
0 ignored issues
show
Unused Code Comprehensibility introduced by
82% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
75
    //    $GLOBALS['xoopsTpl']->assign('slides_scale_x', $slides_arr[$i]->getVar('slides_scale_x'));
0 ignored issues
show
Unused Code Comprehensibility introduced by
82% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
76
    //    $GLOBALS['xoopsTpl']->assign('slides_scale_y', $slides_arr[$i]->getVar('slides_scale_y'));
0 ignored issues
show
Unused Code Comprehensibility introduced by
82% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
77
    //    $GLOBALS['xoopsTpl']->assign('slides_scale_z', $slides_arr[$i]->getVar('slides_scale_z'));
0 ignored issues
show
Unused Code Comprehensibility introduced by
82% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
78
79
    unset($slides);
80
}
81
82
// Display Navigation
83 View Code Duplication
if ($slides_count > $nb_slides) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
84
    require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
85
    $nav = new XoopsPageNav($slides_count, $nb_slides, $start, 'start');
86
    $GLOBALS['xoopsTpl']->assign('pagenav', $nav->renderNav(4));
87
}
88
//keywords
89
presenter_meta_keywords($GLOBALS['xoopsModuleConfig']['keywords'] . ', ' . implode(', ', $keywords));
90
//description
91
presenter_meta_description(_MA_PRESENTER_SLIDES_DESC);
92
//
93
$GLOBALS['xoopsTpl']->assign('xoops_mpageurl', PRESENTER_URL . '/slides.php');
94
$GLOBALS['xoopsTpl']->assign('presenter_url', PRESENTER_URL);
95
$GLOBALS['xoopsTpl']->assign('adv', $GLOBALS['xoopsModuleConfig']['advertise']);
96
//
97
$GLOBALS['xoopsTpl']->assign('social_bookmarks', $GLOBALS['xoopsModuleConfig']['social_bookmarks']);
98
$GLOBALS['xoopsTpl']->assign('fbcomments', $GLOBALS['xoopsModuleConfig']['fbcomments']);
99
//
100
$GLOBALS['xoopsTpl']->assign('admin', PRESENTER_ADMIN);
101
$GLOBALS['xoopsTpl']->assign('copyright', $copyright);
102
//
103
require_once XOOPS_ROOT_PATH . '/footer.php';
104