What sNews hacks or mods would you like to see?
I love sNews CMS. Seriously, I love it, I've used damn near everything over the last 8 years, from a custom built Perl/MySQL system to the ever popular WordPress. What makes sNews so special? It's small, contains the basic functions I need to run a blog/cms, and leaving the rest to me to "hack" or "mod" it as I deem necessary.
There are several areas in which I've already made changes, such as the pretty date and comments mod, the tags mod, and the social bookmarks mod. I'm not done yet, I think the entire search function needs a make over, for one thing, the current function uses the MySQL LIKE operator for matching, this just won't cut it once you've got a years worth of articles piled up in your system.
The fix? Use MySQL's Full-text search, it's simple to implement on any existing database, has a great default list of stopwords, and relevance. We can then create an advanced search form to allow proper boolean operators; something like the search form shown below, from one of my other sites.
One of the biggest tricks I will want to work on is to use the post method... taking the post variables submitted and then format the URL to make it SEO/bookmark friendly, i.e. if your search form submissions contains the words snews updates the URL would appear as http://www.mdj.us/search/snews/updates/. This will take the most of the effort and modifications.
So, that's the next big mod that I will want to tackle at some point in time, what about you, what's the top mod you'd like to create or see created?

Comments
RSS Comments Feed
Patric
Patric from sNewscms.com here... I agree about the searchfunction. Can't wait to see what you do with it ;) And the title itself "What sNews hacks or mods would you like to see?" Whuhaaaa, I could answer that, but I'm not sure you would appriciate the long comment ;)
Would be awsome if, when ready with your enhancements of sNews, you could post the entire, commented, snews.php somewhere at the forum...
Thanks for being a valued part of snews.
Matt
Once I get around to tackling the search function, I will definitely document it and make it available for public usage. I have some smaller hacks that I'm going to do first however :)
Matt
Brian
I used the RSS function to parse this out in 1.6 in a web project, but I'm frustrated I don't have this ability in sNews natively.
To me the best thing about a cms is the ability to pull whatever information I need out of the database and to place it where I want in the design. sNews for everything that I love about it, missed this functionality. I'd like to see something that addresses this, since you're asking...also the Body ID mod for 1.6 to be workable with 1.7 would be great. Lots you can do with CSS and display:none in terms of layout if you have a body id...
great work though man...
Matt
I'm pretty happy with the base layout of sNews actually, I just made some changes in my snews.php, but honestly, right now WordPress is probably the better solution for the majority of people out there that are "blogging". It's included in most every Web Host's auto-install software for one thing, so you don't even need to know a lick of PHP or how to set up a MySQL DB.
The way sNews handles articles... it just spits it all out, makes it much easier for "newbie" designers and such, whereas a WordPress template file can require a fair amount of PHP, sNews is just a single index.php and a few function calls... but it lacks flexibility for designers. I that don't mind echo'ing out a few tags in a loop to position the content where I want. I mean, the default "infoline" string of comments / date is horrendous, hence my "pretty comments" mod. It really limits a designer from doingm everything he or she can with the system.
That being said, that's also one of the reasons I like sNews so much, it's a base platform, performing just what's needed, and I can take it and hack it up to do exactly what I want it to.
To do what you're asking about extracting data from a single article wouldn't be too difficult, I would just write a new function to get all the fields from an article based on an ID that it has been passed, then you can output what you like, that's basically what you did by using the RSS function. However, changing the default articles function to provide a WP style loop would require some thinking and coding.
It should be done though at some point, maybe I'll give a stab at it some time... I'm such a glutton for punishment, heh...
Brian
As you said - "To do what you're asking about extracting data from a single article wouldn't be too difficult, I would just write a new function to get all the fields from an article based on an ID that it has been passed, then you can output what you like..."
That's essentially what I'm looking for really with sNews. I'm assuming you'd have to pick it out with a identifying category number and/or article number and some kind of Y/N in including title, intro text, date, comment number... something like
<php include "(category 1) (Article 2) Title Y, Intro N, )....etc...I'm not a php guy so the syntax escapes me...but just a native standardized sNews tag/variable system like this would just open the system up completely in my eyes..and it doesn't seem difficult, although I'm not sure of how easily it's done given the architecture of the single snews.php engine...
Matt
I come from a primarily Perl background, but PHP is pretty easy to pick up I must say. Yeah, WordPress just looked way to heavy for what I wanted, at least right now.
You know, I'm not sure right off hand the absolute best way to implement what you want, at the most basic level, for an article you could have a function select the articles contents into an array and then you just echo the fields, a la $article[date], etc where you want them. Yes, you'd need to pass it the ID of the article so you'd know what to select, unless for instance you always want say, the most recent article or something.
Sven
"Related posts" would be great :)
Also I would like "subscribe to comments via email\", that is a great to keep those who have commented updated on new comments on the page/subject.
"Subscribe to comments via email" is not to complicated to make, but I am still a php noob and are "no good" with sql... There is also a lot of small comment scripts out there that could give some examples on how to do this. I guess something like this:
1) Comment is sent and "subscribe to comments via email" are clicked.
3) Email is registered and are marked with "awaiting confirmation"
2) An email is sent from the server, asking for confirmation (an url with a id and a unique string).
3) If it is clicked/confirmed, server sets status to "confirmed"
4) Every time a new comment is added to that blogpost/article, an email is sent to confirmed subscribers.
I often comment on old articles I find interesting, sometimes weeks later I receive email that new comments have been added (and I visit again). Its a great tool :)
Sven
Matt
For the second suggestion, you can freeze comments in an article, but there is no setting to do it automatically once it reaches a certain age. That one shouldn't be too difficult to do either, unless you want to set a different specific age for every individual article, then that would take a good bit more coding.
Also, I noticed you've already discovered my related articles plug-in. I plan on refining that even further (ranking title to title higher, not just keywords within titles,etc).
I'm currently working on a new design, and my wife is in the hospital recovering from some minor surgery (she's fine thanks), so my time is VERY limited this week, but I will definitely look into implementing the 2 ideas you suggested.
Sven
Sure, family and friends should always come first (good to hear thats your wife is fine). After all, you asked for suggestions, then "php noobs" like me pop up with a wish list ;)
The freeze comment after certain date /age is not that important.
A more visitor oriented thing would be to have sNews to send a email thanking for the comment when there is a new email address used (compared to all emails for all comments/posts). I think that would be a attractive add-on, like wishing new ones welcome and hope that they will come back and visit again and maybe leave another comment.
Have a nice week Matt
Matt
We're in total agreement about the comment email function, that should definitely be added.
Thanks!
Matt
Sven
I love small scripts that just "do the job". sNews appeared to be such a useful script.
I had been preparing sNews for a site that have ordinary static files and folders, but when I added sNews htaccess-file it messed up the whole site. So I have to drop sNews for that project, but I am planning to put up a new site and use sNews there.
Matt
Hmmm, what was the .htaccess doing to the site? You can change and/or add rewrite rules if needed.
Sven
I think sNews is capable to do almost the same as WP, well the basic stuff anyway. WP is a "monster"!
For my last "try" to upgrade to a cms/blog I installed both sNews and WP, after adding all addons and stuff, WP was huge, a bit slow and used almost 8 MB disk space. sNews had 3 php files and took about 0,3 MB.
I ended up deleting WP, sNews did the job (but are missing some of all the extra stuff that WP have via addons).
The problem with the htaccess was that is was to "wide", it tried to send all traffic to sNews. I could manage with only a few categories (you have 6), so if there was some kind of way to only direct those to/via sNews, and leave all other request to the normal (mostly static) files on the the server, that would have "saved me". Example (remember I am a noob):
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(CSS|Gaming|Netbooks)(.*) $1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(CSS|Gaming|Netbooks)(.*)$ index.php?category=$1 [L]
IF that code was correct (and it not working here) it would tell to direct only url-request starting on of these three categories afte the domain name: "CSS", "Gaming" or "Netbooks" - all other request should go elsewhere (or give an ordinary 404 if not found).
But is it possible?
Matt
Hmm, your code looks OK at a glance, but the static files should be served using the basic rules included with snews, i.e, this rule
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*) $1 [L]
should check if the request is for an actual file and serve the file if it exists, so you shouldn't need to add any specific categories.
Sven
Thanks Matt, I will give it another try this weekend. It will save me a lot of time if you htaccess suggestion works :D
Matt
Oh well, it works well for my needs right now.
Let me know what kind of errors you have with the rewrite rules if you run into problems and I'll try to assist you.
wangsakarsa
i want to ask , how to add gravatar into snews1.7 comment, thanks :D
Matt
I've just recently added that to my "to-do" list as I've gotten a few requests on it, so I will be definitely be writing a tutorial on it at some point. Sorry I don't have a time frame yet, the best I can say right now is to keep checking back every so often or subscribe to my feed for updates.
Thanks!
Steve
By the way, Great site.
Matt
I'm a little confused as to what you're asking about, are you referring to a specific mod or function within sNews?
Thanks,
Matt
Matt
Hmmm, I've never really thought about it or had a need for it. When I want to preserve white space like that I'll use the entity, or the pre tag, like for my code samples.
I'll have to think on that a bit.
Steve
That's exactly what I mean (sorry about the confusion)
Whenever I use the " " tag -- it shows ups. It doesn't in the preview, but it does in the article or page.
Thanks for your time.
42 comments, page 1 of 2 [ 1 2 » ]