The MU forums have moved to WordPress.org

Custom theme, dev wants to hack system files? (13 posts)

  1. carpman
    Member
    Posted 18 years ago #

    Hello, i am having custom theme made for my site and all is not going well.

    The 1st effort did not work at all, then the said to dump my install and install with there dumped installation which was wordpress not wordpress-mu.

    Now they are telling me that for theme to work i have to replace number of system files with their versions for theme to work?

    This does not seem correct to me?

    Should a custom theme need to have system files changed?

    many thanks

  2. dsader
    Member
    Posted 18 years ago #

  3. carpman
    Member
    Posted 18 years ago #

    Bit late for that, but i take you are confirming that edited system files is not the norm?

  4. tdjcbe
    Member
    Posted 18 years ago #

    This does not seem correct to me?

    Doesn't to me either.

    For a system admin to hack system files, it's pretty much the norm for someone who knows what they're doing and feels comfortable with doing so. For a developer, maybe even as well although that would be more for plugins. (The old sitewide tags solution required a single line changed in the core files.)

    For a theme developer to require system files to be changed is unheard of.

    Considering that they're telling you to install wordpress while you're running wpmu says to me that in this case, they might be the world's best theme developer but it appears they may not be aware of what they are doing. That's not to insult them. They may not have any expertise in the are of wpmu. It's just awfully weird.

    Granted though they may have a legit reason to do so. Have to wonder why they're not using plugins of the theme's function.php file to get the result that they want.

  5. andrea_r
    Moderator
    Posted 18 years ago #

    "i take you are confirming that edited system files is not the norm?"

    I'll confirm it too. If it's just a regular theme, then drop them like a hot rock. Even in MU, where you want fancy frills, if they say you need to edit core files, they DO NOT KNOW WHAT THEY ARE DOING.

    Yes, I'm yelling.

  6. carpman
    Member
    Posted 18 years ago #

    Thanks for replies.

    One of the files they wish me change is class.php from /includes

    I did a dif on it and they have removed this code:

    ///Code removed////

    $taxonomy_query_vars = array();
    
    foreach ( $GLOBALS['wp_taxonomies'] as $taxonomy => $t )
    			if ( isset($t->query_var) )
    				$taxonomy_query_vars[$t->query_var] = $taxonomy;
    
    if ( in_array( $wpvar, $taxonomy_query_vars ) ) {
    					$this->query_vars['taxonomy'] = $taxonomy_query_vars[$wpvar];
    					$this->query_vars['term'] = $this->query_vars[$wpvar];
    				}
    			}
    
    $num_elements =
    			for ( $i = 0; $i < $num_elements; $i++ ) {
    
    $num_elements--;

    /// end code removed ///

    They also added two large chunks of code, here is one:

    // ########################################################## Middle content ####################################################
    class Walker_Page_middle extends Walker {
    	var $tree_type = 'page';
    	var $db_fields = array ('parent' => 'post_parent', 'id' => 'ID'); //TODO: decouple this
    
    	function start_lvl(&$output, $depth) {
    		$indent = str_repeat("\t", $depth);
    		$output .= "\n$indent
    
    <ul>\n";
    	}
    
    	function end_lvl(&$output, $depth) {
    		$indent = str_repeat("\t", $depth);
    		$output .= "$indent</ul>
    \n";
    	}
    
    	function start_el(&$output, $page, $depth, $current_page, $args) {
    		if ( $depth )
    			$indent = str_repeat("\t", $depth);
    		else
    			$indent = '';
    
    		extract($args, EXTR_SKIP);
    		$css_class = 'page_item page-item-'.$page->ID;
    		if ( !empty($current_page) ) {
    			$_current_page = get_page( $current_page );
    			if ( in_array($page->ID, (array) $_current_page->ancestors) )
    				$css_class .= ' current_page_ancestor';
    			if ( $page->ID == $current_page )
    				$css_class .= ' current_page_item';
    			elseif ( $_current_page && $page->ID == $_current_page->post_parent )
    				$css_class .= ' current_page_parent';
    		}
    			if($page->post_parent>0)
    			{
    		$output .= $indent . '<a>ID) . '" title="' . attribute_escape(apply_filters('the_title', $page->post_title)) . '">' . apply_filters('the_title', $page->post_title) . '</a>';
    			}
    		if ( !empty($show_date) ) {
    			if ( 'modified' == $show_date )
    				$time = $page->post_modified;
    			else
    				$time = $page->post_date;
    
    			$output .= " " . mysql2date($date_format, $time);
    		}
    	}
    
    	function end_el(&$output, $page, $depth) {
    		$output .= "\n";
    	}
    
    }
    // #######################################################################################

    How, if at all, would this affect wordpress-mu?

    PS i will not be accepting any theme that requires editing of system files.

  7. tdjcbe
    Member
    Posted 18 years ago #

    Please don't post code to the forums. It is unreadable. Please use pastebin or put it into a *txt file post a link.

  8. andrea_r
    Moderator
    Posted 18 years ago #

    We can't see any reason why they felt the need to remove the code above.

    as for the next bit, what it looks like they're doing is inserting a bunch of tabs and making a page list. Again, there's plugin hooks for that. No need to edit the core. Changes like this would affect *every* blog on your system whether they were using the theme in question or not.

    Now I'm curious - what kind of theme features did you ask for that would lead them to making this kind of suggestion?

  9. carpman
    Member
    Posted 18 years ago #

    Sorry about the code.

    I did not ask for any special features, i gave outline for design which they did and i am happy with design, but i did stipulate that it must be compatible with standard wordpress-mu themes and even gave them link to big 100 WPMU themes so they can see what code would need to be like.

    I think they have no idea about WPMU themes!

  10. MrBrian
    Member
    Posted 18 years ago #

    Is this theme for the homepage or a theme for users? Normal themes are compatible with WPMU, but often homepage themes have special data like Recent Posts and such that WPMU has no functions for. I don't see why they are saying you need to change core files unless your theme does something different than normal themes do.

  11. andrea_r
    Moderator
    Posted 18 years ago #

    "and even gave them link to big 100 WPMU themes so they can see what code would need to be like"

    All of the themes in that are no different than WP themes. They've just been cleaned up a little.

    "I don't see why they are saying you need to change core files unless your theme does something different than normal themes do. "

    Especially since they said (above) that it works in regular WP.

    Seriously, I could post all day about the stuff I've seen people code strangely - ones who knew WP but not MU, ones who knew php but not WP and some I dunno what they were thinking...

  12. carpman
    Member
    Posted 18 years ago #

    I said i would be using it for front page and default for users.

    I new it was not right to be editing core files!

  13. carpman
    Member
    Posted 18 years ago #

    Ok seems they finally got the message that theme is for wordpress-mu and wordpress, though this should not have made that big a difference.

    All seems to work ok but i have to check it is, plus see if can find somebody to do quick check on theme code to make sure all is well.

About this Topic