Modified the RSS feed script to build a sitemap, some observations
One thing I noted in the RSS script for BP Blog is that it builds a text file used for RSS feeds. It limits the number of entries in the file to 10 which wouldn't work for a sitemap. But it does build a file and it builds it when changes are made to the site. There is a link to update RSS on the blog update page, but it also runs when you add a new blog entry which would be an ideal time to create sitemaps.
My blog is integrated into the rest of my web site, albeit; the CSS is all jacked up. My main page lists the last 10 blog entries so anytime I update the blog, the main page is updated. I created the sitemap in xml format from a sitemap generator web site to get an idea of what the file would look like. In the header there is a link to the definition of the sitemap standard (http://www.sitemaps.org/schemas/sitemap/0.9) which I also used.
Basically, the header stays the same and the loop through the blog table provided in the RSS script is all that was needed to create a sitemap. After I tested the sitemap script by itself and confirmed that it worked (the date format in the RSS script was not compatible with the sitemap, so I had to redefine that function), I removed all the redundant code that was already in the RSS script and then added the sitemap script to the RSS script as an include file. Now every time the RSS feed is run, I build a new sitemap file which is basically every time I update my blog.
Written by Leonard Rogers on Saturday, June 22, 2013 | Comments (0)
hp Laser Jet 3380 All-in-one (AIO) printer
We installed this printer on a PC that had 3 other HP printers. One was an HP AIO that was installed over the network and one was a Inkjet that had been physically removed from the computer a long time ago, but the software drivers were still there. And there was an HP 6000 printer that we were replacing. During the installation of the HP 3380 AIO, we got an error 97 on the printer itself. There isn't any help for that error message. It seems to be general error message for anything HP doesn't know what to do with.
After the error message displayed, the old printer wouldn't work anymore either. The printer spooler kept crashing. I came in and when into the spool directory under system32 and then into the printers folder and removed all the spooled files and was able to get the spooler to start and then the old printer worked fine.
I decided the only way to get around the problem was to uninstall all the other HP devices. The process was rather lengthy with many error messages on the way. After removing all the other HP devices (all printers), we attempted to install the HP Laserjet 3380. The install with the full version of the software went through in less than a minute. I knew something was wrong because HP software has a huge overhead of software for even the simplest printers. Sure enough, the printer printed, but none of the other functions worked.
One note on the install was an error message about a program called scrubber that kept crashing with a message to send the info to Microsoft. It allowed the HP install to continue. I found out later that this scrubber was an HP product that supposedly checks the installed software and makes adjustments accordingly. The HP Laserjet 3380 is an older printer and doesn't have the imagining monitor software as well as a lot of the huge unknown HP overhead the new models have. Apparently there was a lot of HP junk still installed in the computer.
I used this hp removal utility: http://h10025.www1.hp.com/ewfrf/wc/genericSoftwareDownloadIndex?lc=en&cc=us&softwareitem=mp-24061-2 as suggested by bleepingcomputer. I didn't know if this was the HP software we had. Everything was uninstalled, so I wasn't certain how to tell the version that was stuck in the PC. This removal tool worked however. I ran it 4 times consecutively. Each time, it gave a message that it was running a different level of clean up and each one took a little longer. The final run required a reboot.
After finishing with that utility, the HP LaserJet 3380 still crashed on the scrubber issue. It still installed in less than a minute. At the end, it gave me a message that it did not install properly and to run setup again. I immediately ran the setup again and got no error on the scrubber. The software took a little longer to install, but still didn't have the indications that new installs give (I've seen HP installs take over 10 minutes to complete). The install ended stating that it was successful and to reboot. After rebooting, there was still no image monitor. There is a toolbox that installs which gives http access to a local port number that updates the printer. I opened the HP program folder and found the HP LaserJet 3380 and inside that folder was the scan tool. This tool is a little awkward. It asks if you want to print to file or email. Then you name the file and click okay. After that the scanner shows up. The first time we ran this install that didn't work, I got the same message, but when clicking the okay button, we got an error message stating that no twain compliant scanners were installed. This time, the HP scanner program did start up and the scanner worked fine.
Setting the output requirements needed to be done through the hp toolbox. This version does scan to PDF.
Written by Leonard Rogers on Wednesday, August 3, 2011 | Comments (0)
Print Margins cut off Text on Left Margin Printing from Outlook Express
I got this problem where the emails being printed from Outlook Express were cutting off on the left edge. Nothing changed on the printer. We were using a Dell Laser Printer before and replaced it with a Brother printer and left margin issue became a problem. There are no margin settings in the printer itself and in Print server properties, setting up a new form did not appear in the forms window.
After some research, I found that apparently the margins for Outlook Express are managed by Internet Explorer. Got to File / Print setup and change the margin for the left side. Print another email and the margin issue disappeared. I was losing 2 characters and changed the original left margin value from .25 to .5 and the 2 missing columns reappeared.
Written by Leonard Rogers on Tuesday, May 3, 2011 | Comments (0)
Asp coding the include directive
Few things I found by accident while programming in asp.
The include directive is not part of the asp code or, in other words, the directive doesn't go between the <% %> script delimiters.
Depending on your editor, the included file will not properly show the coding logic if the file extension is not .asp. I had an if then elseif end if structure and the elseif didn't show correctly. That's an editor issue. the include file doesn't have to end in .asp.
The script in the include file must also have the <% %> delimiters. This is a no brainer if you also have html in the file, but if the entire file is an asp script, those delimiters must also be present.
Written by Leonard Rogers on Thursday, April 21, 2011 | Comments (1)
BP Blog 9.0 linking articles from other pages not with in the provided package
On my site, I installed the BP Blog 9.0 package into it's own subdirectory and only put a link to the blog from the main page. The intent was to later incorporate content from the blog into the pages on my main site. My first project was to add the 10 most recent subjects to main page as hyperlinks. The hyperlinks would open the blog page and display the entire article exactly is it would appear if opened from the main blog page.
In order to do this, I had to open the database and pull the subject lines for each article and sort them in date order, most recent being at the top. I chose to do this with a saved query or view. As I mentioned in a previous blog, I used Postgresql database backend on my installation off BP Blog. Further more, the database server is located at a separate site from where the web server is. This doesn't change anything in my project, I am just describing my working environment. I get a lot of flack for setting up database servers separate from the web server, but I have never seen any problem with it. When you are viewing this site, the config is just as I described my working environment here.
I created the view to pull the ID and blog title from the main blog data base and sorted it by date, limiting the selection to include only the articles that were not in draft. Once I had this view saved, I was able to access the view just like I would a regular table. I chose to pull all of the records and limit the number of records in the asp script. Limiting is done differently in different databases, for example, in MS SQL it would be "top 10" and in postgres it would be "limit 10"
I then opened one of the asp pages that is normally used to display the blog text, default.asp (the one in the theme directory) works fine. I copied the lines from the top and bottom of the asp scripts and pasted them into the appropriate places in my main page file. This provided the connections file and the initial database pull. Then I replaced the SQL query text with my select statement which pulled from the view I had created and limited the output would be the 10 most recent entries.
I already had a list of projects on my main page which I was going to replace with this list. The primary difference being that the new list would change everytime I added an article to my blog. With this change my main page would now have changing content. It's the most frequently hit page of all my pages and also the most frequently abandoned page. The bullet format was already there, I just needed to replace the text and make them links. Something like this is done in the blog pages, so I opened default.asp again (same one in the themes folder) and extracted the loop script. I cut out the code that displayed the summary and changed the loop criterion to list everything instead of using the Dreamweaver pagination script that is in the default.asp.
That completed my project. The only problem I ran into, besides typos in my editing was understanding how the script worked to pick the themes in BP Blog 9.0. The main blog directory contains files that have exactly the same name as the themes directory. The asp files in the main directory only open the database to determine the theme and then re-direct to the same named file in the theme directory. Since my package was installed in a separate subdirectory, I had to modify the script copied to include the subdirectory I copied it to. For example:
<a href="/blog/template_permalink.asp?id=<%=(rsBlogSite.Fields.Item("BlogID").Value)%>
The first run I did, didn't work because I left it without the directory in bold. I then put a link directly to the subdirectory which turned out a page without any of the CSS formating. That didn't look good. So I use the default.asp page to get the theme info and set the session variable in my main page, but that wasn't needed. Each same named file in the blog directory also determines the theme you are using and sets that session variable and then calls executes the correct file in your themed directory.
That completes this project.
Written by Leonard Rogers on Thursday, February 24, 2011 | Comments (0)
Using PostgreSQL in bp blog
I discovered today that \'s won't save in the database. Right now I have to double it to make it work, but will need to modify the code to replace all \'s with double so I don't have to do it and so it will save it every time.
Written by Leonard Rogers on Thursday, February 10, 2011 | Comments (0)
Admin login page "Remember Me" always checked
It was irritating me that once I un checked remember me, that I had to keep un checking it. So I looked in the code. On line 176, the input line for the checkbox has this string in just before the conditional check of the cookie:
checked="checked" <%If...
I couldn't find any documentation for this attribute in the <input> html. However, if that checked key word is present, the word "CHECKED" provided in the conditional statment will never be used. Taking checked="checked" allows the login screen to remember that I don't want it to remember.
Written by Leonard Rogers on Thursday, February 10, 2011 | Comments (0)