$networkData = getNetworkDataById(getRequestParameter('network'));
// Init disabled list
- $networkData['disabled'] = array();
+ $GLOBALS['network_types_disabled'] = array();
// Load all advert types for given network
$result = SQL_QUERY_ESC("SELECT
array(getRequestParameter('network')), __FILE__, __LINE__);
// Do we have entries?
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// List all entries
- $OUT = ''; $SW = 2;
+ $OUT = '';
while ($row = SQL_FETCHARRAY($result)) {
// Add/translate some data
- $row['sw'] = $SW;
- if (trim($row['network_type_banner_url']) == '') $row['network_type_banner_url'] = '---';
+ $row['network_type_banner_url'] = fixNullEmptyToDashes($row['network_type_banner_url'], 3);
// Set disabled entry
- $networkData['disabled'][$row['network_type_handle']] = true;
+ $GLOBALS['network_types_disabled'][$row['network_type_handle']] = true;
// Add row template and switch color
$OUT .= loadTemplate('admin_list_network_types_row', true, $row);
- $SW = 3 - $SW;
} // END - while
- // Prepare data for template
- $content = array(
- 'rows' => $OUT,
- 'network_id' => getRequestParameter('network'),
- 'network_title' => $networkData['network_title'],
- 'network_reflink' => $networkData['network_reflink'],
- );
-
// Load main template
- loadTemplate('admin_list_network_types', false, $content);
+ loadTemplate('admin_list_network_types', false, $OUT);
} else {
// No entries found
loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_NETWORK_TYPES_404', $networkData['network_title']));
// Free result
SQL_FREERESULT($result);
- // Add type option list
- $networkData['type_options'] = generateOptionList(
- '/ARRAY/',
- array(
- 'banner',
- 'banner_click',
- 'banner_view',
- 'button',
- 'button_click',
- 'button_view',
- 'surfbar',
- 'surfbar_click',
- 'surfbar_view',
- 'focredbanner',
- 'forcedtextlink',
- 'textlink',
- 'textlink_click',
- 'textlink_view',
- 'skybanner',
- 'skybanner_click',
- 'skybanner_view',
- 'layer',
- 'layer_click',
- 'layer_view',
- 'popup',
- 'popdown',
- 'textmail',
- 'htmlmail',
- 'lead',
- 'sale',
- 'payperactive',
- 'pagepeel'
- ),
- array(
- '{--ADMIN_NETWORK_TYPES_BANNER_CLICK_VIEW--}',
- '{--ADMIN_NETWORK_TYPES_BANNER_CLICK--}',
- '{--ADMIN_NETWORK_TYPES_BANNER_VIEW--}',
- '{--ADMIN_NETWORK_TYPES_BUTTON_CLICK_VIEW--}',
- '{--ADMIN_NETWORK_TYPES_BUTTON_CLICK--}',
- '{--ADMIN_NETWORK_TYPES_BUTTON_VIEW--}',
- '{--ADMIN_NETWORK_TYPES_SURFBAR_CLICK_VIEW--}',
- '{--ADMIN_NETWORK_TYPES_SURFBAR_CLICK--}',
- '{--ADMIN_NETWORK_TYPES_SURFBAR_VIEW--}',
- '{--ADMIN_NETWORK_TYPES_FORCED_BANNER--}',
- '{--ADMIN_NETWORK_TYPES_FORCED_TEXTLINK--}',
- '{--ADMIN_NETWORK_TYPES_TEXTLINK_CLICK_VIEW--}',
- '{--ADMIN_NETWORK_TYPES_TEXTLINK_CLICK--}',
- '{--ADMIN_NETWORK_TYPES_TEXTLINK_VIEW--}',
- '{--ADMIN_NETWORK_TYPES_SKYBANNER_CLICK_VIEW--}',
- '{--ADMIN_NETWORK_TYPES_SKYBANNER_CLICK--}',
- '{--ADMIN_NETWORK_TYPES_SKYBANNER_VIEW--}',
- '{--ADMIN_NETWORK_TYPES_LAYER_CLICK_VIEW--}',
- '{--ADMIN_NETWORK_TYPES_LAYER_CLICK--}',
- '{--ADMIN_NETWORK_TYPES_LAYER_VIEW--}',
- '{--ADMIN_NETWORK_TYPES_POPUP--}',
- '{--ADMIN_NETWORK_TYPES_POPDOWN--}',
- '{--ADMIN_NETWORK_TYPES_TEXTMAIL--}',
- '{--ADMIN_NETWORK_TYPES_HTMLMAIL--}',
- '{--ADMIN_NETWORK_TYPES_LEAD--}',
- '{--ADMIN_NETWORK_TYPES_SALE--}',
- '{--ADMIN_NETWORK_TYPES_PAYPERACTIVE--}',
- '{--ADMIN_NETWORK_TYPES_PAGEPEEL--}'
- ),
- '', '', '',
- $networkData['disabled']
- );
-
// Add form for adding new types
loadTemplate('admin_add_network_type', false, $networkData);
} else {