The MU forums have moved to WordPress.org

Some problem with the Visual editor (7 posts)

  1. miteshashar
    Member
    Posted 17 years ago #

    Visual editor was working well and fine for me since my install in july...
    And today suddenly it stopped functioning...
    Friends had been earlier complaining as well..
    and today it stopped working for me as well...

    I am currently running the latest version of WPMU(1.2.5a)...
    It is the same in Vista->IE7, Vista->Firefox & Ubunt->Firefox...
    No toolbar is appearing...cant import images as well...

  2. andrea_r
    Moderator
    Posted 17 years ago #

    If you've got any javascript conflicts, it'll knock the RTE right out.

    Did you do *anything* at all? Install a plugin? Did your host work on the server at any time?

    Anything can do it.

    Also, have a look at all the error logs you can find.

  3. miteshashar
    Member
    Posted 17 years ago #

    yeah it was my own plugin:

    http://mu.wordpress.org/forums/topic.php?id=6422&page&replies=12

    it also creates problems with the wpmusitefeed plugin...

    this is my first plugin...i need some help coding it from the honchos here...please help me out...i cant figure out why and where it is conflicting the other plugins and features...

    the code is here: http://www.miteshashar.com/wpmu.txt

  4. miteshashar
    Member
    Posted 17 years ago #

    ok friends...
    i did figure it out...
    and for the benefit of all first-timer wpmu plugin coders, here's my assumption of why it wasn't working...

    i'm removing the code from my site now...and shall post it here...

  5. miteshashar
    Member
    Posted 17 years ago #

    OLD CODE:

    <?php
    /*
    Plugin Name: Private Blog by Default
    Plugin URI: http://www.miteshashar.com/
    Description: A brief description of the plugin.
    Version: 0.1
    Author: Mitesh B Ashar
    Author URI: http://www.miteshashar.com/
    */
    ?>

    <?php
    /* Copyright 2007 Mitesh B Ashar (email@miteshashar.com)

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
    */
    ?>

    <?
    if($wpdb->get_var("SHOW TABLES LIKE 'wpmu_pubdenial'")!='wpmu_pubdenial')
    {
    $sql= "CREATE TABLE pubdenial(blog_id int NOT NULL, backup int)";
    require_once(ABSPATH . 'wp-admin/upgrade-functions.php');
    dbDelta($sql);
    }

    function denypuboncreate($blog_id)
    {
    global $wpdb;
    $blogstat=get_blog_status($blog_id,"public");
    $wpdb->query("INSERT INTO pubdenial VALUES(".$blog_id.",".$blogstat.")");
    if($blogstat)update_blog_status($blog_id,"public",0);
    }
    add_action('wpmu_activate_blog','denypuboncreate');

    function denypubonupdate($old,$new)
    {
    global $wpdb,$blog_id;
    $blogstat=get_blog_status($blog_id,"public");
    $wpdb->query("UPDATE pubdenial SET backup='".$blogstat."' WHERE blog_id=".$blog_id);
    echo $blogstat;
    if($blogstat)update_blog_status($blog_id,"public",0);
    }
    add_action('update_option_blog_public','denypubonupdate');

    function rempubblog($blog_id)
    {
    global $wpdb;
    $wpdb->query("DELETE FROM pubdenial WHERE blog_id=".$blog_id);
    }

    function approvepub($blog_id)
    {
    global $wpdb;
    $blogstat=$wpdb->get_var("SELECT backup FROM pubdenial WHERE blog_id=$blog_id");
    update_blog_status($blog_id,"public",$blogstat);
    rempubblog($blog_id);
    }
    function spampub($blog_id)
    {
    update_blog_status($blog_id,"spam",1);
    rempubblog($blog_id);
    }

    add_action('admin_menu', 'config_pubdenial');

    function config_pubdenial()
    {
    get_currentuserinfo();
    //if (!is_site_admin()) return false;
    add_submenu_page('wpmu-admin.php', 'Blogs waiting to go Public', 'Approve New Blogs', 10, basename(__FILE__), 'configpage_pubdenial');
    }

    function configpage_pubdenial()
    {
    global $wpdb;
    if (!is_site_admin()) die(__('<p>You do not have permission to access this page.</p>'));
    if(isset($_POST['submit'])){
    if ( !current_user_can('manage_options') )die(__("Sorry, you ain't admin enough to do this"));
    else
    {
    $pubblogs=array();
    for($i=0;isset($_POST['pubblog'.$i]);$i++)$pubblogs[$i]=$_POST['pubblog'.$i];
    for($i=0;isset($_POST['pubblog'.$i."action"]);$i++)$pubblogsact[$i]=$_POST['pubblog'.$i."action"];
    for($i=0;$i<count($pubblogs);$i++)
    {
    switch($pubblogsact[$i])
    {
    case 'approve': approvepub($pubblogs[$i]);$appflag=1;break;
    case 'spam': spampub($pubblogs[$i]);$spamflag=1;break;
    }
    }
    if($appflag==1) ?> <div id="message" class="updated fade"><p> <?php _e('Selected Blogs approved.') ?> </p></div><?
    if($spamflag==1) ?> <div id="message" class="updated fade"><p> <?php _e('Selected Blogs marked as spam.') ?> </p></div> <?
    }
    }
    ?>
    <div class="wrap">
    <h2>Blogs waiting to go public</h2>
    <form action="" method="post" id="pubblogs" style="margin: auto;">
    <TABLE BORDER=0>
    <TR>
    <TD>Approve</TD><TD>Spam</TD><TD>Decide later</TD><TD>Blog Name</TD>
    </TR>
    <?
    $pubblogs=$wpdb->get_results("SELECT blog_id from pubdenial",ARRAY_A);
    for($i=0;$i<count($pubblogs);$i++)
    {
    echo "<TR>";
    echo '<TD ALIGN=CENTER><INPUT TYPE=radio NAME="pubblog'.$i.'action" VALUE="approve" SELECTED></TD>';
    echo '<TD ALIGN=CENTER><INPUT TYPE=radio NAME="pubblog'.$i.'action" VALUE="spam"></TD>';
    echo '<TD ALIGN=CENTER><INPUT TYPE=radio NAME="pubblog'.$i.'action" VALUE="later"></TD>';
    echo '<TD><INPUT TYPE=hidden NAME="pubblog'.$i.'" VALUE="'.$pubblogs[$i][blog_id].'">';
    $currdetails=get_blog_details($pubblogs[$i][blog_id]);
    echo '<A HREF="'.$currdetails->siteurl.'">'.$currdetails->blogname.'</A>';
    echo '</TD></TR>';
    }?>
    </TABLE>
    <p class="submit"><input type="submit" name="submit" value="<?php _e('Update »'); ?>" /></p>
    </form>
    <?
    }
    //*/
    ?>

  6. miteshashar
    Member
    Posted 17 years ago #

    NEW CODE:


    <?php
    /*
    Plugin Name: Private Blog by Default
    Plugin URI: http://www.miteshashar.com/
    Description: A brief description of the plugin.
    Version: 0.1
    Author: Mitesh B Ashar
    Author URI: http://www.miteshashar.com/

    Copyright 2007 Mitesh B Ashar (email@miteshashar.com)

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
    */

    if($wpdb->get_var("SHOW TABLES LIKE 'wpmu_pubdenial'")!='wpmu_pubdenial')
    {
    $sql= "CREATE TABLE pubdenial(blog_id int NOT NULL, backup int)";
    require_once(ABSPATH . 'wp-admin/upgrade-functions.php');
    dbDelta($sql);
    }
    function denypuboncreate($blog_id)
    {
    global $wpdb;
    $blogstat=get_blog_status($blog_id,"public");
    $wpdb->query("INSERT INTO pubdenial VALUES(".$blog_id.",".$blogstat.")");
    if($blogstat)update_blog_status($blog_id,"public",0);
    }
    add_action('wpmu_activate_blog','denypuboncreate');

    function denypubonupdate($old,$new)
    {
    global $wpdb,$blog_id;
    $blogstat=get_blog_status($blog_id,"public");
    $wpdb->query("UPDATE pubdenial SET backup='".$blogstat."' WHERE blog_id=".$blog_id);
    echo $blogstat;
    if($blogstat)update_blog_status($blog_id,"public",0);
    }
    add_action('update_option_blog_public','denypubonupdate');

    function rempubblog($blog_id)
    {
    global $wpdb;
    $wpdb->query("DELETE FROM pubdenial WHERE blog_id=".$blog_id);
    }

    function approvepub($blog_id)
    {
    global $wpdb;
    $blogstat=$wpdb->get_var("SELECT backup FROM pubdenial WHERE blog_id=$blog_id");
    update_blog_status($blog_id,"public",$blogstat);
    rempubblog($blog_id);
    }
    function spampub($blog_id)
    {
    update_blog_status($blog_id,"spam",1);
    rempubblog($blog_id);
    }

    add_action('admin_menu', 'config_pubdenial');

    function config_pubdenial()
    {
    get_currentuserinfo();
    //if (!is_site_admin()) return false;
    add_submenu_page('wpmu-admin.php', 'Blogs waiting to go Public', 'Approve New Blogs', 10, basename(__FILE__), 'configpage_pubdenial');
    }

    function configpage_pubdenial()
    {
    global $wpdb;
    if (!is_site_admin()) die(__('<p>You do not have permission to access this page.</p>'));
    if(isset($_POST['submit'])){
    if ( !current_user_can('manage_options') )die(__("Sorry, you ain't admin enough to do this"));
    else
    {
    $pubblogs=array();
    for($i=0;isset($_POST['pubblog'.$i]);$i++)$pubblogs[$i]=$_POST['pubblog'.$i];
    for($i=0;isset($_POST['pubblog'.$i."action"]);$i++)$pubblogsact[$i]=$_POST['pubblog'.$i."action"];
    for($i=0;$i<count($pubblogs);$i++)
    {
    switch($pubblogsact[$i])
    {
    case 'approve': approvepub($pubblogs[$i]);$appflag=1;break;
    case 'spam': spampub($pubblogs[$i]);$spamflag=1;break;
    }
    }
    if($appflag==1) ?> <div id="message" class="updated fade"><p> <?php _e('Selected Blogs approved.') ?> </p></div><?
    if($spamflag==1) ?> <div id="message" class="updated fade"><p> <?php _e('Selected Blogs marked as spam.') ?> </p></div> <?
    }
    }
    ?>
    <div class="wrap">
    <h2>Blogs waiting to go public</h2>
    <form action="" method="post" id="pubblogs" style="margin: auto;">
    <TABLE BORDER=0>
    <TR>
    <TD>Approve</TD><TD>Spam</TD><TD>Decide later</TD><TD>Blog Name</TD>
    </TR>
    <?
    $pubblogs=$wpdb->get_results("SELECT blog_id from pubdenial",ARRAY_A);
    for($i=0;$i<count($pubblogs);$i++)
    {
    echo "<TR>";
    echo '<TD ALIGN=CENTER><INPUT TYPE=radio NAME="pubblog'.$i.'action" VALUE="approve" SELECTED></TD>';
    echo '<TD ALIGN=CENTER><INPUT TYPE=radio NAME="pubblog'.$i.'action" VALUE="spam"></TD>';
    echo '<TD ALIGN=CENTER><INPUT TYPE=radio NAME="pubblog'.$i.'action" VALUE="later"></TD>';
    echo '<TD><INPUT TYPE=hidden NAME="pubblog'.$i.'" VALUE="'.$pubblogs[$i][blog_id].'">';
    $currdetails=get_blog_details($pubblogs[$i][blog_id]);
    echo '<A HREF="'.$currdetails->siteurl.'">'.$currdetails->blogname.'</A>';
    echo '</TD></TR>';
    }?>
    </TABLE>
    <p class="submit"><input type="submit" name="submit" value="<?php _e('Update »'); ?>" /></p>
    </form>
    <?
    }
    ?>

  7. miteshashar
    Member
    Posted 17 years ago #

    see the only difference...
    removing the continuous closing(?>) and opening(<?php) of the php tag made such a big difference..
    although such chunks of codes within the functions do not pose any such problem...

    PLEASE DO NOT USE THIS AS A PLUGIN RIGHT NOW...SOME IMPORTANT CHANGES NEED TO BE MADE...
    I SHALL RELEASE IT IN A WEEK OR 10 DAYS...

About this Topic

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