/** * Saves the record on an edit form submit * @param database A database connector object */ function saveWeblink($option) { global $database, $my; $row = new mosWeblink($database); if (!$row->bind($_POST)) { echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n"; exit; } $row->date = date("Y-m-d H:i:s"); if (!$row->check()) { echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n"; exit; } if (!$row->store()) { echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n"; exit; } $row->checkin(); $row->updateOrder("catid='{$row->catid}'"); mosRedirect("index2.php?option={$option}"); }
/** * Moves the order of a record * @param integer The increment to reorder by */ function orderWeblinks($uid, $inc, $option) { josSpoofCheck(); global $database; $row = new mosWeblink($database); $row->load((int) $uid); $row->updateOrder(); $row->move($inc, "published >= 0"); $row->updateOrder(); mosRedirect("index2.php?option={$option}"); }
/** * Saves the record on an edit form submit * @param database A database connector object */ function saveWeblink($option) { global $database, $my; $row = new mosWeblink($database); if (!$row->bind($_POST)) { echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n"; exit; } // save params $params = mosGetParam($_POST, 'params', ''); if (is_array($params)) { $txt = array(); foreach ($params as $k => $v) { $txt[] = "{$k}={$v}"; } $row->params = implode("\n", $txt); } $row->date = date("Y-m-d H:i:s"); if (!$row->check()) { echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n"; exit; } if (!$row->store()) { echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n"; exit; } $row->checkin(); $row->updateOrder("catid='{$row->catid}'"); mosRedirect("index2.php?option={$option}"); }