Forums

Writing a plugin but it's causing a problem (1 post)

  1. crhayes
    Member
    Posted 4 years ago #

    <?php
    /*
    Plugin Name: Highlight Author
    Plugin URI: http://dev.wp-plugins.org/
    Description: Highlight author plugin allows the user to set a default comment css style as well as an alternative for admin/author
    Version: 1.0
    Author: Chris Hayes
    Author URI: http://www.moderncognition.com
    Licence: This WordPress plugin is licenced under the GNU General Public Licence. For more information see: http://www.gnu.org/copyleft/gpl.html
    
    For documentation, please visit http://dev.wp-plugins.org/wiki/
    */
    $comment_info = array
    	(
    			"auth_id" => array
    					(
    						1
    					),
    			"auth_format" => array
    					(
    						"format_type" => "style",
    						"format_content" => "background-color: #000;"
    					),
    			"default_format" => array
    					(
    						"format_type" => "class",
    						"format_content" => "testing"
    					)
    	);
    
    function highlight_auth()
    {
    	global $comment, $comment_info;
    
    	if(in_array($comment->user_id, $comment_info["auth_id"]))
    	{
    		if($comment_info["auth_format"]["format_type"] == "style")
    			echo 'style="';
    		else if($comment_info["auth_format"]["format_type"] == "class")
    			echo 'class="';
    		echo $comment_info["auth_format"]["format_content"] . '"';
    	}
    	else
    	{
    		if($comment_info["default_format"]["format_type"] == "style")
    			echo 'style="';
    		else if($comment_info["default_format"]["format_type"] == "class")
    			echo 'class="';
    		echo $comment_info["default_format"]["format_content"] . '"';
    	}
    }
    ?>

    I am writing this plugin (for change style/class of specified users posts) and there is a problem...for some reason everytime I activate it various pages keep screwing up.

    For example, you can't logout because it messes up, or when you edit plugins/themes and save it, it goes to a blank screen (although it usually does save it in the database).

    Any help would be awesome, thanks!!

    Regards,
    Chris

Topic Closed

This topic has been closed to new replies.

About this Topic