-
Not written on a BlackBerry
Posted on February 13th, 2006 4 commentsNote to self: you can’t write blog posts from your blackberry. I tried once. It was a little overview of my mac mini. Yes, i have a mac mini and it’s impressive. I might even write about it again. We’ll see.
Latest little project has been playing with phpBB 2.1.2 (the pre alpha stage of phpBB3. you have to grab a cvs snapshot to play with it at the moment). It breaks during install. I hacked that into working and have since found a few more errors. After I get mine completely set up, I’ll post all of my hacks to make it run.
On another note, there’s a new mix from S. Zeilenga on the mirror here. It’s a really nice mix. Be on the look out for a new one from Cardamar later this week or next also. Cardamar Music is going to have a limited release of Xerxes latest album, the mirror formula, in march. It’s more ambiant than Cardamar, but is far from boring. It’s a beautiful album.
I have more work to get done. Will update more later.
-
Word Press Hacking
Posted on February 5th, 2006 No commentsWell, as per usual, I wanted more out of my WordPress and hence got it. This time, it was searching. I don’t know when the basic searching was added to WordPress, but I really like MySQL’s FULLTEXT matching abilities, so I went to implement them on my site. NOTE: this is not a plugin and does indeed cause you to modify core files. preform at own risk.
I started by copying the searchform.php out of the default template and adding it into my current template’s folder. That is for ease of typing. I then opened my template’s header file (you might put this in sidebar.php also) and added in for it to include searchform.php by writing (note i added a div so i could edit its appearance in css):
I verified that my edits worked and updated my css to display that div as I wanted it. The search should currently work, although poorly. Next, I modified my database. You need to execute the following query on the database that holds your wordpress tables. (You can execute it from the sql input in phpMyAdmin if you have that set up. Note that this assumes the default prefix of wp_ that you should change as appropriate):
ALTER TABLE `wp_posts` ADD FULLTEXT `realsearch` (`post_title`,`post_content`)Next was time to modify the actual search function of WordPress. This is stored in the wp-includes/classes.php and is in the get_posts() function of WP_Query. You need to do the following:- locate line 416 and cut it (it comes after the comment about search pattern and reads
$search = ' AND (';) - add the following after line 424***:
if(strlen($q['s'])>3){
$search .= " AND MATCH(`post_content`,`post_title`) AGAINST('".mysql_escape_string($q['s'])."' IN BOOLEAN MODE) ";
} else { - paste the line below this.
- add a closing brace after the closing brace of the next else (should end on line 448, add another on line 449 so you can read it)
You may want to alter the lines around 580 to have it order by the match…against clause also, but you have to be aware that wordpress will add post_ to the beginning of the $q['orderby'] clause by default. i decided to override the $q['orderby'] with ‘score’ when i was matching fulltext and then editted line 585 (4 for me since i removed part) to add the direct section if needed. the place where $post_ is added was changed also to only occur if it was not matching fulltext.
i tested and made all this on my new child. Her name is Sin. She is a Mac. I am somewhat ashamed to admit how nice it is to work with. More on that later though. To look at my finished file, browse over to http://cardamar.quad341.com/classes.phps. Enjoy.
*** = for some reason, I cannot use IN BOOLEAN MODE on this server but can on my testing server. Just remove it for it to work again. If anyone can explain that, i’d be appreciative.
- locate line 416 and cut it (it comes after the comment about search pattern and reads
-
Too many projects, too little time
Posted on January 16th, 2006 No commentsWell… berrydev is not progressing the way I wanted it to… RIM is taking their sweet time to get back to me, so I’m waiting. In the mean time, i realize that i didn’t release my cookie handler script (recently updated) to my site. It probably is one of my more useful code bits as it can help you to have secured persistant logins to your site or just storing a username (like hotmail does). That means I gotta upload and write about it… later.
I also noticed that wordpress doesn’t have a search. This can be a problem for developer blogs (ie. mine) especially after it becomes long and filled with various scripts. Hell, i should keep each script on its own page all linked off of downloads… but i don’t want to keep all the zips and such so I think i’ll just post code and talk about it until someone encourages me to do otherwise.
On a final note, I am a music lover. I always have been. it makes it somewhat logical for me to use audioscrobbler then to keep track of what I listen to. it lets artists see how many people are listening as well as what else. I like it because i can get ideas for new bands by people with similar interests. Just for fun, here is one of the status pictures that they have premade. This one is my weekly top artists (i now remember that i fell asleep with godsmack on):
-
Wiki install woes
Posted on January 9th, 2006 No commentsWell, i mentioned in my last post that i installed media wiki for berrydev.net but failed to mention the struggle to get there.
I went to install 1.5.5 (latest stable) figuring it would be ok. I swear they didn’t test the install. Note: this was a completely blank domain. no conflicts were possible.
Step one: add maintainance into the installer’s include path. in /config/index.php, edit line 118 and add
$sep$IP/maintenanceinto the include path (new line:ini_set( "include_path", ".$sep$IP$sep$IP/includes$sep$IP/languages$sep$IP/maintenance" );)Step two: edit the dbsource function. they seem to assume aliasing or something. either way, we need slashes and better references to files. insert after line 94 (so this becomes the first few lines in the function):
if(!preg_match('%^/.%',$fname)){
$fname = dirname( __FILE__ )."/".$fname;
}(probably optional) Step three: insert the contents of InitialiseMessages.inc into updaters.inc. Just copy/paste the first into the end of the second. for some reason, my server would not include the file right so i was getting “funciton not found” fatal errors. it fixed it so… eh.
in case anyone else is having problems installing it, that was what I ended up doing and all worked.
-
Annoying Spammers
Posted on November 6th, 2005 No commentsWell, since spammers don’t bother to actually read posts that are set for them, comments require an account. At least it will be easier to keep track of comments this way. This also only requires me to change a checkbox and not write any code. Sorry to anyone this bothers, but it’s small. I hope i don’t have to implement anything else.
-
Driver Swerves to Miss Cat, But Hits 36 Kids
Posted on October 31st, 2005 No commentsThirty-six children and a woman were injured Thursday afternoon when a car mowed into a line of nursery school children in the city of Shizuoka after its 59-year-old driver swerved to dodge a cat, local police said.
Q: Priorities seem ok to me.
-
Looks bad for Flock…
Posted on October 21st, 2005 No commentsI’m still trying out Flock some more, but I’m progressively becoming less and less impressed. It has very little more for most people than Firefox (the integrated “social networking” aspects are interesting, but don’t save a lot of time).
The worst thing is Flock’s web site. The forum doesn’t work right (hell, you can’t post about flock with flock. the posting page won’t render) and some links in the site are broken. This looks pretty bad in general. I know it’s only version .4.8, but it doesn’t just need bug work. It needs a greater hook. I’m going to try it out for a while more and see how other things go.
-
More Flock!
Posted on October 20th, 2005 No commentsOK, Flock is interesting. It really doesn’t seem to be much more than Firefox. It doesn’t have all the extensions you might want, but by editting the install file (really easy copy/paste job), all the ones i’ve wanted worked.
Bugs: gmail’s compose doesn’t work… that’s odd and annoying but not major.
Features: i’ve only cared about the integrated blog feature (what is doing this). It’s very useful. The favorites I have not checked out much. the search your history is very nice to save you looking for stuff again and again.
I think it has potential, but I need to figure out if it’s enough better than firefox to recommend people using it instead of firefox.
-
Flock
Posted on October 20th, 2005 No commentsOk, this is kindof cool. I’m sitting on some web page looking at who knows what and writing a blog entry about it. This is one of the integrated features of Flock. The interface is nice and the social networking aspects is quite cool. I know it’s based on Firefox, but seems to be built on 1.5 or at least is fixed for some of the security holes. I’m not sure what the drag stuff to blog it box does yet, but it seems quite promising.
Let’s see how well this blogs!



