These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /** |
||
3 | * **************************************************************************** |
||
4 | * MYIFRAME - MODULE FOR XOOPS |
||
5 | * Copyright (c) Hervй Thouzard of Instant Zero (http://www.instant-zero.com) |
||
6 | * **************************************************************************** |
||
7 | */ |
||
8 | |||
9 | require_once '../../mainfile.php'; |
||
10 | require_once XOOPS_ROOT_PATH.'/modules/myiframe/include/functions.php'; |
||
11 | $xoopsOption['template_main'] = 'myiframe.tpl'; |
||
12 | require_once(XOOPS_ROOT_PATH.'/header.php'); |
||
13 | |||
14 | $suplparam = ''; |
||
15 | if ( isset( $_GET ) ) { |
||
16 | foreach ( $_GET as $k => $v ) { |
||
17 | if(trim(strtoupper($k))!='IFRAMEID') { |
||
18 | $suplparam.= $k . '=' . $v . '&'; |
||
19 | } |
||
20 | } |
||
21 | } |
||
22 | |||
23 | if(strlen(xoops_trim($suplparam))>0) { |
||
24 | $suplparam = substr($suplparam,0,strlen($suplparam)-1); |
||
25 | } |
||
26 | |||
27 | $iframe_handler =& xoops_getmodulehandler('myiframe', 'myiframe'); |
||
28 | |||
29 | if(isset($_GET['iframeid'])) { |
||
30 | $tblalign = array('top','middle','bottom','left','rigth'); |
||
31 | $tblscrolling = array('yes','no','auto'); |
||
32 | $frameid = intval($_GET['iframeid']); |
||
33 | |||
34 | $frame = $iframe_handler->get($frameid); |
||
35 | |||
36 | if(is_object($frame)) { |
||
37 | $iframe_handler->updatehits($frameid); |
||
38 | $xoopsTpl->assign('frameok', true); |
||
39 | $xoopsTpl->assign('longdesc', $frame->getVar('frame_description')); |
||
40 | $xoopsTpl->assign('width', $frame->getVar('frame_width')); |
||
41 | $xoopsTpl->assign('height', $frame->getVar('frame_height')); |
||
42 | $xoopsTpl->assign('align', $tblalign[$frame->getVar('frame_align')-1]); |
||
43 | $xoopsTpl->assign('frameborder', $frame->getVar('frame_frameborder')); |
||
44 | $xoopsTpl->assign('marginwidth', $frame->getVar('frame_marginwidth')); |
||
45 | $xoopsTpl->assign('marginheight', $frame->getVar('frame_marginheight')); |
||
46 | $xoopsTpl->assign('scrolling', $tblscrolling[$frame->getVar('frame_scrolling')-1]); |
||
47 | if(xoops_trim($suplparam) != '') { |
||
48 | $xoopsTpl->assign('url', $frame->getVar('frame_url') . '?' . $suplparam); |
||
49 | } else { |
||
50 | $xoopsTpl->assign('url', $frame->getVar('frame_url')); |
||
51 | } |
||
52 | $title = $frame->getVar('frame_description'); |
||
53 | myiframe_set_metas($title, $title); |
||
54 | } else { |
||
55 | $xoopsTpl->assign('frameok',false); |
||
56 | $xoopsTpl->assign('frame_error',_MYIFRAME_FRAME_ERROR); |
||
57 | } |
||
58 | } else { |
||
59 | if(myiframe_getmoduleoption('showlist')) { |
||
60 | $baseurl = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/index.php'; |
||
61 | $frarray = array(); |
||
62 | $critere = new Criteria('1', '1','='); |
||
63 | $critere->setSort('frame_description'); |
||
64 | $frarray = $iframe_handler->getObjects($critere); |
||
65 | if (count($frarray ) > 0) { |
||
66 | foreach( $frarray as $frame ) { |
||
67 | View Code Duplication | if(xoops_trim($frame->getVar('frame_description') =='')) { |
|
68 | $liendesc = $frame->getVar('frame_url'); |
||
69 | } else { |
||
70 | $liendesc = "<a href='".$baseurl.'?iframeid=' . $frame->getVar('frame_frameid') . "'>" . $frame->getVar('frame_description') . "</a>"; |
||
71 | } |
||
72 | $iframe['list'] = $liendesc; |
||
73 | $xoopsTpl->append('iframes', $iframe); |
||
74 | } |
||
75 | } |
||
76 | } else { |
||
77 | $xoopsTpl->assign('frameok',false); |
||
78 | $xoopsTpl->assign('frame_error',_MYIFRAME_FRAME_ERROR); |
||
79 | } |
||
80 | } |
||
81 | include(XOOPS_ROOT_PATH.'/footer.php'); |
||
82 | ?> |
||
0 ignored issues
–
show
|
|||
83 |
Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.
A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.