Hallo ich habe vollgendes script und würd dort gerne eine checkbox einbauen in die man einen Hacken setzen muss damit die Aktivierung klappt. Die checkbox habe ich schon drin aber keinen plan wie man den rest nun in das bestehende script einbauen muss.
Ich hoffe ihr könnt mir helfen.
Ich hoffe ihr könnt mir helfen.
PHP-Code:
<?php define( "WP_INSTALLING", true ); require( 'wp-config.php' ); add_action( 'wp_head', 'signuppageheaders' ) ; require( 'wp-blog-header.php' ); require_once( ABSPATH . WPINC . '/registration.php' ); if( is_array( get_site_option( 'illegal_names' )) && $_GET[ 'new' ] != '' && in_array( $_GET[ 'new' ], get_site_option( 'illegal_names' ) ) == true ) { wp_redirect( "http://{$current_site->domain}{$current_site->path}" ); die(); } do_action("signup_header"); function signuppageheaders() { echo "<meta name='robots' content='noindex,nofollow'>\n"; } if( $current_blog->domain . $current_blog->path != $current_site->domain . $current_site->path ) { wp_redirect( "http://" . $current_site->domain . $current_site->path . "wp-signup.php" ); die(); } function wpmu_signup_stylesheet() { ?> <style type="text/css"> form { margin-top: 2em; } #submit, #blog_title, #user_email { width: 90%; font-size: 24px; } .error { background-color: #f66; } </style> <?php } add_action( 'wp_head', 'wpmu_signup_stylesheet' ); get_header(); ?> <div id="content" class="widecolumn"> <?php function show_blog_form($blog_id = '', $blog_title = '', $errors = '') { global $current_site; $locale = get_locale(); // Blog name/Username if ( $errors->get_error_message('blog_id') ) print '<tr class="error">'; else print '<tr>'; if( constant( "VHOST" ) == 'no' ) echo '<th valign="top">' . __('Blog Name:') . '</th><td>'; else echo '<th valign="top">' . __('Blog Domain:') . '</th><td>'; if ( $errmsg = $errors->get_error_message('blog_id') ) { ?><p><strong><?php echo $errmsg ?></strong></p><?php } if( constant( "VHOST" ) == 'no' ) { print '<span style="font-size: 20px">' . $current_site->domain . $current_site->path . '</span><input name="blog_id" type="text" id="blog_id" value="'.$blog_id.'" maxlength="50" style="width:40%; text-align: left; font-size: 20px;" /><br />'; } else { print '<input name="blog_id" type="text" id="blog_id" value="'.$blog_id.'" maxlength="50" style="width:40%; text-align: right; font-size: 20px;" /><span style="font-size: 20px">.' . $current_site->domain . $current_site->path . '</span><br />'; } if ( !is_user_logged_in() ) { print '(<strong>' . __( 'Deine Adresse wird so aussehen: ' ); if( constant( "VHOST" ) == 'no' ) { print $current_site->domain . $current_site->path . __( 'blogname' ); } else { print __( 'domain.' ) . $current_site->domain . $current_site->path; } print '.</strong>' . __( '<p>Es müssen mindestens 4 Zeichen sein, aber bitte nur Buchstaben und Nummern. Man kann die Domain nicht nachträglich ändern, also überlege dir vorher gut wie sie aussehen soll!)' ) . '</td> </tr>'; } // Blog Title if ( $errors->get_error_message('blog_title')) { print '<tr class="error">'; } else { print '<tr>'; } ?><th valign="top" width="120"><?php _e('Blog Titel:') ?></th><td><?php if ( $errmsg = $errors->get_error_message('blog_title') ) { ?><p><strong><?php echo $errmsg ?></strong></p><?php } print '<input name="blog_title" type="text" id="blog_title" value="'.wp_specialchars($blog_title, 1).'" /></td> </tr>'; ?> <tr> <th scope="row" valign="top"><?php _e('Privatsphäre:') ?></th> <td><?php _e('Ich möchte, dass mein Blog in Suchmaschinen wie Google und Technorati, und auf der Startseite erscheint.'); ?> <label><input type="radio" name="blog_public" value="1" <?php if( !isset( $_POST[ 'blog_public' ] ) || $_POST[ 'blog_public' ] == '1' ) { ?>checked="checked"<?php } ?> /> <strong><?php _e( 'Ja' ); ?></strong> </label> <label><input type="radio" name="blog_public" value="0" <?php if( isset( $_POST[ 'blog_public' ] ) && $_POST[ 'blog_public' ] == '0' ) { ?>checked="checked"<?php } ?> /><strong><?php _e( 'Nein' ); ?></strong> </label> <br /> </tr> <tr> <th scope="row" valign="top"><?php _e('AGB/Haftung:') ?></th> <td> <input type="checkbox" name="agb" id="agb" value="1" /><?php _e('Ich habe die <a href="http://austauschblog.com/AGB/"><b>AGB</b></a> gelesen und stimme diesen hiermit zu.'); ?> </tr> <?php do_action('signup_blogform', $errors); } function validate_blog_form() { if ( is_user_logged_in() ) $user = wp_get_current_user(); else $user = ''; $result = wpmu_validate_blog_signup($_POST['blog_id'], $_POST['blog_title'], $user); return $result; } function show_user_form($user_name = '', $user_email = '', $errors = '') { // Blog name/Username if ( $errors->get_error_message('user_name') ) { print '<tr class="error">'; } else { print '<tr>'; } echo '<th valign="top">' . __('Benutzername:') . '</th><td>'; if ( $errmsg = $errors->get_error_message('user_name') ) { ?><p><strong><?php echo $errmsg ?></strong></p><?php } print '<input name="user_name" type="text" id="user_name" value="'.$user_name.'" maxlength="50" style="width:50%; font-size: 30px;" /><br />'; _e('(Müssen mindestens 4 Zeichen sein, aber bitte nur Buchstaben und Nummern.)'); echo '</td> </tr>'; // User Email if ( $errors->get_error_message('user_email') ) { print '<tr class="error">'; } else { print '<tr>'; } ?><th valign="top"><?php _e('Email Adresse:') ?></th><td valign="top"><?php if ( $errmsg = $errors->get_error_message('user_email') ) { ?><p><strong><?php echo $errmsg ?></strong></p><?php } ?> <input name="user_email" type="text" id="user_email" value="<?php echo wp_specialchars($user_email, 1) ?>" maxlength="200" /><br /><?php _e('(Wir schicken dein Passwort zu dieser E-mail Adresse, daher <b>bitte nochmal überprüfen</b>.)') ?></td> </tr> <?php if ( $errmsg = $errors->get_error_message('generic') ) print '<tr class="error"> <th colspan="2">'.$errmsg.'</th> </tr>'; do_action( 'signup_extra_fields', $errors ); } function validate_user_form() { $result = wpmu_validate_user_signup($_POST['user_name'], $_POST['user_email']); return $result; } function signup_another_blog($blog_id = '', $blog_title = '', $errors = '') { global $current_user, $wpdb, $domain, $current_site; if ( ! is_wp_error($errors) ) $errors = new WP_Error(); // allow definition of default variables $filtered_results = apply_filters('signup_another_blog_init', array('blog_id' => $blog_id, 'blog_title' => $blog_title, 'errors' => $errors )); $blog_id = $filtered_results['blog_id']; $blog_title = $filtered_results['blog_title']; $errors = $filtered_results['errors']; echo '<h2>' . sprintf( __('Hol dir <em>einen weiteren</em> %s Blog in wenigen Sekunden'), $current_site->site_name ) . '</h2>'; if ( $errors->get_error_code() ) { echo "<p>" . __('Es gab ein Problem, bitte füll das Formular noch mal aus.') . "</p>"; } ?> <p><?php printf(__("Willkommen zurück, %s. Wenn du das Formular nochmals ausfüllst, kannst du <strong>einen weiter Blog zu deinem Account hinzufügen.</strong>. Du kannst so viele Blogs erstellen wie du möchtest, also schreib dir die Seele aus dem Leib."), $current_user->display_name) ?></p> <?php $blogs = get_blogs_of_user($current_user->ID); if ( ! empty($blogs) ) { ?><p><?php _e('Hier siehst du die Blogs die du schon hast:') ?></p><ul><?php foreach ( $blogs as $blog ) echo "<li><a href='http://" . $blog->domain . $blog->path . "'>" . $blog->domain . $blog->path . "</a></li>"; ?></ul><?php } ?> <form name="setupform" id="setupform" method="post" action="wp-signup.php"> <input type="hidden" name="stage" value="gimmeanotherblog" /> <?php do_action( "signup_hidden_fields" ); ?> <table border="0" width="100%" cellpadding="9"> <?php show_blog_form($blog_id, $blog_title, $errors); ?> <tr> <th scope="row" valign="top"> </th> <td><input id="submit" type="submit" name="Submit" class="submit" value="<?php _e('Blog erstellen »') ?>" /></td> </tr> </table> </form> <?php }
Kommentar