return $isCreated;
}
+// Checks whether the given sub id is fused by current member
+function isMemberSubIdFree ($subId) {
+ // Check it
+ $isFree = (countSumTotalData(getMemberId(), 'user_subids', 'id', 'userid', true, sprintf(" AND `subid`='%s'", $subId)) == 0);
+
+ // Return result
+ return $isFree;
+}
+
+// Prepares given sub id for storage in database
+function prepareSubId ($subId) {
+ // First convert any spaces/dashes to underscores
+ $subId = str_replace(' ', '_', str_replace('-', '_', $subId));
+
+ // Then filter out any unwanted characters
+ $subId = preg_replace('/([^a-zA-Z0-9_])/', '', $subId);
+
+ // Then Check if it is available
+ if (!isMemberSubIdFree($subId)) {
+ // Is not free
+ $subId = false;
+ } // END - if
+
+ // Return prepared sub id
+ return $subId;
+}
+
//-----------------------------------------------------------------------------
// EL code functions
//-----------------------------------------------------------------------------
return $GLOBALS[__FUNCTION__][$userid];
}
+// ----------------------------------------------------------------------------
+// XML call-back functions
+// ----------------------------------------------------------------------------
+
+// For 'doing' add subid, the column-index is required
+function addXmlSpecialMemberAddDoSubid () {
+ // So set it all here
+ $GLOBALS['__COLUMN_INDEX']['doXmlCallbackFunction'] = 'column';
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['column_index'] = 'column';
+}
+
// ----------------------------------------------------------------------------
// Wrapper functions for configuration entries
// ----------------------------------------------------------------------------