Search


Latest Visitors


Photos

newtargetweb's photos flickr

View blog authority
Creative Commons License

26 ottobre 2006

Wordpress & web spider

by Matteo Crippa news .   

As far as I can, I suggest you to setup your blogs in this way:

robots.txt

User-agent: *
Disallow: /wp-
Disallow: /feed

This will stop the spider to browse and archive file that they haven’t to store at all.

Also i suggest to edit line 84 of /wp-includes/feed-functions.php in this way:

echo “$link_text“;

21 ottobre 2006

Wordpress 2.0.4 rewrite_rule

by Matteo Crippa news .   

Here you are a quick tut how to add new rewrite_rule if you are using WP.

First of all you have to edit your /wp-content/themes/theme_name/functions.php adding this:

function foo_bar_rewrite_rules($rules) {
global $wp_rewrite;
$newrules['cerca.htm$'] = ‘index.php?cerca’;
$newrules['profilo/(.+).htm$'] = ‘index.php?user=$matches[1]‘;
return array_merge($newrules,$rules);
}
add_filter(‘rewrite_rules_array’,'foo_bar_rewrite_rules’);

update_option(‘rewrite_rules’, ”);

Eg. these two rules make 2 rewrite like this:

http://domain/cerca.htm -> http://domain/index.php?cerca
http://domain/profilo/name.htm -> http://domain/index.php?userid=name

To let them work you also have to add in your .htaccess these two rules:

RewriteRule ^profilo/([^/]+)/?.htm$ /index.php?user=$1 [QSA,L]
RewriteRule ^cerca.htm$ /index.php?cerca [QSA,L]

That’s all ;)

19 ottobre 2006

TinyMCE working on Wordpress 2.0.4 with Safari.

by Matteo Crippa news .   

Hi, this is my second tutorial about WP.

In this one i’ll explain how to hack wp to get working TinyMCE 2.0.7 fine on it for safari browsers.

Let’s start!

First of all we have to upgrade out TinyMCE, look at this tutorial

Ok quite half work is done.
Now we have to edit a couple of Wp files:

tiny_mce_gzip.php

We have to edit line 18:

browsers : “msie,gecko,opera”,

changing to

browsers : “msie,gecko,opera,safari”,

wp-admin/admin-functions.php
line 1815:
we have to comment this line

/* if ( preg_match(‘!opera[ /][2-8]|konqueror|safari!i’, $_SERVER['HTTP_USER_AGENT']) )
return false;*/

and line 1083:
we replace the current the_quicktags() function with

function the_quicktags() {
// Browser detection sucks, but until Safari supports the JS needed for this to work people just assume it’s a bug in WP
echo ‘

‘;
echo ‘
‘;
}

At the moment the only bug is related to link system that seems not to work…
We have to wait till a new TinyMce version for a full support on Safari, but let’s start having it half working…