Uncategorized

Not written on a BlackBerry

Note 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...

Read More

Word Press Hacking

Well, 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...

Read More

Too many projects, too little time

Too many projects, too little time

Well… 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...

Read More

Wiki install woes

Well, 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/maintenance into 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...

Read More

Annoying Spammers

Well, 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.

Read More

Driver Swerves to Miss Cat, But Hits 36 Kids

Thirty-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. read more | digg...

Read More