The MU forums have moved to WordPress.org

problem with plugins (4 posts)

  1. rebuscando
    Member
    Posted 17 years ago #

    I have written my first plugin: A plugin for upload images... I works ok but there are a problem when I activate/deactivate it... a blank screen appears instead of the plugins screen. Moreover, when I activate it, this problem also occurs when activating/deactivating any plugin. If I deactivate it all is ok...

    Please, help.

    This is my code:

    <?php
    /*
    Plugin Name: imageheader
    Plugin URI: http://rebuscando.info
    Description: Sube imagen de cabecera personalizada
    Version: 0.1
    Author: Rebuscando.INFO
    Author URI: http://rebuscando.info
    */

    // nueva pagina
    function imageheader_add_page()
    {
    add_options_page('Imagen de Cabecera', 'Imagen de Cabecera', 5, 'plugins.php', 'imageheader_configuration_page');
    }
    add_action('admin_menu', 'imageheader_add_page');

    // presenta pagina
    function imageheader_configuration_page()
    {
    ?>

    <div class="wrap">
    <h2>Imagen de Cabecera Personalizada</h2>
    Imagen de Cabecera Actual:<br/><img src='/files/customheader.jpg'/><br/><br/>Si el tema que usa su blog permite cabeceras con imágenes personalizadas puede seleccionarla aquí.<br/><br/>Si su tema no permite cabeceras con imágenes personalizadas puedes modificarlo para que las admita cambiando el "elemento cabecera" con el código css inline siguiente: <pre>style="background: url(<?php bloginfo('url');?>/files/customheader.jpg);"</pre> por ejemplo:<br/><pre><div id="header" style="background: url(<?php bloginfo('url');?>/files/customheader.jpg)
    #FFFFFF no-repeat bottom;"></pre><br/>Si el "elemento cabecera" tiene en su definición css una imagen fija, por ejemplo, background-image: url('images/header.png'); habrá que quitar dicha definición.<br/><br/>
    Seleccione su Imagen de Cabecera Personalizada: Pinche aquí para refrescar la página después de subir la imagen

    <?php

    if (current_user_can('upload_files')) {
    $uploading_iframe_src = "/wp-content/upload.html";
    $uploading_iframe_src = apply_filters('uploading_iframe_src', $uploading_iframe_src);
    if ( false != $uploading_iframe_src )
    echo '<iframe border="0" width="870" height="70" id="headeruploading" border="0" src="' . $uploading_iframe_src . '">' . __('This feature requires iframe support.') . '</iframe>';
    }

    }
    ?>

  2. drmike
    Member
    Posted 17 years ago #

    Um, why not just use the image uploader already in WPMU?

  3. boetter
    Member
    Posted 17 years ago #

    This is looking good, the ability for users to upload for their themes' header? Very interested in following this!

  4. rebuscando
    Member
    Posted 17 years ago #

    Hello drmike,

    image uploader in WPMU uploads at files/month/day/ directory ... I need to upload in a fixed directory... (files/, as an instance) not depending of the date...

    But the problem is not which one to use to upload... the problem is that when I activate/deactivate my plugin... a blank screen appears instead of the plugins screen.

About this Topic

  • Started 17 years ago by rebuscando
  • Latest reply from rebuscando