 | |  |
 |

terrill
User
Aug 11, 2002, 11:19 AM
Post #1 of 12
(6110 views)
Shortcut
|
|
Subcat NEXT/PREV/Search Fix (and more?)
|
Can't Post
|
|
UPDATED 19-Aug-02: Files attached to this post are now obsolete. If you haven't already placed these files in use (and you want subcategories, Please see further down this thread for newest version!!! Last week we heard Terrill say, "But, using this Subcategory work-a-round breaks the More Headlines, Next, Prev and Search stuff." Pretty bad, huh? But, I warned ya! Since my site will have over forty subcategories (for different products our team supports), I ***REALLY*** need subcategories. At whatever it takes. SO, here's the fix to not only the aforementioned problems, but the code in sfront.cgi COULD easily be modified to act as an SSI for Interactives' Search.cgi engine (another topic on which I've seen several post in various forums). But, I digress... There are three atachements to this message: cats.txt (documentation on implementing) cats.cgi (perl script) sfront.cgi (yet another perl script) IF you've already installed the cats.cgi script, there are "cosmetic-only" changes in this attached version. While you don't have to download it (copy it, whatever) and re-change the places indicated, I'd suggest it, since I moved all the things you change to the top of the script. Makes life easier on YOU if you ever move your site or Artman, OR if you get another customer and you want to implement this on THEIR site. sfront.cgi is a front-end to Interactives' nifty search.cgi. Since their search engine does NOT process SSI exec's (or includes), sfront.cgi DOES! It actually calls search.cgi, captures search.cgi's output via a pipe, and then looks for the SSI exec and executes the program YOU wanted executed (in this case, it's cats.cgi). Note however that, they way I choose to implement this, it only executes the FIRST #exec it finds. You could change it so it executes ANY exec, if you wanted. Change it more, and include includes that search.cgi doesn't. I don't relish the idea of being a front-end to other peoples programs over which I have no control. The only reason I've gone this far is because I *NEED* it. It's done. It works. I'm finished. Read the documentation. It's 3-times bigger than either of the programs because I want you to UNDERSTAND what it does. Nothing hidden. Nothing secret. It attempts to give you a clear indication of what the programs do. The code itself is *heavily* documented (over half of each program are comments!) so even non-programmers should be able to get the idea of what it does, why and more important, how. Even if you're not going to use it, you still may find it to be an interesting insight of what CAN be done. Ninety-percent of the process is knowing I can or can not do something. Nine percent is finding someone else's code that almost does what you want. One percent is modifying that code to do what you want it to do. Feel free to use my code, and make it yours. Enjoy! -- Terrill --
"Evaporating expectations of quality: 1980's paradigm: If it's worth implementing once, it's worth implementing twice. 1990's paradigm: Ship the prototype! 2000's paradigm: Ship the idea!" ---Larry Rosler: http://www.perl.com/pub/a/2000/06/rosler.html
(This post was edited by terrill on Aug 19, 2002, 5:31 PM)
|
|
Attachments:
|
sfront.cgi
(3.02 KB)
|
|
|
cats.cgi
(4.44 KB)
|
|
|
cats.txt
(13.2 KB)
|
|
|  |
 |

WebGuys
User
Aug 11, 2002, 7:29 PM
Post #2 of 12
(6100 views)
Shortcut
|
|
Re: [terrill] Subcat NEXT/PREV/Search Fix (and more?)
[In reply to]
|
Can't Post
|
|
this is prolly a stupid question ( i am full of them) but anyway is there a way, and yes i realize this isnt the place for this question but, i am trying to intigrate a photo gallery into AM and need SSI calls, is it possible to make cgi that calls a template also call ssi's ? thanks all Terrill you ROCK!
|
|
|  |
 |

terrill
User
Aug 12, 2002, 6:35 AM
Post #3 of 12
(6090 views)
Shortcut
|
|
Re: [WebGuys] Subcat NEXT/PREV/Search Fix (and more?)
[In reply to]
|
Can't Post
|
|
Definition: "Question" -(1) an interrogative expression often used to test knowledge. (2) an interrogative sentence or clause. Nowhere in the definition is there a yardstick with which to measure the intelligence of the question. Everything I've learned, I've learned from someone else, beginning with the word "Momma." Looking at the sfront.cgi script should give you a clue that, yes, it is possible to become an SSI engine when other methods fail. In fact, that's what sfront.cgi is doing, in part. It is, however, doing the easiest part: executing another program and gathering its returned code. Writing a full-blown SSI substitute is a daunting task. sfront.cgi is a long way from being that substitute. The questions then arise: is it wise, is it necessary, and just how badly do you want it? In anything involving a produced product (and what you ask, would be), there are three attributes: * Quality * Time * Cost Pick two. For Example: You can get it soon, and cheap... but it won't be quality. Artman is a rare, QUALITY product, and not very expensive. Give 'em time. -- Terrill --
"Evaporating expectations of quality: 1980's paradigm: If it's worth implementing once, it's worth implementing twice. 1990's paradigm: Ship the prototype! 2000's paradigm: Ship the idea!" ---Larry Rosler: http://www.perl.com/pub/a/2000/06/rosler.html
(This post was edited by terrill on Aug 12, 2002, 7:06 AM)
|
|
|  |
 |

terrill
User
Aug 12, 2002, 12:06 PM
Post #5 of 12
(6068 views)
Shortcut
|
|
Re: [Dave] Subcat NEXT/PREV/Search Fix (and more?)
[In reply to]
|
Can't Post
|
|
Ok, so... you slurp the file into an array, set a flag. Then, inside the While(Flag) { Flag=0; loop through old array, adding elements to new array, if INCLUDE or EXEC found, slurp-or-exec and add to new array and set flag=1... Wait a minute. I thought I said I was finished! Never mind!!! Anxiously awaiting version 2.0. Taking into account the number of things Artman does so flawlessly at this point, the next release should blow us all away! <BG> It is seriously refreshing to see a group of people so dedicated to producing great products. It's a lost art... uh, no pun intended!!! -- Terrill --
"Evaporating expectations of quality: 1980's paradigm: If it's worth implementing once, it's worth implementing twice. 1990's paradigm: Ship the prototype! 2000's paradigm: Ship the idea!" ---Larry Rosler: http://www.perl.com/pub/a/2000/06/rosler.html
|
|
|  |
 |

synergy
User
Aug 12, 2002, 1:03 PM
Post #6 of 12
(6063 views)
Shortcut
|
|
Re: [terrill] Subcat NEXT/PREV/Search Fix (and more?)
[In reply to]
|
Can't Post
|
|
hi dave, could you say when v.2.0 will appr. come (6 months, 12 months, 18 months from now etc.), and which demanded features you are going to implement in any case? i consider buying AM because it seems to be a stable and mature system, but i need more features (subcats, polls on articles, better media-and filehandling etc.)-see my other posts here, pls!: http://www.interactivetools.com/forum/forum.cgi?post=774;sb=post_latest_reply;so=ASC;forum_view=forum_view_collapsed;;page=unread#unread there's also a link to a competitor. they aren't ready yet with all their additions, but the planned plugins are exactly what i (and i guess others) would like to see in a CMS: http://english.webedition.de/int/index.php ps: will the upgrade on 2.0 be also free of charge? kind regards.
(This post was edited by synergy on Aug 12, 2002, 1:12 PM)
|
|
|  |
 |

Dave
Staff
/ Moderator

Aug 12, 2002, 1:13 PM
Post #7 of 12
(6055 views)
Shortcut
|
|
Re: [synergy] Subcat NEXT/PREV/Search Fix (and more?)
[In reply to]
|
Can't Post
|
|
We're aiming for two more major product releases before the end of the year, one of those being ArtMan 2.0. We're going to put in as many features as we can, but it's unlikely we'll get everything that everybody wants. Better media handling (being able to use a uploaded image in multiple files, etc) is very high on the list of features. So is subcats, collapsible subcats will likely be some sort of javascript or other add-on though but we'd really like to be able to represent nested cats in the database. Maybe we'll have a flag for a default of collapsed or expanded cats. Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

KenGary
User
Aug 14, 2002, 11:57 AM
Post #8 of 12
(6025 views)
Shortcut
|
|
Re: [terrill] Subcat NEXT/PREV/Search Fix (and more?)
[In reply to]
|
Can't Post
|
|
I really like your work on cats.cgi. I've been experimenting with it at http://www.sonlight.com/main. Unfortunately, since I don't use the defaults it doesn't work for me. I have changed my preferences to use .html instead of .shtml (and my server passes this through SSI so it all works). I name every category index page instead of using the default cat_index_xx.shtml. I have hidden categories, which still appear in the list that cats.cgi generates, but I wouldn't want them to. I also DO use spaces in my category names. Just to see it work a little bit better, I changed everything back to the defaults. It won't stay that way for long because it's not ultimately how I will want to launch this. I'm not a Perl programmer. If you ever feel inclined to modify cats.cgi to pick up the actual names of the files instead of building the default names and if you ever allow for spaces in the category names, then I'd be very interested in knowing when you've done that. But I realize how precious time is and that you're doing this as a favor for people. But if you were to make such changes before the folks put subcategories into the official release, I'll be watching for it. Thanks, and again let me just say Good Work! Ken Ken Gary ~It's a small world, but I wouldn't want to paint it!
|
|
|  |
 |

terrill
User
Aug 19, 2002, 6:10 PM
Post #10 of 12
(5772 views)
Shortcut
|
|
Re: [KenGary] Subcat NEXT/PREV/Search Fix (and more?)
[In reply to]
|
Can't Post
|
|
Ken, DATE: 19-Aug-02: UPDATED VERSIONS! Attached are the latest-greatest versions of cats.cgi and sfront.cgi. They now: - Allow YOU to specify the extension of your SSI files (see variable $SHTML in cats.cgi)
- Acquire the name of your file(s) from category.dat. If you give names to the category index files something other than cat_index_NN, we now adjust to YOUR name!
- For the WebGuys, I now get the category sequence from category.dat. Remember, though, that it's still required that all related categories/subcategories be listed in your set-up options TOGETHER, starting with the category first. Again, you can use the "Up" and "Dn" links in set-up to move them to the correct place(s).
- Spaces and other special characters may now be used in the category/subcategory names. However, subcategories must still use the verticle bar with NO SPACES on either side in the names! For example: "Programming|Glorious, Wonderful Perl!"
- It's a small World, but I wouldn't want to cut the grass.
One problem I did notice that's not a show stopper: when performing a search from the search box, I can't acquire the category ID using CGI->param(). Interactive's search.cgi needs it, and so if I take it, the search doesn't work correctly. [For those who wanna know why: the search form uses the "post" method, which comes to CGI scripts via "standard in." The "get" method comes via QUERY_STRING. Ya can't put stuff BACK INTO standard IN. Go figure! ] I did play with various (and dangerous, from a site security point of view) methods of doing this, but decided against the risk. HOWEVER, just today, I noticed there IS a way for me to get the information... The method will require one change to the results templates: a comment with the Artman variable $cat_num$ in it. Seems that search.cgi will replace it with whatever category was searched (and returns a blank if they searched the "Entire Site"). So, maybe next weekend I'll add that feature. It's actually a simple change. The cats.txt file contains complete instructions for implementing the changes. There are two additional template files to be altered (which I neglected to document earlier), and most of the other changes involve altering $cat_name$ to to read "?cat=$cat_num$" (without the quotes). Future updates will be even simplier, if there are any! Artman 2.0 will be out soon (we all hope), and my little enhancements will be obsolete, unwarrented, tossed to the wayside like yesterdays news, found lining birdcages the world around, and forgotten. Programs progress. It's a rule. I'll find something else to tweak... -- Terrill --
"Evaporating expectations of quality: 1980's paradigm: If it's worth implementing once, it's worth implementing twice. 1990's paradigm: Ship the prototype! 2000's paradigm: Ship the idea!" ---Larry Rosler: http://www.perl.com/pub/a/2000/06/rosler.html
|
|
Attachments:
|
cats.txt
(15.1 KB)
|
|
|
cats.cgi
(5.20 KB)
|
|
|
sfront.cgi
(3.85 KB)
|
|
|  |
 |

KenGary
User
Aug 20, 2002, 7:19 AM
Post #11 of 12
(5763 views)
Shortcut
|
|
Re: [terrill] Subcat NEXT/PREV/Search Fix (and more?)
[In reply to]
|
Can't Post
|
|
That's wonderful! Thanks for having fun with this. Ken Gary ~It's a small world, but I wouldn't want to paint it!
|
|
|  |
 |

cpower
New User
Sep 24, 2002, 12:29 PM
Post #12 of 12
(5351 views)
Shortcut
|
|
Re: [terrill] Subcat NEXT/PREV/Search Fix (and more?)
[In reply to]
|
Can't Post
|
|
Have you ever tested this auto category script on Windows 2000 server running IIS, using .pl extensions instead of .cgi? I am not an experienced Perl programmer and I would really like to get this script working properly. When I implement the script and make all of the changes that you direct in your text file, the navigation doesn't show up in any of my pages. I don't think that it likes the <!--#exec cgi="cats.pl" -->. If you are willing to get this working properly for my system, my company is interested in paying for your services as this is a very valuable functionality to our version of the Article Manager. You can contact me directly at cpower@soka.edu
|
|
|  |
|