 | |  |
 |

terrill
User
Aug 7, 2002, 2:40 PM
Post #1 of 15
(7842 views)
Shortcut
|
|
Auto Subcats: Part last?
|
Can't Post
|
|
So, it's "automatic categories you want?" Well, I decided to put everthing into one post, along with directions. You only need to make these changes ONCE! After that, when you create NEW categories or SUB categories, everything is automatic! When you make an artice visible, or re-publish all your articles, everything is taken care of for you. The program makes NO changes to any of your Artman data files, it ONLY reads them. --- WHAT IT ALL DOES --- In the place where your categories are listed (We'll assum it's on the left), you visitors see: Unix Programming News If they click on a category, say Programming, or if they click on an article in the Headlines list which comes under a Programming category, they'll now see: Unix Programming --> Perl --> C News If they click on another category (not a part of Programming), the Programming group closes, and if there are subcategories for the one they just clicked, that one will expand. --- TESTED --- I've tested the code in two flavors of Linx, and Windows 2000. All of them using Apache as the server. --- REQUIREMENTS --- 1. Your Server has to allow an SSI exec command. Since you're using Artman, your chances are good it does. If it doesn't, contact your server Admin. 2. To create subcategories, use the following naming convention... the program looks for the verticle bar. Of course, you're welcome to change the program to look for something else! Category: Programming SubCat..: Programming|Perl SubCat..: Programming|C Make certain they're in order when you create them. That is, it doesn't matter if they've been created one after the other, just make sure that Programming is higher in the list than all of its subcats. If it's not, move it up using Artman's neat ability in the Category Editor. 3. Categories and subcats with spaces don't work. It has to do with the encoding of URLs sent across the Internet. Someday, if I get the time, I'll fix it. Until then, I'd stay away from spaces, or anything that gets escaped because it might be a shell-interpreted character (such as back-quotes (`) or slash (/), etc.). Since my site doesn't have this problem, don't look for me to fix it soon. --- CHANGES TO YOUR TEMPLATES --- <<<Make a backup copy of each file before changing>>> If you don't like the way things work, you just copy the files back over the changed files. Of course, I'd back those up before ya do... you might decide to give it another try, later! In your templates subdirectories, make the following changes: --- templates/headlines_bycat.html --- NOTE: there are other lines which look VERY MUCH like the following. Get the RIGHT one! UNDER the line: <!-- templatecell : row --> Change: <a href="$detail_link$">$art_name$</a> To....: <a href="$detail_link$?$cat_name$">$art_name$</a> --- templates/article/default.html --- Change: <!--#include file="$file_categories$" --> To....: <!--#exec cgi="cats.cgi" --> Delete: <!-- template include : $file_categories$ --> --- templates/headlines/default.html --- Under the line: <!-- templatecell : row --> Change: <a href="$detail_link$">$art_name$</a> To....: <a href="$detail_link$?$cat_name$">$art_name$</a> --- templates/index/default.html --- Change: <!--#include file="$file_categories$" --> To....: <!--#exec cgi="cats.cgi" --> Delete: <!-- template include : $file_categories$ --> AND Under the line: <!-- templatecell : row --> Change: <a href="$detail_link$">$art_name$</a> To....: <a href="$detail_link$?$cat_name$">$art_name$</a> --- templates/search/search_results.html --- Under the line: <!-- templatecell : row --> Change: <a href="$detail_link$">$art_name$</a> To....: <a href="$detail_link$?$cat_name$">$art_name$</a> --- THE PROGRAM --- The required CGI program is attached to this post. Place it in the directory where your files get published to. There's one line of code that you'll need to alter. It's the one after the "open" statement, and has a comment that says to change it to where your category.dat file lives. The program reads Artman's category.dat file and digests the categories from it. NOTE: there are NO statements which send anything to something other than Standard Out, so this program makes NO CHANGES to anything Artman uses... or anything else, for that matter. If it did, I doubt this message would live long on the board, since the boys and girsl at Interactive are Perl programmers! The program is attached, complete with comments. Download it and save it in your publish directory as: cats.cgi -- and -- if you're on a flavor of Unix/Linux/BSD etc, don't forget to do a chmod 755 or it won't execute. For you Windows folks, you don't have to worry about the chmod! Comments, suggestions, dollars greater than a million (nothing less) all greatly appreciated. Oh, that's the British million... with NINE zeros! Caveat: Don't expect Interactive to help you, and, if they ever change their data structure, you're on your own. They say their next Big release will support subcategories. Chances are good you'll have to make changes when they do, anyway... since they don't have such an animal now, and they can't read your mind on installs. So, you don't have much to lose. Problems or want commented code, email me at mailto:Terrill@Steal-This.com. Sorry it's such a long post, but it's not a short subject... but it IS a lazy way of doing things! 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 8, 2002, 9:03 PM)
|
|
Attachments:
|
cats.cgi
(3.72 KB)
|
|
|  |
 |

Dave
Staff
/ Moderator

Aug 7, 2002, 4:23 PM
Post #2 of 15
(7833 views)
Shortcut
|
|
Re: [terrill] Auto Subcats: Part last?
[In reply to]
|
Can't Post
|
|
Thanks Terrill, That's a pretty interesting hack (in the best sense of the word). Do you have a URL where we can see it in action? Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

Dave
Staff
/ Moderator

Aug 7, 2002, 4:32 PM
Post #3 of 15
(7831 views)
Shortcut
|
|
Re: [Dave] Auto Subcats: Part last?
[In reply to]
|
Can't Post
|
|
Also, I was going to mention... For our faint hearted readers, the workaround, tricks, tips, etc that you'll find in the forum range for from super easy to pretty advanced. If you find any of this stuff intimidating, don't worry, you don't have to use every solution. You can pick and choose the ideas that work for your site... and hopefully learn something along the way. : ) Some people like to use the software almost as is, with barely any customization, and you can certainly use it like that. For others, they like to customize things a little more (sometimes a LOT more), and if that's you then there's a ton of ideas in the forum to help you along the way. Hope that helps. Dave Dave Edis - Senior Developer interactivetools.com
(This post was edited by Dave on Aug 7, 2002, 4:33 PM)
|
|
|  |
 |

terrill
User
Aug 8, 2002, 6:17 AM
Post #4 of 15
(7815 views)
Shortcut
|
|
Re: [Dave] Auto Subcats: Part last?
[In reply to]
|
Can't Post
|
|
Unfortunately, I don't have an open site. I own several domains (Whois on Steal-This.com, EatOurFish.com, Steal-My-Heart.com, steal-your-heart.com, stupidalert.com will do for now). But, I don't have your software online, yet. Been toying with it LocalHost only, for now. Anyone interested, I have the ideas for the domains, just not the time. I normally only use them privately for testing, and exchanging things of interest with my colleagues. We all travel, teaching programming to other companies, and need places to share stuff via Internet. So, again, sorry!!! Thanks again for the oh-so kind words. Oh, one of my clients was BC Hydro (taught there twice). A tiny company there in Vancouver (and elsewhere). They still in business? If not, you can probably figure a way to blame me for the blackout <G!> Nice city y'all got there. First time I ever heard anyone spell "ZOO" as "Zed-Oh-Oh!" L8R -- 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
|
|
|  |
 |

Dave
Staff
/ Moderator

Aug 8, 2002, 9:43 AM
Post #6 of 15
(7802 views)
Shortcut
|
|
Re: [terrill] Auto Subcats: Part last?
[In reply to]
|
Can't Post
|
|
Oh, one of my clients was BC Hydro (taught there twice). A tiny company there in Vancouver (and elsewhere). They still in business? If not, you can probably figure a way to blame me for the blackout <G!> Yea, I was going to say, they better be in business... My UPS only has about 15 minutes of power in it. :) Actually, BC Hydro apparently sells a lot of power to California in addition to lighting all our lightbulbs at home here. As for those who are bold and daring... the stuff I've posted on this topic aren't overly complex unless you actually want to understand what the "program" does and how. I know, I was talking about all the postings, including mine! : ) I'm going to see if I can get attachments turned on so people can attach files. Might be a little easier for people downloading files. Dave Edis - Senior Developer interactivetools.com
(This post was edited by Dave on Aug 8, 2002, 9:46 AM)
|
|
|  |
 |

isac
User
Aug 8, 2002, 10:38 AM
Post #7 of 15
(7794 views)
Shortcut
|
|
Re: [terrill] Auto Subcats: Part last?
[In reply to]
|
Can't Post
|
|
Hi Terril I tested Your program and works, keep your eyes in it. Maybe a little more work (html/css) and will be perfect. Sincerely. Obrigado(thanks) :)= Isac
|
|
|  |
 |

WebGuys
User
Aug 8, 2002, 11:15 AM
Post #8 of 15
(7786 views)
Shortcut
|
|
Re: [isac] Auto Subcats: Part last?
[In reply to]
|
Can't Post
|
|
This question is for Dave is guess, if i impliment the subcatagory fix here, how will it affect the software if you guys do release the new version SOON with subs built in? thanks
|
|
|  |
 |

Dave
Staff
/ Moderator

Aug 8, 2002, 11:30 AM
Post #9 of 15
(7783 views)
Shortcut
|
|
Re: [WebGuys] Auto Subcats: Part last?
[In reply to]
|
Can't Post
|
|
If you wanted to switch back you'd just need to change your templates back and/or edit your categories again and change their names and perhaps enter some new settings. One other thing to keep in mind is you are running a cgi process to generate the category view each time. If you do give it a try post your URL when you're done. I'd be interested to see how you're wanting to setup the categories and how it looks when you're done. Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

WebGuys
User
Aug 8, 2002, 5:44 PM
Post #10 of 15
(7769 views)
Shortcut
|
|
Re: [Dave] Auto Subcats: Part last?
[In reply to]
|
Can't Post
|
|
I played with sub cats, the script posted works pretty well (kudos), all but the formatting. ( minor detail but neccessary for practical reasons) I am switching back to normal mode but would really really really like to know when you guys plan to release sub cats, it is so important to me that is prolly my #1 concern, that and the link on the main page of admin login to license and the ADMIN templates, gee i dont want much thank you for your support ( i miss bartles and james, thank god for chopper john)
|
|
|  |
 |

terrill
User
Aug 8, 2002, 9:12 PM
Post #11 of 15
(7761 views)
Shortcut
|
|
Re: [WebGuys] Auto Subcats: Part last?
[In reply to]
|
Can't Post
|
|
DAVE: THANKS for turning-on attachments!!! I've deleted the program from the post, and made it an attachment. The code is now Heavily commented (there are more lines of comments than actual code!). The file is in Unix format. You DOS, uh, Windows people: it may look weird in your Notepad... but it'll still work! MADE SOME CHANGES: If you look above at the first part of this post, you'll see that where it used to display cats/subcats as: Programming Programming:Perl Programming:C it now displays as: Programming --> Perl --> C Again, the line which produces this formatting has comments preceeding it, telling you how to change it. I also made a commented copy of the original, so IF you change the code and make a boo-boo, you'll have a spare copy so you can start over!-) I suggest that if you DON'T know Regular Expressions, stay away from using slashes, back-slashes, dollar signs, numbers, etc. Underscores, dashes, and greater-than signs are fine. 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
|
|
|  |
 |

WebGuys
User
Aug 9, 2002, 7:10 AM
Post #12 of 15
(7746 views)
Shortcut
|
|
Re: [terrill] Auto Subcats: Part last?
[In reply to]
|
Can't Post
|
|
Tried the new script, i like the change, but now it adds my subcats in the list to the end of the menu
|
|
|  |
 |

Dave
Staff
/ Moderator

Aug 9, 2002, 9:13 AM
Post #13 of 15
(7740 views)
Shortcut
|
|
Re: [WebGuys] Auto Subcats: Part last?
[In reply to]
|
Can't Post
|
|
WebGuys, How do you want your subcats setup? Do you have an URL I can see as an example? Do you plan on constantly adding and removing subcats? Because there's a number of work-arounds to implement it and even when we do it, because there is a few different ways to do it we may not do it they way you want/need. I'd be interested to hear how you'd like it to work and what you would want the output to look like. If you could post a new thread under Feature Requests that would be great. On being able to edit the admin templates, that's coming very very soon (next minor release). Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

jmsierra
User
Aug 12, 2002, 7:27 PM
Post #14 of 15
(7716 views)
Shortcut
|
|
Re: [terrill] Auto Subcats: Part last?
[In reply to]
|
Can't Post
|
|
ok, so after all those great ( and very technical) replies, this is a stupid question I am sure I missed the answer somehwere along the line. Can I have and add ( use ) sub-categories? Is this simple, or does it mean customizing AM?? Just the basic idea. thanks all. ~ Josue Colorado Springs, CO www.josuesierra.net
|
|
|  |
 | |  |
|