Tag Archives: code

links for 2008-02-06

OpenID Delegation

Any blog or webpage which you can edit the HTML, templates, or code, will allow you to support OpenID.

Read section 3.1.1. of the OpenID Authentication 1.1 spec.

It is as simple as adding two lines of HTML which point to an OpenID Identity Provider. I’m feeling so nice, I’ll even give two code examples which you will need to fix to be proper tags. eg. > and < are needed.
### The following would work for LiveJournal accounts.
<link rel=”openid.server” href=”http://www.livejournal.com/openid/server.bml” />
<link rel=”openid.delegate” href=”http://exampleuser.livejournal.com/” />

### The following would work for MyOpenID accounts.
<link rel=”openid.server” href=”http://www.myopenid.com/server” />
<link rel=”openid.delegate” href=”http://exampleuser.myopenid.com/” />

[tags]openid, delegation, livejournal, HTML, code, example[/tags]

wordpress url change mysql code

I changed the url of my blog again recently here is some helpful mysql code to renaming a wordpress blog url. YMMV. You’ll need to find all the other fields which containd the old information. I’d like this to be a plugin, it’s more or less a set of simple database commands, but for now cut and paste code will work ok.

 
UPDATE `wp_postmeta` SET `meta_value` = REPLACE(`meta_value`,'blog.blog.px.ns1.net','blog.px.ns1.net');# MySQL returned an empty result set (i.e. zero rows).
 
UPDATE `wp_comments` SET `comment_author_url` = REPLACE(`comment_author_url`,'blog.blog.px.ns1.net','blog.px.ns1.net');# MySQL returned an empty result set (i.e. zero rows).
 
UPDATE `wp_options` SET `option_value` = REPLACE(`option_value`,'blog.blog.px.ns1.net','blog.px.ns1.net');# MySQL returned an empty result set (i.e. zero rows).
 
UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`,'https://px.ns1.net','http://blog.px.ns1.net:81');
 
UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`,'http://px.ns1.net:81','http://blog.px.ns1.net:81');
UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`,'/wordpress','/');
UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`,':81//',':81/');
UPDATE `wp_xspf_player` SET `url` = REPLACE(`url`,'https://px.ns1.net','http://blog.px.ns1.net:81');
 
UPDATE `wp_posts` SET `guid` = REPLACE(`guid`,'https://px.ns1.net/','http://blog.px.ns1.net:81/');
 
UPDATE `wp_posts` SET `guid` = REPLACE(`guid`,'http://px.ns1.net:81/','http://blog.px.ns1.net:81/');
 
UPDATE `wp_posts` SET `guid` = REPLACE(`guid`,'/wordpress/wordpress/','/');
UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`,"[php]","&lt;pre lang=\"php\"&gt;");
 
 UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`,"[/php]","&lt;/pre&gt;");

update:

UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`,'/wordpress/wordpress/','/');
UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`,'/wordpress/','/');
UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`,'http://px.ns1.net:81/','http://blog.px.ns1.net/');
UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`,'http://blog.px.ns1.net:81/','http://blog.px.ns1.net/');
UPDATE `wp_posts` SET `pinged` = REPLACE(`pinged`,'ns1.net/wordpress/','ns1.net/');
UPDATE `wp_posts` SET `pinged` = REPLACE(`pinged`,'http://px.ns1.net:81/','http://blog.px.ns1.net/');
UPDATE `wp_posts` SET `pinged` = REPLACE(`pinged`,'/wordpress/wordpress/','/');
 
UPDATE `wp_posts` SET `guid` = REPLACE(`guid`,'http://blog.px.ns1.net:81/','http://blog.px.ns1.net/');
 
UPDATE `wp_postmeta` SET `meta_value` = REPLACE(`meta_value`,'http://px.ns1.net:81/','http://blog.px.ns1.net/');
UPDATE `wp_postmeta` SET `meta_value` = REPLACE(`meta_value`,'http://blog.px.ns1.net:81//','http://blog.px.ns1.net/');
UPDATE `wp_postmeta` SET `meta_value` = REPLACE(`meta_value`,'http://blog.px.ns1.net:81/','http://blog.px.ns1.net/');
UPDATE `wp_postmeta` SET `meta_value` = REPLACE(`meta_value`,'/wordpress','/');
 
UPDATE `wp_options` SET `option_value` = REPLACE(`option_value`,':81','');

[tags]mysql, wordpress, wordpress database, mysql code, code, examples, URL, change, tables, fields, rename, replace, blog, mysql code,cut and paste, database commands [/tags]

Bad Behavior has blocked 1454 access attempts in the last 7 days.

>>>>>>> .r246