Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Author Topic: Javascript to make SEF URLs. *NEED FEEDBACK*  (Read 10685 times)

George Antoniadis

  • Sr. Member
  • ****
  • Karma: 0
  • Posts: 479
Javascript to make SEF URLs. *NEED FEEDBACK*
« on: January 28, 2006, 04:32:37 PM »

Javascript to make SEF URLs.

I'm too lazy to write same thing twice so I made this little javascript thingie to transform my title to a sef title... ^_^
or at least try to...

It's still early to put it in snews cause I don't know if anything major will change with sef urls ans stuff so this is a test page with the concept...
could you please check it out and tell me that you think should change, if you would use it and anything else on this?

here it is!!

thanks! ^_^

ps. the concept is easy... write the title... click the link on the right and *PUF* the sef is ready!
Logged
How I feel like I'm starless, I'm ready to fade now.
And how I feel like I'm starless, I'm hopeless and greyed out.

hafing

  • Full Member
  • ***
  • Karma: 1
  • Posts: 174
Javascript to make SEF URLs. *NEED FEEDBACK*
« Reply #1 on: January 28, 2006, 05:06:32 PM »

Hi analyserX.
I tested this with special Icelandic caracters and it worked.
Characters like - - work perfectly in your little gadget. :)
hafing
Logged
I can be 2fast and 2curious

George Antoniadis

  • Sr. Member
  • ****
  • Karma: 0
  • Posts: 479
Javascript to make SEF URLs. *NEED FEEDBACK*
« Reply #2 on: January 28, 2006, 05:15:43 PM »

I wanted these to work... I don't think that either URL rewrites, apache, php or mysql will have any problems with language specific characters...
(Latin, Greek, Swedish, German or whatever! ;))

But seems like we have a problem here... ://
I posted an article with the sef url:
_____________

Firefox does the trick and once clicked translates the url to:
%F0_%F0_%FE_%FE_%E6_%E6_%F3_%F3_%ED_%ED_%E9_%E9_%E1_%E1
which is the correct thing to do...

explorer on the other hand just does... nothing! :P
keeps the url as is and so snews dosn't display a thing! o_O

:) Thank you very much for testing it! ^_^ really appreciate it!
Logged
How I feel like I'm starless, I'm ready to fade now.
And how I feel like I'm starless, I'm hopeless and greyed out.

bryn

  • Hero Member
  • *****
  • Karma: 2
  • Posts: 934
    • http://www.cssugly.com
Javascript to make SEF URLs. *NEED FEEDBACK*
« Reply #3 on: January 28, 2006, 08:31:33 PM »

nice script 'a'

would be handy for anyone who didn't particularly want to create their own alternative ones..which would be better as it gives the opportunity to include other keywords/phrases ;D
Logged
Over 1,000 posts of joy, sNews is not only brilliant, but fun too! thanks guys :D

George Antoniadis

  • Sr. Member
  • ****
  • Karma: 0
  • Posts: 479
Javascript to make SEF URLs. *NEED FEEDBACK*
« Reply #4 on: January 29, 2006, 07:29:08 AM »

in most cases sef urls are like permalinks... so the title being some-what similar to the sef would be the correct thing... ^_^
Logged
How I feel like I'm starless, I'm ready to fade now.
And how I feel like I'm starless, I'm hopeless and greyed out.

albert

  • Sr. Member
  • ****
  • Karma: 0
  • Posts: 405
    • http://www.oswt.co.uk/
Javascript to make SEF URLs. *NEED FEEDBACK*
« Reply #5 on: January 30, 2006, 08:58:25 AM »

Hi analyzerx

this a great and should be added to sNews 1.4 and converted to php.

Plus with knowing that a bug is in adding no articals to a snews it's a must.

Just an up date if you did not know. When adding an Artical and you do not add
Search engine friendly title (will be used as link to the article):

what happens ???

do we need to auto fill .. so when you add a Title: the Search engine friendly title (will be used as link to the article):
gets auto filled just in case..?


Albert
Logged
Albert
http://snews.awddesign.co.uk/snews/ site: v1.3
http://snews.awddesign.co.uk/           site: v1.2 http://www.awddesign.co.uk/
Putting together the largest collection of sNews 1.5 designs. Coming very soon :)

George Antoniadis

  • Sr. Member
  • ****
  • Karma: 0
  • Posts: 479
Javascript to make SEF URLs. *NEED FEEDBACK*
« Reply #6 on: January 30, 2006, 09:03:26 AM »

auto filling is not good, and I don't like the idea of a php version of it... ://
it would limit the sef urls quite a bit...

I did this in javascript so the user can see the url and edit it if needed... :/
if it was in php it would be difficult for a user to predict the result...

imagine a scenario where the title has a ? in the end... and php removes it without the user knowing it...
the question becomes a point... and this could get messy for google... :P
Logged
How I feel like I'm starless, I'm ready to fade now.
And how I feel like I'm starless, I'm hopeless and greyed out.

albert

  • Sr. Member
  • ****
  • Karma: 0
  • Posts: 405
    • http://www.oswt.co.uk/
Javascript to make SEF URLs. *NEED FEEDBACK*
« Reply #7 on: January 30, 2006, 02:01:54 PM »

Hi analyzerx

very good points you have.

So what can be done?

Albert

Quote from: analyzerx
auto filling is not good, and I don't like the idea of a php version of it... ://
it would limit the sef urls quite a bit...

I did this in javascript so the user can see the url and edit it if needed... :/
if it was in php it would be difficult for a user to predict the result...

imagine a scenario where the title has a ? in the end... and php removes it without the user knowing it...
the question becomes a point... and this could get messy for google... :P
Logged
Albert
http://snews.awddesign.co.uk/snews/ site: v1.3
http://snews.awddesign.co.uk/           site: v1.2 http://www.awddesign.co.uk/
Putting together the largest collection of sNews 1.5 designs. Coming very soon :)

Jochum Meester

  • Sr. Member
  • ****
  • Karma: 1
  • Posts: 309
    • JochumMeester.com
Javascript to make SEF URLs. *NEED FEEDBACK*
« Reply #8 on: January 30, 2006, 05:03:52 PM »

I really like this idea! But you said you don't want to see it in PHP cause it'll be 'hidden'. Is it possible in PHP to do the same thing you did in javascript? So after you've written the title PHP will automatically transform it into a SEF and display it in a input.text under the title?

Great idea
Logged

George Antoniadis

  • Sr. Member
  • ****
  • Karma: 0
  • Posts: 479
Javascript to make SEF URLs. *NEED FEEDBACK*
« Reply #9 on: January 30, 2006, 07:40:24 PM »

no php is server side... it's not client side dynamic...
I don't get why you don't like javascript for tihs!!!

I did this in jscript cause I am SURE this was the best way to do this... :/
I can make the same exact thing in php as a failsafe (if the user doesn't write anything for the sef url) but I still think that javascript would be the most apropriate thing...

javascript is simple to use... you write the title, hit (make sef) or something and *PUFF* the sef appears...
if you don't like what it wrote... you just change it...

if this was php you'd have to submit the form without writing a sef, and then go edit the article if you don't like it... and then again, the script  might change it again because it doesn't like something you wrote on the sef... o_O
Logged
How I feel like I'm starless, I'm ready to fade now.
And how I feel like I'm starless, I'm hopeless and greyed out.

Jochum Meester

  • Sr. Member
  • ****
  • Karma: 1
  • Posts: 309
    • JochumMeester.com
Javascript to make SEF URLs. *NEED FEEDBACK*
« Reply #10 on: January 30, 2006, 07:55:06 PM »

Sorry mate didn't intend to say JavaScript was bad or anything, it's just that I myself dont know much about it. That page you showed us works really nice. I think that if all the odd characters are added it would be a great script to use! Sorry again.
Logged

George Antoniadis

  • Sr. Member
  • ****
  • Karma: 0
  • Posts: 479
Javascript to make SEF URLs. *NEED FEEDBACK*
« Reply #11 on: January 30, 2006, 08:00:40 PM »

Quote from: JM
Sorry mate didn't intend to say JavaScript was bad or anything, it's just that I myself dont know much about it. That page you showed us works really nice. I think that if all the odd characters are added it would be a great script to use! Sorry again.

Lol, hey stop apologizing! ^_^ I just don't get what ppl have against jscrip! :P
sorry I got edgie! - my bad... ; )

I'm trying to find out what characters are compatible with url rewrites and don't **ck up everything...
I know from experience that ~ kills everything! :P
also these &?%$*:/ also make a mess!

thanx for your kind words and sorry for getting miffy! ^_^
Logged
How I feel like I'm starless, I'm ready to fade now.
And how I feel like I'm starless, I'm hopeless and greyed out.

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
Javascript to make SEF URLs. *NEED FEEDBACK*
« Reply #12 on: January 30, 2006, 08:17:48 PM »

Hey, miffo ;)   The swedish odd letters, dy'a know them ? If ya don't they're , and , and , and other characters would be the same worldwide I guess like % & # and you name it

Patric.
Logged
"It's only dead fish that goes with the flow... "
Updated

bryn

  • Hero Member
  • *****
  • Karma: 2
  • Posts: 934
    • http://www.cssugly.com
Javascript to make SEF URLs. *NEED FEEDBACK*
« Reply #13 on: February 02, 2006, 07:07:36 AM »

Quote from: analyzerx
no php is server side... it's not client side dynamic...
I don't get why you don't like javascript for tihs!!!

I did this in jscript cause I am SURE this was the best way to do this... :/
I can make the same exact thing in php as a failsafe (if the user doesn't write anything for the sef url) but I still think that javascript would be the most apropriate thing...

javascript is simple to use... you write the title, hit (make sef) or something and *PUFF* the sef appears...
if you don't like what it wrote... you just change it...

if this was php you'd have to submit the form without writing a sef, and then go edit the article if you don't like it... and then again, the script  might change it again because it doesn't like something you wrote on the sef... o_O

people here might be referring to the fact that Luka suggested we keep javascript out of sNews if possible 'a' but in this case it would seem to be the best way to do this..for now ;)
Logged
Over 1,000 posts of joy, sNews is not only brilliant, but fun too! thanks guys :D

George Antoniadis

  • Sr. Member
  • ****
  • Karma: 0
  • Posts: 479
Javascript to make SEF URLs. *NEED FEEDBACK*
« Reply #14 on: February 02, 2006, 10:33:30 AM »

Luka still doesn't like the idea of javascript (sorry I didn't know that) so I'm working on something similar in php! ^_^
it might take a while cause I'me trying to see what I can to to translate weird characters to latin ones... (and it might no be easy! :P)
Logged
How I feel like I'm starless, I'm ready to fade now.
And how I feel like I'm starless, I'm hopeless and greyed out.