Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Q:  Numeric part of file names

I use CityDesk to maintain a blog, to which I would like to add comments via YACCS.  YACCS requires that each comment be identified to it by an ascending NUMBER.  The numeric part of the file name would be excellent for this purpose -- save that it preceded by "fog".  Is there a way to get only the numeric portion of the file name?

John "Akatsukami" Braue
Monday, May 13, 2002

PTMFOG urls are internal to citydesk... so you can't even get citydesk to spit out the ptmfog number in html.

I had written up some javascript that did what you wanted, but then I realized that CD just replaces PTMFOG urls with the real url at publish time, so it won't work.

You could still use some javascript that took the fileddate and made it into a unique number.  Something like the following (although you'll have to edit the syntax etc).

First set the date time format so you get mm/dd/yyyy

In the article :
<a href="{$x.fileddate$}" id="yaccurl">Yacc Comment</a>

Then on the Page Load event call a javascript function such as:

var nID;
nID = yaccurl.href.value.replace("/","");
yaccurl.href.value = "http://yacc.cgi?id=" + nID

You'll have to play with the code, but you get the idea.

Customer Service
Monday, May 13, 2002

What's your back-end server? I wrote an ASP.net comments system that can use any database as a backend (Access, SQL, etc.) and works great with CityDesk...

Brad Wilson
Tuesday, May 14, 2002

Brad: Is the comments system for ASP.NET you built online? I found your message board, but, was looking for something more along the lines of YACC

Steve M
Friday, May 17, 2002

I posted example code which mimics this style of free-posted topics & comments, but I also use the same engine to power the comments for my weblog. In that usage, the users cannot create topics on their own, they can only respond to articles I've posted.

http://www.quality.nu/

Brad Wilson
Thursday, May 23, 2002

*  Recent Topics

*  Fog Creek Home