Hallöchen gibts hier ein mudul wo mann im admin bereich alle kommentare sehen kann und sie auch löschen kann ohne jeden artikel zu suchen?
wäre echt toll
verwendete ilch Version: 1.1
betroffene Homepage: facecomnews.de.to
Hier kann eine Notiz zum Merk-Eintrag hinzugefügt werden (optional)
Geschlossen |
<?php /* Copyright 404studios.com Stand 2010 */ defined ('main') or die ( 'no direct access' ); defined ('admin') or die ( 'only admin access' ); $design = new design ( 'Admins Area', 'Admins Area', 2 ); $design->header(); // Auslesen Kategorien echo '<b>Wähle ein Modul aus, um Kommentare zu sehen:</b><br /> | '; $erg = db_query("SELECT DISTINCT cat FROM `prefix_koms`"); while ($row = db_fetch_object($erg)) { echo '<a href="admin.php?kommentare-cat-'.$row->cat.'">'.$row->cat.'</a> | ' ; } echo '<hr/><br />'; switch($menu->get(1)){ default: break; case 'cat': $cat = escape($menu->get(2), 'String'); echo '<b>Kommentarkategorie:</b> '.$cat ; echo '<table width="100%" cellpadding="3" cellspacing="1" border="0" class="border" >'; echo "<tr class=\"Chead\"><th>Autor</th><th>Kommentar</th><th></th></tr>"; $erg = db_query("SELECT * FROM `prefix_koms` WHERE cat ='".$cat." ' ORDER BY id DESC"); while ($row = db_fetch_object($erg)) { echo "<tr class=\"Cmite\"><td><a href='admin.php?kommentare-user-".$row->name."'>".$row->name."</a></td><td width='80%'>".$row->text."</td><td width='100px'><a href='index.php?".$row->cat."-".$row->uid."'><img src='include/images/icons/edit.gif' alt='Zum Thema' border='0'></a> <a href='?kommentare-del-".$row->id."'><img src='include/images/icons/del.gif' alt='Löschen' border='0'></a></td></tr>"; } echo "</table>"; break; case 'user': $user = escape($menu->get(2), 'String'); $anzkommentare = db_result(db_query("SELECT COUNT(id) FROM `prefix_koms` WHERE name = '".$user."'"),0); echo '<b>Kommentarübersicht:</b> '.$user; echo '<br />Dieses Mitglied hat bereits '.$anzkommentare.' Kommentare geschrieben.'; echo '<table width="100%" cellpadding="3" cellspacing="1" border="0" class="border" >'; echo "<tr class=\"Chead\"><th>Autor</th><th>Kommentar</th><th></th></tr>"; $erg = db_query("SELECT * FROM `prefix_koms` WHERE name ='".$user." ' ORDER BY id DESC"); while ($row = db_fetch_object($erg)) { echo "<tr class=\"Cmite\"><td><a href='admin.php?kommentare-cat-".$row->cat."'>".$row->cat."</a> </td><td width='80%'>".$row->text."</td><td width='20px'><a href='index.php?".$row->cat."-".$row->uid."'><img src='include/images/icons/16er/betreff_mini.gif' alt='Zum Thema' border='0'></a> <a href='?kommentare-del-".$row->id."'><img src='include/images/icons/del.gif' alt='Löschen' border='0'></a></td></tr>"; } echo "</table>"; break; case 'del': $del = escape($menu->get(2),'Integer'); db_query('DELETE FROM `prefix_koms` WHERE id = "'.$del.'" LIMIT 1'); break; } $design->footer(); ?>
Fatal error: Call to undefined function escapte() in /var/www/web43/html/hp/include/admin/kommentare.php on line 31
jetpack_post_by_email = { init: function() { jQuery( '#jp-pbe-enable' ).click( jetpack_post_by_email.enable ); jQuery( '#jp-pbe-regenerate' ).click( jetpack_post_by_email.regenerate ); jQuery( '#jp-pbe-disable' ).click( jetpack_post_by_email.disable ); }, enable: function() { jQuery( '#jp-pbe-enable' ).attr( 'disabled', 'disabled' ); jQuery( '#jp-pbe-error' ).fadeOut(); jQuery( '#jp-pbe-spinner' ).fadeIn(); var data = { action: 'jetpack_post_by_email_enable' }; jQuery.post( ajaxurl, data, jetpack_post_by_email.handle_enabled ); }, handle_enabled: function( response ) { var enabled = false; var error; try { error = JSON.parse( response ); } catch ( e ) { enabled = true; } jQuery( '#jp-pbe-regenerate' ).removeAttr( 'disabled' ); jQuery( '#jp-pbe-disable' ).removeAttr( 'disabled' ); if ( enabled ) { jQuery( '#jp-pbe-enable' ).fadeOut( 400, function() { jQuery( '#jp-pbe-enable' ).removeAttr( 'disabled' ); jQuery( '#jp-pbe-email' ).val( response ); jQuery( '#jp-pbe-info' ).fadeIn(); }); } else { jQuery( '#jp-pbe-error' ).text( error.message ); jQuery( '#jp-pbe-error' ).fadeIn(); jQuery( '#jp-pbe-enable' ).removeAttr( 'disabled' ); } jQuery( '#jp-pbe-spinner' ).fadeOut(); }, regenerate: function() { jQuery( '#jp-pbe-regenerate' ).attr( 'disabled', 'disabled' ); jQuery( '#jp-pbe-disable' ).attr( 'disabled', 'disabled' ); jQuery( '#jp-pbe-error' ).fadeOut(); jQuery( '#jp-pbe-spinner' ).fadeIn(); var data = { action: 'jetpack_post_by_email_regenerate' }; jQuery.post( ajaxurl, data, jetpack_post_by_email.handle_regenerated ); }, handle_regenerated: function( response ) { var regenerated = false; var error; try { error = JSON.parse( response ); } catch ( e ) { regenerated = true; } if ( regenerated ) { jQuery( '#jp-pbe-email-wrapper' ).fadeOut( 400, function() { jQuery( '#jp-pbe-email' ).val( response ); jQuery( '#jp-pbe-email-wrapper' ).fadeIn(); }); } else { jQuery( '#jp-pbe-error' ).text( error.message ); jQuery( '#jp-pbe-error' ).fadeIn(); } jQuery( '#jp-pbe-regenerate' ).removeAttr( 'disabled' ); jQuery( '#jp-pbe-disable' ).removeAttr( 'disabled' ); jQuery( '#jp-pbe-spinner' ).fadeOut(); }, disable: function() { jQuery( '#jp-pbe-regenerate' ).attr( 'disabled', 'disabled' ); jQuery( '#jp-pbe-disable' ).attr( 'disabled', 'disabled' ); jQuery( '#jp-pbe-error' ).fadeOut(); jQuery( '#jp-pbe-spinner' ).fadeIn(); var data = { action: 'jetpack_post_by_email_disable' }; jQuery.post( ajaxurl, data, jetpack_post_by_email.handle_disabled ); }, handle_disabled: function( response ) { var disabled = false; var error; try { error = JSON.parse( response ); } catch ( e ) { disabled = true; } if ( 'error' != error.response ) { disabled = true; } if ( disabled ) { jQuery( '#jp-pbe-enable' ).removeAttr( 'disabled' ); jQuery( '#jp-pbe-info' ).fadeOut( 400, function() { jQuery( '#jp-pbe-regenerate' ).removeAttr( 'disabled' ); jQuery( '#jp-pbe-disable' ).removeAttr( 'disabled' ); jQuery( '#jp-pbe-enable' ).fadeIn(); }); } else { jQuery( '#jp-pbe-regenerate' ).removeAttr( 'disabled' ); jQuery( '#jp-pbe-disable' ).removeAttr( 'disabled' ); jQuery( '#jp-pbe-error' ).text( error.message ); jQuery( '#jp-pbe-error' ).fadeIn(); } jQuery( '#jp-pbe-spinner' ).fadeOut(); } }; jQuery( function() { jetpack_post_by_email.init(); } );
<?php /** * Module Name: Post by Email * Module Description: Publish posts to your blog directly from your personal email account. * First Introduced: 2.0 * Sort Order: 4 * Requires Connection: Yes * Auto Activate: Yes * Module Tags: Writing */ add_action( 'jetpack_modules_loaded', array( 'Jetpack_Post_By_Email', 'init' ) ); Jetpack_Sync::sync_options( __FILE__, 'large_size_w', 'large_size_h', 'thumbnail_size_w', 'thumbnail_size_h', 'medium_size_w', 'medium_size_h' ); add_action( 'jetpack_activate_module_post-by-email', array( 'Jetpack_Post_By_Email', 'module_toggle' ) ); add_action( 'jetpack_deactivate_module_post-by-email', array( 'Jetpack_Post_By_Email', 'module_toggle' ) ); Jetpack::enable_module_configurable( __FILE__ ); Jetpack::module_configuration_load( __FILE__, array( 'Jetpack_Post_By_Email', 'configuration_redirect' ) ); class Jetpack_Post_By_Email { public static function init() { static $instance = NULL; if ( !$instance ) { $instance = new Jetpack_Post_By_Email; } return $instance; } function __construct() { add_action( 'init', array( &$this, 'action_init' ) ); } function module_toggle() { $jetpack = Jetpack::init(); $jetpack->sync->register( 'noop' ); } static function configuration_redirect() { wp_safe_redirect( get_edit_profile_url( get_current_user_id() ) . '#post-by-email' ); exit; } function action_init() { if ( ! current_user_can( 'edit_posts' ) ) return; add_action( 'profile_personal_options', array( &$this, 'user_profile' ) ); add_action( 'admin_print_scripts-profile.php', array( &$this, 'profile_scripts' ) ); add_action( 'wp_ajax_jetpack_post_by_email_enable', array( &$this, 'create_post_by_email_address' ) ); add_action( 'wp_ajax_jetpack_post_by_email_regenerate', array( &$this, 'regenerate_post_by_email_address' ) ); add_action( 'wp_ajax_jetpack_post_by_email_disable', array( &$this, 'delete_post_by_email_address' ) ); } function profile_scripts() { wp_enqueue_script( 'post-by-email', plugins_url( 'post-by-email/post-by-email.js', __FILE__ ), array( 'jquery' ) ); wp_enqueue_style( 'post-by-email', plugins_url( 'post-by-email/post-by-email.css', __FILE__ ) ); Jetpack::init()->admin_styles(); } function check_user_connection() { $user_token = Jetpack_Data::get_access_token( get_current_user_id() ); $is_user_connected = $user_token && !is_wp_error( $user_token ); // If the user is already connected via Jetpack, then we're good if ( $is_user_connected ) return true; return false; } function user_profile() { $blog_name = get_bloginfo( 'blogname' ); if ( empty( $blog_name ) ) { $blog_name = home_url( '/' ); } ?> <div id="post-by-email" class="jetpack-targetable"> <h3><?php esc_html_e( 'Post by Email', 'jetpack' ); ?></h3> <table class="form-table"> <tr> <th scope="row"><?php esc_html_e( 'Email Address', 'jetpack' ); ?><span id="jp-pbe-spinner" class="spinner"></span></th> <td> <div id="jp-pbe-error" class="jetpack-inline-error"></div> <?php if ( $this->check_user_connection() ) { $email = $this->get_post_by_email_address(); if ( empty( $email ) ) { $enable_hidden = ''; $info_hidden = ' style="display: none;"'; } else { $enable_hidden = ' style="display: none;"'; $info_hidden = ''; } ?> <input type="button" name="jp-pbe-enable" id="jp-pbe-enable" class="button" value="<?php esc_attr_e( 'Enable Post By Email', 'jetpack' ); ?> "<?php echo $enable_hidden; ?> /> <div id="jp-pbe-info"<?php echo $info_hidden; ?>> <p id="jp-pbe-email-wrapper"> <input type="text" id="jp-pbe-email" value="<?php echo esc_attr( $email ); ?>" readonly="readonly" class="regular-text" /> <span class="description"><a target="_blank" href="http://jetpack.me/support/post-by-email/"><?php esc_html_e( 'More information', 'jetpack' ); ?></a></span> </p> <p> <input type="button" name="jp-pbe-regenerate" id="jp-pbe-regenerate" class="button" value="<?php esc_attr_e( 'Regenerate Address', 'jetpack' ); ?> " /> <input type="button" name="jp-pbe-disable" id="jp-pbe-disable" class="button" value="<?php esc_attr_e( 'Disable Post By Email', 'jetpack' ); ?> " /> </p> </div> <?php } else { $jetpack = Jetpack::init(); ?> <p class="jetpack-inline-message"> <?php printf( esc_html( wptexturize( __( 'To use Post By Email, you need to link your %s account to your WordPress.com account.', 'jetpack' ) ) ), '<strong>' . esc_html( $blog_name ) . '</strong>' ); ?><br /> <?php echo esc_html( wptexturize( __( "If you don't have a WordPress.com account yet, you can sign up for free in just a few seconds.", 'jetpack' ) ) ); ?> </p> <p> <a href="<?php echo $jetpack->build_connect_url( false, get_edit_profile_url( get_current_user_id() ) . '#post-by-email' ); ?>" class="button button-connector" id="wpcom-connect"><?php esc_html_e( 'Link account with WordPress.com', 'jetpack' ); ?></a> </p> <?php } ?> </td> </tr> </table> </div> <?php } function get_post_by_email_address() { Jetpack::load_xml_rpc_client(); $xml = new Jetpack_IXR_Client( array( 'user_id' => get_current_user_id(), ) ); $xml->query( 'jetpack.getPostByEmailAddress' ); if ( $xml->isError() ) return NULL; $response = $xml->getResponse(); if ( empty( $response ) ) return NULL; return $response; } function create_post_by_email_address() { Jetpack::load_xml_rpc_client(); $xml = new Jetpack_IXR_Client( array( 'user_id' => get_current_user_id(), ) ); $xml->query( 'jetpack.createPostByEmailAddress' ); if ( $xml->isError() ) { echo json_encode( array( 'response' => 'error', 'message' => __( 'Unable to create your Post By Email address. Please try again later.', 'jetpack' ) ) ); die(); } $response = $xml->getResponse(); if ( empty( $response ) ) { echo json_encode( array( 'response' => 'error', 'message' => __( 'Unable to create your Post By Email address. Please try again later.', 'jetpack' ) ) ); die(); } echo $response; die(); } function regenerate_post_by_email_address() { Jetpack::load_xml_rpc_client(); $xml = new Jetpack_IXR_Client( array( 'user_id' => get_current_user_id(), ) ); $xml->query( 'jetpack.regeneratePostByEmailAddress' ); if ( $xml->isError() ) { echo json_encode( array( 'response' => 'error', 'message' => __( 'Unable to regenerate your Post By Email address. Please try again later.', 'jetpack' ) ) ); die(); } $response = $xml->getResponse(); if ( empty( $response ) ) { echo json_encode( array( 'response' => 'error', 'message' => __( 'Unable to regenerate your Post By Email address. Please try again later.', 'jetpack' ) ) ); die(); } echo $response; die(); } function delete_post_by_email_address() { Jetpack::load_xml_rpc_client(); $xml = new Jetpack_IXR_Client( array( 'user_id' => get_current_user_id(), ) ); $xml->query( 'jetpack.deletePostByEmailAddress' ); if ( $xml->isError() ) { echo json_encode( array( 'response' => 'error', 'message' => __( 'Unable to disable your Post By Email address. Please try again later.', 'jetpack' ) ) ); die(); } $response = $xml->getResponse(); if ( empty( $response ) ) { echo json_encode( array( 'response' => 'error', 'message' => __( 'Unable to disable your Post By Email address. Please try again later.', 'jetpack' ) ) ); die(); } echo $response; die(); } }
#jp-pbe-error { display: none; } #post-by-email:target .jetpack-inline-message { background-color: #fff; }
Geschlossen | ||
Zurück zu HTML, PHP, SQL,... |