Page 1 of 1

New features, is there interest or should I keep it quiet?

Posted: Sat Nov 20, 2004 7:29 am
by trixter
I have made a few modifications to CMS to suit my needs, I dont know if anyone is interested or not. These are all quick and dirty changes, most likely full of erors, dont use if you value your site working. Ok, enough of the disclaimer :) If you want the modules I have butchered posted reply to this thread, I will monitor it for a few days and see if anyone is interested.


Hack #1: domain rewriting
Using the apache wildcard virtual host directive (ServerAlias *.domain) all entries for a given domian name can goto CMS (or anything else). I have added in functionality for http://articlename.domain/ (search engines rank pages based on hostname as well as content, this can increase your ranking by placing the article name in the hostname). It is a VERY simple implementation, where http://www.article.domain == http://article.domain == http://article.randomcharacters.domain etc.

Hack #2: url rewriting
I also added in the ability (via .htaccess) to rewrite urls so instead of http://domain/index.php?page=article to be http://domain/article.html or http://domain/print/article.html. Some search engines penalize you (or just dont index your page) if there are cgi variables. This allows for better search engine placement on those engines.

RewriteEngine on

# Modify the RewriteBase if you are using CMS in a subdirectory and the
# rewrite rules are not working properly:
RewriteBase /cms

# Rewrite URLs of the form 'index.php?page=x&print=true':
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^print/(.*)\.html$ /index.php?print=true&page=$1

# Rewrite URLs of the form 'index.php?page=x':
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\.html$ index.php?page=$1 [L,QSA]



Hack #3: redirecting any 404 to CMS
Ok, this one is not really a hack but a config setting, by placing entries in a .htaccess file you can make all 404 pages goto CMS so you can control the display better and possibly use the plugin I wrote to display a list of valid articles should anyone enter anyhting that isnt found
ErrorDocument 404 /cms/index.php


Hack #4: plugin to display articles
I quickly modified bulletmenu to display a list of valid articles. No checking is done to limit the size of this list, so if you have hundreds of articles you can have a very large page ... Maybe I will add to that. If anyone is interested I will post this somewhere (I believe there is the provisions to allow uploading of plugins somewhere on the CMS page, but since I just got CMS last night I havent really looked around).


Hack #5:
removed the print button on the print page and added author name, email, website it came from and title at the top. This I think makes it slightly better (and matches what I was using prior on my website, which was why I did it).. The back button on the browser can be used to replace the missing form button - and the printed output looks nicer. I may even add in headers to cause the automatc printing of the document. (window.print(); at the end of the document - although there may be a Content-disposition tag that does the same thing).


FUTURE HACKS:

I plan on adding PDF document creation (fortunately the hard work is done, there are libraries that already exist that will create PDF dox from html). I will be seeing about integrating these into the site via a plugin (although it may require a module as there are a few headers that need to be set, content-type, content-dsposition, etc) and I dont know if I can disable all other display information without a module, I just havent looked enough yet.

Keywords for each article:
I often use a keyword tag for keywords. These should match the document itself, and not be generic (some engines penalize you if you have keywords that do not appear in your document). It is a paint to add the tag in the HEAD section (via advanced button) when creating the document, and with the domainname hack I did it would allow for things like http://article.keyword.domain/ which goes to the correct place. So I was thinking about:
mysql: alter table cms_pages add keywords varchar(255);
then in lib/functions.content.php add the code to put them in a meta tag (add it to the headtags var that is already there and does the replace). The only other parts are fairly simple in terms of updating the database on addcontent.php and all to make a that is just for a comma seperated list of keywords.

I wanted to wait a little bit on this so that I could understand the structure of CMS better to avoid breakage, but this is something I personally want so it should happen soon.

another addition I was considering

Posted: Sat Nov 20, 2004 7:36 am
by trixter
Excuse the typos in the previous message...

I am also thinking about a phpBB and smiley and code highlighting filters for output. I am unsure if they exist for CMS already, but I will look around first (I am generally lazy and dont want to write something if it works already :) )

One thing I forgot to ask in the previous message was, is anyone working on any of these things already? If so I will either work with you or wait for you to finish.

New features, is there interest or should I keep it quiet?

Posted: Sun Nov 21, 2004 2:58 am
by Ted
I'd glad you like the system. Sounds like you've gotten pretty comformatable quickly. :)

We welcome all code submissions, so send it anything you have and we'll take a look.

What do you mean by articles? News items? Or content pages?

#2 already exists in CMS. There is an htaccess file in the doc directory. Then you can turn on assume_mod_rewrite in the config.php file and the menus will automatically generate the proper URL.

As far as I know, none of the other issues are being worked on. If you do want to develop code for submission, please develop it against the current svn. Makes it a lot easier to patch in your changes if they should go into the trunk.

Enjoy!

New features, is there interest or should I keep it quiet?

Posted: Sun Nov 21, 2004 5:59 am
by Anonymous
wishy wrote: We welcome all code submissions, so send it anything you have and we'll take a look.
I will clean it up and submit all my changes then. Some of them should probably be made configurable, but we shall see.
wishy wrote: What do you mean by articles? News items? Or content pages?
Content pages. All I did was change the way that bulletmenu outputted so that you can have a single content page that has {articlelist} or whatever as its contents, and it will display a list of available content to read.

My custom 404 also has that in it, so if someone goes to an invalid url they get a list of what is valid :)
wishy wrote: #2 already exists in CMS. There is an htaccess file in the doc directory. Then you can turn on assume_mod_rewrite in the config.php file and the menus will automatically generate the proper URL.
Personal preference I didnt like that.. Google and possibly others gives a page a lower rank if its directory structure is too deep. Or so the rumor goes (to prevent spoon feeding google keeps a tight lid on exactly what they do now although some of googles original documentation was made available by google).
wishy wrote: As far as I know, none of the other issues are being worked on. If you do want to develop code for submission, please develop it against the current svn. Makes it a lot easier to patch in your changes if they should go into the trunk.
Yeah, will have to look into SVN (familiar with CVS not sure of differences).

New features, is there interest or should I keep it quiet?

Posted: Mon Nov 22, 2004 1:58 pm
by Akrabat
Anonymous wrote:Personal preference I didnt like that.. Google and possibly others gives a page a lower rank if its directory structure is too deep. Or so the rumor goes (to prevent spoon feeding google keeps a tight lid on exactly what they do now although some of googles original documentation was made available by google).
http://www.example.com/pagename.shtml is too deep?!

redirect

Posted: Fri Dec 10, 2004 3:12 pm
by trixter
Akrabat wrote:
Anonymous wrote:Personal preference I didnt like that.. Google and possibly others gives a page a lower rank if its directory structure is too deep. Or so the rumor goes (to prevent spoon feeding google keeps a tight lid on exactly what they do now although some of googles original documentation was made available by google).
http://www.example.com/pagename.shtml is too deep?!
What I saw made it look like it was a subdir. Perhaps I was not looking at the right thing.

New features, is there interest or should I keep it quiet?

Posted: Tue Dec 14, 2004 3:06 am
by snorki
Nice work, once my site is finished I'll try Hack #1,#2 and #3. I think I saw them in action on your your site www.0xdecafbad.com. Thanks for posting the rewrite stuff like that, major timesaver. :D

snorki

Hack#4

Posted: Wed Nov 30, 2005 1:49 pm
by Pj
Hi,

hack 4 sounds very interesting. Could you post it here?

Bilingual website support

Posted: Thu Dec 01, 2005 9:41 am
by katon
Wishy,

I have made a custom version of core CMSMS files with bilingual front-end support.  It allows for a disable option. This is now based on Beta 6. Would you be interested if I introduced my changes to svn at this point?  Or should I share the files in any other manner?  BTW, beta 6 works well for my Ukrainian and English front ends.

Trixter,

Did you make your changes configurable?  I mean can I turn them on or off if necessary?

Re: New features, is there interest or should I keep it quiet?

Posted: Thu Dec 01, 2005 10:14 am
by roman
hi trixter, independently your post before 10 days, i was created your hack #5 :), and it's http://forum.cmsmadesimple.org/index.ph ... 289.0.html and will by probably in next release

Re: New features, is there interest or should I keep it quiet?

Posted: Thu Dec 01, 2005 11:31 am
by martin42
Hi Trixter,

YourURL-rewrite idea is cool.  I don't use Apache,  but with your mod_rewrite example to work from, I can patch my web server to rewrite the URL each time a GET request comes in.

Do you have a CMSMS patch so that the CSS menu shows the rewritten URLs, not the "page=" URLs?

Thanks!

Re: New features, is there interest or should I keep it quiet?

Posted: Thu Dec 01, 2005 12:02 pm
by westis
Funny that everyone is addressing Trixter. The thread was started in November a year ago... :D Is he still around?

Re: New features, is there interest or should I keep it quiet?

Posted: Thu Dec 01, 2005 2:25 pm
by roman
westis, ...and after one year is still actual it's funny also :)