}
// Load URL data by given search term and column
-function SURFBAR_GET_URL_DATA ($searchTerm, $column="id", $order="id", $sort="ASC", $group="id", $add = '') {
+function SURFBAR_GET_URL_DATA ($searchTerm, $column='id', $order='id', $sort="ASC", $group='id', $add = '') {
// By default nothing is found
$GLOBALS['last_url_data'] = array();
// Is the column an id number?
- if (($column == "id") || ($column == 'userid')) {
+ if (($column == 'id') || ($column == 'userid')) {
// Extra secure input
$searchTerm = bigintval($searchTerm);
} // END - if
- // If the column is "id" there can be only one entry
+ // If the column is 'id' there can be only one entry
$limit = '';
- if ($column == "id") {
+ if ($column == 'id') {
$limit = "LIMIT 1";
} // END - if
// Then load all!
while ($dataRow = SQL_FETCHARRAY($result)) {
// Shall we group these results?
- if ($group == "id") {
+ if ($group == 'id') {
// Add the row by id as index
$GLOBALS['last_url_data'][$dataRow['id']] = $dataRow;
} else {
}
// Registers an URL with the surfbar. You should have called SURFBAR_LOOKUP_BY_URL() first!
-function SURFBAR_REGISTER_URL ($url, $uid, $status="PENDING", $addMode="reg", $extraFields = array()) {
+function SURFBAR_REGISTER_URL ($url, $uid, $status = 'PENDING', $addMode = 'reg', $extraFields = array()) {
// Make sure by the user registered URLs are always pending
- if ($addMode == "reg") $status = "PENDING";
+ if ($addMode == 'reg') {
+ $status = 'PENDING';
+ } // END - if
// Prepare content
$content = merge_array($extraFields, array(
));
// Is limit/reload set?
- if (!isset($config['limit'])) $content['limit'] = 0;
- if (!isset($config['reload'])) $content['reload'] = 0;
+ if (!isset($config['limit'])) {
+ $content['limit'] = 0;
+ } // END - if
+ if (!isset($config['reload'])) {
+ $content['reload'] = 0;
+ } // END - if
// Insert the URL into database
$content['insert_id'] = SURFBAR_INSERT_URL_BY_ARRAY($content);
$content['limit'] = surfbarTranslateLimit($content['limit']);
// If in reg-mode we notify admin
- if (($addMode == "reg") || (getConfig('surfbar_notify_admin_unlock') == 'Y')) {
+ if (($addMode == 'reg') || (getConfig('surfbar_notify_admin_unlock') == 'Y')) {
// Notify admin even when he as unlocked an email
SURFBAR_NOTIFY_ADMIN("url_{$addMode}", $content);
} // END - if
$templateName = "surfbar_frameset";
// Any frame set? ;-)
- if (REQUEST_ISSET_GET(('frame'))) {
+ if (REQUEST_ISSET_GET('frame')) {
// Use the frame as a template name part... ;-)
$templateName = sprintf("surfbar_frame_%s",
- REQUEST_GET(('frame'))
+ REQUEST_GET('frame')
);
} // END - if