Passed
Branch master (2ecc51)
by Michael
03:51
created
blocks/efqdiralpha1_menu.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -40,16 +40,16 @@  discard block
 block discarded – undo
40 40
  
41 41
 function b_efqdiralpha1_menu_show($options) {
42 42
 	global $xoopsDB, $xoopsModule, $eh;
43
-	$info =  dirname(__FILE__);
44
-	$split = split("[\]",$info);
43
+	$info = dirname(__FILE__);
44
+	$split = split("[\]", $info);
45 45
 	$count = count($split) - 2;
46 46
 	$moddir = $split[$count];
47 47
 	$block = array();
48 48
 	$block['lang_dirmenu'] = _MB_EFQDIR_MENU;
49 49
 	$block['moddir'] = $moddir;
50
-	$myts =& MyTextSanitizer::getInstance();
50
+	$myts = & MyTextSanitizer::getInstance();
51 51
 	$result = $xoopsDB->query("SELECT dirid, name, descr FROM ".$xoopsDB->prefix("efqdiralpha1_dir")." WHERE open='1' ORDER BY name") or $eh->show("0013");
52
-	while($myrow = $xoopsDB->fetchArray($result)){
52
+	while ($myrow = $xoopsDB->fetchArray($result)) {
53 53
 		$directory = array();
54 54
 		$name = $myts->makeTboxData4Show($myrow["name"]);
55 55
 		$directory['dirid'] = $myrow['dirid'];
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
 function b_efqdiralpha1_menu_edit($options) {
65 65
 	$form = ""._MB_EFQDIR_DISP." ";
66 66
 	$form .= "<input type='hidden' name='options[]' value='";
67
-	if($options[0] == "date"){
67
+	if ($options[0] == "date") {
68 68
 		$form .= "date'";
69
-	}else {
69
+	} else {
70 70
 		$form .= "hits'";
71 71
 	}
72 72
 	$form .= " />";
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
 	$form .= "<input type='hidden' name='options[]' value='";
67 67
 	if($options[0] == "date"){
68 68
 		$form .= "date'";
69
-	}else {
69
+	} else {
70 70
 		$form .= "hits'";
71 71
 	}
72 72
 	$form .= " />";
Please login to merge, or discard this patch.
blocks/efqdir_menu.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -43,19 +43,19 @@  discard block
 block discarded – undo
43 43
 	if (isset($xoopsModule)) {
44 44
 		$moddir = $xoopsModule->getvar("dirname");
45 45
 	} else {
46
-		$info =  dirname(__FILE__);
47
-		$split = split("[\]",$info);
46
+		$info = dirname(__FILE__);
47
+		$split = split("[\]", $info);
48 48
 		$count = count($split) - 2;
49 49
 		$moddir = $split[$count];
50 50
 	}
51 51
 	$block = array();
52 52
 	$block['lang_dirmenu'] = _MB_EFQDIR_MENU;
53 53
 	$block['moddir'] = $moddir;
54
-	$myts =& MyTextSanitizer::getInstance();
54
+	$myts = & MyTextSanitizer::getInstance();
55 55
 	$result = $xoopsDB->query("SELECT dirid, name, descr FROM ".$xoopsDB->prefix("efqdiralpha1_dir")." WHERE open='1' ORDER BY name") or $eh->show("0013");
56 56
 	echo "test";
57 57
 	print_r($result);
58
-	while($myrow = $xoopsDB->fetchArray($result)){
58
+	while ($myrow = $xoopsDB->fetchArray($result)) {
59 59
 		$directory = array();
60 60
 		$name = $myts->makeTboxData4Show($myrow["name"]);
61 61
 		$directory['dirid'] = $myrow['dirid'];
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
 function b_efqdiralpha1_menu_edit($options) {
71 71
 	$form = ""._MB_EFQDIR_DISP."&nbsp;";
72 72
 	$form .= "<input type='hidden' name='options[]' value='";
73
-	if($options[0] == "date"){
73
+	if ($options[0] == "date") {
74 74
 		$form .= "date'";
75
-	}else {
75
+	} else {
76 76
 		$form .= "hits'";
77 77
 	}
78 78
 	$form .= " />";
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@
 block discarded – undo
72 72
 	$form .= "<input type='hidden' name='options[]' value='";
73 73
 	if($options[0] == "date"){
74 74
 		$form .= "date'";
75
-	}else {
75
+	} else {
76 76
 		$form .= "hits'";
77 77
 	}
78 78
 	$form .= " />";
Please login to merge, or discard this patch.
include/couponform.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,8 +64,8 @@
 block discarded – undo
64 64
 $button_tray->addElement(new XoopsFormButton('', 'submit', _MD_SUBMIT, 'submit'));
65 65
 
66 66
 if ($couponid) {
67
-    $button_tray->addElement(new XoopsFormButton('', 'delete', _MD_DELETE, 'submit'));
68
-    $coupform->addElement(new XoopsFormHidden('couponid', $couponid));
67
+	$button_tray->addElement(new XoopsFormButton('', 'delete', _MD_DELETE, 'submit'));
68
+	$coupform->addElement(new XoopsFormHidden('couponid', $couponid));
69 69
 }
70 70
 $coupform->addElement($button_tray);
71 71
 $coupform->display();
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -45,13 +45,13 @@
 block discarded – undo
45 45
 $coupform->addElement(new XoopsFormHidden('itemid', $itemid));
46 46
 $coupform->addElement(new XoopsFormText(_MD_COUPONHEADER, 'heading', 25, 30, $heading), true);
47 47
 $coupform->addElement(new XoopsFormDhtmlTextArea(_MD_DESCRIPTIONC, 'description', $description));
48
-$image_option=new XoopsFormSelect(_MD_COUPONIMGMGR."<br />"._MD_COUPONIMG."<br />", 'image', $image);
48
+$image_option = new XoopsFormSelect(_MD_COUPONIMGMGR."<br />"._MD_COUPONIMG."<br />", 'image', $image);
49 49
 $image_option->addOptionArray($linkimg_array);
50
-$imgtray = new XoopsFormElementTray(_MD_COUPSEL,'<br />');
50
+$imgtray = new XoopsFormElementTray(_MD_COUPSEL, '<br />');
51 51
 
52
-$image_option->setExtra("onchange='showImgSelected(\"imagex\", \"image\", \"" . $uploaddirectory . "\", \"\", \"" . XOOPS_URL . "\")'" );
53
-$imgtray->addElement($image_option,false);
54
-$imgtray -> addElement( new XoopsFormLabel( '', "<br /><img src='". $uploaddirectory . "/" . $image . "' name='imagex' id='imagex' alt='' />" ) );
52
+$image_option->setExtra("onchange='showImgSelected(\"imagex\", \"image\", \"".$uploaddirectory."\", \"\", \"".XOOPS_URL."\")'");
53
+$imgtray->addElement($image_option, false);
54
+$imgtray -> addElement(new XoopsFormLabel('', "<br /><img src='".$uploaddirectory."/".$image."' name='imagex' id='imagex' alt='' />"));
55 55
 $coupform->addElement($imgtray);
56 56
 $coupform->addelement(new XoopsFormRadioYN(_MD_CONVERTLBR, 'lbr', $lbr));
57 57
 $coupform->addElement(new XoopsFormDateTime(_MD_PUBLISHCOUPON, 'publish', 25, $publish));
Please login to merge, or discard this patch.
include/functions.php 4 patches
Indentation   +211 added lines, -211 removed lines patch added patch discarded remove patch
@@ -61,27 +61,27 @@  discard block
 block discarded – undo
61 61
 }
62 62
 
63 63
 function convertorderbytrans($orderby) {
64
-            $orderbyTrans = "";
64
+			$orderbyTrans = "";
65 65
 			if ($orderby == "hits ASC")    $orderbyTrans = ""._MD_POPULARITYLTOM."";
66
-            if ($orderby == "hits DESC")   $orderbyTrans = ""._MD_POPULARITYMTOL."";
67
-            if ($orderby == "title ASC")   $orderbyTrans = ""._MD_TITLEATOZ."";
68
-           	if ($orderby == "title DESC")  $orderbyTrans = ""._MD_TITLEZTOA."";
69
-            if ($orderby == "date ASC")    $orderbyTrans = ""._MD_DATEOLD."";
70
-            if ($orderby == "date DESC")   $orderbyTrans = ""._MD_DATENEW."";
71
-            if ($orderby == "rating ASC")  $orderbyTrans = ""._MD_RATINGLTOH."";
72
-            if ($orderby == "rating DESC") $orderbyTrans = ""._MD_RATINGHTOL."";
73
-            return $orderbyTrans;
66
+			if ($orderby == "hits DESC")   $orderbyTrans = ""._MD_POPULARITYMTOL."";
67
+			if ($orderby == "title ASC")   $orderbyTrans = ""._MD_TITLEATOZ."";
68
+		   	if ($orderby == "title DESC")  $orderbyTrans = ""._MD_TITLEZTOA."";
69
+			if ($orderby == "date ASC")    $orderbyTrans = ""._MD_DATEOLD."";
70
+			if ($orderby == "date DESC")   $orderbyTrans = ""._MD_DATENEW."";
71
+			if ($orderby == "rating ASC")  $orderbyTrans = ""._MD_RATINGLTOH."";
72
+			if ($orderby == "rating DESC") $orderbyTrans = ""._MD_RATINGHTOL."";
73
+			return $orderbyTrans;
74 74
 }
75 75
 function convertorderbyout($orderby) {
76
-            if ($orderby == "title ASC")            $orderby = "titleA";
77
-            if ($orderby == "date ASC")            $orderby = "dateA";
78
-            if ($orderby == "hits ASC")          $orderby = "hitsA";
79
-            if ($orderby == "rating ASC")        $orderby = "ratingA";
80
-            if ($orderby == "title DESC")              $orderby = "titleD";
81
-            if ($orderby == "date DESC")            $orderby = "dateD";
82
-            if ($orderby == "hits DESC")          $orderby = "hitsD";
83
-            if ($orderby == "rating DESC")        $orderby = "ratingD";
84
-            return $orderby;
76
+			if ($orderby == "title ASC")            $orderby = "titleA";
77
+			if ($orderby == "date ASC")            $orderby = "dateA";
78
+			if ($orderby == "hits ASC")          $orderby = "hitsA";
79
+			if ($orderby == "rating ASC")        $orderby = "ratingA";
80
+			if ($orderby == "title DESC")              $orderby = "titleD";
81
+			if ($orderby == "date DESC")            $orderby = "dateD";
82
+			if ($orderby == "hits DESC")          $orderby = "hitsD";
83
+			if ($orderby == "rating DESC")        $orderby = "ratingD";
84
+			return $orderby;
85 85
 }
86 86
 
87 87
 function newlinkgraphic($time, $status) {
@@ -106,82 +106,82 @@  discard block
 block discarded – undo
106 106
 	return '';
107 107
 }
108 108
 function getTotalItems($sel_id, $status=0){
109
-        global $xoopsDB, $mytree;
110
-	    $count = 0;
111
-        $arr = array();
112
-        $query = "SELECT DISTINCT l.itemid FROM ".$xoopsDB->prefix("efqdiralpha1_items")." l, ".$xoopsDB->prefix("efqdiralpha1_item_x_cat")." x WHERE x.itemid=l.itemid AND x.cid=".$sel_id."";
109
+		global $xoopsDB, $mytree;
110
+		$count = 0;
111
+		$arr = array();
112
+		$query = "SELECT DISTINCT l.itemid FROM ".$xoopsDB->prefix("efqdiralpha1_items")." l, ".$xoopsDB->prefix("efqdiralpha1_item_x_cat")." x WHERE x.itemid=l.itemid AND x.cid=".$sel_id."";
113 113
 		if($status != ""){
114
-        	$query .= " AND l.status>='$status'";
115
-        } else {
114
+			$query .= " AND l.status>='$status'";
115
+		} else {
116 116
 			$query .= "";
117 117
 		}
118 118
 		$query .= " AND x.active >= '1'";
119
-        $result = $xoopsDB->query($query);
119
+		$result = $xoopsDB->query($query);
120 120
 		//print_r($xoopsDB->fetchArray($result));
121 121
 		if (!$result) {
122
-        	$count = 0;
123
-        } else {
122
+			$count = 0;
123
+		} else {
124 124
 			$num_results = mysql_num_rows($result);
125 125
 			$count = $num_results;
126 126
 		}
127
-        $arr = $mytree->getAllChildId($sel_id);
128
-	    $size = count($arr);
129
-    	for($i=0;$i<$size;$i++){
127
+		$arr = $mytree->getAllChildId($sel_id);
128
+		$size = count($arr);
129
+		for($i=0;$i<$size;$i++){
130 130
 				$query2 = "SELECT DISTINCT l.itemid FROM ".$xoopsDB->prefix("efqdiralpha1_items")." l, ".$xoopsDB->prefix("efqdiralpha1_item_x_cat")." x WHERE l.itemid=x.itemid AND x.cid=".$arr[$i]."";
131 131
 				if($status != ""){
132
-			       	$query2 .= " AND l.status>='$status'";
133
-			    } else {
132
+				   	$query2 .= " AND l.status>='$status'";
133
+				} else {
134 134
 					$query2 .= "";
135 135
 				}
136 136
 				$query2 .= " AND x.active >= '1'";
137
-                $result2 = $xoopsDB->query($query2);
137
+				$result2 = $xoopsDB->query($query2);
138 138
 				$num_results2 = mysql_num_rows($result2);
139
-                $count += $num_results2;
140
-        }
141
-        return $count;
139
+				$count += $num_results2;
140
+		}
141
+		return $count;
142 142
 }
143 143
 function getTotalItems2($sel_id, $status="", $locdestid){
144
-        global $xoopsDB, $mytree;
145
-        $count = 0;
146
-        $arr = array();
147
-        $query = "select count(*) from ".$xoopsDB->prefix("links_links")." t, ".$xoopsDB->prefix("links_x_loc_dest")." x  where x.ldestid=t.lid AND x.locdestid=".$locdestid." AND t.cid=".$sel_id."";
144
+		global $xoopsDB, $mytree;
145
+		$count = 0;
146
+		$arr = array();
147
+		$query = "select count(*) from ".$xoopsDB->prefix("links_links")." t, ".$xoopsDB->prefix("links_x_loc_dest")." x  where x.ldestid=t.lid AND x.locdestid=".$locdestid." AND t.cid=".$sel_id."";
148 148
 //		$query = "select DISTINCT count(lid) from ".$xoopsDB->prefix("links_links")." t, ".$xoopsDB->prefix("links_x_loc_dest")." x  where x.ldestid=t.lid AND x.locdestid=".$locdestid." AND t.cid=".$sel_id."";
149 149
 //		$query = "select count(*) from ".$xoopsDB->prefix("links_links")." where cid=".$sel_id."";
150
-        if($status!=""){
151
-                $query .= " and status>=$status";
152
-        }
153
-        $result = $xoopsDB->query($query);
154
-        list($thing) = $xoopsDB->fetchRow($result);
155
-        $count = $thing;
156
-        $arr = $mytree->getAllChildId($sel_id);
157
-        $size = count($arr);
158
-        for($i=0;$i<$size;$i++){
159
-                $query2 = "select count(*) ".$xoopsDB->prefix("links_links")." t, ".$xoopsDB->prefix("links_x_loc_dest")." x  where x.ldestid=t.lid AND x.locdestid=".$locdestid." AND t.cid=".$arr[$i]."";
160
-                if($status!=""){
161
-                        $query2 .= " and status>=$status";
162
-                }
163
-                $result2 = $xoopsDB->query($query2);
164
-                list($thing) = $xoopsDB->fetchRow($result2);
165
-                $count += $thing;
166
-        }
167
-        return $count;
150
+		if($status!=""){
151
+				$query .= " and status>=$status";
152
+		}
153
+		$result = $xoopsDB->query($query);
154
+		list($thing) = $xoopsDB->fetchRow($result);
155
+		$count = $thing;
156
+		$arr = $mytree->getAllChildId($sel_id);
157
+		$size = count($arr);
158
+		for($i=0;$i<$size;$i++){
159
+				$query2 = "select count(*) ".$xoopsDB->prefix("links_links")." t, ".$xoopsDB->prefix("links_x_loc_dest")." x  where x.ldestid=t.lid AND x.locdestid=".$locdestid." AND t.cid=".$arr[$i]."";
160
+				if($status!=""){
161
+						$query2 .= " and status>=$status";
162
+				}
163
+				$result2 = $xoopsDB->query($query2);
164
+				list($thing) = $xoopsDB->fetchRow($result2);
165
+				$count += $thing;
166
+		}
167
+		return $count;
168 168
 }
169 169
 
170 170
 function getDirNameFromId($dirid=0)
171 171
 {
172 172
 	global $xoopsDB;
173 173
 	$myts =& MyTextSanitizer::getInstance();
174
-    $result = $xoopsDB->query("SELECT name FROM ".$xoopsDB->prefix("efqdiralpha1_dir")." WHERE dirid = '".$dirid."'");
175
-    $num_results = mysql_num_rows($result);
176
-    if (!$result) {
177
-        return 0;
178
-        }
179
-    for ($i=0; $i <$num_results; $i++)
180
-    {
181
-        $row = mysql_fetch_array($result);
182
-        $dirname = $row['name'];
183
-    }
184
-    return $dirname;
174
+	$result = $xoopsDB->query("SELECT name FROM ".$xoopsDB->prefix("efqdiralpha1_dir")." WHERE dirid = '".$dirid."'");
175
+	$num_results = mysql_num_rows($result);
176
+	if (!$result) {
177
+		return 0;
178
+		}
179
+	for ($i=0; $i <$num_results; $i++)
180
+	{
181
+		$row = mysql_fetch_array($result);
182
+		$dirname = $row['name'];
183
+	}
184
+	return $dirname;
185 185
 }
186 186
 
187 187
 function getCatTitleFromId($cid=0)
@@ -189,17 +189,17 @@  discard block
 block discarded – undo
189 189
 	global $xoopsDB;
190 190
 	//$block = array();
191 191
 	$myts =& MyTextSanitizer::getInstance();
192
-    $result = $xoopsDB->query("SELECT title FROM ".$xoopsDB->prefix("efqdiralpha1_cat")." WHERE cid = '".$cid."'");
193
-    $num_results = mysql_num_rows($result);
194
-    if (!$result) {
195
-        return 0;
196
-        }
197
-    for ($i=0; $i <$num_results; $i++)
198
-    {
199
-        $row = mysql_fetch_array($result);
200
-        $cattitle = $row['title'];
201
-    }
202
-    return $cattitle;
192
+	$result = $xoopsDB->query("SELECT title FROM ".$xoopsDB->prefix("efqdiralpha1_cat")." WHERE cid = '".$cid."'");
193
+	$num_results = mysql_num_rows($result);
194
+	if (!$result) {
195
+		return 0;
196
+		}
197
+	for ($i=0; $i <$num_results; $i++)
198
+	{
199
+		$row = mysql_fetch_array($result);
200
+		$cattitle = $row['title'];
201
+	}
202
+	return $cattitle;
203 203
 }
204 204
 
205 205
 function getCategoriesPaths($get_itemid)
@@ -211,44 +211,44 @@  discard block
 block discarded – undo
211 211
 		$isadmin = false;
212 212
 	}
213 213
 	$result = $xoopsDB->query("SELECT xid, cid, itemid FROM ".$xoopsDB->prefix("efqdiralpha1_item_x_cat")." WHERE itemid = ".$get_itemid." AND active='1'");
214
-    $num_results = mysql_num_rows($result);
215
-    if (!$result) {
216
-        return 0;
217
-    }
218
-    $output = "";
214
+	$num_results = mysql_num_rows($result);
215
+	if (!$result) {
216
+		return 0;
217
+	}
218
+	$output = "";
219 219
 	for ($i=0; $i <$num_results; $i++)
220
-    {
221
-        $row = mysql_fetch_array($result);
222
-        $cid = $row['cid'];
220
+	{
221
+		$row = mysql_fetch_array($result);
222
+		$cid = $row['cid'];
223 223
 		$path = "";
224 224
 		$path .= $efqtree->getUnformattedPathFromId($cid, "title", $path);
225 225
 		$path .= "<br />";
226 226
 		$output .= $path;
227
-    }
227
+	}
228 228
 	if ($isadmin) {
229 229
 		$output .= "<br /><a href=\"admin/categories.php?dirid=".$get_dirid."\">"._MD_EDITCATEGORIES."</a>";
230 230
 	}
231 231
 	//$output .= "<br /><a href=\"editcategories.php?item=".$get_itemid."\">["._MD_EDIT_CATEGORIES."]</a>";
232
-    return $output;
232
+	return $output;
233 233
 }
234 234
 
235 235
 function adminmenu($currentoption=0,$breadcrumb)
236 236
 {
237
-    global $xoopsModule, $xoopsConfig;
238
-    $tblColors=Array();
239
-    $tblColors[0]=$tblColors[1]=$tblColors[2]=$tblColors[3]=$tblColors[4]=$tblColors[5]=$tblColors[6]=$tblColors[7] = '#DDE';
240
-    $tblColors[$currentoption] = 'white';
241
-    echo "<table width=100% class='outer'><tr><td align=right>
237
+	global $xoopsModule, $xoopsConfig;
238
+	$tblColors=Array();
239
+	$tblColors[0]=$tblColors[1]=$tblColors[2]=$tblColors[3]=$tblColors[4]=$tblColors[5]=$tblColors[6]=$tblColors[7] = '#DDE';
240
+	$tblColors[$currentoption] = 'white';
241
+	echo "<table width=100% class='outer'><tr><td align=right>
242 242
           <font size=2>".$xoopsModule->name().":".$breadcrumb."</font>
243 243
           </td></tr></table><br />";
244
-    echo "<div id=\"navcontainer\"><ul style=\"padding: 3px 0; margin-left:
244
+	echo "<div id=\"navcontainer\"><ul style=\"padding: 3px 0; margin-left:
245 245
          0;font: bold 12px Verdana, sans-serif; \">";
246
-    echo "<li style=\"list-style: none; margin: 0; display: inline; \">
246
+	echo "<li style=\"list-style: none; margin: 0; display: inline; \">
247 247
          <a href=\"index.php\" style=\"padding: 3px 0.5em;
248 248
          margin-left: 3px;
249 249
          border: 1px solid #778; background: ".$tblColors[0].";
250 250
          text-decoration: none; \">"._MD_A_MODADMIN_HOME ."</a></li>";
251
-    echo "<li style=\"list-style: none; margin: 0; display: inline; \">
251
+	echo "<li style=\"list-style: none; margin: 0; display: inline; \">
252 252
          <a href=\"directories.php\" style=\"padding: 3px 0.5em;
253 253
          margin-left: 3px;
254 254
          border: 1px solid #778; background: ".$tblColors[1].";
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
          margin-left: 3px;
259 259
          border: 1px solid #778; background: ".$tblColors[2].";
260 260
          text-decoration: none; \">"._MD_A_CATEGORIESADMIN."</a></li>";
261
-    echo "<li style=\"list-style: none; margin: 0; display: inline; \">
261
+	echo "<li style=\"list-style: none; margin: 0; display: inline; \">
262 262
          <a href=\"fieldtypes.php\" style=\"padding: 3px 0.5em;
263 263
          margin-left: 3px;
264 264
          border: 1px solid #778; background: ".$tblColors[3].";
@@ -274,69 +274,69 @@  discard block
 block discarded – undo
274 274
 function getTypeFromId($typeid='0') {
275 275
 	global $xoopsDB;
276 276
 	$myts =& MyTextSanitizer::getInstance();
277
-    $result = $xoopsDB->query("SELECT typename  FROM ".$xoopsDB->prefix("efqdiralpha1_itemtypes")." WHERE typeid = '".$typeid."'");
278
-    $num_results = $xoopsDB->getRowsNum($result);
279
-    $typename = "";
277
+	$result = $xoopsDB->query("SELECT typename  FROM ".$xoopsDB->prefix("efqdiralpha1_itemtypes")." WHERE typeid = '".$typeid."'");
278
+	$num_results = $xoopsDB->getRowsNum($result);
279
+	$typename = "";
280 280
 	if (!$result) {
281
-        return 0;
282
-    }
283
-    for ($i=0; $i <$num_results; $i++)
284
-    {
285
-        $row = mysql_fetch_array($result);
286
-        $typename = $row['typename'];
287
-    }
288
-    return $typename;
281
+		return 0;
282
+	}
283
+	for ($i=0; $i <$num_results; $i++)
284
+	{
285
+		$row = mysql_fetch_array($result);
286
+		$typename = $row['typename'];
287
+	}
288
+	return $typename;
289 289
 }
290 290
 
291 291
 function getDirId($catid='0') {
292 292
 	global $xoopsDB;
293 293
 	$myts =& MyTextSanitizer::getInstance();
294
-    $result = $xoopsDB->query("SELECT dirid  FROM ".$xoopsDB->prefix("efqdiralpha1_cat")." WHERE cid = '".$catid."'");
295
-    $num_results = $xoopsDB->getRowsNum($result);
296
-    $dirid = 0;
294
+	$result = $xoopsDB->query("SELECT dirid  FROM ".$xoopsDB->prefix("efqdiralpha1_cat")." WHERE cid = '".$catid."'");
295
+	$num_results = $xoopsDB->getRowsNum($result);
296
+	$dirid = 0;
297 297
 	if (!$result) {
298
-        return 0;
299
-    }
300
-    for ($i=0; $i <$num_results; $i++)
301
-    {
302
-        $row = mysql_fetch_array($result);
303
-        $dirid = $row['dirid'];
304
-    }
305
-    return $dirid;
298
+		return 0;
299
+	}
300
+	for ($i=0; $i <$num_results; $i++)
301
+	{
302
+		$row = mysql_fetch_array($result);
303
+		$dirid = $row['dirid'];
304
+	}
305
+	return $dirid;
306 306
 }
307 307
 
308 308
 function checkDescription($catid='0') {
309 309
 	global $xoopsDB;
310 310
 	$myts =& MyTextSanitizer::getInstance();
311
-    $result = $xoopsDB->query("SELECT txtid FROM ".$xoopsDB->prefix("efqdiralpha1_cat_txt")." WHERE cid = '".$catid."'");
312
-    $num_results = $xoopsDB->getRowsNum($result);
313
-    $txtid = false;
311
+	$result = $xoopsDB->query("SELECT txtid FROM ".$xoopsDB->prefix("efqdiralpha1_cat_txt")." WHERE cid = '".$catid."'");
312
+	$num_results = $xoopsDB->getRowsNum($result);
313
+	$txtid = false;
314 314
 	if (!$result) {
315
-        return false;
316
-    }
317
-    for ($i=0; $i <$num_results; $i++)
318
-    {
319
-        $row = mysql_fetch_array($result);
320
-        $txtid = $row['txtid'];
321
-    }
322
-    return $txtid;
315
+		return false;
316
+	}
317
+	for ($i=0; $i <$num_results; $i++)
318
+	{
319
+		$row = mysql_fetch_array($result);
320
+		$txtid = $row['txtid'];
321
+	}
322
+	return $txtid;
323 323
 }
324 324
 
325 325
 function getTemplateFromCatid($get_catid='0') {
326 326
 	global $xoopsDB;
327 327
 	$myts =& MyTextSanitizer::getInstance();
328
-    $result = $xoopsDB->query("SELECT c.tplid, t.name  FROM ".$xoopsDB->prefix("efqdiralpha1_cat_tpl")." c, ".$xoopsDB->prefix("efqdiralpha1_tpl")." t WHERE c.tplid=t.tplid AND c.catid = '".$get_catid."'");
329
-    $num_results = $xoopsDB->getRowsNum($result);
330
-    $tplname = "";
328
+	$result = $xoopsDB->query("SELECT c.tplid, t.name  FROM ".$xoopsDB->prefix("efqdiralpha1_cat_tpl")." c, ".$xoopsDB->prefix("efqdiralpha1_tpl")." t WHERE c.tplid=t.tplid AND c.catid = '".$get_catid."'");
329
+	$num_results = $xoopsDB->getRowsNum($result);
330
+	$tplname = "";
331 331
 	if (!$result) {
332
-        return 0;
333
-        }
334
-    for ($i=0; $i <$num_results; $i++)
335
-    {
336
-        $row = mysql_fetch_array($result);
337
-        $tplname = $row['name'];
338
-    }
339
-    return $tplname;
332
+		return 0;
333
+		}
334
+	for ($i=0; $i <$num_results; $i++)
335
+	{
336
+		$row = mysql_fetch_array($result);
337
+		$tplname = $row['name'];
338
+	}
339
+	return $tplname;
340 340
 }
341 341
 
342 342
 function getCatSelectArea($item='0', $dirid = '0')
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 	$sql = "SELECT c.cid, c.title, c.pid, c.allowlist, x.active FROM ".$xoopsDB->prefix("efqdiralpha1_cat")." c LEFT JOIN ".$xoopsDB->prefix("efqdiralpha1_item_x_cat")." x ON (c.cid=x.cid AND x.itemid=".$item.")  WHERE c.dirid='".$dirid."' AND c.pid='0' AND c.active='1'";
346 346
 	$mainresult = $xoopsDB->query($sql);
347 347
 	$numrows = $xoopsDB->getRowsNum($mainresult);
348
-    $output = "<table>";
348
+	$output = "<table>";
349 349
 	if ( $numrows > 0 ) {
350 350
 		$cats = "";
351 351
 		$output .= "<tr><td class=\"categoryHeader\" colspan=\"2\"><strong>"._MD_CATTITLE."</strong></td><td class=\"categoryHeader\"><strong>"._MD_SELECT."</strong></td></tr>\n";
@@ -409,108 +409,108 @@  discard block
 block discarded – undo
409 409
 function getDirIdFromItem($item = 0)
410 410
 {
411 411
 	global $xoopsDB;
412
-    $block = array();
412
+	$block = array();
413 413
 	$myts =& MyTextSanitizer::getInstance();
414 414
 	$dirid = 0;
415
-    $result = $xoopsDB->query("SELECT dirid FROM ".$xoopsDB->prefix("efqdiralpha1_items")." WHERE itemid = ".$item."");
416
-    $num_results = $xoopsDB->getRowsNum($result);
417
-    if (!$result) {
418
-        return 0;
419
-        }
420
-    for ($i=0; $i <$num_results; $i++)
421
-    {
422
-        $row = mysql_fetch_array($result);
423
-        $dirid = $row['dirid'];
424
-    }
425
-    return $dirid;
415
+	$result = $xoopsDB->query("SELECT dirid FROM ".$xoopsDB->prefix("efqdiralpha1_items")." WHERE itemid = ".$item."");
416
+	$num_results = $xoopsDB->getRowsNum($result);
417
+	if (!$result) {
418
+		return 0;
419
+		}
420
+	for ($i=0; $i <$num_results; $i++)
421
+	{
422
+		$row = mysql_fetch_array($result);
423
+		$dirid = $row['dirid'];
424
+	}
425
+	return $dirid;
426 426
 }
427 427
 function countOpenDirectories()
428 428
 {
429 429
 	global $xoopsDB;
430
-    $block = array();
430
+	$block = array();
431 431
 	$myts =& MyTextSanitizer::getInstance();
432 432
 	$dirid = 0;
433
-    $result = $xoopsDB->query("SELECT dirid FROM ".$xoopsDB->prefix("efqdiralpha1_dir")." WHERE open = '1'");
434
-    $num_results = $xoopsDB->getRowsNum($result);
435
-    if (!$result) {
436
-        return 0;
437
-    } else if ($num_results == 0) {
438
-    	return 0;
439
-    } else if ($num_results == 1) {
440
-    	$row = mysql_fetch_array($result);
441
-        $dirid = $row['dirid'];
442
-        return $dirid;
443
-    } else {
444
-    	return 0;
445
-    }
433
+	$result = $xoopsDB->query("SELECT dirid FROM ".$xoopsDB->prefix("efqdiralpha1_dir")." WHERE open = '1'");
434
+	$num_results = $xoopsDB->getRowsNum($result);
435
+	if (!$result) {
436
+		return 0;
437
+	} else if ($num_results == 0) {
438
+		return 0;
439
+	} else if ($num_results == 1) {
440
+		$row = mysql_fetch_array($result);
441
+		$dirid = $row['dirid'];
442
+		return $dirid;
443
+	} else {
444
+		return 0;
445
+	}
446 446
 }
447 447
 function getUserIdFromItem($item = 0)
448 448
 {
449 449
 	global $xoopsDB;
450
-    $block = array();
450
+	$block = array();
451 451
 	$myts =& MyTextSanitizer::getInstance();
452 452
 	$userid = 0;
453
-    $result = $xoopsDB->query("SELECT uid FROM ".$xoopsDB->prefix("efqdiralpha1_items")." WHERE itemid = ".$item."");
454
-    $num_results = $xoopsDB->getRowsNum($result);
455
-    if (!$result) {
456
-        return 0;
457
-        }
458
-    for ($i=0; $i <$num_results; $i++)
459
-    {
460
-        $row = mysql_fetch_array($result);
461
-        $userid = $row['uid'];
462
-    }
463
-    return $userid;
453
+	$result = $xoopsDB->query("SELECT uid FROM ".$xoopsDB->prefix("efqdiralpha1_items")." WHERE itemid = ".$item."");
454
+	$num_results = $xoopsDB->getRowsNum($result);
455
+	if (!$result) {
456
+		return 0;
457
+		}
458
+	for ($i=0; $i <$num_results; $i++)
459
+	{
460
+		$row = mysql_fetch_array($result);
461
+		$userid = $row['uid'];
462
+	}
463
+	return $userid;
464 464
 }
465 465
 //updates rating data in itemtable for a given item
466 466
 function updaterating($sel_id){
467
-        global $xoopsDB;
468
-        $query = "select rating FROM ".$xoopsDB->prefix("efqdiralpha1_votedata")." WHERE itemid = ".$sel_id."";
469
-        $voteresult = $xoopsDB->query($query);
470
-            $votesDB = $xoopsDB->getRowsNum($voteresult);
471
-        $totalrating = 0;
472
-            while(list($rating)=$xoopsDB->fetchRow($voteresult)){
473
-                $totalrating += $rating;
474
-        }
475
-        $finalrating = $totalrating/$votesDB;
476
-        $finalrating = number_format($finalrating, 4);
477
-        $query =  "UPDATE ".$xoopsDB->prefix("efqdiralpha1_items")." SET rating=$finalrating, votes=$votesDB WHERE itemid = $sel_id";
478
-        $xoopsDB->query($query) or exit();
467
+		global $xoopsDB;
468
+		$query = "select rating FROM ".$xoopsDB->prefix("efqdiralpha1_votedata")." WHERE itemid = ".$sel_id."";
469
+		$voteresult = $xoopsDB->query($query);
470
+			$votesDB = $xoopsDB->getRowsNum($voteresult);
471
+		$totalrating = 0;
472
+			while(list($rating)=$xoopsDB->fetchRow($voteresult)){
473
+				$totalrating += $rating;
474
+		}
475
+		$finalrating = $totalrating/$votesDB;
476
+		$finalrating = number_format($finalrating, 4);
477
+		$query =  "UPDATE ".$xoopsDB->prefix("efqdiralpha1_items")." SET rating=$finalrating, votes=$votesDB WHERE itemid = $sel_id";
478
+		$xoopsDB->query($query) or exit();
479 479
 }
480 480
 function getAddressFields($typeid='0')
481 481
 {
482 482
 	global $xoopsDB;
483
-    $block = array();
483
+	$block = array();
484 484
 	$myts =& MyTextSanitizer::getInstance();
485 485
 	$dirid = 0;
486 486
 	$addressarray = array();
487 487
 	if ($typeid == '0') {
488 488
 		$result = $xoopsDB->query("SELECT typeid, address, address2, zip, postcode, lat, lon, phone, fax, mobile, city, country, typename, uselocyn FROM ".$xoopsDB->prefix("efqdiralpha1_address_types")." WHERE defaultyn = '1'");
489
-    } else {
489
+	} else {
490 490
 		$result = $xoopsDB->query("SELECT typeid, address, address2, zip, postcode, lat, lon, phone, fax, mobile, city, country, typename, uselocyn FROM ".$xoopsDB->prefix("efqdiralpha1_address_types")." WHERE typeid = '$typeid'");
491 491
 	}	
492
-    $num_results = $xoopsDB->getRowsNum($result);
493
-    if (!$result) {
494
-        return 0;
495
-    }
496
-    while ( list($typeid, $address, $address2, $zip, $postcode, $lat, $lon, $phone, $fax, $mobile, $city, $country, $typename, $uselocyn) = $xoopsDB->fetchRow($result) ) {
492
+	$num_results = $xoopsDB->getRowsNum($result);
493
+	if (!$result) {
494
+		return 0;
495
+	}
496
+	while ( list($typeid, $address, $address2, $zip, $postcode, $lat, $lon, $phone, $fax, $mobile, $city, $country, $typename, $uselocyn) = $xoopsDB->fetchRow($result) ) {
497 497
 		$addressarray = array('typeid' => $typeid, 'typename' => $typename, 'uselocyn' => $uselocyn, 'addressfields' => array('address' => $address, 'address2' => $address2, 'zip' => $zip, 'postcode' => $postcode, 'lat' => $lat, 'lon' => $lon, 'phone' => $phone, 'fax' => $fax, 'mobile' => $mobile, 'city' => $city, 'country' => $country));
498
-    }
499
-    return $addressarray;
498
+	}
499
+	return $addressarray;
500 500
 }
501 501
 function getAddressValues($addrid = '0') {
502 502
 	global $xoopsDB;
503 503
 	$myts =& MyTextSanitizer::getInstance();
504 504
 	$addressarray = array();
505
-    $result = $xoopsDB->query("SELECT address, address2, zip, postcode, lat, lon, phone, fax, mobile, city, country FROM ".$xoopsDB->prefix("efqdiralpha1_addresses")." WHERE addrid = '$addrid'");
506
-    $num_results = $xoopsDB->getRowsNum($result);
507
-    if ($num_results == 0) {
508
-        $addressarray = array('address' => "", 'address2' => "", 'zip' => "", 'postcode' => "", 'lat' => "", 'lon' => "", 'phone' => "", 'fax' => "", 'mobile' => "", 'city' => "", 'country' => "");
505
+	$result = $xoopsDB->query("SELECT address, address2, zip, postcode, lat, lon, phone, fax, mobile, city, country FROM ".$xoopsDB->prefix("efqdiralpha1_addresses")." WHERE addrid = '$addrid'");
506
+	$num_results = $xoopsDB->getRowsNum($result);
507
+	if ($num_results == 0) {
508
+		$addressarray = array('address' => "", 'address2' => "", 'zip' => "", 'postcode' => "", 'lat' => "", 'lon' => "", 'phone' => "", 'fax' => "", 'mobile' => "", 'city' => "", 'country' => "");
509 509
 	}
510
-    while ( list($address, $address2, $zip, $postcode, $lat, $lon, $phone, $fax, $mobile, $city, $country) = $xoopsDB->fetchRow($result) ) {
510
+	while ( list($address, $address2, $zip, $postcode, $lat, $lon, $phone, $fax, $mobile, $city, $country) = $xoopsDB->fetchRow($result) ) {
511 511
 		$addressarray = array('address' => $address, 'address2' => $address2, 'zip' => $zip, 'postcode' => $postcode, 'lat' => $lat, 'lon' => $lon, 'phone' => $phone, 'fax' => $fax, 'mobile' => $mobile, 'city' => $city, 'country' => $country);
512
-    }
513
-    return $addressarray;
512
+	}
513
+	return $addressarray;
514 514
 }
515 515
 function getCatSelectArea2()
516 516
 {
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
 	$mainresult = $xoopsDB->query($sql);
525 525
 	$numrows = $xoopsDB->getRowsNum($mainresult);
526 526
 	$output= "";
527
-    if ( $numrows > 0 ) {
527
+	if ( $numrows > 0 ) {
528 528
 		$cats = "";
529 529
 		$output = "<table class=\"categoryTable\"><tr><td class=\"categoryHeader\" colspan=\"2\"><strong>"._MD_CATTITLE."</strong></td><td class=\"categoryHeader\"><strong>"._MD_SELECT."</strong></td></tr>\n";
530 530
 		$brench = 0;
Please login to merge, or discard this patch.
Switch Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -31,31 +31,31 @@
 block discarded – undo
31 31
 // ------------------------------------------------------------------------- //
32 32
 function convertorderbyin($orderby) {
33 33
 	switch (trim($orderby)) {
34
-	case "titleA":
35
-		$orderby = "title ASC";
36
-		break;
37
-	case "dateA":
38
-		$orderby = "created ASC";
39
-		break;
40
-	case "hitsA":
41
-		$orderby = "hits ASC";
42
-		break;
43
-	case "ratingA":
44
-		$orderby = "rating ASC";
45
-		break;
46
-	case "titleD":
47
-		$orderby = "title DESC";
48
-		break;
49
-	case "hitsD":
50
-		$orderby = "hits DESC";
51
-		break;
52
-	case "ratingD":
53
-		$orderby = "rating DESC";
54
-		break;
55
-	case"dateD":
56
-	default:
57
-		$orderby = "created DESC";
58
-		break;
34
+		case "titleA":
35
+			$orderby = "title ASC";
36
+			break;
37
+		case "dateA":
38
+			$orderby = "created ASC";
39
+			break;
40
+		case "hitsA":
41
+			$orderby = "hits ASC";
42
+			break;
43
+		case "ratingA":
44
+			$orderby = "rating ASC";
45
+			break;
46
+		case "titleD":
47
+			$orderby = "title DESC";
48
+			break;
49
+		case "hitsD":
50
+			$orderby = "hits DESC";
51
+			break;
52
+		case "ratingD":
53
+			$orderby = "rating DESC";
54
+			break;
55
+		case"dateD":
56
+		default:
57
+			$orderby = "created DESC";
58
+			break;
59 59
 	}
60 60
 	return $orderby;
61 61
 }
Please login to merge, or discard this patch.
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -88,11 +88,11 @@  discard block
 block discarded – undo
88 88
 	global $moddir;
89 89
 	$count = 7;
90 90
 	$new = '';
91
-	$startdate = (time()-(86400 * $count));
91
+	$startdate = (time() - (86400 * $count));
92 92
 	if ($startdate < $time) {
93
-		if($status==2){
93
+		if ($status == 2) {
94 94
 			$new = "&nbsp;<img src=\"".XOOPS_URL."/modules/$moddir/images/newred.gif\" alt=\""._MD_NEWTHISWEEK."\" />";
95
-		}elseif($status==3){
95
+		}elseif ($status == 3) {
96 96
 			$new = "&nbsp;<img src=\"".XOOPS_URL."/modules/$moddir/images/update.gif\" alt=\""._MD_UPTHISWEEK."\" />";
97 97
 		}
98 98
 	}
@@ -105,12 +105,12 @@  discard block
 block discarded – undo
105 105
 	}
106 106
 	return '';
107 107
 }
108
-function getTotalItems($sel_id, $status=0){
108
+function getTotalItems($sel_id, $status = 0) {
109 109
         global $xoopsDB, $mytree;
110 110
 	    $count = 0;
111 111
         $arr = array();
112 112
         $query = "SELECT DISTINCT l.itemid FROM ".$xoopsDB->prefix("efqdiralpha1_items")." l, ".$xoopsDB->prefix("efqdiralpha1_item_x_cat")." x WHERE x.itemid=l.itemid AND x.cid=".$sel_id."";
113
-		if($status != ""){
113
+		if ($status != "") {
114 114
         	$query .= " AND l.status>='$status'";
115 115
         } else {
116 116
 			$query .= "";
@@ -126,9 +126,9 @@  discard block
 block discarded – undo
126 126
 		}
127 127
         $arr = $mytree->getAllChildId($sel_id);
128 128
 	    $size = count($arr);
129
-    	for($i=0;$i<$size;$i++){
129
+    	for ($i = 0; $i < $size; $i++) {
130 130
 				$query2 = "SELECT DISTINCT l.itemid FROM ".$xoopsDB->prefix("efqdiralpha1_items")." l, ".$xoopsDB->prefix("efqdiralpha1_item_x_cat")." x WHERE l.itemid=x.itemid AND x.cid=".$arr[$i]."";
131
-				if($status != ""){
131
+				if ($status != "") {
132 132
 			       	$query2 .= " AND l.status>='$status'";
133 133
 			    } else {
134 134
 					$query2 .= "";
@@ -140,14 +140,14 @@  discard block
 block discarded – undo
140 140
         }
141 141
         return $count;
142 142
 }
143
-function getTotalItems2($sel_id, $status="", $locdestid){
143
+function getTotalItems2($sel_id, $status = "", $locdestid) {
144 144
         global $xoopsDB, $mytree;
145 145
         $count = 0;
146 146
         $arr = array();
147 147
         $query = "select count(*) from ".$xoopsDB->prefix("links_links")." t, ".$xoopsDB->prefix("links_x_loc_dest")." x  where x.ldestid=t.lid AND x.locdestid=".$locdestid." AND t.cid=".$sel_id."";
148 148
 //		$query = "select DISTINCT count(lid) from ".$xoopsDB->prefix("links_links")." t, ".$xoopsDB->prefix("links_x_loc_dest")." x  where x.ldestid=t.lid AND x.locdestid=".$locdestid." AND t.cid=".$sel_id."";
149 149
 //		$query = "select count(*) from ".$xoopsDB->prefix("links_links")." where cid=".$sel_id."";
150
-        if($status!=""){
150
+        if ($status != "") {
151 151
                 $query .= " and status>=$status";
152 152
         }
153 153
         $result = $xoopsDB->query($query);
@@ -155,9 +155,9 @@  discard block
 block discarded – undo
155 155
         $count = $thing;
156 156
         $arr = $mytree->getAllChildId($sel_id);
157 157
         $size = count($arr);
158
-        for($i=0;$i<$size;$i++){
158
+        for ($i = 0; $i < $size; $i++) {
159 159
                 $query2 = "select count(*) ".$xoopsDB->prefix("links_links")." t, ".$xoopsDB->prefix("links_x_loc_dest")." x  where x.ldestid=t.lid AND x.locdestid=".$locdestid." AND t.cid=".$arr[$i]."";
160
-                if($status!=""){
160
+                if ($status != "") {
161 161
                         $query2 .= " and status>=$status";
162 162
                 }
163 163
                 $result2 = $xoopsDB->query($query2);
@@ -167,16 +167,16 @@  discard block
 block discarded – undo
167 167
         return $count;
168 168
 }
169 169
 
170
-function getDirNameFromId($dirid=0)
170
+function getDirNameFromId($dirid = 0)
171 171
 {
172 172
 	global $xoopsDB;
173
-	$myts =& MyTextSanitizer::getInstance();
173
+	$myts = & MyTextSanitizer::getInstance();
174 174
     $result = $xoopsDB->query("SELECT name FROM ".$xoopsDB->prefix("efqdiralpha1_dir")." WHERE dirid = '".$dirid."'");
175 175
     $num_results = mysql_num_rows($result);
176 176
     if (!$result) {
177 177
         return 0;
178 178
         }
179
-    for ($i=0; $i <$num_results; $i++)
179
+    for ($i = 0; $i < $num_results; $i++)
180 180
     {
181 181
         $row = mysql_fetch_array($result);
182 182
         $dirname = $row['name'];
@@ -184,17 +184,17 @@  discard block
 block discarded – undo
184 184
     return $dirname;
185 185
 }
186 186
 
187
-function getCatTitleFromId($cid=0)
187
+function getCatTitleFromId($cid = 0)
188 188
 {
189 189
 	global $xoopsDB;
190 190
 	//$block = array();
191
-	$myts =& MyTextSanitizer::getInstance();
191
+	$myts = & MyTextSanitizer::getInstance();
192 192
     $result = $xoopsDB->query("SELECT title FROM ".$xoopsDB->prefix("efqdiralpha1_cat")." WHERE cid = '".$cid."'");
193 193
     $num_results = mysql_num_rows($result);
194 194
     if (!$result) {
195 195
         return 0;
196 196
         }
197
-    for ($i=0; $i <$num_results; $i++)
197
+    for ($i = 0; $i < $num_results; $i++)
198 198
     {
199 199
         $row = mysql_fetch_array($result);
200 200
         $cattitle = $row['title'];
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
         return 0;
217 217
     }
218 218
     $output = "";
219
-	for ($i=0; $i <$num_results; $i++)
219
+	for ($i = 0; $i < $num_results; $i++)
220 220
     {
221 221
         $row = mysql_fetch_array($result);
222 222
         $cid = $row['cid'];
@@ -232,11 +232,11 @@  discard block
 block discarded – undo
232 232
     return $output;
233 233
 }
234 234
 
235
-function adminmenu($currentoption=0,$breadcrumb)
235
+function adminmenu($currentoption = 0, $breadcrumb)
236 236
 {
237 237
     global $xoopsModule, $xoopsConfig;
238
-    $tblColors=Array();
239
-    $tblColors[0]=$tblColors[1]=$tblColors[2]=$tblColors[3]=$tblColors[4]=$tblColors[5]=$tblColors[6]=$tblColors[7] = '#DDE';
238
+    $tblColors = Array();
239
+    $tblColors[0] = $tblColors[1] = $tblColors[2] = $tblColors[3] = $tblColors[4] = $tblColors[5] = $tblColors[6] = $tblColors[7] = '#DDE';
240 240
     $tblColors[$currentoption] = 'white';
241 241
     echo "<table width=100% class='outer'><tr><td align=right>
242 242
           <font size=2>".$xoopsModule->name().":".$breadcrumb."</font>
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
          <a href=\"index.php\" style=\"padding: 3px 0.5em;
248 248
          margin-left: 3px;
249 249
          border: 1px solid #778; background: ".$tblColors[0].";
250
-         text-decoration: none; \">"._MD_A_MODADMIN_HOME ."</a></li>";
250
+         text-decoration: none; \">"._MD_A_MODADMIN_HOME."</a></li>";
251 251
     echo "<li style=\"list-style: none; margin: 0; display: inline; \">
252 252
          <a href=\"directories.php\" style=\"padding: 3px 0.5em;
253 253
          margin-left: 3px;
@@ -271,16 +271,16 @@  discard block
 block discarded – undo
271 271
 	 echo "</div></ul>";
272 272
 } 
273 273
 
274
-function getTypeFromId($typeid='0') {
274
+function getTypeFromId($typeid = '0') {
275 275
 	global $xoopsDB;
276
-	$myts =& MyTextSanitizer::getInstance();
276
+	$myts = & MyTextSanitizer::getInstance();
277 277
     $result = $xoopsDB->query("SELECT typename  FROM ".$xoopsDB->prefix("efqdiralpha1_itemtypes")." WHERE typeid = '".$typeid."'");
278 278
     $num_results = $xoopsDB->getRowsNum($result);
279 279
     $typename = "";
280 280
 	if (!$result) {
281 281
         return 0;
282 282
     }
283
-    for ($i=0; $i <$num_results; $i++)
283
+    for ($i = 0; $i < $num_results; $i++)
284 284
     {
285 285
         $row = mysql_fetch_array($result);
286 286
         $typename = $row['typename'];
@@ -288,16 +288,16 @@  discard block
 block discarded – undo
288 288
     return $typename;
289 289
 }
290 290
 
291
-function getDirId($catid='0') {
291
+function getDirId($catid = '0') {
292 292
 	global $xoopsDB;
293
-	$myts =& MyTextSanitizer::getInstance();
293
+	$myts = & MyTextSanitizer::getInstance();
294 294
     $result = $xoopsDB->query("SELECT dirid  FROM ".$xoopsDB->prefix("efqdiralpha1_cat")." WHERE cid = '".$catid."'");
295 295
     $num_results = $xoopsDB->getRowsNum($result);
296 296
     $dirid = 0;
297 297
 	if (!$result) {
298 298
         return 0;
299 299
     }
300
-    for ($i=0; $i <$num_results; $i++)
300
+    for ($i = 0; $i < $num_results; $i++)
301 301
     {
302 302
         $row = mysql_fetch_array($result);
303 303
         $dirid = $row['dirid'];
@@ -305,16 +305,16 @@  discard block
 block discarded – undo
305 305
     return $dirid;
306 306
 }
307 307
 
308
-function checkDescription($catid='0') {
308
+function checkDescription($catid = '0') {
309 309
 	global $xoopsDB;
310
-	$myts =& MyTextSanitizer::getInstance();
310
+	$myts = & MyTextSanitizer::getInstance();
311 311
     $result = $xoopsDB->query("SELECT txtid FROM ".$xoopsDB->prefix("efqdiralpha1_cat_txt")." WHERE cid = '".$catid."'");
312 312
     $num_results = $xoopsDB->getRowsNum($result);
313 313
     $txtid = false;
314 314
 	if (!$result) {
315 315
         return false;
316 316
     }
317
-    for ($i=0; $i <$num_results; $i++)
317
+    for ($i = 0; $i < $num_results; $i++)
318 318
     {
319 319
         $row = mysql_fetch_array($result);
320 320
         $txtid = $row['txtid'];
@@ -322,16 +322,16 @@  discard block
 block discarded – undo
322 322
     return $txtid;
323 323
 }
324 324
 
325
-function getTemplateFromCatid($get_catid='0') {
325
+function getTemplateFromCatid($get_catid = '0') {
326 326
 	global $xoopsDB;
327
-	$myts =& MyTextSanitizer::getInstance();
327
+	$myts = & MyTextSanitizer::getInstance();
328 328
     $result = $xoopsDB->query("SELECT c.tplid, t.name  FROM ".$xoopsDB->prefix("efqdiralpha1_cat_tpl")." c, ".$xoopsDB->prefix("efqdiralpha1_tpl")." t WHERE c.tplid=t.tplid AND c.catid = '".$get_catid."'");
329 329
     $num_results = $xoopsDB->getRowsNum($result);
330 330
     $tplname = "";
331 331
 	if (!$result) {
332 332
         return 0;
333 333
         }
334
-    for ($i=0; $i <$num_results; $i++)
334
+    for ($i = 0; $i < $num_results; $i++)
335 335
     {
336 336
         $row = mysql_fetch_array($result);
337 337
         $tplname = $row['name'];
@@ -339,19 +339,19 @@  discard block
 block discarded – undo
339 339
     return $tplname;
340 340
 }
341 341
 
342
-function getCatSelectArea($item='0', $dirid = '0')
342
+function getCatSelectArea($item = '0', $dirid = '0')
343 343
 {
344 344
 	global $xoopsDB, $myts, $eh, $mytree, $moddir, $get_itemid;
345 345
 	$sql = "SELECT c.cid, c.title, c.pid, c.allowlist, x.active FROM ".$xoopsDB->prefix("efqdiralpha1_cat")." c LEFT JOIN ".$xoopsDB->prefix("efqdiralpha1_item_x_cat")." x ON (c.cid=x.cid AND x.itemid=".$item.")  WHERE c.dirid='".$dirid."' AND c.pid='0' AND c.active='1'";
346 346
 	$mainresult = $xoopsDB->query($sql);
347 347
 	$numrows = $xoopsDB->getRowsNum($mainresult);
348 348
     $output = "<table>";
349
-	if ( $numrows > 0 ) {
349
+	if ($numrows > 0) {
350 350
 		$cats = "";
351 351
 		$output .= "<tr><td class=\"categoryHeader\" colspan=\"2\"><strong>"._MD_CATTITLE."</strong></td><td class=\"categoryHeader\"><strong>"._MD_SELECT."</strong></td></tr>\n";
352 352
 		$brench = 0;
353 353
 		$tab = "";
354
-		while(list($cid, $title, $pid, $allowlist, $active) = $xoopsDB->fetchRow($mainresult)) {
354
+		while (list($cid, $title, $pid, $allowlist, $active) = $xoopsDB->fetchRow($mainresult)) {
355 355
 			//For each cid, get all 'first children' using getFirstChildId() function
356 356
 				if ($allowlist != '0') {
357 357
 					if ($active == '1') {
@@ -373,22 +373,22 @@  discard block
 block discarded – undo
373 373
 	return $output;
374 374
 }
375 375
 
376
-function getCatSelectAreaChildren($childid="0", $level="0")
376
+function getCatSelectAreaChildren($childid = "0", $level = "0")
377 377
 {
378 378
 	global $xoopsDB, $myts, $eh, $mytree, $get_dirid, $moddir, $get_itemid;
379 379
 	$tab = "&nbsp;";
380 380
 	$level = $level;
381 381
 	$output = "";
382 382
 	$plus = "<img src=\"".XOOPS_URL."/images/arrow.gif\">";
383
-	for ($i=0; $i <$level; $i++)
383
+	for ($i = 0; $i < $level; $i++)
384 384
 	{
385 385
 		$tab .= "&nbsp;&nbsp;&nbsp;&nbsp;";
386 386
 	}
387 387
 	$sql = "SELECT DISTINCT c.cid, c.title, c.pid, c.allowlist, x.active FROM ".$xoopsDB->prefix("efqdiralpha1_cat")." c LEFT JOIN ".$xoopsDB->prefix("efqdiralpha1_item_x_cat")." x ON (c.cid=x.cid AND x.itemid='".$get_itemid."')  WHERE c.dirid='".$get_dirid."' AND c.pid='".$childid."' AND c.active='1'";
388 388
 	$childresult = $xoopsDB->query($sql);
389 389
 	$numrows = $xoopsDB->getRowsNum($childresult);
390
-	if ( $numrows > 0 ) {
391
-		while(list($cid, $title, $pid, $allowlist, $active) = $xoopsDB->fetchRow($childresult)) {
390
+	if ($numrows > 0) {
391
+		while (list($cid, $title, $pid, $allowlist, $active) = $xoopsDB->fetchRow($childresult)) {
392 392
 			if ($allowlist != '0') {
393 393
 				if ($active == '1') {
394 394
 					$checked = " checked";
@@ -410,14 +410,14 @@  discard block
 block discarded – undo
410 410
 {
411 411
 	global $xoopsDB;
412 412
     $block = array();
413
-	$myts =& MyTextSanitizer::getInstance();
413
+	$myts = & MyTextSanitizer::getInstance();
414 414
 	$dirid = 0;
415 415
     $result = $xoopsDB->query("SELECT dirid FROM ".$xoopsDB->prefix("efqdiralpha1_items")." WHERE itemid = ".$item."");
416 416
     $num_results = $xoopsDB->getRowsNum($result);
417 417
     if (!$result) {
418 418
         return 0;
419 419
         }
420
-    for ($i=0; $i <$num_results; $i++)
420
+    for ($i = 0; $i < $num_results; $i++)
421 421
     {
422 422
         $row = mysql_fetch_array($result);
423 423
         $dirid = $row['dirid'];
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 {
429 429
 	global $xoopsDB;
430 430
     $block = array();
431
-	$myts =& MyTextSanitizer::getInstance();
431
+	$myts = & MyTextSanitizer::getInstance();
432 432
 	$dirid = 0;
433 433
     $result = $xoopsDB->query("SELECT dirid FROM ".$xoopsDB->prefix("efqdiralpha1_dir")." WHERE open = '1'");
434 434
     $num_results = $xoopsDB->getRowsNum($result);
@@ -448,14 +448,14 @@  discard block
 block discarded – undo
448 448
 {
449 449
 	global $xoopsDB;
450 450
     $block = array();
451
-	$myts =& MyTextSanitizer::getInstance();
451
+	$myts = & MyTextSanitizer::getInstance();
452 452
 	$userid = 0;
453 453
     $result = $xoopsDB->query("SELECT uid FROM ".$xoopsDB->prefix("efqdiralpha1_items")." WHERE itemid = ".$item."");
454 454
     $num_results = $xoopsDB->getRowsNum($result);
455 455
     if (!$result) {
456 456
         return 0;
457 457
         }
458
-    for ($i=0; $i <$num_results; $i++)
458
+    for ($i = 0; $i < $num_results; $i++)
459 459
     {
460 460
         $row = mysql_fetch_array($result);
461 461
         $userid = $row['uid'];
@@ -463,25 +463,25 @@  discard block
 block discarded – undo
463 463
     return $userid;
464 464
 }
465 465
 //updates rating data in itemtable for a given item
466
-function updaterating($sel_id){
466
+function updaterating($sel_id) {
467 467
         global $xoopsDB;
468 468
         $query = "select rating FROM ".$xoopsDB->prefix("efqdiralpha1_votedata")." WHERE itemid = ".$sel_id."";
469 469
         $voteresult = $xoopsDB->query($query);
470 470
             $votesDB = $xoopsDB->getRowsNum($voteresult);
471 471
         $totalrating = 0;
472
-            while(list($rating)=$xoopsDB->fetchRow($voteresult)){
472
+            while (list($rating) = $xoopsDB->fetchRow($voteresult)) {
473 473
                 $totalrating += $rating;
474 474
         }
475
-        $finalrating = $totalrating/$votesDB;
475
+        $finalrating = $totalrating / $votesDB;
476 476
         $finalrating = number_format($finalrating, 4);
477
-        $query =  "UPDATE ".$xoopsDB->prefix("efqdiralpha1_items")." SET rating=$finalrating, votes=$votesDB WHERE itemid = $sel_id";
477
+        $query = "UPDATE ".$xoopsDB->prefix("efqdiralpha1_items")." SET rating=$finalrating, votes=$votesDB WHERE itemid = $sel_id";
478 478
         $xoopsDB->query($query) or exit();
479 479
 }
480
-function getAddressFields($typeid='0')
480
+function getAddressFields($typeid = '0')
481 481
 {
482 482
 	global $xoopsDB;
483 483
     $block = array();
484
-	$myts =& MyTextSanitizer::getInstance();
484
+	$myts = & MyTextSanitizer::getInstance();
485 485
 	$dirid = 0;
486 486
 	$addressarray = array();
487 487
 	if ($typeid == '0') {
@@ -493,21 +493,21 @@  discard block
 block discarded – undo
493 493
     if (!$result) {
494 494
         return 0;
495 495
     }
496
-    while ( list($typeid, $address, $address2, $zip, $postcode, $lat, $lon, $phone, $fax, $mobile, $city, $country, $typename, $uselocyn) = $xoopsDB->fetchRow($result) ) {
496
+    while (list($typeid, $address, $address2, $zip, $postcode, $lat, $lon, $phone, $fax, $mobile, $city, $country, $typename, $uselocyn) = $xoopsDB->fetchRow($result)) {
497 497
 		$addressarray = array('typeid' => $typeid, 'typename' => $typename, 'uselocyn' => $uselocyn, 'addressfields' => array('address' => $address, 'address2' => $address2, 'zip' => $zip, 'postcode' => $postcode, 'lat' => $lat, 'lon' => $lon, 'phone' => $phone, 'fax' => $fax, 'mobile' => $mobile, 'city' => $city, 'country' => $country));
498 498
     }
499 499
     return $addressarray;
500 500
 }
501 501
 function getAddressValues($addrid = '0') {
502 502
 	global $xoopsDB;
503
-	$myts =& MyTextSanitizer::getInstance();
503
+	$myts = & MyTextSanitizer::getInstance();
504 504
 	$addressarray = array();
505 505
     $result = $xoopsDB->query("SELECT address, address2, zip, postcode, lat, lon, phone, fax, mobile, city, country FROM ".$xoopsDB->prefix("efqdiralpha1_addresses")." WHERE addrid = '$addrid'");
506 506
     $num_results = $xoopsDB->getRowsNum($result);
507 507
     if ($num_results == 0) {
508 508
         $addressarray = array('address' => "", 'address2' => "", 'zip' => "", 'postcode' => "", 'lat' => "", 'lon' => "", 'phone' => "", 'fax' => "", 'mobile' => "", 'city' => "", 'country' => "");
509 509
 	}
510
-    while ( list($address, $address2, $zip, $postcode, $lat, $lon, $phone, $fax, $mobile, $city, $country) = $xoopsDB->fetchRow($result) ) {
510
+    while (list($address, $address2, $zip, $postcode, $lat, $lon, $phone, $fax, $mobile, $city, $country) = $xoopsDB->fetchRow($result)) {
511 511
 		$addressarray = array('address' => $address, 'address2' => $address2, 'zip' => $zip, 'postcode' => $postcode, 'lat' => $lat, 'lon' => $lon, 'phone' => $phone, 'fax' => $fax, 'mobile' => $mobile, 'city' => $city, 'country' => $country);
512 512
     }
513 513
     return $addressarray;
@@ -523,14 +523,14 @@  discard block
 block discarded – undo
523 523
 	$sql = "SELECT cid, title, pid, allowlist FROM ".$xoopsDB->prefix("efqdiralpha1_cat")." WHERE dirid='".$get_dirid."' AND pid='0' AND active='1'";
524 524
 	$mainresult = $xoopsDB->query($sql);
525 525
 	$numrows = $xoopsDB->getRowsNum($mainresult);
526
-	$output= "";
527
-    if ( $numrows > 0 ) {
526
+	$output = "";
527
+    if ($numrows > 0) {
528 528
 		$cats = "";
529 529
 		$output = "<table class=\"categoryTable\"><tr><td class=\"categoryHeader\" colspan=\"2\"><strong>"._MD_CATTITLE."</strong></td><td class=\"categoryHeader\"><strong>"._MD_SELECT."</strong></td></tr>\n";
530 530
 		$brench = 0;
531 531
 		$tab = "";
532 532
 		$selectablecat = false;
533
-		while(list($cid, $title, $pid, $allowlist) = $xoopsDB->fetchRow($mainresult)) {
533
+		while (list($cid, $title, $pid, $allowlist) = $xoopsDB->fetchRow($mainresult)) {
534 534
 			//For each cid, get all 'first children' using getFirstChildId() function
535 535
 			if ($allowlist != '0') {
536 536
 				$checkbox = "<input type=\"checkbox\" name=\"selected".$cid."\"";
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
 			}
549 549
 		}
550 550
 	} else {
551
-		redirect_header(XOOPS_URL."/modules/$moddir/index.php?dirid=$get_dirid",2,_MD_NOACTIVECATEGORIES);
551
+		redirect_header(XOOPS_URL."/modules/$moddir/index.php?dirid=$get_dirid", 2, _MD_NOACTIVECATEGORIES);
552 552
 		exit();
553 553
 		//$output = ""._MD_NORESULTS."";
554 554
 	}
@@ -557,28 +557,28 @@  discard block
 block discarded – undo
557 557
 	}
558 558
 	$output .= "</table>";
559 559
 	if ($selectablecat == false) {
560
-		redirect_header(XOOPS_URL."/modules/$moddir/index.php?dirid=$get_dirid",2,_MD_NOACTIVECATEGORIES);
560
+		redirect_header(XOOPS_URL."/modules/$moddir/index.php?dirid=$get_dirid", 2, _MD_NOACTIVECATEGORIES);
561 561
 		exit();
562 562
 	}
563 563
 	return $output;
564 564
 }
565 565
 
566
-function getCatSelectAreaChildren2($childid="0", $level="0")
566
+function getCatSelectAreaChildren2($childid = "0", $level = "0")
567 567
 {
568 568
 	global $xoopsDB, $myts, $eh, $mytree, $get_dirid, $moddir;
569 569
 	$tab = "&nbsp;";
570 570
 	$level = $level;
571 571
 	$output = "";
572 572
 	$plus = "<img src=\"".XOOPS_URL."/images/arrow.gif\">";
573
-	for ($i=0; $i <$level; $i++)
573
+	for ($i = 0; $i < $level; $i++)
574 574
 	{
575 575
 		$tab .= "&nbsp;&nbsp;&nbsp;&nbsp;";
576 576
 	}
577 577
 	$sql = "SELECT cid, title, pid, allowlist FROM ".$xoopsDB->prefix("efqdiralpha1_cat")." WHERE dirid='".intval($get_dirid)."' AND pid='".intval($childid)."' AND active='1'";
578 578
 	$childresult = $xoopsDB->query($sql);
579 579
 	$numrows = $xoopsDB->getRowsNum($childresult);
580
-	if ( $numrows > 0 ) {
581
-		while(list($cid, $title, $pid, $allowlist) = $xoopsDB->fetchRow($childresult)) {
580
+	if ($numrows > 0) {
581
+		while (list($cid, $title, $pid, $allowlist) = $xoopsDB->fetchRow($childresult)) {
582 582
 			if ($allowlist != '0') {
583 583
 				$checkbox = "<input type=\"checkbox\" name=\"selected".$cid."\"";
584 584
 			} else {
Please login to merge, or discard this patch.
Braces   +49 added lines, -17 removed lines patch added patch discarded remove patch
@@ -62,25 +62,57 @@  discard block
 block discarded – undo
62 62
 
63 63
 function convertorderbytrans($orderby) {
64 64
             $orderbyTrans = "";
65
-			if ($orderby == "hits ASC")    $orderbyTrans = ""._MD_POPULARITYLTOM."";
66
-            if ($orderby == "hits DESC")   $orderbyTrans = ""._MD_POPULARITYMTOL."";
67
-            if ($orderby == "title ASC")   $orderbyTrans = ""._MD_TITLEATOZ."";
68
-           	if ($orderby == "title DESC")  $orderbyTrans = ""._MD_TITLEZTOA."";
69
-            if ($orderby == "date ASC")    $orderbyTrans = ""._MD_DATEOLD."";
70
-            if ($orderby == "date DESC")   $orderbyTrans = ""._MD_DATENEW."";
71
-            if ($orderby == "rating ASC")  $orderbyTrans = ""._MD_RATINGLTOH."";
72
-            if ($orderby == "rating DESC") $orderbyTrans = ""._MD_RATINGHTOL."";
65
+			if ($orderby == "hits ASC") {
66
+				$orderbyTrans = ""._MD_POPULARITYLTOM."";
67
+			}
68
+            if ($orderby == "hits DESC") {
69
+            	$orderbyTrans = ""._MD_POPULARITYMTOL."";
70
+            }
71
+            if ($orderby == "title ASC") {
72
+            	$orderbyTrans = ""._MD_TITLEATOZ."";
73
+            }
74
+           	if ($orderby == "title DESC") {
75
+           		$orderbyTrans = ""._MD_TITLEZTOA."";
76
+           	}
77
+            if ($orderby == "date ASC") {
78
+            	$orderbyTrans = ""._MD_DATEOLD."";
79
+            }
80
+            if ($orderby == "date DESC") {
81
+            	$orderbyTrans = ""._MD_DATENEW."";
82
+            }
83
+            if ($orderby == "rating ASC") {
84
+            	$orderbyTrans = ""._MD_RATINGLTOH."";
85
+            }
86
+            if ($orderby == "rating DESC") {
87
+            	$orderbyTrans = ""._MD_RATINGHTOL."";
88
+            }
73 89
             return $orderbyTrans;
74 90
 }
75 91
 function convertorderbyout($orderby) {
76
-            if ($orderby == "title ASC")            $orderby = "titleA";
77
-            if ($orderby == "date ASC")            $orderby = "dateA";
78
-            if ($orderby == "hits ASC")          $orderby = "hitsA";
79
-            if ($orderby == "rating ASC")        $orderby = "ratingA";
80
-            if ($orderby == "title DESC")              $orderby = "titleD";
81
-            if ($orderby == "date DESC")            $orderby = "dateD";
82
-            if ($orderby == "hits DESC")          $orderby = "hitsD";
83
-            if ($orderby == "rating DESC")        $orderby = "ratingD";
92
+            if ($orderby == "title ASC") {
93
+            	$orderby = "titleA";
94
+            }
95
+            if ($orderby == "date ASC") {
96
+            	$orderby = "dateA";
97
+            }
98
+            if ($orderby == "hits ASC") {
99
+            	$orderby = "hitsA";
100
+            }
101
+            if ($orderby == "rating ASC") {
102
+            	$orderby = "ratingA";
103
+            }
104
+            if ($orderby == "title DESC") {
105
+            	$orderby = "titleD";
106
+            }
107
+            if ($orderby == "date DESC") {
108
+            	$orderby = "dateD";
109
+            }
110
+            if ($orderby == "hits DESC") {
111
+            	$orderby = "hitsD";
112
+            }
113
+            if ($orderby == "rating DESC") {
114
+            	$orderby = "ratingD";
115
+            }
84 116
             return $orderby;
85 117
 }
86 118
 
@@ -92,7 +124,7 @@  discard block
 block discarded – undo
92 124
 	if ($startdate < $time) {
93 125
 		if($status==2){
94 126
 			$new = "&nbsp;<img src=\"".XOOPS_URL."/modules/$moddir/images/newred.gif\" alt=\""._MD_NEWTHISWEEK."\" />";
95
-		}elseif($status==3){
127
+		} elseif($status==3){
96 128
 			$new = "&nbsp;<img src=\"".XOOPS_URL."/modules/$moddir/images/update.gif\" alt=\""._MD_UPTHISWEEK."\" />";
97 129
 		}
98 130
 	}
Please login to merge, or discard this patch.
paypal_includes/global_config.inc.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 function create_local_variables() {
18 18
 
19 19
 	$array_name = array();
20
-	$variables = array('business','receiver_email', 'receiver_id', 'item_name', 'item_number', 'quantity', 'invoice', 
20
+	$variables = array('business', 'receiver_email', 'receiver_id', 'item_name', 'item_number', 'quantity', 'invoice', 
21 21
 		'custom', 'memo', 'tax', 'option_selection1', 'option_name1', 'option_selection2', 'option_name2', 'num_cart_items',
22 22
 		'mc_gross', 'mc_fee', 'mc_currency', 'settle_amount', 'settle_currency', 'exchange_rate', 'payment_gross',
23 23
 		'payment_fee', 'payment_status', 'pending_reason', 'reason_code', 'payment_date', 'txn_id', 'txn_type',
@@ -28,9 +28,9 @@  discard block
 block discarded – undo
28 28
 		
29 29
 	foreach ($variables as $k => $v) {
30 30
 		if (isset($_POST[$v])) {
31
-			$array_name[$v]="$_POST[$v]";
31
+			$array_name[$v] = "$_POST[$v]";
32 32
 		} else {
33
-			$array_name[$v]="";
33
+			$array_name[$v] = "";
34 34
 		}
35 35
 	}
36 36
 	//print_r($array_name);
@@ -40,23 +40,23 @@  discard block
 block discarded – undo
40 40
 
41 41
 //post transaction data using curl
42 42
 
43
-function curlPost($url,$data)  {
43
+function curlPost($url, $data) {
44 44
 
45 45
 global $paypal, $info;
46 46
 
47 47
 //build post string
48 48
 
49
-foreach($data as $i=>$v) {
50
-$postdata.= $i . "=" . urlencode($v) . "&";
49
+foreach ($data as $i=>$v) {
50
+$postdata .= $i."=".urlencode($v)."&";
51 51
 }
52 52
 
53
-$postdata.="cmd=_notify-validate";
53
+$postdata .= "cmd=_notify-validate";
54 54
 
55 55
 //execute curl on the command line
56 56
 
57 57
 exec("$paypal[curl_location] -d \"$postdata\" $url", $info);
58 58
 
59
-$info=implode(",",$info);
59
+$info = implode(",", $info);
60 60
 
61 61
 return $info;
62 62
 
@@ -64,31 +64,31 @@  discard block
 block discarded – undo
64 64
 
65 65
 //posts transaction data using libCurl
66 66
 
67
-function libCurlPost($url,$data)  {
67
+function libCurlPost($url, $data) {
68 68
 
69 69
 //build post string
70 70
 
71
-foreach($data as $i=>$v) {
71
+foreach ($data as $i=>$v) {
72 72
 
73
-$postdata.= $i . "=" . urlencode($v) . "&";
73
+$postdata .= $i."=".urlencode($v)."&";
74 74
 
75 75
 }
76 76
 
77
-$postdata.="cmd=_notify-validate";
77
+$postdata .= "cmd=_notify-validate";
78 78
 
79
-$ch=curl_init();
79
+$ch = curl_init();
80 80
 
81
-curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,FALSE);
82
-curl_setopt($ch,CURLOPT_URL,$url);
83
-curl_setopt($ch,CURLOPT_POST,1);
84
-curl_setopt($ch,CURLOPT_POSTFIELDS,$postdata);
81
+curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
82
+curl_setopt($ch, CURLOPT_URL, $url);
83
+curl_setopt($ch, CURLOPT_POST, 1);
84
+curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
85 85
 
86 86
 //Start ob to prevent curl_exec from displaying stuff.
87 87
 ob_start();
88 88
 curl_exec($ch);
89 89
 
90 90
 //Get contents of output buffer
91
-$info=ob_get_contents();
91
+$info = ob_get_contents();
92 92
 curl_close($ch);
93 93
 
94 94
 //End ob and erase contents.
@@ -99,27 +99,27 @@  discard block
 block discarded – undo
99 99
 }
100 100
 
101 101
 //posts transaction data using fsockopen.
102
-function fsockPost($url,$data) {
102
+function fsockPost($url, $data) {
103 103
 
104 104
 //Parse url
105
-$web=parse_url($url);
105
+$web = parse_url($url);
106 106
 
107 107
 $postdata = "";
108 108
 //build post string
109
-foreach($data as $i=>$v) {
110
-$postdata.= $i . "=" . urlencode($v) . "&";
109
+foreach ($data as $i=>$v) {
110
+$postdata .= $i."=".urlencode($v)."&";
111 111
 }
112 112
 
113
-$postdata.="cmd=_notify-validate";
113
+$postdata .= "cmd=_notify-validate";
114 114
 
115 115
 //Set the port number
116
-if($web['scheme'] == "https") { $web['port']="443";  $ssl="ssl://"; } else { $web['port']="80"; }
116
+if ($web['scheme'] == "https") { $web['port'] = "443"; $ssl = "ssl://"; } else { $web['port'] = "80"; }
117 117
 
118 118
 //Create paypal connection
119
-$fp=@fsockopen($ssl . $web[host],$web[port],$errnum,$errstr,30);
119
+$fp = @fsockopen($ssl.$web[host], $web[port], $errnum, $errstr, 30);
120 120
 
121 121
 //Error checking
122
-if(!$fp) { echo "$errnum: $errstr"; }
122
+if (!$fp) { echo "$errnum: $errstr"; }
123 123
 
124 124
 //Post Data
125 125
 else {
@@ -129,16 +129,16 @@  discard block
 block discarded – undo
129 129
   fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n");
130 130
   fputs($fp, "Content-length: ".strlen($postdata)."\r\n");
131 131
   fputs($fp, "Connection: close\r\n\r\n");
132
-  fputs($fp, $postdata . "\r\n\r\n");
132
+  fputs($fp, $postdata."\r\n\r\n");
133 133
 
134 134
 //loop through the response from the server
135
-while(!feof($fp)) { $info[]=@fgets($fp, 1024); }
135
+while (!feof($fp)) { $info[] = @fgets($fp, 1024); }
136 136
 
137 137
 //close fp - we are done with it
138 138
 fclose($fp);
139 139
 
140 140
 //break up results into a string
141
-$info=implode(",",$info);
141
+$info = implode(",", $info);
142 142
 
143 143
 }
144 144
 
Please login to merge, or discard this patch.
paypal_includes/config.inc.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  *
13 13
  */
14 14
  
15
-$vars = array('item_name','item_number', 'receiver_id', 'item_name', 'item_number', 'on1', 'os1', 
15
+$vars = array('item_name', 'item_number', 'receiver_id', 'item_name', 'item_number', 'on1', 'os1', 
16 16
 		'on0', 'on1', 'tax', 'quantity', 'invoice', 'firstname', 'lastname', 'address1',
17 17
 		'address2', 'city', 'state', 'zip', 'email', 'phone1', 'phone2', 'phone3', 'custom', 'amount');
18 18
 		 
@@ -22,45 +22,45 @@  discard block
 block discarded – undo
22 22
 		
23 23
 foreach ($vars as $k => $v) {
24 24
 	if (isset($_POST[$v])) {
25
-		$paypal[$v]="$_POST[$v]";
25
+		$paypal[$v] = "$_POST[$v]";
26 26
 	} else {
27
-		$paypal[$v]="";
27
+		$paypal[$v] = "";
28 28
 	}
29 29
 }
30 30
 
31 31
 //Configuration Settings
32
-$paypal['business']=$xoopsModuleConfig['paypal_business_mail'];
33
-$paypal['site_url']= "".XOOPS_URL."/modules/".$moddir."/";
34
-$paypal['image_url']="";
35
-$paypal['success_url']="ipn.php";
32
+$paypal['business'] = $xoopsModuleConfig['paypal_business_mail'];
33
+$paypal['site_url'] = "".XOOPS_URL."/modules/".$moddir."/";
34
+$paypal['image_url'] = "";
35
+$paypal['success_url'] = "ipn.php";
36 36
 //$paypal[success_url]="php_paypal/ipn/ipn.php";
37
-$paypal['cancel_url']="ipn.php";
38
-$paypal['notify_url']="ipn.php";
39
-$paypal['return_method']="2"; //1=GET 2=POST
40
-$paypal['currency_code']="EUR"; //[USD,GBP,JPY,CAD,EUR]
41
-$paypal['lc']="US";
37
+$paypal['cancel_url'] = "ipn.php";
38
+$paypal['notify_url'] = "ipn.php";
39
+$paypal['return_method'] = "2"; //1=GET 2=POST
40
+$paypal['currency_code'] = "EUR"; //[USD,GBP,JPY,CAD,EUR]
41
+$paypal['lc'] = "US";
42 42
 
43
-if ( $xoopsModuleConfig['paypal_test'] == '1' ) {
44
-	$paypal['url']="https://www.sandbox.paypal.com/cgi-bin/webscr";
45
-} else if ( $xoopsModuleConfig['paypal_secure_yn'] == '0' ) {
46
-	$paypal[url]="http://www.paypal.com/cgi-bin/webscr";
43
+if ($xoopsModuleConfig['paypal_test'] == '1') {
44
+	$paypal['url'] = "https://www.sandbox.paypal.com/cgi-bin/webscr";
45
+} else if ($xoopsModuleConfig['paypal_secure_yn'] == '0') {
46
+	$paypal[url] = "http://www.paypal.com/cgi-bin/webscr";
47 47
 } else {
48
-	$paypal[url]="https://www.paypal.com/cgi-bin/webscr";
48
+	$paypal[url] = "https://www.paypal.com/cgi-bin/webscr";
49 49
 }
50 50
 
51
-$paypal['post_method']="fso"; //fso=fsockopen(); curl=curl command line libCurl=php compiled with libCurl support
52
-$paypal['curl_location']="/usr/local/bin/curl";
51
+$paypal['post_method'] = "fso"; //fso=fsockopen(); curl=curl command line libCurl=php compiled with libCurl support
52
+$paypal['curl_location'] = "/usr/local/bin/curl";
53 53
 
54
-$paypal['bn']="toolkit-php";
55
-$paypal['cmd']="_xclick";
54
+$paypal['bn'] = "toolkit-php";
55
+$paypal['cmd'] = "_xclick";
56 56
 
57 57
 //Payment Page Settings
58
-$paypal['display_comment']="0"; //0=yes 1=no
59
-$paypal['comment_header']="Comments";
60
-$paypal['continue_button_text']="Continue >>";
61
-$paypal['background_color']=""; //""=white 1=black
62
-$paypal['display_shipping_address']=""; //""=yes 1=no
63
-$paypal['display_comment']="1"; //""=yes 1=no
58
+$paypal['display_comment'] = "0"; //0=yes 1=no
59
+$paypal['comment_header'] = "Comments";
60
+$paypal['continue_button_text'] = "Continue >>";
61
+$paypal['background_color'] = ""; //""=white 1=black
62
+$paypal['display_shipping_address'] = ""; //""=yes 1=no
63
+$paypal['display_comment'] = "1"; //""=yes 1=no
64 64
 
65 65
 
66 66
 //Product Settings
@@ -73,14 +73,14 @@  discard block
 block discarded – undo
73 73
 $paypal['on1']="$_POST[on1]";
74 74
 $paypal['os1']="$_POST[os1]";
75 75
 $paypal['quantity']="$_POST[quantity]"; */
76
-$paypal['edit_quantity']=""; //1=yes ""=no
76
+$paypal['edit_quantity'] = ""; //1=yes ""=no
77 77
 /* $paypal['invoice']="$_POST[invoice]";
78 78
 $paypal['tax']="$_POST[tax]"; */
79 79
 
80 80
 //Shipping and Taxes
81 81
 //$paypal['shipping_amount']="$_POST[shipping_amount]";
82
-$paypal['shipping_amount_per_item']="";
83
-$paypal['handling_amount']="";
82
+$paypal['shipping_amount_per_item'] = "";
83
+$paypal['handling_amount'] = "";
84 84
 /* $paypal['custom']="$_POST[custom]"; */
85 85
 
86 86
 //Customer Settings
Please login to merge, or discard this patch.
ratelisting.php 3 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -57,46 +57,46 @@
 block discarded – undo
57 57
 
58 58
    	// Check if Link POSTER is voting (UNLESS Anonymous users allowed to post)
59 59
    	if ($ratinguser != 0) {
60
-       	$result=$xoopsDB->query("select submitter from ".$xoopsDB->prefix("efqdiralpha1_items")." where itemid=$p_itemid");
61
-       	while(list($ratinguserDB) = $xoopsDB->fetchRow($result)) {
62
-       		if ($ratinguserDB == $ratinguser) {
60
+	   	$result=$xoopsDB->query("select submitter from ".$xoopsDB->prefix("efqdiralpha1_items")." where itemid=$p_itemid");
61
+	   	while(list($ratinguserDB) = $xoopsDB->fetchRow($result)) {
62
+	   		if ($ratinguserDB == $ratinguser) {
63 63
 				redirect_header("index.php",4,_MD_CANTVOTEOWN);
64 64
 				exit();
65
-          	}
66
-       	}
65
+		  	}
66
+	   	}
67 67
 
68
-    	// Check if REG user is trying to vote twice.
68
+		// Check if REG user is trying to vote twice.
69 69
    		$result=$xoopsDB->query("select ratinguser from ".$xoopsDB->prefix("efqdiralpha1_votedata")." where itemid=$p_itemid");
70
-       	while(list($ratinguserDB) = $xoopsDB->fetchRow($result)) {
71
-       		if ($ratinguserDB == $ratinguser) {
70
+	   	while(list($ratinguserDB) = $xoopsDB->fetchRow($result)) {
71
+	   		if ($ratinguserDB == $ratinguser) {
72 72
 				redirect_header("index.php",4,_MD_VOTEONCE2);
73 73
 				exit();
74
-           	}
75
-      	}
74
+		   	}
75
+	  	}
76 76
 
77 77
    	} else {
78 78
 
79 79
    		// Check if ANONYMOUS user is trying to vote more than once per day.
80 80
 		$yesterday = (time()-(86400 * $anonwaitdays));
81
-       	$result=$xoopsDB->query("select count(*) FROM ".$xoopsDB->prefix("efqdiralpha1_votedata")." WHERE itemid=$p_itemid AND ratinguser=0 AND ratinghostname = '$ip' AND ratingtimestamp > $yesterday");
81
+	   	$result=$xoopsDB->query("select count(*) FROM ".$xoopsDB->prefix("efqdiralpha1_votedata")." WHERE itemid=$p_itemid AND ratinguser=0 AND ratinghostname = '$ip' AND ratingtimestamp > $yesterday");
82 82
    		list($anonvotecount) = $xoopsDB->fetchRow($result);
83 83
    		if ($anonvotecount > 0) {
84 84
 			redirect_header("index.php",4,_MD_VOTEONCE2);
85 85
 			exit();
86
-       	}
86
+	   	}
87 87
    	}
88 88
 	if($rating > 10){
89 89
 		$rating = 10;
90 90
 	}
91 91
 
92
-    //Add to Line Item Rate to DB.
92
+	//Add to Line Item Rate to DB.
93 93
 	$newid = $xoopsDB->genId($xoopsDB->prefix("efqdiralpha1_votedata")."_ratingid_seq");
94 94
 	$datetime = time();
95 95
 	$sql = sprintf("INSERT INTO %s (ratingid, itemid, ratinguser, rating, ratinghostname, ratingtimestamp) VALUES (%u, %u, %u, %u, '%s', %u)", $xoopsDB->prefix("efqdiralpha1_votedata"), $newid, $p_itemid, $ratinguser, $p_rating, $ip, $datetime);
96 96
 	$xoopsDB->query($sql) or $eh->show("0013");
97 97
 
98 98
 	//Calculate Score & Add to Summary (for quick retrieval & sorting) to DB.
99
-    updaterating($p_itemid);
99
+	updaterating($p_itemid);
100 100
 	if (!empty($_POST['catid'])) {
101 101
 		$p_catid = intval($_POST['catid']);
102 102
 	} else {
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -31,14 +31,14 @@  discard block
 block discarded – undo
31 31
 // ------------------------------------------------------------------------- //
32 32
 include "header.php";
33 33
 include_once XOOPS_ROOT_PATH."/class/module.errorhandler.php";
34
-$myts =& MyTextSanitizer::getInstance(); // MyTextSanitizer object
34
+$myts = & MyTextSanitizer::getInstance(); // MyTextSanitizer object
35 35
 $moddir = $xoopsModule->getvar("dirname");
36 36
 
37 37
 if (!empty($_POST['submit'])) {
38 38
 	$eh = new ErrorHandler; //ErrorHandler object
39
-	if(empty($xoopsUser)){
39
+	if (empty($xoopsUser)) {
40 40
 		$ratinguser = 0;
41
-	}else{
41
+	} else {
42 42
 		$ratinguser = $xoopsUser->getVar('uid');
43 43
 	}
44 44
 
@@ -50,26 +50,26 @@  discard block
 block discarded – undo
50 50
 	$p_rating = intval($_POST['rating']);
51 51
 
52 52
    	// Check if Rating is Null
53
-   	if ($p_rating=="--") {
54
-		redirect_header("ratelisting.php?catid=".$p_catid."&amp;item=".$itemid."",2,_MD_NORATING);
53
+   	if ($p_rating == "--") {
54
+		redirect_header("ratelisting.php?catid=".$p_catid."&amp;item=".$itemid."", 2, _MD_NORATING);
55 55
 		exit();
56 56
    	}
57 57
 
58 58
    	// Check if Link POSTER is voting (UNLESS Anonymous users allowed to post)
59 59
    	if ($ratinguser != 0) {
60
-       	$result=$xoopsDB->query("select submitter from ".$xoopsDB->prefix("efqdiralpha1_items")." where itemid=$p_itemid");
61
-       	while(list($ratinguserDB) = $xoopsDB->fetchRow($result)) {
60
+       	$result = $xoopsDB->query("select submitter from ".$xoopsDB->prefix("efqdiralpha1_items")." where itemid=$p_itemid");
61
+       	while (list($ratinguserDB) = $xoopsDB->fetchRow($result)) {
62 62
        		if ($ratinguserDB == $ratinguser) {
63
-				redirect_header("index.php",4,_MD_CANTVOTEOWN);
63
+				redirect_header("index.php", 4, _MD_CANTVOTEOWN);
64 64
 				exit();
65 65
           	}
66 66
        	}
67 67
 
68 68
     	// Check if REG user is trying to vote twice.
69
-   		$result=$xoopsDB->query("select ratinguser from ".$xoopsDB->prefix("efqdiralpha1_votedata")." where itemid=$p_itemid");
70
-       	while(list($ratinguserDB) = $xoopsDB->fetchRow($result)) {
69
+   		$result = $xoopsDB->query("select ratinguser from ".$xoopsDB->prefix("efqdiralpha1_votedata")." where itemid=$p_itemid");
70
+       	while (list($ratinguserDB) = $xoopsDB->fetchRow($result)) {
71 71
        		if ($ratinguserDB == $ratinguser) {
72
-				redirect_header("index.php",4,_MD_VOTEONCE2);
72
+				redirect_header("index.php", 4, _MD_VOTEONCE2);
73 73
 				exit();
74 74
            	}
75 75
       	}
@@ -77,15 +77,15 @@  discard block
 block discarded – undo
77 77
    	} else {
78 78
 
79 79
    		// Check if ANONYMOUS user is trying to vote more than once per day.
80
-		$yesterday = (time()-(86400 * $anonwaitdays));
81
-       	$result=$xoopsDB->query("select count(*) FROM ".$xoopsDB->prefix("efqdiralpha1_votedata")." WHERE itemid=$p_itemid AND ratinguser=0 AND ratinghostname = '$ip' AND ratingtimestamp > $yesterday");
80
+		$yesterday = (time() - (86400 * $anonwaitdays));
81
+       	$result = $xoopsDB->query("select count(*) FROM ".$xoopsDB->prefix("efqdiralpha1_votedata")." WHERE itemid=$p_itemid AND ratinguser=0 AND ratinghostname = '$ip' AND ratingtimestamp > $yesterday");
82 82
    		list($anonvotecount) = $xoopsDB->fetchRow($result);
83 83
    		if ($anonvotecount > 0) {
84
-			redirect_header("index.php",4,_MD_VOTEONCE2);
84
+			redirect_header("index.php", 4, _MD_VOTEONCE2);
85 85
 			exit();
86 86
        	}
87 87
    	}
88
-	if($rating > 10){
88
+	if ($rating > 10) {
89 89
 		$rating = 10;
90 90
 	}
91 91
 
@@ -112,8 +112,8 @@  discard block
 block discarded – undo
112 112
 	} else {
113 113
 		$dirid = $p_dirid;
114 114
 	}
115
-	$ratemessage = _MD_VOTEAPPRE."<br />".sprintf(_MD_THANKURATE,$xoopsConfig['sitename']);
116
-	redirect_header("index.php?dirid=".$dirid."",2,$ratemessage);
115
+	$ratemessage = _MD_VOTEAPPRE."<br />".sprintf(_MD_THANKURATE, $xoopsConfig['sitename']);
116
+	redirect_header("index.php?dirid=".$dirid."", 2, $ratemessage);
117 117
 	exit();
118 118
 
119 119
 } else {
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 		$get_catid = '0';
132 132
 	}
133 133
 	
134
-	$result=$xoopsDB->query("select title from ".$xoopsDB->prefix("efqdiralpha1_listings")." where itemid=$get_itemid");
134
+	$result = $xoopsDB->query("select title from ".$xoopsDB->prefix("efqdiralpha1_listings")." where itemid=$get_itemid");
135 135
 	list($title) = $xoopsDB->fetchRow($result);
136 136
 	$xoopsTpl->assign('listing', array('itemid' => $get_itemid, 'catid' => $get_catid, 'title' => $myts->htmlSpecialChars($title)));
137 137
 	$xoopsTpl->assign('moddir', $moddir);
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
 	$eh = new ErrorHandler; //ErrorHandler object
39 39
 	if(empty($xoopsUser)){
40 40
 		$ratinguser = 0;
41
-	}else{
41
+	} else{
42 42
 		$ratinguser = $xoopsUser->getVar('uid');
43 43
 	}
44 44
 
Please login to merge, or discard this patch.
addcoupon.php 3 patches
Indentation   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
 if ((empty($xoopsUser)) || !$xoopsUser->isAdmin($xoopsModule->mid()) || ($itemid == 0 && empty($_POST['delete']))) {
64 64
 	redirect_header('index.php', 3, _NOPERM);
65
-    exit();
65
+	exit();
66 66
 }
67 67
 
68 68
 
@@ -73,40 +73,40 @@  discard block
 block discarded – undo
73 73
 	$lbr = 0;
74 74
 }
75 75
 if ($couponid > 0) {
76
-    $coupon = new efqCouponHandler();
77
-    $coupon->get($couponid);
78
-    //$couponid = $coupon->couponid;
79
-    $myts =& MyTextSanitizer::getInstance();
80
-    $lbr = $coupon->lbr;
81
-    $description = $coupon->descr;
82
-    $image = $coupon->image;
83
-    $heading = $coupon->heading;
84
-    $publish = $coupon->publish > 0 ? $coupon->publish : time();
85
-    $expire = $coupon->expire;    
86
-    $dohtml = 1;
87
-    $dobr = $lbr;
88
-    if ($expire > 0) {
89
-        $setexpire = 1;
90
-    }
91
-    else {
92
-        $setexpire = 0;
93
-        $expire = time() + 3600 * 24 * 7;
94
-    }
76
+	$coupon = new efqCouponHandler();
77
+	$coupon->get($couponid);
78
+	//$couponid = $coupon->couponid;
79
+	$myts =& MyTextSanitizer::getInstance();
80
+	$lbr = $coupon->lbr;
81
+	$description = $coupon->descr;
82
+	$image = $coupon->image;
83
+	$heading = $coupon->heading;
84
+	$publish = $coupon->publish > 0 ? $coupon->publish : time();
85
+	$expire = $coupon->expire;    
86
+	$dohtml = 1;
87
+	$dobr = $lbr;
88
+	if ($expire > 0) {
89
+		$setexpire = 1;
90
+	}
91
+	else {
92
+		$setexpire = 0;
93
+		$expire = time() + 3600 * 24 * 7;
94
+	}
95 95
 } else {
96
-    $itemid = isset($_POST['itemid']) ? intval($_POST['itemid']) : (isset($_GET['item']) ? intval($_GET['item']) : 0);
97
-    $couponid = isset($_POST['couponid']) ? intval($_POST['couponid']) : null;
98
-    $description = isset($_POST['description']) ? $_POST['description'] : "";
99
-    $publish = isset($_POST['publish']) ? $_POST['publish'] : 0;
100
-    $image = isset($_POST['image']) ? $_POST['image'] : "";
96
+	$itemid = isset($_POST['itemid']) ? intval($_POST['itemid']) : (isset($_GET['item']) ? intval($_GET['item']) : 0);
97
+	$couponid = isset($_POST['couponid']) ? intval($_POST['couponid']) : null;
98
+	$description = isset($_POST['description']) ? $_POST['description'] : "";
99
+	$publish = isset($_POST['publish']) ? $_POST['publish'] : 0;
100
+	$image = isset($_POST['image']) ? $_POST['image'] : "";
101 101
 	$expire = isset($_POST['expire']) ? $_POST['expire'] : 0;
102
-    $heading = isset($_POST['heading']) ? $_POST['heading'] : "";
103
-    if ($expire > 0) {
104
-        $setexpire = 1;
105
-    }
106
-    else {
107
-        $setexpire = 0;
108
-        $expire = time() + 3600 * 24 * 7;
109
-    }
102
+	$heading = isset($_POST['heading']) ? $_POST['heading'] : "";
103
+	if ($expire > 0) {
104
+		$setexpire = 1;
105
+	}
106
+	else {
107
+		$setexpire = 0;
108
+		$expire = time() + 3600 * 24 * 7;
109
+	}
110 110
     
111 111
 }
112 112
 
@@ -115,37 +115,37 @@  discard block
 block discarded – undo
115 115
 if (!empty($_POST['submit'])) {
116 116
 	$coupon = new efqCouponHandler();
117 117
 	if (isset($_POST['couponid'])) {
118
-        $couponid = intval($_POST['couponid']);
119
-        $message = _MD_COUPONEDITED;
120
-    } else {
121
-        $coupon->_new = true;
122
-        $message = _MD_COUPONADDED;
123
-    }	  
124
-    if (!$coupon->create()) {
125
-    	$coupon->message = _MD_ERR_ADDCOUPON;
126
-    }      
127
-    redirect_header('listing.php?item='.$itemid, 2, $coupon->message);
128
-    exit();
118
+		$couponid = intval($_POST['couponid']);
119
+		$message = _MD_COUPONEDITED;
120
+	} else {
121
+		$coupon->_new = true;
122
+		$message = _MD_COUPONADDED;
123
+	}	  
124
+	if (!$coupon->create()) {
125
+		$coupon->message = _MD_ERR_ADDCOUPON;
126
+	}      
127
+	redirect_header('listing.php?item='.$itemid, 2, $coupon->message);
128
+	exit();
129 129
 
130 130
 } elseif (!empty($_POST['delete'])) {
131
-    if ( !empty($_POST['ok']) ) {
132
-        if (empty($_POST['couponid'])) {
133
-            redirect_header('index.php',2,_MD_ERR_COUPONIDMISSING);
134
-            exit();
135
-        }
136
-        $coupon = new efqCouponHandler();
137
-        $couponid = intval($_POST['couponid']);
138
-        if ($coupon->delete($couponid)) {
139
-            redirect_header("listing.php?item=".$itemid,2,_MD_COUPONDELETED);
140
-            exit();
141
-        }
142
-    }
143
-    else {
144
-        include XOOPS_ROOT_PATH.'/header.php';
145
-        xoops_confirm(array('delete' => 'yes', 'couponid' => $couponid, 'ok' => 1), 'addcoupon.php?item='.$itemid.'', _MD_COUPONRUSURE);
146
-        include_once XOOPS_ROOT_PATH.'/footer.php';
147
-        exit();
148
-    }
131
+	if ( !empty($_POST['ok']) ) {
132
+		if (empty($_POST['couponid'])) {
133
+			redirect_header('index.php',2,_MD_ERR_COUPONIDMISSING);
134
+			exit();
135
+		}
136
+		$coupon = new efqCouponHandler();
137
+		$couponid = intval($_POST['couponid']);
138
+		if ($coupon->delete($couponid)) {
139
+			redirect_header("listing.php?item=".$itemid,2,_MD_COUPONDELETED);
140
+			exit();
141
+		}
142
+	}
143
+	else {
144
+		include XOOPS_ROOT_PATH.'/header.php';
145
+		xoops_confirm(array('delete' => 'yes', 'couponid' => $couponid, 'ok' => 1), 'addcoupon.php?item='.$itemid.'', _MD_COUPONRUSURE);
146
+		include_once XOOPS_ROOT_PATH.'/footer.php';
147
+		exit();
148
+	}
149 149
 }
150 150
 include XOOPS_ROOT_PATH.'/header.php';
151 151
 include 'include/couponform.php';
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
  */
37 37
 
38 38
 include "header.php";
39
-$myts =& MyTextSanitizer::getInstance(); // MyTextSanitizer object
39
+$myts = & MyTextSanitizer::getInstance(); // MyTextSanitizer object
40 40
 include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
41 41
 include_once XOOPS_ROOT_PATH."/class/module.errorhandler.php";
42 42
 include_once XOOPS_ROOT_PATH."/include/xoopscodes.php";
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 $eh = new ErrorHandler; //ErrorHandler object
49 49
 
50 50
 $moddir = $xoopsModule->getvar("dirname");
51
-$mytree = new XoopsTree($xoopsDB->prefix("efqdiralpha1_cat"),"cid","pid");
51
+$mytree = new XoopsTree($xoopsDB->prefix("efqdiralpha1_cat"), "cid", "pid");
52 52
 
53 53
 //$moddir = $xoopsModule->getvar("dirname");
54 54
 $couponid = isset($_GET['couponid']) ? intval($_GET['couponid']) : 0;
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     $coupon = new efqCouponHandler();
77 77
     $coupon->get($couponid);
78 78
     //$couponid = $coupon->couponid;
79
-    $myts =& MyTextSanitizer::getInstance();
79
+    $myts = & MyTextSanitizer::getInstance();
80 80
     $lbr = $coupon->lbr;
81 81
     $description = $coupon->descr;
82 82
     $image = $coupon->image;
@@ -128,15 +128,15 @@  discard block
 block discarded – undo
128 128
     exit();
129 129
 
130 130
 } elseif (!empty($_POST['delete'])) {
131
-    if ( !empty($_POST['ok']) ) {
131
+    if (!empty($_POST['ok'])) {
132 132
         if (empty($_POST['couponid'])) {
133
-            redirect_header('index.php',2,_MD_ERR_COUPONIDMISSING);
133
+            redirect_header('index.php', 2, _MD_ERR_COUPONIDMISSING);
134 134
             exit();
135 135
         }
136 136
         $coupon = new efqCouponHandler();
137 137
         $couponid = intval($_POST['couponid']);
138 138
         if ($coupon->delete($couponid)) {
139
-            redirect_header("listing.php?item=".$itemid,2,_MD_COUPONDELETED);
139
+            redirect_header("listing.php?item=".$itemid, 2, _MD_COUPONDELETED);
140 140
             exit();
141 141
         }
142 142
     }
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -87,8 +87,7 @@  discard block
 block discarded – undo
87 87
     $dobr = $lbr;
88 88
     if ($expire > 0) {
89 89
         $setexpire = 1;
90
-    }
91
-    else {
90
+    } else {
92 91
         $setexpire = 0;
93 92
         $expire = time() + 3600 * 24 * 7;
94 93
     }
@@ -102,8 +101,7 @@  discard block
 block discarded – undo
102 101
     $heading = isset($_POST['heading']) ? $_POST['heading'] : "";
103 102
     if ($expire > 0) {
104 103
         $setexpire = 1;
105
-    }
106
-    else {
104
+    } else {
107 105
         $setexpire = 0;
108 106
         $expire = time() + 3600 * 24 * 7;
109 107
     }
@@ -139,8 +137,7 @@  discard block
 block discarded – undo
139 137
             redirect_header("listing.php?item=".$itemid,2,_MD_COUPONDELETED);
140 138
             exit();
141 139
         }
142
-    }
143
-    else {
140
+    } else {
144 141
         include XOOPS_ROOT_PATH.'/header.php';
145 142
         xoops_confirm(array('delete' => 'yes', 'couponid' => $couponid, 'ok' => 1), 'addcoupon.php?item='.$itemid.'', _MD_COUPONRUSURE);
146 143
         include_once XOOPS_ROOT_PATH.'/footer.php';
Please login to merge, or discard this patch.
subscriptions.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,9 +42,9 @@
 block discarded – undo
42 42
 $subscription = new efqSubscription();
43 43
 
44 44
 if (isset($_GET['op'])) {
45
-    $op =  $_GET['op'];
45
+	$op =  $_GET['op'];
46 46
 } else if (isset($_POST['op'])) {
47
-    $op =  $_POST['op'];
47
+	$op =  $_POST['op'];
48 48
 } else {
49 49
 	$op = '';
50 50
 }
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 //	Based upon the mylinks and the mxDirectory modules						 //
31 31
 // ------------------------------------------------------------------------- //
32 32
 include 'header.php';
33
-$myts =& MyTextSanitizer::getInstance();// MyTextSanitizer object
33
+$myts = & MyTextSanitizer::getInstance(); // MyTextSanitizer object
34 34
 include_once XOOPS_ROOT_PATH.'/class/xoopstree.php';
35 35
 include_once XOOPS_ROOT_PATH.'/class/module.errorhandler.php';
36 36
 include_once XOOPS_ROOT_PATH.'/include/xoopscodes.php';
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 $subscription = new efqSubscription();
43 43
 
44 44
 if (isset($_GET['op'])) {
45
-    $op =  $_GET['op'];
45
+    $op = $_GET['op'];
46 46
 } else if (isset($_POST['op'])) {
47
-    $op =  $_POST['op'];
47
+    $op = $_POST['op'];
48 48
 } else {
49 49
 	$op = '';
50 50
 }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	$editrights = '1';
70 70
 } else {
71 71
 	$editrights = '0';
72
-	redirect_header("listing.php?itemid=$get_itemid",2,_MD_EDITRIGHTS);
72
+	redirect_header("listing.php?itemid=$get_itemid", 2, _MD_EDITRIGHTS);
73 73
 	exit();
74 74
 }
75 75
 		
@@ -77,8 +77,8 @@  discard block
 block discarded – undo
77 77
 {
78 78
 	global $xoopsDB, $eh, $myts, $moddir, $get_itemid, $owner, $xoopsOption, $xoopsTpl, $subscription, $xoopsUser;
79 79
 	//Check if item selected.
80
-	if ( $get_itemid == '0' ) {
81
-		redirect_header("index.php",2,_MD_NOVALIDITEM);
80
+	if ($get_itemid == '0') {
81
+		redirect_header("index.php", 2, _MD_NOVALIDITEM);
82 82
 		exit();
83 83
 	}
84 84
 	
@@ -92,27 +92,27 @@  discard block
 block discarded – undo
92 92
 	$order_exists = false;
93 93
 	if ($numrows > 0) {
94 94
 		$xoopsTpl->assign('order_table', true);
95
-		while(list($title, $typeid, $orderid, $offerid, $startdate, $enddate, $billto, $orderstatus, $itemid, $autorenew, $typename, $ref, $paymentstatus) = $xoopsDB->fetchRow($item_result)) {
95
+		while (list($title, $typeid, $orderid, $offerid, $startdate, $enddate, $billto, $orderstatus, $itemid, $autorenew, $typename, $ref, $paymentstatus) = $xoopsDB->fetchRow($item_result)) {
96 96
 			//Assign the text of the label for subscription type.
97 97
 			$ordername = $subscription->getOrderItemName($offerid);
98 98
 			
99
-			if ( $paymentstatus == '' ) {
99
+			if ($paymentstatus == '') {
100 100
 				$paymentstatus = _MD_LANG_INCOMPLETE;
101 101
 				$terminate_on = '1';
102 102
 			} else {
103 103
 				$terminate_on = null;
104 104
 				$order_exists = true;
105 105
 			}
106
-			if ( $orderstatus == '1' ) {
106
+			if ($orderstatus == '1') {
107 107
 				$defaultstartdate = $billto;
108 108
 			}
109
-			if ( $billto != '' ) {
109
+			if ($billto != '') {
110 110
 				$billto = date('d-M-Y', $billto);
111 111
 			}
112
-			if ( $enddate != '' ) {
112
+			if ($enddate != '') {
113 113
 				$enddate = date('d-M-Y', $enddate);
114 114
 			} 
115
-			if ( $startdate != '' ) {
115
+			if ($startdate != '') {
116 116
 				$startdate = date('d-M-Y', $startdate);
117 117
 			}  
118 118
 			$xoopsTpl->assign('lang_subscr_offers_header', _MD_LANG_SUBSCR_ACTIVE_ORDERS_HEADER);
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 		$form->addElement($itemtype_select, true);
151 151
 		//TO DO: Add Auto Renew functionality
152 152
 		//$form->addElement(new XoopsFormRadioYN(_MD_AUTORENEWYN, 'autorenewal', '1'),true);
153
-		$form->addElement(new XoopsFormTextDateSelect(_MD_SELECT_STARTDATE, 'startdate', 15, $defaultstartdate),true);
153
+		$form->addElement(new XoopsFormTextDateSelect(_MD_SELECT_STARTDATE, 'startdate', 15, $defaultstartdate), true);
154 154
 		$form->addElement(new XoopsFormButton('', 'submit', _MD_CONTINUE, 'submit'));
155 155
 		$form->addElement(new XoopsFormHidden("op", "orderselect"));
156 156
 		$form->addElement(new XoopsFormHidden("uid", $xoopsUser->getVar('uid')));
@@ -165,20 +165,20 @@  discard block
 block discarded – undo
165 165
 function orderselect() {
166 166
 	//function to update subscription by creating an order or updating an order.
167 167
 	global $xoopsDB, $eh, $myts, $moddir, $get_itemid, $owner, $xoopsOption, $xoopsTpl, $subscription, $xoopsUser;
168
-	if ( $get_itemid == '0' ) {
169
-		redirect_header("index.php",2,_MD_NOVALIDITEM);
168
+	if ($get_itemid == '0') {
169
+		redirect_header("index.php", 2, _MD_NOVALIDITEM);
170 170
 		exit();
171 171
 	}
172 172
 	$orderid = $subscription->createOrder($get_itemid);
173
-	if ( $orderid == false ) {
174
-		redirect_header("subscriptions.php?item=$get_itemid",2,_MD_SUBSCR_TYPE_NOTSELECTED);
173
+	if ($orderid == false) {
174
+		redirect_header("subscriptions.php?item=$get_itemid", 2, _MD_SUBSCR_TYPE_NOTSELECTED);
175 175
 		exit();	
176 176
 	}
177
-	if ( $orderid != 0 ) {
178
-		redirect_header("subscriptions.php?item=$get_itemid&op=orderpayment&orderid=$orderid",2,_MD_SAVED);
177
+	if ($orderid != 0) {
178
+		redirect_header("subscriptions.php?item=$get_itemid&op=orderpayment&orderid=$orderid", 2, _MD_SAVED);
179 179
 		exit();	
180 180
 	} else {
181
-		redirect_header("subscriptions.php?item=$get_itemid",2,_MD_ITEM_NOT_EXIST);
181
+		redirect_header("subscriptions.php?item=$get_itemid", 2, _MD_ITEM_NOT_EXIST);
182 182
 		exit();
183 183
 	}
184 184
 }
@@ -193,14 +193,14 @@  discard block
 block discarded – undo
193 193
 	if (!empty($_GET['orderid'])) {
194 194
 		$get_orderid = intval($_GET['orderid']);
195 195
 	} else {
196
-		redirect_header("index.php",2,_MD_NOVALIDITEM);
196
+		redirect_header("index.php", 2, _MD_NOVALIDITEM);
197 197
 		exit();
198 198
 	}
199 199
 	$sql = "SELECT o.orderid, o.uid, o.offerid, o.typeid, o.startdate, o.billto, o.status, o.itemid, o.autorenew, f.price, f.currency FROM ".$xoopsDB->prefix("efqdiralpha1_subscr_orders")." o, ".$xoopsDB->prefix("efqdiralpha1_subscr_offers")." f WHERE o.offerid=f.offerid AND o.orderid=".$get_orderid."";
200 200
 	$order_result = $xoopsDB->query($sql) or $eh->show("0013");
201 201
 	$numrows = $xoopsDB->getRowsNum($order_result);
202 202
 	if ($numrows > 0) {
203
-		while(list($orderid, $uid, $offerid, $typeid, $startdate, $billto, $status, $itemid, $autorenew, $price, $currency) = $xoopsDB->fetchRow($order_result)) {
203
+		while (list($orderid, $uid, $offerid, $typeid, $startdate, $billto, $status, $itemid, $autorenew, $price, $currency) = $xoopsDB->fetchRow($order_result)) {
204 204
 			ob_start();
205 205
 				$itemname = $subscription->getOrderItemName($offerid);
206 206
 				$form = new XoopsThemeForm(_MD_ORDER_PAYMENT_FORM, 'orderpaymentform', 'process.php');
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 		$xoopsTpl->assign('moddir', $moddir);
242 242
 	} else {
243 243
 		//Else this item cannot be found in the database.
244
-		redirect_header("listing.php?itemid=$get_itemid",2,_MD_ITEM_NOT_EXIST);
244
+		redirect_header("listing.php?itemid=$get_itemid", 2, _MD_ITEM_NOT_EXIST);
245 245
 		exit();		
246 246
 	}
247 247
 }
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 	if (!empty($_GET['order'])) {
253 253
 		$get_orderid = intval($_GET['order']);
254 254
 	} else {
255
-		redirect_header("subscriptions.php?item=$get_itemid",2,_MD_NOVALIDORDER);
255
+		redirect_header("subscriptions.php?item=$get_itemid", 2, _MD_NOVALIDORDER);
256 256
 		exit();
257 257
 	}
258 258
 	if ($editrights == '1') {
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
 		$form->addElement(new XoopsFormHidden("orderid", $get_orderid));
264 264
 		$form->display();
265 265
 	} else {
266
-		redirect_header("subscriptions.php?itemid=$get_itemid",2,_MD_NORIGHTS);
266
+		redirect_header("subscriptions.php?itemid=$get_itemid", 2, _MD_NORIGHTS);
267 267
 		exit();
268 268
 	}
269 269
 	
@@ -272,14 +272,14 @@  discard block
 block discarded – undo
272 272
 function terminate_confirm()
273 273
 {
274 274
 	global $subscription, $get_itemid;
275
-	if ( isset( $_POST['orderid'] )) {
275
+	if (isset($_POST['orderid'])) {
276 276
 		$post_orderid = intval($_POST['orderid']);
277 277
 		if ($subscription->delete($post_orderid)) {
278
-			redirect_header("subscriptions.php?item=$get_itemid",2,_MD_ORDER_DELETED);
278
+			redirect_header("subscriptions.php?item=$get_itemid", 2, _MD_ORDER_DELETED);
279 279
 			exit();
280 280
 		}
281 281
 	} else {
282
-		redirect_header("subscriptions.php?item=$get_itemid",2,_MD_NOVALIDORDER);
282
+		redirect_header("subscriptions.php?item=$get_itemid", 2, _MD_NOVALIDORDER);
283 283
 		exit();
284 284
 	}
285 285
 }
@@ -290,16 +290,16 @@  discard block
 block discarded – undo
290 290
 	if (!empty($_GET['order'])) {
291 291
 		$get_orderid = intval($_GET['order']);
292 292
 	} else {
293
-		redirect_header("index.php",2,_MD_NOVALIDITEM);
293
+		redirect_header("index.php", 2, _MD_NOVALIDITEM);
294 294
 		exit();
295 295
 	}
296 296
 	if ($editrights == '1') {
297
-		redirect_header("subscriptions.php?item=$get_itemid&op=orderpayment&orderid=$get_orderid",2,_MD_FORWARDED_PAYMENT_PAGE);
297
+		redirect_header("subscriptions.php?item=$get_itemid&op=orderpayment&orderid=$get_orderid", 2, _MD_FORWARDED_PAYMENT_PAGE);
298 298
 		exit();	
299 299
 	}
300 300
 }
301 301
 
302
-switch($op) {
302
+switch ($op) {
303 303
 case "upgrade":
304 304
 	upgrade();
305 305
 	break;
Please login to merge, or discard this patch.