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
Steve
Matt
You're looking for "French Spacing", the double space at the end of sentences, correct?
This was taught in many typing classes, but this styling convention never made it to the web, web browsers are by default, expected to collapse multiple whitespace unless specifically instructed to do otherwise via the entity or pre tag.
I don't think there is a way to do that without using the & nbsp; entity. Not an easy way at least, you could wrap sentences in a span and put a margin-right style on it, but that's more work than the entity.
A problem with using the entity is if it occurs at a line break, the sentence would be oddly indented. That could make readability worse.
If you're having a readability issue on your web site/page, I would first examine the font you're using. Try using verdana for windows and lucida grande for Mac OS, and arial and/or tahoma as a fall back.
Try setting the body style in your stylesheet to something like this;
body {
font-family: "Lucida Grande", Verdana, Tahoma, Arial, sans-serif;
}
Steve
Thanks for the tip. I like that font combination much better than what I had.
You also had me pegged correctly -- I learned to type on an IBM Selectric II. The lights would dim when I powered it up.
Again, great site.
Matt
Yeah, verdana is a great web font.
Also check your line-height, I find setting it to 1.6em on all paragraphs is just about perfect;
p {
line-height: 1.6em;
}
toolman
As already mentioned somewhere, display in RSS categories would be useful.
Another useful mod, I hope, would be "word repleacing", somethig like "An enhanced word filter for sNews, with whole words matching", but more configurable, for example:
define:
[HTML]
and replace with:
HTML
define:
Enter
and replace with:
define:
:)
and replace with:
I think that will be useful not only for me ;)
P.S.
I can not wait to advanced search.
Translated by: translate.google.pl
toolman
define:
[HTML]
and replace with:
‹acronym title="Hypertext Markup Language"›HTML‹/acronym›
define:
‹kbd›Enter‹/kbd›
and replace with:
‹img src="images/enter.gif" /›
define:
:)
and replace with:
‹img src="images/emo/smile.gif" /›
Matt
toolman
But the admin interface would be more user-friendly.
Matt
BTW, adding categories to the RSS is a pain, lol... you can add a
<category>'.$catTitle.'</category>
within the RSS item, but extracting it from the DB currently would need to be placed within the existing loop.
Thomas
Matt
I tried my hand at that one actually a while back, it was more involved and I dropped it. It may very well be a better idea to create a separate function to create the RSS feed for a category based on cat ID or something and then pass that where needed.
That's the other question, where would you display the link for category feeds?
John Flower
1. I am religious about using headings correct on web pages. I think a good document structure for the web is made up of lots of headings, paragraphs, lists, etc. One thing that most CMSes get horribly wrong, is heading structures.
I don't like a website to have it's header to be the h1 heading. I always place h1 headings on a per-page basis. The heading, for me, must outline what the page is saying, or the article is saying. Now, one can hack snews pages to make use of h1 headings, as well as on single articles. The problem is when articles are grouped together on category pages, or even the home page. The list of articles on a home page, for instance, will have the h2 heading. It would be nice to be able to place an info box above such a section, with the ability to add some text, and in my case, a nice h1 heading.
2. Another thing that would be sweet, and is along the same lines as my 404 error request, is the ability to add URL-specific robots data. I think sometimes it's best to not index a category, or certain articles, and the ability to add a robots rag would be sweet. SEO is an ongoing experiment, and unique to each site. So playing around with, and seeing the results, with a robots tag, would be sweet.
Matt
I think both of those suggestions would require a fair amount of core hacking to get working with sNews.
For item one, are you saying not to use the page title as the h1 heading, but rather add a separate entry for each page/article?
John Flower
See, the average setup, even for a good CMS, is to place the h1 in the header of the site, and then make everything else h2 and lower. It seems most people (snews definitely) make use of h3 for headings in the sidebar. I think this is completely wrong. If you do that, you may break the flow of the article. The h1 to h6 headings are to be used in articles, to help break down the whole thing into understandable chunks; it's not there to be used as a design element.
So, if the page title is placed within the h1 tag, let the page title be page specific.
eg.
If your site is www.houses.com, the average h1 tag would probably be Houses.
I say no.
If you have a document about selling houses ("How to sell your house"), let the h1 heading not be houses, but "How to sell your house".
I have another theory: I think your domain name plays a significant role in document structure too. However, these are theories. I cannot claim them to be fact.
Are you following me, or am I making no sense at all? Sorry, I find it hard to explain stuff sometimes.
Matt
I don't really know about using h3, etc for sidebars, whether or not it's "appropriate". There may be some gray area there, it's my understanding that that the heading tags are intended to describe the topic of the following section, not sure if a menu really applies there.
I think overall, there's a lot of bad HTML out there, my first page in 1996 was loaded with horrible animated GIFs :)
I'm sure there's always room for improvement and I'm no expert, but content is king, Google and other SEs are smart enough generally to extract relevant data for the most part I believe.
WeeBey
By that I mean IP address and web browser at the very least. That way one could be able to block spammers with your IP restriction mod :)
I don't know how to customize the snews.php file so that all that information is added to the contact information :(
Matt
It's supposed to add the user's IP address, but the language variable for IP was never added.
In your snews.php file, find the function send_email, uncomment the line where it's looking to insert the IP variable, like this;
// The below requires new lang var if ip to be sent with email - $l['ip'] = 'IP';
$body .= isset($ip) ? l('ip').': '.$ip."\n" : '';
Then open your language file, and add $l['ip'] = 'IP';
Upload the edited files & it should now add the user's IP.
To add the user's browser info, you'll need to add another language variable, like $l['user_agent'] = 'User Agent';
Then add this to the send_email function;
$body .= l('user_agent').': '.$_SERVER['HTTP_USER_AGENT']."\n";
Above the $body .= $text."\n"; part
This is all untested, but I think that should do it. Let me know.
BS0D
Do you know a way to localize a snews website? If not, any way you could see if you can work on that? Your modules are awesome!
Matt
Do you mean having the user select a language and displaying headings based on the language, or are you talking about authoring articles in multiple languages?
BS0D
Meaning I write 3 articles, one for each language, but they are all linked together in some way only in different languages. Not sure I'm explaining things right...
Matt
I get what you're asking. That would require a LOT of re-work of the snews.php file. That's almost a different project, or fork really.
BS0D
Thanks for your time Matt, always appreciate it :)