This week I got a couple of questions on some older posts asking for a little tech assistance. Rather than reply in the comments, I thought a special post would best serve to answer their questions, or those of anyone else in the future:
ennoundinga asks on Converting Your WordPress Blog to an eBook (Part 2) : In my Blog export I would like to grab the comments also. Do you think there is a chance to extend the XSL transformation to evaluate the comments?
For my solution I wanted to do two things:
- Add a “Comments” header if comments existed, and hide it if there are none
- Format comments with the comment author and comment content
Testing for the existence of comment elements can be accomplished with an xsl:if test:
<xsl:if test="./wp:comment"> <h2><b>Comments:</b></h2> </xsl:if>
The xpath statement “./wp:comment” looks for the first comment element that is a child of the current post. If one is found the “Comments” header is printed. If not the parser moves on to the next post.
If comments are present the following code will format them into our working HTML:
<xsl:for-each select="wp:comment"> <b> <xsl:for-each select="wp:comment_author"> <xsl:call-template name="print-paras"/> </xsl:for-each> </b> <em> <xsl:for-each select="wp:comment_content"> <xsl:call-template name="print-paras"/> </xsl:for-each> </em> </xsl:for-each>
Both the comment content and author name are stored in CDATA statements and need to be processed by our print-paras template. This code will format the comment like this:
Name of Commenter
What the commenter said in all its glorious detail.
I’ve uploaded an update to the XSL template here (again note since WordPress has filename restrictions the extension has been renamed .xls).
Next question, I’m on a rampage!
WZ writes on AGFV: 20 years of Star Trek 25th Anniversary : Ben: Followed your instructions carefully for Star Trek 25th using DBGL, but I only have the CD not floppies version. DBGL is fine. This game appears to not run because (per dos window) the game is looking for a CD to be in the CD drive. But need this to run from the hard disk instead because of physical disability makes it hard to always be putting cd’s in and out of the drive bay. Is the CD game version hardcoded to only run from CD bay? Please reply to my email… Thanks for your gaming blog, it’s great, I enjoyed all your gaming entries.
As it happens, I was reorganizing some of my DBGL files this week (no joke) and managed to create a solution to this very problem.
The 25th Anniversary Enhanced Edition CD-ROM is a little unusual. It’s an Enhanced CD, meaning it has both CD Audio content and CD data content. This means it can’t be fully ripped to an ISO image, since ISO’s only deal with CD data. But there are programs available that allow you to rip an enhanced CD, one such being CloneCD.
To rip an enhanced CD using CloneCD:
1) Open CloneCD and click Read to Image File:
2) CloneCD will analyze the disc in the drive, and ask you to select the type of CD. Many selections will work for our purposes, but for now select Game CD:
3) Browse to a folder and choose a name for your file (the program will actually create four different files so maybe store in a blank folder). Check the box next to Create “Cue-Sheet”:
4) Click OK to begin ripping the CD:
5) When you’re finished your folder will contain four files that will look something like this:
6) Create a folder in dbgl\dosroot called TREKCD (full path dbgl\dosroot\TREKCD). Copy the folder containing your ripped CD to this folder.
7) You’ll need to install the game from the CD first, then set DBGL to run it. Add a mount for the C drive to the TREKCD sub-folder. Add another mount for the D drive and select the Mount Image(s) radio button. Click Browse, browse to your CUE file and select it as the mount point.
8) With the imgmount selected, click the Grab button next to the main then Browse to add files from the CD image to run at startup. Select INSTALL.EXE. Your run window should look like this:
9) Click OK, and run the file to run the install program. When the installation is finished copy the files it installed into your TREKCD folder. Your final directory should look something like this (you may not have the CFG or savegame files):
10) Edit the Profile again and change the Main to STARTREK.EXE in the TREKCD folder, and Setup to SETUP.EXE (in the same folder). Your final setup should look like this:
Note: You probably want to set your machine to 7500 cycles for optimum performance.
And you should be good to go. Let me know if you have any further questions.