# Logged into session or login not required $canlogin = 1; } if (!$id) { # find the default one: $id = getConfig('defaultsubscribepage'); # fix the true/false issue if ($id == 'true') { $id = 1; } if ($id == 'false') { $id = 0; } if (!$id) { # pick a first $req = Sql_Fetch_row_Query(sprintf('select ID from %s where active', $tables['subscribepage'])); $id = $req[0]; } } $pagedata = array(); if ($id) { $GLOBALS['pagedata'] = PageData($id); if (isset($pagedata['language_file']) && is_file(dirname(__FILE__) . '/texts/' . basename($pagedata['language_file']))) { @(include dirname(__FILE__) . '/texts/' . basename($pagedata['language_file'])); # Allow customisation per installation if (is_file($_SERVER['DOCUMENT_ROOT'] . '/' . basename($pagedata['language_file']))) { include_once $_SERVER['DOCUMENT_ROOT'] . '/' . basename($pagedata['language_file']); } } } /*
$val_index = Sql_Insert_id(); } else { $val_index = $exists[0]; } Sql_Query(sprintf('update %s set value = %d where attributeid = %d', $tables['user_attribute'], $val_index, $attid)); } Sql_Query(sprintf('update %s set attributeid = %d where attributeid = %d', $tables['user_attribute'], $first, $attid), 1); Sql_Query(sprintf('drop table %s', $table_prefix . 'listattr_' . $attdata['tablename']), 1); Sql_Query(sprintf('delete from %s where id = %d', $tables['attribute'], $attid)); # mark forms to use the merged attribute if ($formtable_exists) { Sql_Query(sprintf('update formfield set attribute = %d where attribute = %d', $first, $attid), 1); } break; case 'checkbox': $exists = Sql_Fetch_row_Query(sprintf('select id from %s where name = "%s"', $valuestable, $attdata['name'])); if (!$exists[0]) { Sql_Query(sprintf('insert into %s (name) values("%s")', $valuestable, $attdata['name'])); $val_index = Sql_Insert_id(); } else { $val_index = $exists[0]; } Sql_Query(sprintf('update %s set value = concat(value,",","%s") where attributeid = %d and (value != 0 or value != "off") ', $tables['user_attribute'], $val_index, $first)); Sql_Query(sprintf('delete from %s where id = %d', $tables['attribute'], $attid)); # mark forms to use the merged attribute if ($formtable_exists) { Sql_Query(sprintf('update formfield set attribute = %d where attribute = %d', $first, $attid), 1); } break; case 'checkboxgroup': # hmm, this is a tricky one.