weird characters in the url |
[eluser]shadow player[/eluser]
Quote:i add spaces because without them it will echo the greek word in the post And exactly because of those whitespaces the function hexToStr won't work correctly. Remove them before passing them to the function and it will work.
[eluser]osci[/eluser]
My example is not using a url like Code: http://test.loc/welcome/index/search_by_name=Doe+John Code: http://test.loc/welcome/index/Doe i guess this has to do with Code: $config['uri_protocol'] = "AUTO"; The controller (News as seen in site_url below) Code: function index($q='-', $offset = 0) The model Code: function get_pager_records_q($max,$start,$q) The view Code: <?php if (isset($records) & ($records <> NULL)) { ?> I have to use $q='-' as letting $q='' would produce url with double slashes in this code.
[eluser]dianikol85[/eluser]
[quote author="shadow player" date="1302467151"] Quote:i add spaces because without them it will echo the greek word in the post And exactly because of those whitespaces the function hexToStr won't work correctly. Remove them before passing them to the function and it will work.[/quote] i add them just in here in this post because without them it with prin the greek word. in the script i wrote it without the spaces. Another weird thing. i store the search form post in a session and then i pass it to the model and it worked. But the sql query is exactly the same as before. It's getting really fraustrating I am not comfortable to extend a library yet.
[eluser]dianikol85[/eluser]
osci i follow this technique because i didn't wont to fave so many segments in the url. Maybe i have 5 or 6 keywords at the same time. I tried to do that more dynamically
[eluser]osci[/eluser]
$q could be a serialized array containing your list of and likes ie Code: http://test.loc/welcome/index/one+two+three and in your controller you could convert that to an array Code: $q_array = explode('+',$q); and use that array in your model to loop and create a set of likes You could extend it to be more dynamic with another segment containing fields. Code: http://test.loc/welcome/index/one+two+three/title+content ie use another array for the fields too. Code: $f_array = explode('+',$f); and combine arrays in model to give you more power It's up to your requirements
[eluser]InsiteFX[/eluser]
CodeIgniter User Guide - Text Helper convert_accented_characters() Transliterates high ASCII characters to low ASCII equivalents, useful when non-English characters need to be used where only standard ASCII characters are safely used, for instance, in URLs. Code: $string = convert_accented_characters($string); InsiteFX
[eluser]osci[/eluser]
Wouldn't that mean I would have to make equivalents for each of my greek character to an english equivalent? meaning ie i for ι or ί and a for α? that would be something we call in Greece as greeklish (ie γράφω σε ελληνικά = grafw se ellinika,) and it wouldn't be seo friendly, as grafw means nothing to search engines while γράφω does.
[eluser]dianikol85[/eluser]
yes definitely not greeklish. its like trush. only in Greece that lang is understandable and seo doesn't recognize it
[eluser]osci[/eluser]
@dianikol85 the arrays way in comment #14 weren't good for your dynamic requirement?
[eluser]dianikol85[/eluser]
[quote author="osci" date="1302470779"]@dianikol85 the arrays way in comment #14 weren't good for your dynamic requirement?[/quote] sure it works fine but the problem isn't how to generate the url. The prob is when i have greeks in it. In you example in comment #11 you didn't explain how did you pass the search form variables in the url. Do you do something like i do? I send the post int a method and in that method i generate the segments and then i redirect with the generating string like that Code: redirect('index/'.$generated_string); I can't think another way on how to pass it to the view in order to have the pagination. I also want to mention that when i have greeks in the url try to copy the url and paste it in a text document. It prints a hex value of those greek words. And that hex value pass in the model. Even if use a func hex to string the sql query still doesn't work. The only way i make it works is that in the method i produce the $generated_string at the same time i store the values in a session and i use that session in the model to achieve a success sql query It works but with that way i can't share the link because i use a session in the model... |
Welcome Guest, Not a member yet? Register Sign In |