RE: [WebDNA] List Files question

This WebDNA talk-list message is from

2009


It keeps the original formatting.
numero = 103679
interpreted = N
texte = Thanks Ken and everyone else who replied so quickly. I'll give your suggestions a go this afternoon when I return from an appointment. Muchas gracias! Michael A. DeLorenzo Broker - Associate General Manager Olde Carriage Realty, Inc. Office: 904-824-4500 Mobile: 904-377-5582 Toll-Free: 1-800-555-6138 Fax: 904-824-6866 www.oldecarriage.com -----Original Message----- From: Kenneth Grome [mailto:kengrome@gmail.com] Sent: Wednesday, September 23, 2009 6:08 PM To: talk@webdna.us Subject: Re: [WebDNA] List Files question This should be exceptionally fast: Use listfiles one time -- at the top of the page -- to create a table: [table name=pics.db&fields=fName] [listfiles path=pics][filename] [/listfiles][/table] Then do a lookup in the table to see if each file you're looking for actually exists ... and take advantage of the 'notfound' parameter in the lookup tag to avoid using showifs/hideif's and/or if/then/else: You should be able to copy/paste this code into your page. I may have missed something but I think this will do it. :) Sincerely, Ken Grome > I need help. My server is bogging down with the following code as it is run > a few hundreds times on the same page. Is there anyone out there that can > help me increase the efficiency of this? > > > > [text]thumb=t[/text] > > [listfiles path=pics&name=[sku]A.jpg&exact=t] > > [showif [filename]!][text]thumb=f[/text][/showif] > > [/listfiles] > > > > > [showif [thumb]=t][/showif] > > [showif [thumb]=f][/showif] > > > > > > Basically I am looking in the pics folder to see if a photo exists and if it > does then display the photo, if it does not then display a generic > placeholder photo. Maybe an if/then would be faster? Is there any statistics > on how quick an if/then is compared to showif and hideif? > > > > Thanks in advance for all help. > > > > > > Michael A. DeLorenzo > > Broker - Associate > > General Manager > > Olde Carriage Realty, Inc. > > Office: 904-824-4500 > > Mobile: 904-377-5582 > > Toll-Free: 1-800-555-6138 > > Fax: 904-824-6866 > > www.oldecarriage.com > > > > --------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us old archives: http://dev.webdna.us/TalkListArchive/ Bug Reporting: http://forum.webdna.us/eucabb.html?page=topics&category=288 Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] List Files question (Patrick McCormick 2009)
  2. Re: [WebDNA] List Files question ("Terry Wilson" 2009)
  3. RE: [WebDNA] List Files question ("Will Starck" 2009)
  4. Re: [WebDNA] List Files question (Kenneth Grome 2009)
  5. RE: [WebDNA] List Files question ("Michael A. DeLorenzo" 2009)
  6. Re: [WebDNA] List Files question (Patrick McCormick 2009)
  7. Re: [WebDNA] List Files question (Kenneth Grome 2009)
  8. Re: [WebDNA] List Files question ("Gary Krockover" 2009)
  9. Re: [WebDNA] List Files question (Kenneth Grome 2009)
  10. Re: [WebDNA] List Files question (Marc Thompson 2009)
  11. Re: [WebDNA] List Files question (William DeVaul 2009)
Thanks Ken and everyone else who replied so quickly. I'll give your suggestions a go this afternoon when I return from an appointment. Muchas gracias! Michael A. DeLorenzo Broker - Associate General Manager Olde Carriage Realty, Inc. Office: 904-824-4500 Mobile: 904-377-5582 Toll-Free: 1-800-555-6138 Fax: 904-824-6866 www.oldecarriage.com -----Original Message----- From: Kenneth Grome [mailto:kengrome@gmail.com] Sent: Wednesday, September 23, 2009 6:08 PM To: talk@webdna.us Subject: Re: [WebDNA] List Files question This should be exceptionally fast: Use listfiles one time -- at the top of the page -- to create a table: [table name=pics.db&fields=fName] [listfiles path=pics][filename] [/listfiles][/table] Then do a lookup in the table to see if each file you're looking for actually exists ... and take advantage of the 'notfound' parameter in the lookup tag to avoid using showifs/hideif's and/or if/then/else: You should be able to copy/paste this code into your page. I may have missed something but I think this will do it. :) Sincerely, Ken Grome > I need help. My server is bogging down with the following code as it is run > a few hundreds times on the same page. Is there anyone out there that can > help me increase the efficiency of this? > > > > [text]thumb=t[/text] > > [listfiles path=pics&name=[sku]A.jpg&exact=t] > > [showif [filename]!][text]thumb=f[/text][/showif] > > [/listfiles] > > > > > [showif [thumb]=t][/showif] > > [showif [thumb]=f][/showif] > > > > > > Basically I am looking in the pics folder to see if a photo exists and if it > does then display the photo, if it does not then display a generic > placeholder photo. Maybe an if/then would be faster? Is there any statistics > on how quick an if/then is compared to showif and hideif? > > > > Thanks in advance for all help. > > > > > > Michael A. DeLorenzo > > Broker - Associate > > General Manager > > Olde Carriage Realty, Inc. > > Office: 904-824-4500 > > Mobile: 904-377-5582 > > Toll-Free: 1-800-555-6138 > > Fax: 904-824-6866 > > www.oldecarriage.com > > > > --------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us old archives: http://dev.webdna.us/TalkListArchive/ Bug Reporting: http://forum.webdna.us/eucabb.html?page=topics&category=288 "Michael A. DeLorenzo"

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Problems appending to database (1997) Plugin or CGI or both (1997) emailer (1997) comparison to Lasso 6 or 7 (2004) Deleting Multiple Database Records based on Checkbox (1998) [WebDNA] TLS 1.2 and [tcpconnect] (2018) 'does not contain' operator needed ... (1997) Weird Math and SV Bad News (1997) [cart]'s ever get recycled? (2000) Problems getting parameters passed into email. (1997) WebCat2b13MacPlugIn - [include] doesn't allow creator (1997) UNC path support in WebDNA 5.0 (2003) Re:Running 2 two WebCatalog.acgi's (1996) Help! WebCat2 bug (1997) converchars in sendmail context.... (2004) format and math on the fly (1998) OK, here goes... (1997) What am I missing (1997) Duplicates (1998) WebMerchant 2.1.2 (1998)