sharepoint comments edit

It has come to my attention that at this time there are no real documents out there (at all - even internal to Microsoft) that discuss the ins and outs of querying SPS 2003 via the search web service and fulltext search queries. Nobody seems to have the magic answer as to how to formulate the query - what you can SELECT, what goes in the WHERE clause, etc.

I don’t have the answer, but I know how you can get a jumpstart on figuring out how it works.

On the SharePoint Portal Server 2003 “advanced search” page (the one that allows you to search over document metadata), do a search. Once you get the results you want, do a “View Source.” Scroll down near the bottom (or search for “SELECT” - match the upper case letters, too) and check this out: They embed the entire SQL full-text query right in the page.

Apparently that’s how the MS guys figure out how the thing works; if it works for them, it should work for you, too. Good luck!

gists, php, blog comments edit

I had a problem where I wanted to add a pMCode tag in pMachine to allow me to automatically link to other pages on my site. For example, normally you can use [url=http://somesite.com]linktext[/url] to create links to other sites… but what if you want to link to pages in your own site? Adding hard references like that makes the site sort of inflexible if you change your URL or move to a different server (which is the problem I had). Wouldn’t it be nice if you could link to, say, your comments page by doing something like this: [commentlink=123]linktext[/commentlink]

So that’s what I drummed up. It seems to work for my site, which only hosts one blog, but it should work for multi-blog sites, too. To enable this change, you’ll need to edit your /pm/lib/pmcode.fns.php file.

At the top of the pmcode_decode function, add the following:

global $weblog;

Now add the following lines as shown, around line 305 in the file, with the rest of the substitutions:

// [commentlink=123]sometext[/commentlink]
$str = preg_replace("/\[commentlink=(.*?)\](.*?)\[\/commentlink\]/i", "<a href=\"" . get_comments_link('\\1', $weblog) . "\">\\2</a>", $str);

Then copy and paste the following function in that same file, somewhere toward the bottom:

function get_comments_link($postid, $weblog = ""){
 global $db_multiweblogs, $db_categories, $db_weblog;
 global $db_members, $db_upload_prefs, $db_nonmembers, $pingserver_path;
 global $db_comments, $profileviewpage, $auto_xhtml, $url_rewriting, $sfx;

 if ($weblog == "") $weblog = "weblog";

 $db = new DB();
 $blogid_array = array();
 $sql = "select id,weblog from $db_multiweblogs order by id";
 $query = new DB_query($db, $sql);

 while ($query->db_fetch_object())
 {
  $blogid_array[$query->obj->weblog] = $query->obj->id;
 }

 unset($query);
 unset($sql);

 $catpage = (isset($blogid_array[$blog]))  ? $blogid_array[$blog] : "1";
 $pagespath = get_pref("pages_path_abs_$weblog","1");
 $comments_page = get_pref("comments_page_$weblog");

 $delim = '?id=';

 if ($url_rewriting == 1)
 {
  $delim = '/';
  $comments_page = str_replace($sfx, '', $comments_page);
 }

 $catrow     = 0;

 $comments_url = "$pagespath{$comments_page}$delim$prefix{$postid}_0_{$catpage}_{$catrow}_C";

 if ($url_rewriting == 1) $comments_url .= '/';

 return $comments_url;
}

That should do it. Now you can use the new “commentlink” pMCode tag. Just pass in the ID to the entry you want to link to, like this: [commentlink=123]linktext[/commentlink]

Good luck!

I know enough about myself to admit my weaknesses and know the boundaries on my abilities. For example, I have very little patience with people. I already know I have this flaw, and I do my best to accommodate for it by avoiding situations where it may require I have a lot of patience in regards to socializing with others. I try to spare myself - and everyone else - the pain of having to deal with me once my patience wears out.

See, for me, patience is sort of like a bank account: You have a certain amount of patience, you spend it on different situations, and when you’re out, you’re out - time to back off and build up some more patience in the old account.

Teaching people is like going on a patience spending spree. I get spending long before I even get to the teaching part. I start thinking about all the different stupid shit the person I will eventually be teaching will want to know, then I get thinking about how I’m going to answer the questions - particularly technical questions from a non-technical person - and pretty soon I’m already stressed out and pissed off.

Putting this into perspective, I just got off a very, very long project at work that pretty much kept my patience bank at a low level. I got by, but barely, and I look back on it now as a trial that I successfully overcame; I’m happy with the end product, I’m happy with the team I worked with, and I’m happy that we were able to succeed. That said, I need a little time before jumping right back into the fire so I can build my patience account back up. I’m fresh out. Plus, now that I’m working on a different project, I’d like to actually make some headway on the new project, not continually context-switch back to the old project.

I got word today that we’ve got a non-technical guy who needs to be educated on how to do some reasonably technical stuff to customize the output of my last project. To that end, I’ve been tasked to train this guy on how to do the changes, then potentially have a meeting where I train a room full of these people.

Asking for this is akin to saying “We have a whole bunch of people who don’t know how the web works; in two hours or less, you need to teach them how to make web pages using cascading style sheets.” At the very best, my patience bank just got robbed for whatever was left; more likely, I’m going to end up shooting all these people and then shooting myself.

You might ask yourself what the big deal is. The problem is in the way I work. My mind moves very quickly and not necessarily in a straight line from point A to point B. In fact, there are usually about 20 different points in between that I stop at on the way. This doesn’t translate well in a training environment for things where there’s not actually a process to follow. In many cases, I don’t even know how I got from point A to point B - there was a path, there was some method to the madness, but articulating that is beyond my abilities. This trait became problematic in college math classes where I’d write out the problem then the solution right after; you’re supposed to show your work but I don’t know how I got the answer, I just knew what the answer was.

It’s the articulation of the path that blasts away my patience. If I slow down enough to explain the exact thought process going on, I lose track of where I am and don’t actually accomplish anything. Ever start to say something and then forget what you were going to say right as you were going to say it? It’s like that. I’m like, “Okay, first you do this, then… uh… what were we working on?”

Note that this is different if I have a curriculum to teach and there’s a process to be followed. When it’s not “train this entirely non-technical person on a totally unstructured technical topic,” I do reasonably well. I can answer questions, follow a curriculum, and all is well. It’s when I have to get into defining a process for how to do something at the same time I’m trying to teach the person how to do it that really gets me… the impromptu requests for training on topics that have no curriculum, process, or structure. That’s where we have issues.

Anyway, I’m doing my best to make my displeasure at this training idea known without overtly pissing too many people off. I’m quickly coming upon the time where I won’t care about who I piss off, though, and that could be career limiting. Here’s hoping I don’t end up getting fired, eh?

downloads, media, music comments edit

I’ve seen a few ways to do this out there, usually involving a Perl script of some nature, but why go to the hassle? When iTunes exports the XML, just transform it using an XSL style sheet to convert to HTML. This might not be as easy for the lay user, but it is certainly better than manually scripting it.

First, download itunes2html.xsl and put it in the same folder as the exported library XML file.

That’s it. If you open the document in a browser that knows XML (like IE6), the XML will automatically be displayed after being transformed to HTML. Copy and paste the results into Excel, if you want. Works pretty well. Note that to actually get HTML source out of the thing, you’ll have to use a command line transform utility like MSXSL.

personal, dotnet, sql comments edit

The end of a long, long journey has finally arrived.

I took my last test today, MS070-228: Installing, Configuring, and Administering Microsoft SQL Server 2000 Enterprise Edition, and passed. I got a score of 854 (passing was 700) and from the look of the results sheet, I think I only missed one question (they don’t actually tell you how many you got right or wrong, but you can sort of tell by looking at these little graphs they give you that show your strengths and weaknesses based on the questions you got right).

That makes me a Microsoft Certified Database Administrator, which, alongside my existing Microsoft Certified Solutions Developer for .NET certification, is pretty cool. It’s been over a year in the making, and it’s finally come to fruition.

Yay, me!