Completed
Branch master (15a86c)
by Michael
06:07
created
admin/about.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
  * @version    $Id $
19 19
  */
20 20
 
21
-include_once dirname(__FILE__) . '/admin_header.php';
21
+include_once dirname(__FILE__).'/admin_header.php';
22 22
 
23 23
 xoops_cp_header();
24 24
 
Please login to merge, or discard this patch.
admin/header.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
 
33 33
 // include the default language file for the admin interface
34 34
 if(!@include_once(XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/language/" . $xoopsConfig['language'] . "/main.php")){
35
-    include_once(XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/language/english/main.php");
35
+	include_once(XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/language/english/main.php");
36 36
 }
37 37
 
38 38
 planet_define_url_delimiter();
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,10 +31,10 @@
 block discarded – undo
31 31
 include_once(XOOPS_ROOT_PATH."/Frameworks/art/functions.admin.php");
32 32
 
33 33
 // include the default language file for the admin interface
34
-if(!@include_once(XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/language/" . $xoopsConfig['language'] . "/main.php")){
34
+if (!@include_once(XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/language/".$xoopsConfig['language']."/main.php")) {
35 35
     include_once(XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/language/english/main.php");
36 36
 }
37 37
 
38 38
 planet_define_url_delimiter();
39
-$myts =& MyTextSanitizer::getInstance();
39
+$myts = & MyTextSanitizer::getInstance();
40 40
 ?>
41 41
\ No newline at end of file
Please login to merge, or discard this patch.
admin/admin.category.php 3 patches
Indentation   +88 added lines, -88 removed lines patch added patch discarded remove patch
@@ -42,66 +42,66 @@  discard block
 block discarded – undo
42 42
 
43 43
 switch($op){
44 44
 	case "save":
45
-        if ($cat_id) {
46
-            $category_obj =& $category_handler->get($cat_id);
47
-        } else {
48
-            $category_obj =& $category_handler->create();
49
-        }
45
+		if ($cat_id) {
46
+			$category_obj =& $category_handler->get($cat_id);
47
+		} else {
48
+			$category_obj =& $category_handler->create();
49
+		}
50 50
 
51
-        $category_obj->setVar('cat_title', $_POST['cat_title']);
52
-        $category_obj->setVar('cat_order', $_POST['cat_order']);
51
+		$category_obj->setVar('cat_title', $_POST['cat_title']);
52
+		$category_obj->setVar('cat_order', $_POST['cat_order']);
53 53
 
54
-        if (!$category_handler->insert($category_obj)) {
55
-        	$message = planet_constant("AM_ERROR");
56
-        }else{
57
-        	$message = planet_constant("AM_DBUPDATED");
58
-    	}
59
-        redirect_header("admin.category.php", 2, $message);
60
-        exit();	
54
+		if (!$category_handler->insert($category_obj)) {
55
+			$message = planet_constant("AM_ERROR");
56
+		}else{
57
+			$message = planet_constant("AM_DBUPDATED");
58
+		}
59
+		redirect_header("admin.category.php", 2, $message);
60
+		exit();	
61 61
         
62 62
 	case "del":
63 63
 		if(!is_array($cat_id)) $cat_id = array($cat_id);
64 64
 		foreach($cat_id as $cid){
65
-	        $category_obj =& $category_handler->get($cid);
66
-	        if (!$category_handler->delete($category_obj)) {
67
-	        }
68
-       	}
69
-        $message = planet_constant("AM_DBUPDATED");
70
-        redirect_header("admin.category.php", 2, $message);
71
-        exit();	
65
+			$category_obj =& $category_handler->get($cid);
66
+			if (!$category_handler->delete($category_obj)) {
67
+			}
68
+	   	}
69
+		$message = planet_constant("AM_DBUPDATED");
70
+		redirect_header("admin.category.php", 2, $message);
71
+		exit();	
72 72
         
73 73
 	case "order":
74 74
 		$count = count($_POST['cat_order']);
75 75
 		for($i=0; $i < $count; $i++){
76
-        	$category_obj =& $category_handler->get($_POST['cat'][$i]);
77
-        	$category_obj->setVar("cat_order", $_POST['cat_order'][$i]);
78
-        	$category_handler->insert($category_obj, true);
79
-        	unset($category_obj);
76
+			$category_obj =& $category_handler->get($_POST['cat'][$i]);
77
+			$category_obj->setVar("cat_order", $_POST['cat_order'][$i]);
78
+			$category_handler->insert($category_obj, true);
79
+			unset($category_obj);
80 80
 		}
81
-        $message = planet_constant("AM_DBUPDATED");
82
-        redirect_header("admin.category.php", 2, $message);
83
-        exit();	
81
+		$message = planet_constant("AM_DBUPDATED");
82
+		redirect_header("admin.category.php", 2, $message);
83
+		exit();	
84 84
         
85 85
 	case "edit":
86
-        $category_obj =& $category_handler->get($cat_id);
87
-        $form = new XoopsThemeForm(_EDIT, "edit", xoops_getenv('PHP_SELF'));
88
-	    $form->addElement(new XoopsFormText(planet_constant("AM_TITLE"), 'cat_title', 50, 80, $category_obj->getVar('cat_title', 'E')), true);
89
-	    $form->addElement(new XoopsFormText(planet_constant("AM_ORDER"), 'cat_order', 5, 10, $category_obj->getVar('cat_order')), false);
90
-	    $form->addElement(new XoopsFormHidden('category', $cat_id));
91
-	    $form->addElement(new XoopsFormHidden('op', 'save'));
86
+		$category_obj =& $category_handler->get($cat_id);
87
+		$form = new XoopsThemeForm(_EDIT, "edit", xoops_getenv('PHP_SELF'));
88
+		$form->addElement(new XoopsFormText(planet_constant("AM_TITLE"), 'cat_title', 50, 80, $category_obj->getVar('cat_title', 'E')), true);
89
+		$form->addElement(new XoopsFormText(planet_constant("AM_ORDER"), 'cat_order', 5, 10, $category_obj->getVar('cat_order')), false);
90
+		$form->addElement(new XoopsFormHidden('category', $cat_id));
91
+		$form->addElement(new XoopsFormHidden('op', 'save'));
92 92
 	
93
-	    $button_tray = new XoopsFormElementTray('', '');
94
-	    $butt_save = new XoopsFormButton('', 'submit', _SUBMIT, 'submit');
95
-	    $button_tray->addElement($butt_save);
96
-        $butt_cancel = new XoopsFormButton('', '', _CANCEL, 'reset');
97
-        $button_tray->addElement($butt_cancel);
98
-	    $form->addElement($button_tray);
93
+		$button_tray = new XoopsFormElementTray('', '');
94
+		$butt_save = new XoopsFormButton('', 'submit', _SUBMIT, 'submit');
95
+		$button_tray->addElement($butt_save);
96
+		$butt_cancel = new XoopsFormButton('', '', _CANCEL, 'reset');
97
+		$button_tray->addElement($butt_cancel);
98
+		$form->addElement($button_tray);
99 99
         
100
-        echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _EDIT . "</legend>";
101
-        echo"<br />";
102
-        $form->display();
103
-        echo "</fieldset>";
104
-        break;	
100
+		echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _EDIT . "</legend>";
101
+		echo"<br />";
102
+		$form->display();
103
+		echo "</fieldset>";
104
+		break;	
105 105
         
106 106
 	default:
107 107
 		$crit = new Criteria("1", 1);
@@ -115,60 +115,60 @@  discard block
 block discarded – undo
115 115
 			}
116 116
 		}
117 117
 		
118
-        echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . planet_constant("AM_LIST") . "</legend>";
119
-        echo "<br style=\"clear:both\" />";
118
+		echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . planet_constant("AM_LIST") . "</legend>";
119
+		echo "<br style=\"clear:both\" />";
120 120
 
121
-        echo "<form name='list' method='post'>";
122
-        echo "<table border='0' cellpadding='4' cellspacing='1' width='100%' class='outer'>";
123
-        echo "<tr align='center'>";
124
-        echo "<th class='bg3' width='5%'>" . planet_constant("AM_ORDER") . "</td>";
125
-        echo "<th align='left' class='bg3' width='80%'>" . planet_constant("AM_TITLE") . "</td>";
126
-        echo "<th class='bg3' width='5%'>" . planet_constant("AM_BLOGCOUNT") . "</td>";
127
-        echo "<th class='bg3' width='5%'>" . planet_constant("AM_ACTIONS") . "</td>";
121
+		echo "<form name='list' method='post'>";
122
+		echo "<table border='0' cellpadding='4' cellspacing='1' width='100%' class='outer'>";
123
+		echo "<tr align='center'>";
124
+		echo "<th class='bg3' width='5%'>" . planet_constant("AM_ORDER") . "</td>";
125
+		echo "<th align='left' class='bg3' width='80%'>" . planet_constant("AM_TITLE") . "</td>";
126
+		echo "<th class='bg3' width='5%'>" . planet_constant("AM_BLOGCOUNT") . "</td>";
127
+		echo "<th class='bg3' width='5%'>" . planet_constant("AM_ACTIONS") . "</td>";
128 128
 //        echo "<td class='bg3' width='5%'>" . _DELETE . "</td>";
129 129
 
130
-        echo "</tr>";
130
+		echo "</tr>";
131 131
         
132
-        $ii = 0;
132
+		$ii = 0;
133 133
 		foreach(array_keys($categories) as $cid){
134
-            echo "<tr class='odd' align='left'>";
135
-            echo "<td><input type='hidden' name='cat[]' value='".$cid."' />";
136
-            echo "<input type='text' name='cat_order[]' value='".($ii*10)."' /></td>";
137
-            echo "<td>".$categories[$cid]."</td>";
138
-            echo "<td align='center'>".@$blog_counts[$cid]."</td>";
134
+			echo "<tr class='odd' align='left'>";
135
+			echo "<td><input type='hidden' name='cat[]' value='".$cid."' />";
136
+			echo "<input type='text' name='cat_order[]' value='".($ii*10)."' /></td>";
137
+			echo "<td>".$categories[$cid]."</td>";
138
+			echo "<td align='center'>".@$blog_counts[$cid]."</td>";
139 139
 
140
-        echo "<td align='center'><a href='admin.category.php?op=edit &amp;category='".$cid."' title='"._EDIT."'><img src='".  $pathIcon16 ."/edit.png '". "alt='" . _EDIT . "' title='" ._EDIT."' </a>&nbsp;
140
+		echo "<td align='center'><a href='admin.category.php?op=edit &amp;category='".$cid."' title='"._EDIT."'><img src='".  $pathIcon16 ."/edit.png '". "alt='" . _EDIT . "' title='" ._EDIT."' </a>&nbsp;
141 141
                   <a href='admin.category.php?op=del &amp;category='".$cid."' title='"._DELETE."'><img src='". $pathIcon16 ."/delete.png '"." alt='" . _EDIT . "' title='"._DELETE."' </a></td>";
142
-            echo "</tr>";			
143
-            $ii++;
142
+			echo "</tr>";			
143
+			$ii++;
144 144
 		}
145
-        echo "<tr class='even' align='center'>";
146
-        echo "<td colspan='5'>";
147
-        echo "<input name='submit' value='"._SUBMIT."' type='submit' />";
148
-        echo "<input name='' value='"._CANCEL."' type='reset' />";
149
-        echo "<input name='op' value='order' type='hidden' />";
150
-        echo "</td>";
151
-        echo "</tr>";			
152
-        echo "</table></form>";
153
-        echo "</fieldset><br style='clear:both;'>";
145
+		echo "<tr class='even' align='center'>";
146
+		echo "<td colspan='5'>";
147
+		echo "<input name='submit' value='"._SUBMIT."' type='submit' />";
148
+		echo "<input name='' value='"._CANCEL."' type='reset' />";
149
+		echo "<input name='op' value='order' type='hidden' />";
150
+		echo "</td>";
151
+		echo "</tr>";			
152
+		echo "</table></form>";
153
+		echo "</fieldset><br style='clear:both;'>";
154 154
         
155
-        $form = new XoopsThemeForm(_ADD, "mod", xoops_getenv('PHP_SELF'));
156
-	    $form->addElement(new XoopsFormText(planet_constant("AM_TITLE"), 'cat_title', 50, 80), true);
157
-	    $form->addElement(new XoopsFormText(planet_constant("AM_ORDER"), 'cat_order', 5, 10), false);
158
-	    $form->addElement(new XoopsFormHidden('op', 'save'));
155
+		$form = new XoopsThemeForm(_ADD, "mod", xoops_getenv('PHP_SELF'));
156
+		$form->addElement(new XoopsFormText(planet_constant("AM_TITLE"), 'cat_title', 50, 80), true);
157
+		$form->addElement(new XoopsFormText(planet_constant("AM_ORDER"), 'cat_order', 5, 10), false);
158
+		$form->addElement(new XoopsFormHidden('op', 'save'));
159 159
 	
160
-	    $button_tray = new XoopsFormElementTray('', '');
161
-	    $butt_save = new XoopsFormButton('', 'submit', _SUBMIT, 'submit');
162
-	    $button_tray->addElement($butt_save);
163
-        $butt_cancel = new XoopsFormButton('', '', _CANCEL, 'reset');
164
-        $button_tray->addElement($butt_cancel);
165
-	    $form->addElement($button_tray);
160
+		$button_tray = new XoopsFormElementTray('', '');
161
+		$butt_save = new XoopsFormButton('', 'submit', _SUBMIT, 'submit');
162
+		$button_tray->addElement($butt_save);
163
+		$butt_cancel = new XoopsFormButton('', '', _CANCEL, 'reset');
164
+		$button_tray->addElement($butt_cancel);
165
+		$form->addElement($button_tray);
166 166
         
167
-        echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _ADD . "</legend>";
168
-        echo"<br />";
169
-        $form->display();
170
-        echo "</fieldset>";
171
-        break;		
167
+		echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _ADD . "</legend>";
168
+		echo"<br />";
169
+		$form->display();
170
+		echo "</fieldset>";
171
+		break;		
172 172
 }
173 173
 
174 174
 xoops_cp_footer();
Please login to merge, or discard this patch.
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
 // URL: http://xoops.org                         //
25 25
 // Project: Article Project                                                 //
26 26
 // ------------------------------------------------------------------------ //
27
-include( "admin_header.php" );
28
-require_once(XOOPS_ROOT_PATH . "/class/xoopsformloader.php");
27
+include("admin_header.php");
28
+require_once(XOOPS_ROOT_PATH."/class/xoopsformloader.php");
29 29
 
30 30
 xoops_cp_header();
31 31
 $indexAdmin = new ModuleAdmin();
@@ -33,19 +33,19 @@  discard block
 block discarded – undo
33 33
 require XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/include/vars.php";
34 34
 //planet_adminmenu(1);
35 35
 
36
-$op = !empty($_POST["op"])?$_POST["op"]:(!empty($_GET["op"])?$_GET["op"]:"");
37
-$cat_id = !empty($_POST["category"])?$_POST["category"]:(!empty($_GET["category"])?$_GET["category"]:0);
38
-$cat_id = is_array($cat_id)?array_map("intval", $cat_id):intval($cat_id);
36
+$op = !empty($_POST["op"]) ? $_POST["op"] : (!empty($_GET["op"]) ? $_GET["op"] : "");
37
+$cat_id = !empty($_POST["category"]) ? $_POST["category"] : (!empty($_GET["category"]) ? $_GET["category"] : 0);
38
+$cat_id = is_array($cat_id) ? array_map("intval", $cat_id) : intval($cat_id);
39 39
 
40
-$category_handler =& xoops_getmodulehandler("category", $GLOBALS["moddirname"]);
41
-$blog_handler =& xoops_getmodulehandler("blog", $GLOBALS["moddirname"]);
40
+$category_handler = & xoops_getmodulehandler("category", $GLOBALS["moddirname"]);
41
+$blog_handler = & xoops_getmodulehandler("blog", $GLOBALS["moddirname"]);
42 42
 
43
-switch($op){
43
+switch ($op) {
44 44
 	case "save":
45 45
         if ($cat_id) {
46
-            $category_obj =& $category_handler->get($cat_id);
47
-        } else {
48
-            $category_obj =& $category_handler->create();
46
+            $category_obj = & $category_handler->get($cat_id);
47
+        }else {
48
+            $category_obj = & $category_handler->create();
49 49
         }
50 50
 
51 51
         $category_obj->setVar('cat_title', $_POST['cat_title']);
@@ -53,16 +53,16 @@  discard block
 block discarded – undo
53 53
 
54 54
         if (!$category_handler->insert($category_obj)) {
55 55
         	$message = planet_constant("AM_ERROR");
56
-        }else{
56
+        }else {
57 57
         	$message = planet_constant("AM_DBUPDATED");
58 58
     	}
59 59
         redirect_header("admin.category.php", 2, $message);
60 60
         exit();	
61 61
         
62 62
 	case "del":
63
-		if(!is_array($cat_id)) $cat_id = array($cat_id);
64
-		foreach($cat_id as $cid){
65
-	        $category_obj =& $category_handler->get($cid);
63
+		if (!is_array($cat_id)) $cat_id = array($cat_id);
64
+		foreach ($cat_id as $cid) {
65
+	        $category_obj = & $category_handler->get($cid);
66 66
 	        if (!$category_handler->delete($category_obj)) {
67 67
 	        }
68 68
        	}
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
         
73 73
 	case "order":
74 74
 		$count = count($_POST['cat_order']);
75
-		for($i=0; $i < $count; $i++){
76
-        	$category_obj =& $category_handler->get($_POST['cat'][$i]);
75
+		for ($i = 0; $i<$count; $i++) {
76
+        	$category_obj = & $category_handler->get($_POST['cat'][$i]);
77 77
         	$category_obj->setVar("cat_order", $_POST['cat_order'][$i]);
78 78
         	$category_handler->insert($category_obj, true);
79 79
         	unset($category_obj);
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         exit();	
84 84
         
85 85
 	case "edit":
86
-        $category_obj =& $category_handler->get($cat_id);
86
+        $category_obj = & $category_handler->get($cat_id);
87 87
         $form = new XoopsThemeForm(_EDIT, "edit", xoops_getenv('PHP_SELF'));
88 88
 	    $form->addElement(new XoopsFormText(planet_constant("AM_TITLE"), 'cat_title', 50, 80, $category_obj->getVar('cat_title', 'E')), true);
89 89
 	    $form->addElement(new XoopsFormText(planet_constant("AM_ORDER"), 'cat_order', 5, 10, $category_obj->getVar('cat_order')), false);
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
         $button_tray->addElement($butt_cancel);
98 98
 	    $form->addElement($button_tray);
99 99
         
100
-        echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _EDIT . "</legend>";
100
+        echo "<fieldset><legend style='font-weight: bold; color: #900;'>"._EDIT."</legend>";
101 101
         echo"<br />";
102 102
         $form->display();
103 103
         echo "</fieldset>";
@@ -109,36 +109,36 @@  discard block
 block discarded – undo
109 109
 		$crit->setOrder("ASC");
110 110
 		$categories = $category_handler->getList($crit);
111 111
 		$blog_counts = $blog_handler->getCountsByCategory();
112
-		foreach(array_keys($categories) as $cid){
113
-			if(!empty($blog_counts[$cid])){
112
+		foreach (array_keys($categories) as $cid) {
113
+			if (!empty($blog_counts[$cid])) {
114 114
 				$categories[$cid] .= " (".intval($blog_counts[$cid]).")";
115 115
 			}
116 116
 		}
117 117
 		
118
-        echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . planet_constant("AM_LIST") . "</legend>";
118
+        echo "<fieldset><legend style='font-weight: bold; color: #900;'>".planet_constant("AM_LIST")."</legend>";
119 119
         echo "<br style=\"clear:both\" />";
120 120
 
121 121
         echo "<form name='list' method='post'>";
122 122
         echo "<table border='0' cellpadding='4' cellspacing='1' width='100%' class='outer'>";
123 123
         echo "<tr align='center'>";
124
-        echo "<th class='bg3' width='5%'>" . planet_constant("AM_ORDER") . "</td>";
125
-        echo "<th align='left' class='bg3' width='80%'>" . planet_constant("AM_TITLE") . "</td>";
126
-        echo "<th class='bg3' width='5%'>" . planet_constant("AM_BLOGCOUNT") . "</td>";
127
-        echo "<th class='bg3' width='5%'>" . planet_constant("AM_ACTIONS") . "</td>";
124
+        echo "<th class='bg3' width='5%'>".planet_constant("AM_ORDER")."</td>";
125
+        echo "<th align='left' class='bg3' width='80%'>".planet_constant("AM_TITLE")."</td>";
126
+        echo "<th class='bg3' width='5%'>".planet_constant("AM_BLOGCOUNT")."</td>";
127
+        echo "<th class='bg3' width='5%'>".planet_constant("AM_ACTIONS")."</td>";
128 128
 //        echo "<td class='bg3' width='5%'>" . _DELETE . "</td>";
129 129
 
130 130
         echo "</tr>";
131 131
         
132 132
         $ii = 0;
133
-		foreach(array_keys($categories) as $cid){
133
+		foreach (array_keys($categories) as $cid) {
134 134
             echo "<tr class='odd' align='left'>";
135 135
             echo "<td><input type='hidden' name='cat[]' value='".$cid."' />";
136 136
             echo "<input type='text' name='cat_order[]' value='".($ii*10)."' /></td>";
137 137
             echo "<td>".$categories[$cid]."</td>";
138 138
             echo "<td align='center'>".@$blog_counts[$cid]."</td>";
139 139
 
140
-        echo "<td align='center'><a href='admin.category.php?op=edit &amp;category='".$cid."' title='"._EDIT."'><img src='".  $pathIcon16 ."/edit.png '". "alt='" . _EDIT . "' title='" ._EDIT."' </a>&nbsp;
141
-                  <a href='admin.category.php?op=del &amp;category='".$cid."' title='"._DELETE."'><img src='". $pathIcon16 ."/delete.png '"." alt='" . _EDIT . "' title='"._DELETE."' </a></td>";
140
+        echo "<td align='center'><a href='admin.category.php?op=edit &amp;category='".$cid."' title='"._EDIT."'><img src='".$pathIcon16."/edit.png '"."alt='"._EDIT."' title='"._EDIT."' </a>&nbsp;
141
+                  <a href='admin.category.php?op=del &amp;category='".$cid."' title='"._DELETE."'><img src='".$pathIcon16."/delete.png '"." alt='"._EDIT."' title='"._DELETE."' </a></td>";
142 142
             echo "</tr>";			
143 143
             $ii++;
144 144
 		}
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
         $button_tray->addElement($butt_cancel);
165 165
 	    $form->addElement($button_tray);
166 166
         
167
-        echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _ADD . "</legend>";
167
+        echo "<fieldset><legend style='font-weight: bold; color: #900;'>"._ADD."</legend>";
168 168
         echo"<br />";
169 169
         $form->display();
170 170
         echo "</fieldset>";
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,14 +53,16 @@
 block discarded – undo
53 53
 
54 54
         if (!$category_handler->insert($category_obj)) {
55 55
         	$message = planet_constant("AM_ERROR");
56
-        }else{
56
+        } else{
57 57
         	$message = planet_constant("AM_DBUPDATED");
58 58
     	}
59 59
         redirect_header("admin.category.php", 2, $message);
60 60
         exit();	
61 61
         
62 62
 	case "del":
63
-		if(!is_array($cat_id)) $cat_id = array($cat_id);
63
+		if(!is_array($cat_id)) {
64
+			$cat_id = array($cat_id);
65
+		}
64 66
 		foreach($cat_id as $cid){
65 67
 	        $category_obj =& $category_handler->get($cid);
66 68
 	        if (!$category_handler->delete($category_obj)) {
Please login to merge, or discard this patch.
admin/admin_header.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
 
49 49
 // include the default language file for the admin interface
50 50
 if(!@include_once(XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/language/" . $xoopsConfig['language'] . "/main.php")){
51
-    include_once(XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/language/english/main.php");
51
+	include_once(XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/language/english/main.php");
52 52
 }
53 53
 
54 54
 planet_define_url_delimiter();
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -19,9 +19,9 @@  discard block
 block discarded – undo
19 19
  */
20 20
 
21 21
 $path = dirname(dirname(dirname(dirname(__FILE__))));
22
-include_once $path . '/mainfile.php';
23
-include_once $path . '/include/cp_functions.php';
24
-require_once $path . '/include/cp_header.php';
22
+include_once $path.'/mainfile.php';
23
+include_once $path.'/include/cp_functions.php';
24
+require_once $path.'/include/cp_header.php';
25 25
 
26 26
 global $xoopsModule;
27 27
 
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
 include_once(XOOPS_ROOT_PATH."/Frameworks/art/functions.admin.php");
48 48
 
49 49
 // include the default language file for the admin interface
50
-if(!@include_once(XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/language/" . $xoopsConfig['language'] . "/main.php")){
50
+if (!@include_once(XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/language/".$xoopsConfig['language']."/main.php")) {
51 51
     include_once(XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/language/english/main.php");
52 52
 }
53 53
 
54 54
 planet_define_url_delimiter();
55
-$myts =& MyTextSanitizer::getInstance();
55
+$myts = & MyTextSanitizer::getInstance();
Please login to merge, or discard this patch.
admin/admin.article.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 // URL: http://xoops.org                         //
25 25
 // Project: Article Project                                                 //
26 26
 // ------------------------------------------------------------------------ //
27
-include( "admin_header.php" );
27
+include("admin_header.php");
28 28
 
29 29
 xoops_cp_header();
30 30
 $indexAdmin = new ModuleAdmin();
@@ -39,29 +39,29 @@  discard block
 block discarded – undo
39 39
 require XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/include/vars.php";
40 40
 //planet_adminmenu(3);
41 41
 
42
-$article_handler =& xoops_getmodulehandler("article", $GLOBALS["moddirname"]);
43
-if(!empty($xoopsModuleConfig["article_expire"])){
42
+$article_handler = & xoops_getmodulehandler("article", $GLOBALS["moddirname"]);
43
+if (!empty($xoopsModuleConfig["article_expire"])) {
44 44
 	$criteria = new Criteria("art_time", time()-$xoopsModuleConfig["article_expire"]*60*60*24, "<");
45
-	if(!empty($_GET["purge"])){
45
+	if (!empty($_GET["purge"])) {
46 46
 		$crit = new CriteriaCompo($criteria);
47 47
 		$crit->add(new Criteria("art_comments", 0));
48
-		$article_expires =& $article_handler->getObjects($criteria);
49
-		foreach($article_expires as $id=>$article_obj){
48
+		$article_expires = & $article_handler->getObjects($criteria);
49
+		foreach ($article_expires as $id=>$article_obj) {
50 50
 			$article_handler->delete($article_obj);
51 51
 		}
52 52
 	}
53 53
 	$article_count_expire = $article_handler->getCount($criteria);
54
-}else{
54
+}else {
55 55
 	$article_count_expire = 0;
56 56
 }
57 57
 $article_count = $article_handler->getCount();
58 58
 
59
-echo "<fieldset><legend style=\"font-weight: bold; color: #900;\">" . planet_constant("AM_ARTICLES") . "</legend>";
59
+echo "<fieldset><legend style=\"font-weight: bold; color: #900;\">".planet_constant("AM_ARTICLES")."</legend>";
60 60
 echo "<div style=\"padding: 8px;\">";
61
-echo "<br clear=\"all\" />" . planet_constant("AM_COUNT").": ". $article_count;
61
+echo "<br clear=\"all\" />".planet_constant("AM_COUNT").": ".$article_count;
62 62
 echo "<br clear=\"all\" />";
63
-if($article_count_expire>0){
64
-	echo "<br clear=\"all\" /><a href=\"".XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/admin/admin.article.php?purge=1\" >" . planet_constant("AM_EXPIRED").": ".$article_count_expire."</a>";
63
+if ($article_count_expire>0) {
64
+	echo "<br clear=\"all\" /><a href=\"".XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/admin/admin.article.php?purge=1\" >".planet_constant("AM_EXPIRED").": ".$article_count_expire."</a>";
65 65
 	echo "<br clear=\"all\" />";
66 66
 }
67 67
 echo "</div>";
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
 		}
52 52
 	}
53 53
 	$article_count_expire = $article_handler->getCount($criteria);
54
-}else{
54
+} else{
55 55
 	$article_count_expire = 0;
56 56
 }
57 57
 $article_count = $article_handler->getCount();
Please login to merge, or discard this patch.
action.rate.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -32,8 +32,8 @@  discard block
 block discarded – undo
32 32
 $blog_id = intval( !empty($_POST["blog"])?$_POST["blog"]:(!empty($_GET["blog"])?$_GET["blog"]:0) );
33 33
 
34 34
 if(empty($article_id) && empty($blog_id)){
35
-    redirect_header("javascript:history.go(-1);", 1, planet_constant("MD_INVALID"));
36
-    exit();
35
+	redirect_header("javascript:history.go(-1);", 1, planet_constant("MD_INVALID"));
36
+	exit();
37 37
 }
38 38
 
39 39
 $article_handler =& xoops_getmodulehandler("article", $GLOBALS["moddirname"]);
@@ -69,8 +69,8 @@  discard block
 block discarded – undo
69 69
 		$rate_obj->setVar("rate_rating", $rate);
70 70
 		$rate_obj->setVar("rate_time", time());
71 71
 		if(!$rate_id = $rate_handler->insert($rate_obj, true)){
72
-		    redirect_header("javascript:history.go(-1);", 1, planet_constant("MD_NOTSAVED"));
73
-		    exit();
72
+			redirect_header("javascript:history.go(-1);", 1, planet_constant("MD_NOTSAVED"));
73
+			exit();
74 74
 		}
75 75
 		if($article_id>0){
76 76
 			$article_obj =& $article_handler->get($article_id);
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -27,58 +27,58 @@  discard block
 block discarded – undo
27 27
 
28 28
 include 'header.php';
29 29
 
30
-$rate = intval( !empty($_POST["rate"])?$_POST["rate"]:(!empty($_GET["rate"])?$_GET["rate"]:0) );
31
-$article_id = intval( !empty($_POST["article"])?$_POST["article"]:(!empty($_GET["article"])?$_GET["article"]:0) );
32
-$blog_id = intval( !empty($_POST["blog"])?$_POST["blog"]:(!empty($_GET["blog"])?$_GET["blog"]:0) );
30
+$rate = intval(!empty($_POST["rate"]) ? $_POST["rate"] : (!empty($_GET["rate"]) ? $_GET["rate"] : 0));
31
+$article_id = intval(!empty($_POST["article"]) ? $_POST["article"] : (!empty($_GET["article"]) ? $_GET["article"] : 0));
32
+$blog_id = intval(!empty($_POST["blog"]) ? $_POST["blog"] : (!empty($_GET["blog"]) ? $_GET["blog"] : 0));
33 33
 
34
-if(empty($article_id) && empty($blog_id)){
34
+if (empty($article_id) && empty($blog_id)) {
35 35
     redirect_header("javascript:history.go(-1);", 1, planet_constant("MD_INVALID"));
36 36
     exit();
37 37
 }
38 38
 
39
-$article_handler =& xoops_getmodulehandler("article", $GLOBALS["moddirname"]);
40
-$blog_handler =& xoops_getmodulehandler("blog", $GLOBALS["moddirname"]);
41
-if(empty($xoopsModuleConfig["anonymous_rate"]) && !is_object($xoopsUser)){
39
+$article_handler = & xoops_getmodulehandler("article", $GLOBALS["moddirname"]);
40
+$blog_handler = & xoops_getmodulehandler("blog", $GLOBALS["moddirname"]);
41
+if (empty($xoopsModuleConfig["anonymous_rate"]) && !is_object($xoopsUser)) {
42 42
 	$message = planet_constant("MD_NOACCESS");
43
-}else{
44
-	$uid = (is_object($xoopsUser))?$xoopsUser->getVar("uid"):0;
43
+}else {
44
+	$uid = (is_object($xoopsUser)) ? $xoopsUser->getVar("uid") : 0;
45 45
 	$ip = planet_getIP();
46
-	if($article_id>0){
46
+	if ($article_id>0) {
47 47
 		$criteria = new CriteriaCompo(new Criteria("art_id", $article_id));
48
-	}else{
48
+	}else {
49 49
 		$criteria = new CriteriaCompo(new Criteria("blog_id", $blog_id));
50 50
 	}
51
-	if($uid>0){
51
+	if ($uid>0) {
52 52
 		$criteria->add(new Criteria("rate_uid", $uid));
53
-	}else{
53
+	}else {
54 54
 		$criteria->add(new Criteria("rate_ip", $ip));
55 55
 		$criteria->add(new Criteria("rate_time", time()-24*3600, ">"));
56 56
 	}
57
-	$rate_handler =& xoops_getmodulehandler("rate", $GLOBALS["moddirname"]);
58
-	if($count=$rate_handler->getCount($criteria)){
57
+	$rate_handler = & xoops_getmodulehandler("rate", $GLOBALS["moddirname"]);
58
+	if ($count = $rate_handler->getCount($criteria)) {
59 59
 		$message = planet_constant("MD_ALREADYRATED");
60
-	}else{
61
-		$rate_obj =& $rate_handler->create();
62
-		if($article_id>0){
60
+	}else {
61
+		$rate_obj = & $rate_handler->create();
62
+		if ($article_id>0) {
63 63
 			$rate_obj->setVar("art_id", $article_id);
64
-		}else{
64
+		}else {
65 65
 			$rate_obj->setVar("blog_id", $blog_id);
66 66
 		}
67 67
 		$rate_obj->setVar("rate_uid", $uid);
68 68
 		$rate_obj->setVar("rate_ip", $ip);
69 69
 		$rate_obj->setVar("rate_rating", $rate);
70 70
 		$rate_obj->setVar("rate_time", time());
71
-		if(!$rate_id = $rate_handler->insert($rate_obj, true)){
71
+		if (!$rate_id = $rate_handler->insert($rate_obj, true)) {
72 72
 		    redirect_header("javascript:history.go(-1);", 1, planet_constant("MD_NOTSAVED"));
73 73
 		    exit();
74 74
 		}
75
-		if($article_id>0){
76
-			$article_obj =& $article_handler->get($article_id);
75
+		if ($article_id>0) {
76
+			$article_obj = & $article_handler->get($article_id);
77 77
 			$article_obj->setVar("art_rating", $article_obj->getVar("art_rating")+$rate);
78 78
 			$article_obj->setVar("art_rates", $article_obj->getVar("art_rates")+1);
79 79
 			$article_handler->insert($article_obj, true);
80
-		}else{
81
-			$blog_obj =& $blog_handler->get($blog_id);
80
+		}else {
81
+			$blog_obj = & $blog_handler->get($blog_id);
82 82
 			$blog_obj->setVar("blog_rating", $blog_obj->getVar("blog_rating")+$rate);
83 83
 			$blog_obj->setVar("blog_rates", $blog_obj->getVar("blog_rates")+1);
84 84
 			$blog_handler->insert($blog_obj, true);
@@ -86,9 +86,9 @@  discard block
 block discarded – undo
86 86
 		$message = planet_constant("MD_ACTIONDONE");
87 87
 	}
88 88
 }
89
-if($article_id>0){
89
+if ($article_id>0) {
90 90
 	redirect_header(XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/view.article.php".URL_DELIMITER."".$article_id, 2, $message);
91
-}else{
91
+}else {
92 92
 	redirect_header(XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/index.php".URL_DELIMITER."b".$blog_id, 2, $message);
93 93
 }
94 94
 include 'footer.php';
Please login to merge, or discard this patch.
Braces   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -40,28 +40,28 @@  discard block
 block discarded – undo
40 40
 $blog_handler =& xoops_getmodulehandler("blog", $GLOBALS["moddirname"]);
41 41
 if(empty($xoopsModuleConfig["anonymous_rate"]) && !is_object($xoopsUser)){
42 42
 	$message = planet_constant("MD_NOACCESS");
43
-}else{
43
+} else{
44 44
 	$uid = (is_object($xoopsUser))?$xoopsUser->getVar("uid"):0;
45 45
 	$ip = planet_getIP();
46 46
 	if($article_id>0){
47 47
 		$criteria = new CriteriaCompo(new Criteria("art_id", $article_id));
48
-	}else{
48
+	} else{
49 49
 		$criteria = new CriteriaCompo(new Criteria("blog_id", $blog_id));
50 50
 	}
51 51
 	if($uid>0){
52 52
 		$criteria->add(new Criteria("rate_uid", $uid));
53
-	}else{
53
+	} else{
54 54
 		$criteria->add(new Criteria("rate_ip", $ip));
55 55
 		$criteria->add(new Criteria("rate_time", time()-24*3600, ">"));
56 56
 	}
57 57
 	$rate_handler =& xoops_getmodulehandler("rate", $GLOBALS["moddirname"]);
58 58
 	if($count=$rate_handler->getCount($criteria)){
59 59
 		$message = planet_constant("MD_ALREADYRATED");
60
-	}else{
60
+	} else{
61 61
 		$rate_obj =& $rate_handler->create();
62 62
 		if($article_id>0){
63 63
 			$rate_obj->setVar("art_id", $article_id);
64
-		}else{
64
+		} else{
65 65
 			$rate_obj->setVar("blog_id", $blog_id);
66 66
 		}
67 67
 		$rate_obj->setVar("rate_uid", $uid);
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 			$article_obj->setVar("art_rating", $article_obj->getVar("art_rating")+$rate);
78 78
 			$article_obj->setVar("art_rates", $article_obj->getVar("art_rates")+1);
79 79
 			$article_handler->insert($article_obj, true);
80
-		}else{
80
+		} else{
81 81
 			$blog_obj =& $blog_handler->get($blog_id);
82 82
 			$blog_obj->setVar("blog_rating", $blog_obj->getVar("blog_rating")+$rate);
83 83
 			$blog_obj->setVar("blog_rates", $blog_obj->getVar("blog_rates")+1);
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 }
89 89
 if($article_id>0){
90 90
 	redirect_header(XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/view.article.php".URL_DELIMITER."".$article_id, 2, $message);
91
-}else{
91
+} else{
92 92
 	redirect_header(XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/index.php".URL_DELIMITER."b".$blog_id, 2, $message);
93 93
 }
94 94
 include 'footer.php';
Please login to merge, or discard this patch.
action.article.php 3 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -29,12 +29,12 @@  discard block
 block discarded – undo
29 29
 
30 30
 $art_id = intval( isset($_GET["article"]) ? $_GET["article"] : (isset($_POST["article"]) ? $_POST["article"]: 0) );
31 31
 if(empty($art_id)){
32
-    redirect_header("javascript:history.go(-1);", 1, planet_constant("MD_INVALID"));
33
-    exit();
32
+	redirect_header("javascript:history.go(-1);", 1, planet_constant("MD_INVALID"));
33
+	exit();
34 34
 }
35 35
 if (!$xoopsUser->isAdmin()){
36
-    redirect_header("javascript:history.go(-1);", 2, _NOPERM);
37
-    exit();
36
+	redirect_header("javascript:history.go(-1);", 2, _NOPERM);
37
+	exit();
38 38
 }
39 39
 include XOOPS_ROOT_PATH."/header.php";
40 40
 include XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/include/vars.php";
@@ -52,28 +52,28 @@  discard block
 block discarded – undo
52 52
 }elseif ( $op == "save" ) {
53 53
 	
54 54
 	if(empty($_POST["art_content"])){
55
-	    redirect_header("javascript:history.go(-1);", 1, planet_constant("MD_TEXTEMPTY"));
56
-	    exit();
55
+		redirect_header("javascript:history.go(-1);", 1, planet_constant("MD_TEXTEMPTY"));
56
+		exit();
57 57
 	}
58 58
 
59 59
 	foreach(array(
60
-	    "art_title",
61
-	    "art_link",
62
-	    "art_author",
63
-	    "art_content"
60
+		"art_title",
61
+		"art_link",
62
+		"art_author",
63
+		"art_content"
64 64
 		) as $tag){
65 65
 		if(@$_POST[$tag] != $article_obj->getVar($tag))
66
-    	$article_obj->setVar($tag, @$_POST[$tag]);
66
+		$article_obj->setVar($tag, @$_POST[$tag]);
67 67
 	}
68 68
 
69
-    $art_id_new = $article_handler->insert($article_obj);
69
+	$art_id_new = $article_handler->insert($article_obj);
70 70
 	if(!$article_obj->getVar("art_id")){
71 71
 		$redirect = XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/index.php";
72
-	    $message = planet_constant("MD_INSERTERROR");
72
+		$message = planet_constant("MD_INSERTERROR");
73 73
 	}else{
74
-	    $redirect = XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/view.article.php".URL_DELIMITER."".$article_obj->getVar("art_id");
75
-	    $message = planet_constant("MD_SAVED");
76
-    }
74
+		$redirect = XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/view.article.php".URL_DELIMITER."".$article_obj->getVar("art_id");
75
+		$message = planet_constant("MD_SAVED");
76
+	}
77 77
 	redirect_header($redirect,2,$message);
78 78
 }else{
79 79
 	require_once(XOOPS_ROOT_PATH . "/class/xoopsformloader.php");
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -27,56 +27,56 @@
 block discarded – undo
27 27
 
28 28
 include "header.php";
29 29
 
30
-$art_id = intval( isset($_GET["article"]) ? $_GET["article"] : (isset($_POST["article"]) ? $_POST["article"]: 0) );
31
-if(empty($art_id)){
30
+$art_id = intval(isset($_GET["article"]) ? $_GET["article"] : (isset($_POST["article"]) ? $_POST["article"] : 0));
31
+if (empty($art_id)) {
32 32
     redirect_header("javascript:history.go(-1);", 1, planet_constant("MD_INVALID"));
33 33
     exit();
34 34
 }
35
-if (!$xoopsUser->isAdmin()){
35
+if (!$xoopsUser->isAdmin()) {
36 36
     redirect_header("javascript:history.go(-1);", 2, _NOPERM);
37 37
     exit();
38 38
 }
39 39
 include XOOPS_ROOT_PATH."/header.php";
40 40
 include XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/include/vars.php";
41 41
 
42
-$article_handler =& xoops_getmodulehandler("article", $GLOBALS["moddirname"]);
42
+$article_handler = & xoops_getmodulehandler("article", $GLOBALS["moddirname"]);
43 43
 $article_obj = $article_handler->get($art_id);
44 44
 
45 45
 $op = isset($_POST["op"]) ? $_POST["op"] : "";
46 46
 
47
-if ( $op == "del" || !empty($_POST["del"])) {
47
+if ($op == "del" || !empty($_POST["del"])) {
48 48
 	$article_handler->delete($article_obj);
49 49
 	$redirect = XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/index.php";
50 50
 	$message = planet_constant("MD_SAVED");
51
-	redirect_header($redirect,2,$message);
52
-}elseif ( $op == "save" ) {
51
+	redirect_header($redirect, 2, $message);
52
+}elseif ($op == "save") {
53 53
 	
54
-	if(empty($_POST["art_content"])){
54
+	if (empty($_POST["art_content"])) {
55 55
 	    redirect_header("javascript:history.go(-1);", 1, planet_constant("MD_TEXTEMPTY"));
56 56
 	    exit();
57 57
 	}
58 58
 
59
-	foreach(array(
59
+	foreach (array(
60 60
 	    "art_title",
61 61
 	    "art_link",
62 62
 	    "art_author",
63 63
 	    "art_content"
64
-		) as $tag){
65
-		if(@$_POST[$tag] != $article_obj->getVar($tag))
64
+		) as $tag) {
65
+		if (@$_POST[$tag] != $article_obj->getVar($tag))
66 66
     	$article_obj->setVar($tag, @$_POST[$tag]);
67 67
 	}
68 68
 
69 69
     $art_id_new = $article_handler->insert($article_obj);
70
-	if(!$article_obj->getVar("art_id")){
70
+	if (!$article_obj->getVar("art_id")) {
71 71
 		$redirect = XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/index.php";
72 72
 	    $message = planet_constant("MD_INSERTERROR");
73
-	}else{
73
+	}else {
74 74
 	    $redirect = XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/view.article.php".URL_DELIMITER."".$article_obj->getVar("art_id");
75 75
 	    $message = planet_constant("MD_SAVED");
76 76
     }
77
-	redirect_header($redirect,2,$message);
78
-}else{
79
-	require_once(XOOPS_ROOT_PATH . "/class/xoopsformloader.php");
77
+	redirect_header($redirect, 2, $message);
78
+}else {
79
+	require_once(XOOPS_ROOT_PATH."/class/xoopsformloader.php");
80 80
 	
81 81
 	$form = new XoopsThemeForm(_EDIT, "formarticle", xoops_getenv('PHP_SELF'));
82 82
 	
Please login to merge, or discard this patch.
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	$redirect = XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/index.php";
50 50
 	$message = planet_constant("MD_SAVED");
51 51
 	redirect_header($redirect,2,$message);
52
-}elseif ( $op == "save" ) {
52
+} elseif ( $op == "save" ) {
53 53
 	
54 54
 	if(empty($_POST["art_content"])){
55 55
 	    redirect_header("javascript:history.go(-1);", 1, planet_constant("MD_TEXTEMPTY"));
@@ -62,20 +62,21 @@  discard block
 block discarded – undo
62 62
 	    "art_author",
63 63
 	    "art_content"
64 64
 		) as $tag){
65
-		if(@$_POST[$tag] != $article_obj->getVar($tag))
66
-    	$article_obj->setVar($tag, @$_POST[$tag]);
65
+		if(@$_POST[$tag] != $article_obj->getVar($tag)) {
66
+		    	$article_obj->setVar($tag, @$_POST[$tag]);
67
+		}
67 68
 	}
68 69
 
69 70
     $art_id_new = $article_handler->insert($article_obj);
70 71
 	if(!$article_obj->getVar("art_id")){
71 72
 		$redirect = XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/index.php";
72 73
 	    $message = planet_constant("MD_INSERTERROR");
73
-	}else{
74
+	} else{
74 75
 	    $redirect = XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/view.article.php".URL_DELIMITER."".$article_obj->getVar("art_id");
75 76
 	    $message = planet_constant("MD_SAVED");
76 77
     }
77 78
 	redirect_header($redirect,2,$message);
78
-}else{
79
+} else{
79 80
 	require_once(XOOPS_ROOT_PATH . "/class/xoopsformloader.php");
80 81
 	
81 82
 	$form = new XoopsThemeForm(_EDIT, "formarticle", xoops_getenv('PHP_SELF'));
Please login to merge, or discard this patch.
view.archive.php 3 patches
Indentation   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 }
61 61
 $time = array("year"=>$year, "month"=>$month, "day"=>$day);
62 62
 if ($xoopsUser) {
63
-    $timeoffset = ($xoopsUser->getVar("timezone_offset")- $xoopsConfig['server_TZ'])*3600;
63
+	$timeoffset = ($xoopsUser->getVar("timezone_offset")- $xoopsConfig['server_TZ'])*3600;
64 64
 } else {
65
-    $timeoffset = ($xoopsConfig['default_TZ']- $xoopsConfig['server_TZ'])*3600;
65
+	$timeoffset = ($xoopsConfig['default_TZ']- $xoopsConfig['server_TZ'])*3600;
66 66
 }
67 67
 
68 68
 $criteria = new CriteriaCompo();
@@ -127,20 +127,20 @@  discard block
 block discarded – undo
127 127
 	}
128 128
 	// Get monthly list
129 129
 	if(empty($month)){
130
-    	$sql = "SELECT MONTH(FROM_UNIXTIME(art_time - $timeoffset)) AS mon, COUNT(DISTINCT art_id) AS count 
130
+		$sql = "SELECT MONTH(FROM_UNIXTIME(art_time - $timeoffset)) AS mon, COUNT(DISTINCT art_id) AS count 
131 131
             FROM ".planet_DB_prefix("article")."
132 132
             WHERE YEAR(FROM_UNIXTIME(art_time - $timeoffset)) = $year
133 133
             ".$blog_criteria."
134 134
             GROUP BY mon
135 135
             ";
136
-        $result = $xoopsDB->query($sql);
137
-        $months = array();
138
-        while ($myrow = $xoopsDB->fetchArray($result)) {
139
-            $months[] = array(
140
-            	"title"=>planet_constant("MD_MONTH_".intval($myrow["mon"]))." (".intval($myrow["count"]).")",
136
+		$result = $xoopsDB->query($sql);
137
+		$months = array();
138
+		while ($myrow = $xoopsDB->fetchArray($result)) {
139
+			$months[] = array(
140
+				"title"=>planet_constant("MD_MONTH_".intval($myrow["mon"]))." (".intval($myrow["count"]).")",
141 141
 				"url"=>XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/view.archive.php".URL_DELIMITER."".$year."/".$myrow["mon"]."/b".$blog_id,
142
-            	);
143
-        }
142
+				);
143
+		}
144 144
 		$timenav["prev"] = array(
145 145
 			"url"=>XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/view.archive.php".URL_DELIMITER."".($year-1)."/b".$blog_id,
146 146
 			"title"=>sprintf(planet_constant("MD_TIME_Y"), ($year-1))
@@ -154,37 +154,37 @@  discard block
 block discarded – undo
154 154
 	}
155 155
 	// Get daily list
156 156
 	elseif(empty($day)){
157
-    	$sql = "SELECT DAY(FROM_UNIXTIME(art_time - $timeoffset)) AS day, COUNT(DISTINCT a.art_id) AS count 
157
+		$sql = "SELECT DAY(FROM_UNIXTIME(art_time - $timeoffset)) AS day, COUNT(DISTINCT a.art_id) AS count 
158 158
             FROM ".planet_DB_prefix("article")."
159 159
             WHERE YEAR(FROM_UNIXTIME(art_time - $timeoffset)) = $year
160 160
             AND MONTH(FROM_UNIXTIME(art_time - $timeoffset)) = $month
161 161
             ".$blog_criteria."
162 162
             GROUP BY day
163 163
             ";
164
-        $result = $xoopsDB->query($sql);
165
-        $days = array();
166
-        while ($myrow = $xoopsDB->fetchArray($result)) {
167
-            $days[$myrow["day"]]["count"] = $myrow["count"];
168
-        }
169
-        for($i=1;$i<=31;$i++){
170
-	        if(!isset($days[$i])) continue;
171
-	        $days[$i] = array(
172
-            	"title"=>$days[$i]["count"],
164
+		$result = $xoopsDB->query($sql);
165
+		$days = array();
166
+		while ($myrow = $xoopsDB->fetchArray($result)) {
167
+			$days[$myrow["day"]]["count"] = $myrow["count"];
168
+		}
169
+		for($i=1;$i<=31;$i++){
170
+			if(!isset($days[$i])) continue;
171
+			$days[$i] = array(
172
+				"title"=>$days[$i]["count"],
173 173
 				"url"=>XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/view.archive.php".URL_DELIMITER."".$year."/".$month."/".$i."/b".$blog_id
174
-            	);
175
-        }
176
-        $calendar = planet_getCalendar($year, $month, $days);
177
-        $month_next = $month+1;
178
-        $month_prev = $month-1;
179
-        $_year = $year;
180
-        if($month==12) {
181
-	        $month_next = 1;
182
-	        $_year = $year +1;
183
-        }
184
-        if($month==1) {
185
-	        $month_pre = 12;
186
-	        $_year = $year - 1;
187
-        }
174
+				);
175
+		}
176
+		$calendar = planet_getCalendar($year, $month, $days);
177
+		$month_next = $month+1;
178
+		$month_prev = $month-1;
179
+		$_year = $year;
180
+		if($month==12) {
181
+			$month_next = 1;
182
+			$_year = $year +1;
183
+		}
184
+		if($month==1) {
185
+			$month_pre = 12;
186
+			$_year = $year - 1;
187
+		}
188 188
 		$timenav["prev"] = array(
189 189
 			"url"=>XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/view.archive.php".URL_DELIMITER."".$_year."/".$month_prev."/b".$blog_id,
190 190
 			"title"=>planet_constant("MD_MONTH_".$month_prev)
@@ -218,59 +218,59 @@  discard block
 block discarded – undo
218 218
 {
219 219
 	$year = empty($year)?date("Y"):$year;
220 220
 	$month = empty($month)?date("n"):$month;
221
-    $unixmonth = mktime(0, 0 , 0, $month, 1, $year);
221
+	$unixmonth = mktime(0, 0 , 0, $month, 1, $year);
222 222
 	
223
-    ob_start();
224
-    echo '<table id="calendar">';
225
-    echo '<caption>';
226
-    printf(planet_constant("MD_TIME_YM"), $year, planet_constant("MD_MONTH_".$month));
227
-    echo '</caption>';
223
+	ob_start();
224
+	echo '<table id="calendar">';
225
+	echo '<caption>';
226
+	printf(planet_constant("MD_TIME_YM"), $year, planet_constant("MD_MONTH_".$month));
227
+	echo '</caption>';
228 228
 	
229
-    for ($i=1;$i<=7;$i++) {
230
-        echo "\n\t\t<th abbr=\"".planet_constant("MD_WEEK_".$i)."\" scope=\"col\" title=\"".planet_constant("MD_WEEK_".$i)."\">" . planet_constant("MD_WEEK_".$i) . '</th>';
231
-    }
229
+	for ($i=1;$i<=7;$i++) {
230
+		echo "\n\t\t<th abbr=\"".planet_constant("MD_WEEK_".$i)."\" scope=\"col\" title=\"".planet_constant("MD_WEEK_".$i)."\">" . planet_constant("MD_WEEK_".$i) . '</th>';
231
+	}
232 232
 
233 233
 	echo '<tr>';
234 234
 	
235 235
 	// See how much we should pad in the beginning
236 236
 	$week_begins = 1;
237
-    $pad = planet_calendar_week_mod(date('w', $unixmonth)-$week_begins);
238
-    if (0 != $pad) echo "\n\t\t".'<td colspan="'.$pad.'">&nbsp;</td>';
237
+	$pad = planet_calendar_week_mod(date('w', $unixmonth)-$week_begins);
238
+	if (0 != $pad) echo "\n\t\t".'<td colspan="'.$pad.'">&nbsp;</td>';
239 239
 
240
-    $daysinmonth = intval(date('t', $unixmonth));
241
-    for ($day = 1; $day <= $daysinmonth; ++$day) {
242
-        if (isset($newrow) && $newrow){
243
-            echo "\n\t</tr>\n\t<tr>\n\t\t";
244
-        }
245
-        $newrow = false;
240
+	$daysinmonth = intval(date('t', $unixmonth));
241
+	for ($day = 1; $day <= $daysinmonth; ++$day) {
242
+		if (isset($newrow) && $newrow){
243
+			echo "\n\t</tr>\n\t<tr>\n\t\t";
244
+		}
245
+		$newrow = false;
246 246
 
247
-       	echo '<td>';
247
+	   	echo '<td>';
248 248
 
249
-        if (!empty($days[$day]["url"])) {
249
+		if (!empty($days[$day]["url"])) {
250 250
 			echo '<a href="' . $days[$day]["url"] . "\"";
251 251
 			if(!empty($days[$day]["title"])) echo "title=\"".$days[$day]["title"]."\"";
252 252
 			echo ">$day</a>";
253
-        } elseif(!empty($days[$day]["title"])) {
254
-            echo "<acronym title=\"".$days[$day]["title"]."\">$day</acronym>";
255
-        } else {
256
-            echo $day;
257
-        }
258
-        echo '</td>';
253
+		} elseif(!empty($days[$day]["title"])) {
254
+			echo "<acronym title=\"".$days[$day]["title"]."\">$day</acronym>";
255
+		} else {
256
+			echo $day;
257
+		}
258
+		echo '</td>';
259 259
 
260 260
 	if (6 == planet_calendar_week_mod(date('w', mktime(0, 0 , 0, $month, $day, $year))-$week_begins))
261
-            $newrow = true;
262
-    }
261
+			$newrow = true;
262
+	}
263 263
 
264
-    $pad = 7 - planet_calendar_week_mod(date('w', mktime(0, 0 , 0, $month, $day, $year))-$week_begins);
265
-    if ($pad != 0 && $pad != 7){
266
-        echo "\n\t\t".'<td class="pad" colspan="'.$pad.'">&nbsp;</td>';
267
-    }
264
+	$pad = 7 - planet_calendar_week_mod(date('w', mktime(0, 0 , 0, $month, $day, $year))-$week_begins);
265
+	if ($pad != 0 && $pad != 7){
266
+		echo "\n\t\t".'<td class="pad" colspan="'.$pad.'">&nbsp;</td>';
267
+	}
268 268
 
269
-    echo "\n\t</tr>\n\t</tbody>\n\t</table>";
270
-    $calendar = ob_get_contents();
271
-    ob_end_clean();    
269
+	echo "\n\t</tr>\n\t</tbody>\n\t</table>";
270
+	$calendar = ob_get_contents();
271
+	ob_end_clean();    
272 272
     
273
-    return $calendar;
273
+	return $calendar;
274 274
 }
275 275
 
276 276
 // Used in get_calendar
Please login to merge, or discard this patch.
Spacing   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -26,60 +26,60 @@  discard block
 block discarded – undo
26 26
 // ------------------------------------------------------------------------ //
27 27
 include "header.php";
28 28
 
29
-if(planet_parse_args($args_num, $args, $args_str)){
29
+if (planet_parse_args($args_num, $args, $args_str)) {
30 30
 	$args["year"] = @$args_num[0];
31 31
 	$args["month"] = @$args_num[1];
32 32
 	$args["day"] = @$args_num[2];
33 33
 }
34 34
 
35
-$day = intval( empty($_GET["day"])?@$args["day"]:$_GET["day"] );
36
-$year = intval( empty($_GET["year"])?@$args["year"]:$_GET["year"] );
37
-$month = intval( empty($_GET["month"])?@$args["month"]:$_GET["month"] );
38
-$blog_id = intval( empty($_GET["blog"])?@$args["blog"]:$_GET["blog"] );
39
-$start = intval( empty($_GET["start"])?@$args["start"]:$_GET["start"] );
35
+$day = intval(empty($_GET["day"]) ? @$args["day"] : $_GET["day"]);
36
+$year = intval(empty($_GET["year"]) ? @$args["year"] : $_GET["year"]);
37
+$month = intval(empty($_GET["month"]) ? @$args["month"] : $_GET["month"]);
38
+$blog_id = intval(empty($_GET["blog"]) ? @$args["blog"] : $_GET["blog"]);
39
+$start = intval(empty($_GET["start"]) ? @$args["start"] : $_GET["start"]);
40 40
 
41 41
 $page["title"] = planet_constant("MD_ACHIVE");
42 42
 
43
-$article_handler =& xoops_getmodulehandler("article", $GLOBALS["moddirname"]);
44
-$blog_handler =& xoops_getmodulehandler("blog", $GLOBALS["moddirname"]);
43
+$article_handler = & xoops_getmodulehandler("article", $GLOBALS["moddirname"]);
44
+$blog_handler = & xoops_getmodulehandler("blog", $GLOBALS["moddirname"]);
45 45
 
46
-$xoopsOption["xoops_pagetitle"] = $xoopsModule->getVar("name"). " - " .planet_constant("MD_ACHIVE");
46
+$xoopsOption["xoops_pagetitle"] = $xoopsModule->getVar("name")." - ".planet_constant("MD_ACHIVE");
47 47
 $xoopsOption["template_main"] = planet_getTemplate("archive");
48
-include_once( XOOPS_ROOT_PATH . "/header.php" );
48
+include_once(XOOPS_ROOT_PATH."/header.php");
49 49
 include XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/include/vars.php";
50 50
 
51
-$year = empty($year)?date("Y"):$year;
52
-if($month<1){
51
+$year = empty($year) ? date("Y") : $year;
52
+if ($month<1) {
53 53
 	$month = $day = 0;
54 54
 	$page["time"] = sprintf(planet_constant("MD_TIME_Y"), $year);
55
-}elseif($day<1){
55
+}elseif ($day<1) {
56 56
 	$day = 0;
57 57
 	$page["time"] = sprintf(planet_constant("MD_TIME_YM"), $year, $month);
58
-}else{
58
+}else {
59 59
 	$page["time"] = sprintf(planet_constant("MD_TIME_YMD"), $year, $month, $day);
60 60
 }
61 61
 $time = array("year"=>$year, "month"=>$month, "day"=>$day);
62 62
 if ($xoopsUser) {
63
-    $timeoffset = ($xoopsUser->getVar("timezone_offset")- $xoopsConfig['server_TZ'])*3600;
64
-} else {
65
-    $timeoffset = ($xoopsConfig['default_TZ']- $xoopsConfig['server_TZ'])*3600;
63
+    $timeoffset = ($xoopsUser->getVar("timezone_offset")-$xoopsConfig['server_TZ'])*3600;
64
+}else {
65
+    $timeoffset = ($xoopsConfig['default_TZ']-$xoopsConfig['server_TZ'])*3600;
66 66
 }
67 67
 
68 68
 $criteria = new CriteriaCompo();
69
-if($blog_id){
69
+if ($blog_id) {
70 70
 	$criteria->add(new Criteria("blog_id", $blog_id));
71 71
 }
72 72
 $criteria->add(new Criteria("YEAR(FROM_UNIXTIME(art_time_publish - $timeoffset))", $year));
73
-if($month){
73
+if ($month) {
74 74
 	$criteria->add(new Criteria("MONTH(FROM_UNIXTIME(art_time_publish - $timeoffset))", $month));
75
-	if($day){
75
+	if ($day) {
76 76
 		$criteria->add(new Criteria("DAY(FROM_UNIXTIME(art_time_publish - $timeoffset))", $day));
77 77
 	}
78 78
 }
79 79
 $criteria->setStart($start);
80 80
 $criteria->setLimit($xoopsModuleConfig["articles_perpage"]);
81 81
 
82
-$articles_obj =& $article_handler->getAll(
82
+$articles_obj = & $article_handler->getAll(
83 83
 	$criteria,
84 84
 	array("uid", "art_title", "art_time", "blog_id", "art_content")
85 85
 );
@@ -87,10 +87,10 @@  discard block
 block discarded – undo
87 87
 
88 88
 $articles = array();
89 89
 $blogs_id = array();
90
-foreach($articles_obj as $id=>$article){
90
+foreach ($articles_obj as $id=>$article) {
91 91
 	$articles[] = array(
92 92
 		"id"=>$id,
93
-		"blog"=>array("id"=>$article->getVar("blog_id"),"title"=>""),
93
+		"blog"=>array("id"=>$article->getVar("blog_id"), "title"=>""),
94 94
 		"title"=>$article->getVar("art_title"),
95 95
 		"time"=>$article->getTime(),
96 96
 		"content"=>$article->getVar("art_content")
@@ -101,32 +101,32 @@  discard block
 block discarded – undo
101 101
 }
102 102
 $criteria_blog = new Criteria("blog_id", "(".implode(",", array_keys($blog_array)).")", "IN");
103 103
 $blogs = $blog_handler->getList($criteria_blog);
104
-foreach(array_keys($articles) as $key){
104
+foreach (array_keys($articles) as $key) {
105 105
 	$articles[$key]["blog"]["title"] = $blogs[$articles[$key]["blog"]["id"]];
106 106
 }
107
-if($blog_id>0){
108
-	$page["blog"] = $blogs[$blog_id];;
107
+if ($blog_id>0) {
108
+	$page["blog"] = $blogs[$blog_id]; ;
109 109
 }
110 110
 
111
-if ( $articles_count > $xoopsModuleConfig["articles_perpage"]) {
111
+if ($articles_count>$xoopsModuleConfig["articles_perpage"]) {
112 112
 	include(XOOPS_ROOT_PATH."/class/pagenav.php");
113 113
 	$nav = new XoopsPageNav($articles_count, $xoopsModuleConfig["articles_perpage"], $start, "start", "month=".$month."&amp;day=".$day."&amp;year=".$year."&amp;blog=".intval($blog_id));
114 114
 	$pagenav = $nav->renderNav(4);
115
-} else {
115
+}else {
116 116
 	$pagenav = "";
117 117
 }
118 118
 
119 119
 $timenav = null;
120 120
 $calendar = null;
121 121
 $months = null;
122
-if(empty($start)){
123
-	if($blog_id){
122
+if (empty($start)) {
123
+	if ($blog_id) {
124 124
 		$blog_criteria = " AND blog_id=".$blog_id;
125
-	}else{
125
+	}else {
126 126
 		$blog_criteria = "";
127 127
 	}
128 128
 	// Get monthly list
129
-	if(empty($month)){
129
+	if (empty($month)) {
130 130
     	$sql = "SELECT MONTH(FROM_UNIXTIME(art_time - $timeoffset)) AS mon, COUNT(DISTINCT art_id) AS count 
131 131
             FROM ".planet_DB_prefix("article")."
132 132
             WHERE YEAR(FROM_UNIXTIME(art_time - $timeoffset)) = $year
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 			"url"=>XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/view.archive.php".URL_DELIMITER."".($year-1)."/b".$blog_id,
146 146
 			"title"=>sprintf(planet_constant("MD_TIME_Y"), ($year-1))
147 147
 			);
148
-		if($year<date("Y")){
148
+		if ($year<date("Y")) {
149 149
 			$timenav["next"] = array(
150 150
 				"url"=>XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/view.archive.php".URL_DELIMITER."".($year+1)."/b".$blog_id,
151 151
 				"title"=>sprintf(planet_constant("MD_TIME_Y"), ($year+1))
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 		}
154 154
 	}
155 155
 	// Get daily list
156
-	elseif(empty($day)){
156
+	elseif (empty($day)) {
157 157
     	$sql = "SELECT DAY(FROM_UNIXTIME(art_time - $timeoffset)) AS day, COUNT(DISTINCT a.art_id) AS count 
158 158
             FROM ".planet_DB_prefix("article")."
159 159
             WHERE YEAR(FROM_UNIXTIME(art_time - $timeoffset)) = $year
@@ -166,8 +166,8 @@  discard block
 block discarded – undo
166 166
         while ($myrow = $xoopsDB->fetchArray($result)) {
167 167
             $days[$myrow["day"]]["count"] = $myrow["count"];
168 168
         }
169
-        for($i=1;$i<=31;$i++){
170
-	        if(!isset($days[$i])) continue;
169
+        for ($i = 1; $i<=31; $i++) {
170
+	        if (!isset($days[$i])) continue;
171 171
 	        $days[$i] = array(
172 172
             	"title"=>$days[$i]["count"],
173 173
 				"url"=>XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/view.archive.php".URL_DELIMITER."".$year."/".$month."/".$i."/b".$blog_id
@@ -177,19 +177,19 @@  discard block
 block discarded – undo
177 177
         $month_next = $month+1;
178 178
         $month_prev = $month-1;
179 179
         $_year = $year;
180
-        if($month==12) {
180
+        if ($month == 12) {
181 181
 	        $month_next = 1;
182
-	        $_year = $year +1;
182
+	        $_year = $year+1;
183 183
         }
184
-        if($month==1) {
184
+        if ($month == 1) {
185 185
 	        $month_pre = 12;
186
-	        $_year = $year - 1;
186
+	        $_year = $year-1;
187 187
         }
188 188
 		$timenav["prev"] = array(
189 189
 			"url"=>XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/view.archive.php".URL_DELIMITER."".$_year."/".$month_prev."/b".$blog_id,
190 190
 			"title"=>planet_constant("MD_MONTH_".$month_prev)
191 191
 			);
192
-		if($year<date("Y") || $month < date("n")){
192
+		if ($year<date("Y") || $month<date("n")) {
193 193
 			$timenav["next"] = array(
194 194
 				"url"=>XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/view.archive.php".URL_DELIMITER."".$_year."/".$month_next."/b".$blog_id,
195 195
 				"title"=>planet_constant("MD_MONTH_".$month_next)
@@ -216,9 +216,9 @@  discard block
 block discarded – undo
216 216
 
217 217
 function planet_getCalendar($year = null, $month = null, $days = null)
218 218
 {
219
-	$year = empty($year)?date("Y"):$year;
220
-	$month = empty($month)?date("n"):$month;
221
-    $unixmonth = mktime(0, 0 , 0, $month, 1, $year);
219
+	$year = empty($year) ? date("Y") : $year;
220
+	$month = empty($month) ? date("n") : $month;
221
+    $unixmonth = mktime(0, 0, 0, $month, 1, $year);
222 222
 	
223 223
     ob_start();
224 224
     echo '<table id="calendar">';
@@ -226,8 +226,8 @@  discard block
 block discarded – undo
226 226
     printf(planet_constant("MD_TIME_YM"), $year, planet_constant("MD_MONTH_".$month));
227 227
     echo '</caption>';
228 228
 	
229
-    for ($i=1;$i<=7;$i++) {
230
-        echo "\n\t\t<th abbr=\"".planet_constant("MD_WEEK_".$i)."\" scope=\"col\" title=\"".planet_constant("MD_WEEK_".$i)."\">" . planet_constant("MD_WEEK_".$i) . '</th>';
229
+    for ($i = 1; $i<=7; $i++) {
230
+        echo "\n\t\t<th abbr=\"".planet_constant("MD_WEEK_".$i)."\" scope=\"col\" title=\"".planet_constant("MD_WEEK_".$i)."\">".planet_constant("MD_WEEK_".$i).'</th>';
231 231
     }
232 232
 
233 233
 	echo '<tr>';
@@ -238,8 +238,8 @@  discard block
 block discarded – undo
238 238
     if (0 != $pad) echo "\n\t\t".'<td colspan="'.$pad.'">&nbsp;</td>';
239 239
 
240 240
     $daysinmonth = intval(date('t', $unixmonth));
241
-    for ($day = 1; $day <= $daysinmonth; ++$day) {
242
-        if (isset($newrow) && $newrow){
241
+    for ($day = 1; $day<=$daysinmonth; ++$day) {
242
+        if (isset($newrow) && $newrow) {
243 243
             echo "\n\t</tr>\n\t<tr>\n\t\t";
244 244
         }
245 245
         $newrow = false;
@@ -247,22 +247,22 @@  discard block
 block discarded – undo
247 247
        	echo '<td>';
248 248
 
249 249
         if (!empty($days[$day]["url"])) {
250
-			echo '<a href="' . $days[$day]["url"] . "\"";
251
-			if(!empty($days[$day]["title"])) echo "title=\"".$days[$day]["title"]."\"";
250
+			echo '<a href="'.$days[$day]["url"]."\"";
251
+			if (!empty($days[$day]["title"])) echo "title=\"".$days[$day]["title"]."\"";
252 252
 			echo ">$day</a>";
253
-        } elseif(!empty($days[$day]["title"])) {
253
+        } elseif (!empty($days[$day]["title"])) {
254 254
             echo "<acronym title=\"".$days[$day]["title"]."\">$day</acronym>";
255
-        } else {
255
+        }else {
256 256
             echo $day;
257 257
         }
258 258
         echo '</td>';
259 259
 
260
-	if (6 == planet_calendar_week_mod(date('w', mktime(0, 0 , 0, $month, $day, $year))-$week_begins))
260
+	if (6 == planet_calendar_week_mod(date('w', mktime(0, 0, 0, $month, $day, $year))-$week_begins))
261 261
             $newrow = true;
262 262
     }
263 263
 
264
-    $pad = 7 - planet_calendar_week_mod(date('w', mktime(0, 0 , 0, $month, $day, $year))-$week_begins);
265
-    if ($pad != 0 && $pad != 7){
264
+    $pad = 7-planet_calendar_week_mod(date('w', mktime(0, 0, 0, $month, $day, $year))-$week_begins);
265
+    if ($pad != 0 && $pad != 7) {
266 266
         echo "\n\t\t".'<td class="pad" colspan="'.$pad.'">&nbsp;</td>';
267 267
     }
268 268
 
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 // Used in get_calendar
277 277
 function planet_calendar_week_mod($num) {
278 278
 	$base = 7;
279
-	return ($num - $base*floor($num/$base));
279
+	return ($num-$base*floor($num/$base));
280 280
 }
281 281
 
282 282
 ?>
283 283
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +15 added lines, -8 removed lines patch added patch discarded remove patch
@@ -52,10 +52,10 @@  discard block
 block discarded – undo
52 52
 if($month<1){
53 53
 	$month = $day = 0;
54 54
 	$page["time"] = sprintf(planet_constant("MD_TIME_Y"), $year);
55
-}elseif($day<1){
55
+} elseif($day<1){
56 56
 	$day = 0;
57 57
 	$page["time"] = sprintf(planet_constant("MD_TIME_YM"), $year, $month);
58
-}else{
58
+} else{
59 59
 	$page["time"] = sprintf(planet_constant("MD_TIME_YMD"), $year, $month, $day);
60 60
 }
61 61
 $time = array("year"=>$year, "month"=>$month, "day"=>$day);
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 if(empty($start)){
123 123
 	if($blog_id){
124 124
 		$blog_criteria = " AND blog_id=".$blog_id;
125
-	}else{
125
+	} else{
126 126
 		$blog_criteria = "";
127 127
 	}
128 128
 	// Get monthly list
@@ -167,7 +167,9 @@  discard block
 block discarded – undo
167 167
             $days[$myrow["day"]]["count"] = $myrow["count"];
168 168
         }
169 169
         for($i=1;$i<=31;$i++){
170
-	        if(!isset($days[$i])) continue;
170
+	        if(!isset($days[$i])) {
171
+	        	continue;
172
+	        }
171 173
 	        $days[$i] = array(
172 174
             	"title"=>$days[$i]["count"],
173 175
 				"url"=>XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/view.archive.php".URL_DELIMITER."".$year."/".$month."/".$i."/b".$blog_id
@@ -235,7 +237,9 @@  discard block
 block discarded – undo
235 237
 	// See how much we should pad in the beginning
236 238
 	$week_begins = 1;
237 239
     $pad = planet_calendar_week_mod(date('w', $unixmonth)-$week_begins);
238
-    if (0 != $pad) echo "\n\t\t".'<td colspan="'.$pad.'">&nbsp;</td>';
240
+    if (0 != $pad) {
241
+    	echo "\n\t\t".'<td colspan="'.$pad.'">&nbsp;</td>';
242
+    }
239 243
 
240 244
     $daysinmonth = intval(date('t', $unixmonth));
241 245
     for ($day = 1; $day <= $daysinmonth; ++$day) {
@@ -248,7 +252,9 @@  discard block
 block discarded – undo
248 252
 
249 253
         if (!empty($days[$day]["url"])) {
250 254
 			echo '<a href="' . $days[$day]["url"] . "\"";
251
-			if(!empty($days[$day]["title"])) echo "title=\"".$days[$day]["title"]."\"";
255
+			if(!empty($days[$day]["title"])) {
256
+				echo "title=\"".$days[$day]["title"]."\"";
257
+			}
252 258
 			echo ">$day</a>";
253 259
         } elseif(!empty($days[$day]["title"])) {
254 260
             echo "<acronym title=\"".$days[$day]["title"]."\">$day</acronym>";
@@ -257,8 +263,9 @@  discard block
 block discarded – undo
257 263
         }
258 264
         echo '</td>';
259 265
 
260
-	if (6 == planet_calendar_week_mod(date('w', mktime(0, 0 , 0, $month, $day, $year))-$week_begins))
261
-            $newrow = true;
266
+	if (6 == planet_calendar_week_mod(date('w', mktime(0, 0 , 0, $month, $day, $year))-$week_begins)) {
267
+	            $newrow = true;
268
+	}
262 269
     }
263 270
 
264 271
     $pad = 7 - planet_calendar_week_mod(date('w', mktime(0, 0 , 0, $month, $day, $year))-$week_begins);
Please login to merge, or discard this patch.
transfer.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
 	exit();
67 67
 }else{
68 68
 	$data = array();
69
-    $data["id"] = $article_id;
69
+	$data["id"] = $article_id;
70 70
 	$data["title"] = $article_obj->getVar("art_title");
71 71
 	$data["time"] = $article_obj->getTime("l");
72 72
 	$data["image"] = "";
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -15,38 +15,38 @@  discard block
 block discarded – undo
15 15
 
16 16
 include "header.php";
17 17
 
18
-if(planet_parse_args($args_num, $args, $args_str)){
18
+if (planet_parse_args($args_num, $args, $args_str)) {
19 19
 	$args["article"] = @$args_num[0];
20 20
 	$args["op"] = @$args_str[0];
21 21
 }
22 22
 
23
-$article_id = intval( empty($_GET["article"]) ? ( empty($_POST["article"]) ? @$args["article"] : $_POST["article"] ) : $_GET["article"] );
23
+$article_id = intval(empty($_GET["article"]) ? (empty($_POST["article"]) ? @$args["article"] : $_POST["article"]) : $_GET["article"]);
24 24
 
25
-$op = empty($_GET["op"]) ? ( empty($_POST["op"])? @$args["op"] : $_POST["op"] ) : $_GET["op"];
25
+$op = empty($_GET["op"]) ? (empty($_POST["op"]) ? @$args["op"] : $_POST["op"]) : $_GET["op"];
26 26
 $op = strtolower(trim($op));
27 27
 
28
-if ( empty($article_id) )  {
29
-	if(empty($_SERVER['HTTP_REFERER'])){
28
+if (empty($article_id)) {
29
+	if (empty($_SERVER['HTTP_REFERER'])) {
30 30
 		include XOOPS_ROOT_PATH."/header.php";
31 31
 		xoops_error(_NOPERM);
32 32
 		$xoopsOption['output_type'] = "plain";
33 33
 		include XOOPS_ROOT_PATH."/footer.php";
34 34
 		exit();
35
-	}else{
35
+	}else {
36 36
 		$ref_parser = parse_url($_SERVER['HTTP_REFERER']);
37 37
 		$uri_parser = parse_url($_SERVER['REQUEST_URI']);
38
-		if(
38
+		if (
39 39
 			(!empty($ref_parser['host']) && !empty($uri_parser['host']) && $uri_parser['host'] != $ref_parser['host']) 
40 40
 			|| 
41 41
 			($ref_parser["path"] != $uri_parser["path"])
42
-		){
42
+		) {
43 43
 			include XOOPS_ROOT_PATH."/header.php";
44 44
 			include XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/include/vars.php";
45
-			xoops_confirm(array(), "javascript: window.close();", sprintf(planet_constant("MD_TRANSFER_DONE"),""), _CLOSE, $_SERVER['HTTP_REFERER']);
45
+			xoops_confirm(array(), "javascript: window.close();", sprintf(planet_constant("MD_TRANSFER_DONE"), ""), _CLOSE, $_SERVER['HTTP_REFERER']);
46 46
 			$xoopsOption['output_type'] = "plain";
47 47
 			include XOOPS_ROOT_PATH."/footer.php";
48 48
 			exit();
49
-		}else{
49
+		}else {
50 50
 			include XOOPS_ROOT_PATH."/header.php";
51 51
 			xoops_error(_NOPERM);
52 52
 			$xoopsOption['output_type'] = "plain";
@@ -56,15 +56,15 @@  discard block
 block discarded – undo
56 56
 	}
57 57
 }
58 58
 
59
-$article_handler =& xoops_getmodulehandler("article", $GLOBALS["moddirname"]);
60
-$article_obj =& $article_handler->get($article_id);
59
+$article_handler = & xoops_getmodulehandler("article", $GLOBALS["moddirname"]);
60
+$article_obj = & $article_handler->get($article_id);
61 61
 
62 62
 // Display option form
63
-if(empty($op)){
64
-	$module_variables .=  "<input type=\"hidden\" name=\"article\" id=\"article\" value=\"{$article_id}\">";
63
+if (empty($op)) {
64
+	$module_variables .= "<input type=\"hidden\" name=\"article\" id=\"article\" value=\"{$article_id}\">";
65 65
 	include XOOPS_ROOT_PATH."/Frameworks/transfer/option.transfer.php";
66 66
 	exit();
67
-}else{
67
+}else {
68 68
 	$data = array();
69 69
     $data["id"] = $article_id;
70 70
 	$data["title"] = $article_obj->getVar("art_title");
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 	$data["url"] = XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/view.article.php".URL_DELIMITER."".$article_obj->getVar("art_id");
75 75
 	$data["author"] = $article_obj->getVar("art_author");
76 76
 	
77
-	switch($op){
77
+	switch ($op) {
78 78
 		
79 79
 		// Use title
80 80
 		case "bookmark";	
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 		
83 83
 		case "print":
84 84
 		case "pdf":
85
-			${"{$op}_data"} =& $data;
85
+			${"{$op}_data"} = & $data;
86 86
 			${"{$op}_data"}["date"] = $pdf_data["time"];
87 87
 			${"{$op}_data"}["content"] = $article_obj->getVar("art_content");
88 88
 			break;
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 		$xoopsOption['output_type'] = "plain";
33 33
 		include XOOPS_ROOT_PATH."/footer.php";
34 34
 		exit();
35
-	}else{
35
+	} else{
36 36
 		$ref_parser = parse_url($_SERVER['HTTP_REFERER']);
37 37
 		$uri_parser = parse_url($_SERVER['REQUEST_URI']);
38 38
 		if(
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 			$xoopsOption['output_type'] = "plain";
47 47
 			include XOOPS_ROOT_PATH."/footer.php";
48 48
 			exit();
49
-		}else{
49
+		} else{
50 50
 			include XOOPS_ROOT_PATH."/header.php";
51 51
 			xoops_error(_NOPERM);
52 52
 			$xoopsOption['output_type'] = "plain";
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	$module_variables .=  "<input type=\"hidden\" name=\"article\" id=\"article\" value=\"{$article_id}\">";
65 65
 	include XOOPS_ROOT_PATH."/Frameworks/transfer/option.transfer.php";
66 66
 	exit();
67
-}else{
67
+} else{
68 68
 	$data = array();
69 69
     $data["id"] = $article_id;
70 70
 	$data["title"] = $article_obj->getVar("art_title");
Please login to merge, or discard this patch.