db_query($q, 'could not update the places a blog on a page relationship'); echo '<p>Renamed "Places a blog on a page" relationship to "page_to_blog"</p>'; } else { echo '<p>The "Places a blog on a page" relationship has already been updated</p>'; } } $news_to_issue_rel = relationship_finder('news', 'issue_type', 'news_to_issue'); $news_to_news_section_rel = relationship_finder('news', 'news_section_type', 'news_to_news_section'); if (check_required($news_to_issue_rel)) { if (remove_required_relationship($news_to_issue_rel)) { echo '<p>Set required to "no" for news_to_issue relationship</p>'; } } else { echo '<p>Required is already set to "no" for news_to_issue relationship - no changes made</p>'; } if (check_required($news_to_news_section_rel)) { if (remove_required_relationship($news_to_news_section_rel)) { echo '<p>Set required to "no" for news_to_news_section relationship</p>'; } } else { echo '<p>Required is already set to "no" for news_to_news_section relationship - no changes made</p>'; } //if (check_required($news_to_news_section_rel)) echo 'required for news_to_news_section_rel'; zap_field('commenting_settings', 'enable_comment_notification', $reason_user_id); zap_field('blog', 'pagination_state', $reason_user_id); zap_field('blog', 'enable_front_end_posting', $reason_user_id); $pub_type_id = id_of('publication_type'); if ($pub_type_id) { //check if type is related to commenting_settings entity table and if so, kill the rel $es = new entity_selector(); $es->add_type(id_of('content_table'));
include BASE_DIR . '/inc/db.config.php'; include BASE_DIR . '/inc/config.php'; include BASE_DIR . '/functions/func.common.php'; include BASE_DIR . '/class/class.template.php'; $AVE_Template = new AVE_Template(BASE_DIR . '/install/tpl/'); $ver = APP_NAME . ' ' . APP_VERSION; $AVE_Template->assign('version_setup', $lang_i['install_name'] . ' ' . $ver); $AVE_Template->assign('app_info', APP_INFO); $AVE_Template->assign('la', $lang_i); $db_connect = check_db_connect($config['dbhost'], $config['dbuser'], $config['dbpass'], $config['dbname']); if ($db_connect && $_REQUEST['step'] != 'finish' && check_installed($config['dbpref'])) { echo '<pre>' . $lang_i['installed'] . '</pre>'; exit; } $error_is_required = array(); check_required(); check_writable(); $count_error = sizeof((array) $error_is_required); if (1 == $count_error) { $AVE_Template->assign('error_header', $lang_i['erroro']); } elseif ($count_error > 1) { $AVE_Template->assign('error_header', $lang_i['erroro_more']); } if ($count_error > 0 && !(isset($_REQUEST['force']) && 1 == $_REQUEST['force'])) { $AVE_Template->assign('error_is_required', $error_is_required); $AVE_Template->display('error.tpl'); exit; } $_REQUEST['step'] = isset($_REQUEST['step']) ? $_REQUEST['step'] : ''; switch ($_REQUEST['step']) { case '':
function check_required($postdata, $messages = array()) { if (is_array($postdata)) { foreach ($postdata as $key => $val) { if (strpos($key, '_required') && strlen($val)) { $required_key = str_replace('_required', '', $key); if (!isset($postdata[$required_key]) || !$postdata[$required_key]) { $messages[] = 'Required field missing: ' . htmlspecialchars($val); } } if (is_array($val)) { $messages = check_required($val, $messages); } } } return $messages; }