![]() |
|
problem calling `filterAccentedCharacters` function in ZP 1.4 - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: problem calling `filterAccentedCharacters` function in ZP 1.4 (/thread-8053.html) |
problem calling `filterAccentedCharacters` function in ZP 1.4 - frankm - 2011-01-06 hi, i have a filter that i wrote for zenphoto 1.2.9. it used to make good use of the of course i have enabled the zenphoto_seo plugin to be able to mak a call to the function. thanks for your help, problem calling `filterAccentedCharacters` function in ZP 1.4 - sbillard - 2011-01-06 So, some more detail, maybe. What do you mean by "not working"? Is it throwing errors? BTW, you are not really using the function correctly (although it should work so long as the plugin is enable.) What you should be using is the seoFrindly() function. That function uses whatever is configured for the "seoFriendly" filter, including a default translation should none be configured. problem calling `filterAccentedCharacters` function in ZP 1.4 - frankm - 2011-01-06 what i have in my filter is something like this if i edit the hopefully, this helps a bit. with the version 1.2.9, activating a plugin or a filter was enough for all its functions to be known everywhere, i am now wondering if since then one has to add a specific instruction so that functions of one plugin can be used in another one ? problem calling `filterAccentedCharacters` function in ZP 1.4 - acrylian - 2011-01-06 Maybe you should really post either more details or the complete plugin. Why do you need this filter actually? The plugin is meant to hook into the upload/creation process on the backend for all Zenphoto items already. problem calling `filterAccentedCharacters` function in ZP 1.4 - sbillard - 2011-01-06 Well, if it is not entering the function it is not a problem of the function. Surly if execution stops there will be some kind of script error generated. You will need to find that. If not, then be sure you are really getting to the line in your plugin. But better anyway is that you use the standard seoFriendly() function as described above. problem calling `filterAccentedCharacters` function in ZP 1.4 - frankm - 2011-01-11 i have tried to use the right now what i need is a seo friendly version of the image title which can contain accented characters (french, spanish...), double dashes or spaces. basically if the image title is "René Hood" i want to turn it into "rene-hood". looking at the using the zenpage theme, i made a simple test. i added this code right after ` ` inside the note the lower case option in the zenphoto_seo plugin is checked. problem calling `filterAccentedCharacters` function in ZP 1.4 - sbillard - 2011-01-11 the zenphoto_seo plugin is a "back-end" plugin. That is, it is not loaded for theme pages so you are getting the default seoFriendly() processing which just strips out the suspect characters. You will have to cause your them to do a But just for curiosity, why are you stripping the diacritical marks from the title? The filter is back-end only because it is normally used only for converting file/folder names so that both the URL looks better and filesystems which do not support those characters will work. problem calling `filterAccentedCharacters` function in ZP 1.4 - frankm - 2011-01-11 thanks for the tip. i missed that now to answer your curiosity... basically i have different albums. in every album, the photos have a generic filename and a number that differentiate them (e.g. burma-1.jpg, burma-2.jpg and so on). i have read that for image search, the filename is important and it is better to have some kind of explicit name such as jumping-cat.jpg rather than burma-34.jpg. well that's is what i read. as google is very opaque, i do not know to what extent this is true. anyway i had in mind to change the name of my pictures and have it reflect the title of the pic. i could have simply renamed all pics once for all but i have so much more on my harddrive that are waiting to be uploaded that i thought it would maybe be better to keep things how they are and just write a filter that does that. i did with ZP 1.2.9 and it works ok. you can check that on my burmese gallery for instance. i want to port this feature to the latest ZP1.4 version and that's where i am... working on it. doing things this way is the solution i have chosen which might not be the best. maybe there is already a function that i haven't seen which does that. if you have any feedback i'll be glad to hear it even if it is to tell me that this filter thing sounds stupid. problem calling `filterAccentedCharacters` function in ZP 1.4 - sbillard - 2011-01-12 Ok, makes sense now that I understand. problem calling `filterAccentedCharacters` function in ZP 1.4 - frankm - 2011-01-12 with ZP1.2.9, i used to be able to do jsut by applying a filter on load_request. right now, with ZP1.4, i have difficulties to do that. so basically i went back to the basics and here is my "stripped" plugin ` ` problem calling `filterAccentedCharacters` function in ZP 1.4 - sbillard - 2011-01-12 Prbably you were caught by a little trap. If you change the We manage to hide that most times as Setup will also insure the value in the option is correct. But of course if you are developing a plugin this is something you would need to know. problem calling `filterAccentedCharacters` function in ZP 1.4 - sbillard - 2011-01-12 BY the way, you might want to look at the new utility in the development stream named SEO cleanup. It is doing almost what you describe. But instead of using the title for the name it is just using seoFriendly() on the filename. If you are actually changing the filename of the image you should remember that there are database entries that have to get handled as well. This utility does take care of that. |