Category Archives: CMS

Getting WordPress multisite work with Windows Live Writer

Windows Live Writer is configured for working with WordPress multi-site the same way as with normal single-site WordPress installation, but WordPress works a bit differently in multi-site and single-site configurations. The difference consists in a few lines of code in wp-includes/class-wp-xmlrpc-server.php:

function wp_getUsersBlogs( $args ) {
    global $current_site;
    // If this isn't on WPMU then just use blogger_getUsersBlogs
    if ( !is_multisite() ) {
        array_unshift( $args, 1 );
        return $this->blogger_getUsersBlogs( $args );
    }

    //single-site verion...
}

(more…)

How to modify product page title in VirtueMart 1.1.9, Joomla 1.5.23

Function $document->setTitle($title) is called from “administrator/components/com_virtuemart/classes/mainframe.class.php”:

function setPageTitle( $title ) {
    global $mainframe;
    $title = strip_tags(str_replace(' ',' ', $title));
    $title = trim($title);
    if( defined( '_VM_IS_BACKEND')) {
        echo vmCommonHTML::scriptTag('', "//<![CDATA[
        var vm_page_title=\"".str_replace('"', '\"', $title )."\";
        try{ parent.document.title = vm_page_title; } catch(e) { document.title =vm_page_title; } 
        //]]>
        ");
        
    }
    elseif( vmIsJoomla('1.5') ) {
        $document=& JFactory::getDocument();
        $document->setTitle($title);
    } else {
        $mainframe->setPageTitle( $title );
    }
}

(more…)

Progressive discounts in VirtueMart

I did some investigation of VirtueMart 1.1.x discount system and the first thing I did notice is that VirtueMart 1.1.x does not support progressive discounts natively. In other words it does not allow to define the discount based on the amount of products bought or total amount of money paid.

(more…)

Getting WordPress Syntax Highlighter work

WordPress has a very nice plugin called SyntaxHighlighter Evolved based on JavaScript package written by Alex Gorbatchev.

To make it work with Widows Live Writer I commented out a line of code in wp-includes/kses.php that installs some filter:

function kses_init_filters() {
	// Normal filtering.
	add_filter('pre_comment_content', 'wp_filter_kses');
	add_filter('title_save_pre', 'wp_filter_kses');

	// Post filtering
	//add_filter('content_save_pre', 'wp_filter_post_kses');
	add_filter('excerpt_save_pre', 'wp_filter_post_kses');
	add_filter('content_filtered_save_pre', 'wp_filter_post_kses');
}