• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

My Monkey Do

A Log of Coding Solutions

  • Home
  • Web Hosts
  • Tools
  • About

Custom WordPress Comments

June 27, 2011 by Webhead

This guy explains how to customize WordPress comments pretty well:

http://devpress.com/blog/using-the-wordpress-comment-form/

 

Disable HTML in Comments

You can try this plugin found on :  http://www.theblog.ca/literal-comments

 

// This will occur when the comment is posted
function plc_comment_post( $incoming_comment ) {

	// convert everything in a comment to display literally
	$incoming_comment['comment_content'] = htmlspecialchars($incoming_comment['comment_content']);

	// the one exception is single quotes, which cannot be #039; because WordPress marks it as spam
	$incoming_comment['comment_content'] = str_replace( "'", ''', $incoming_comment['comment_content'] );

	return( $incoming_comment );
}

// This will occur before a comment is displayed
function plc_comment_display( $comment_to_display ) {

	// Put the single quotes back in
	$comment_to_display = str_replace( ''', "'", $comment_to_display );

	return $comment_to_display;
}

add_filter( 'preprocess_comment', 'plc_comment_post', '', 1);
add_filter( 'comment_text', 'plc_comment_display', '', 1);
add_filter( 'comment_text_rss', 'plc_comment_display', '', 1);
add_filter( 'comment_excerpt', 'plc_comment_display', '', 1);

 

Filed Under: Coding Tagged With: wordpress

Google Spreadsheet Adding Hyperlink

June 17, 2011 by Webhead

To add a hyperlink to a google spreadsheet enter the following into a cell:

=HYPERLINK(“www.mymonkeydo.com”, “My Monkey Do”)

Do not put in the “http://” part otherwise it may not work.

See the Example Spreadsheet.

 

 

 

Filed Under: Off the Shelf Tagged With: google

IIS 7 PHP Write Permissions

June 15, 2011 by Webhead

Problem:

PHP is throwing errors saying it cannot find a directory when trying to upload a file.  This usually means PHP does not have permissions to create or modify files in that directory.

Solution:

I’m not sure why, but adding Modify and Write permissions for COMPUTERUsers group solves the problem.  Found the solution here: http://forums.iis.net/t/1153990.aspx

Filed Under: Coding Tagged With: iis, php

WordPress CMS Plugins

June 15, 2011 by Webhead

WordPress has tons of features, but most clients just need to edit pages and want a content management system.  I needed to get rid of all the fat.

Complicated Menus

To get rid of the menus on the dashboard for all roles except the admin place the following code in the functions.php of your theme.

function remove_menus () {
    global $menu;
    if (!(current_user_can('install_themes'))) {
        $restricted = array(__('Dashboard'), __('Posts'), __('Media'), __('Links'), __('Pages'), __('Appearance'), __('Tools'), __('Users'), __('Settings'), __('Comments'), __('Plugins'));
    }
    else {
        return;
    }
	end ($menu);
	while (prev($menu)){
		$value = explode(' ',$menu[key($menu)][0]);
		if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){unset($menu[key($menu)]);}
	}
}
add_action('admin_menu', 'remove_menus');

Thanks to http://www.wprecipes.com/how-to-remove-menus-in-wordpress-dashboard

Redirected Login

A problem that arises from this is the dashboard is pretty much useless.  You can use this plugin to redirect a user to a specific page based on their role:  http://wordpress.org/extend/plugins/peters-login-redirect/

Easy TinyMCE adjustments

One plugin that makes this very simple:  http://wordpress.org/extend/plugins/tinymce-advanced/

 

Filed Under: Coding Tagged With: php, wordpress

Preload Images with Jquery

June 15, 2011 by Webhead

Very impressive preloading:

http://www.dynamicwp.net/articles-and-tutorials/how-to-create-preload-images-with-jquery-in-wordpress/

Filed Under: Coding Tagged With: jquery

Drop Shadow with CSS

June 15, 2011 by Webhead

.shadow {
	-moz-box-shadow: 3px 3px 4px #000;
	-webkit-box-shadow: 3px 3px 4px #000;
	box-shadow: 3px 3px 4px #000;
	/* For IE 8 */
	-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000')";
	/* For IE 5.5 - 7 */
	filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000');
}

Solution found here: http://robertnyman.com/2010/03/16/drop-shadow-with-css-for-all-web-browsers/

Filed Under: Coding Tagged With: css

  • « Go to Previous Page
  • Go to page 1
  • Interim pages omitted …
  • Go to page 32
  • Go to page 33
  • Go to page 34
  • Go to page 35
  • Go to page 36
  • Interim pages omitted …
  • Go to page 40
  • Go to Next Page »

Primary Sidebar

Topics

apache apple bootstrap buddypress chrome cloudways cms css debug drupal eCommerce firebug firefox git gmail goDaddy google hosting htaccess html html 5 IE crap image iPad iPhone javascript jquery kinsta linux localization mac os x ms sql mysql open source optimize php php 7.2 svg tinymce woocommerce wordpress wpengine xss yii youtube




Categories

  • Coding
  • Off the Shelf
  • Plugins
  • Random Thoughts
  • Server Stuff
  • Tools
  • Uncategorized