Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+6 votes
1.7k views
in Q2A Core by
edited by

How to automatically capitalize URLs like this ? =>

2 Answers

+1 vote
by
edited by

ok, here is quick core hack:

in 'qa-base.php' find 'qa_q_request' function. at the end of it replace

        return (int)$questionid.'/'.$title;

with

        return (int)$questionid.'/'.strtoupper($title);
 


OK, I made a quick guide to create a plugin for this(nothing fancy), you can check it here:

http://qa-themes.com/forums/topic/capitalizing-urls-of-questions

I don't think that many people will like to use it since lower case URL's look cleaner, but if I'm wrong and there is more request I can add it to repository.

by
you must remove the fist line, because when a 'return' command is executed nothing after that will be called.
by
edited by
I add only this =>  return  str_replace(' ', '?', ucwords(str_replace('?', ' ',  str_replace(' ', '/', ucwords(str_replace('/', ' ', str_replace(' ', '-', ucwords( str_replace('-', ' ', strtolower($url)) )) )) ))));

and I have these error => <b>Notice</b>:  Undefined variable: url in <b>/home/numeroco/public_html/odlg.org/qa-include/qa-base.php</b> on line <b>1255</b><br />
by
create a plugin according to this guide: http://qa-themes.com/forums/topic/capitalizing-urls-of-questions
in case you want to do the core hack, replace
     return (int)$questionid.'/'.$title;
with
     return  str_replace(' ', '?', ucwords(str_replace('?', ' ',  str_replace(' ', '/', ucwords(str_replace('/', ' ', str_replace(' ', '-', ucwords( str_replace('-', ' ', strtolower((int)$questionid.'/'.$title)) )) )) ))));
asked Feb 14, 2014 in Q2A Core by
edited Feb 28, 2014 by
NEED HELP => How To Uppercase TAGS Urls ?
0 votes
by
this feature is added as a part of a new plugin I developed. check it out here:

http://www.question2answer.org/qa/33567/new-plugin-url-customizer
...