View Full Version : $vbulletin->adv_links_cats
Lionel
03-01-2007, 08:19 PM
I am doing my vba_links truly multilingual for the categories and subcategories. So far so good. The main categories display in proper order depending of language. But I have one major problem that I pinpointed to $vbulletin->adv_links_cats which is serialized.
My question is, if I include some textboxes in admin for the additional titles of the different language so they could to be serialized, will that break anything else?
Brian
03-01-2007, 08:26 PM
No, storing more variables/data in the $vbulletin->adv_links_cats array will not hurt anything. Keep in mind that there is an update_category_cache() function though that you will have to modify as well, assuming you're adding more columns to the adv_links_cats table and want to store those things you're adding in the cache.
Lionel
03-01-2007, 08:33 PM
Ah, never mind... I was not building the cache properly in function update_category_cache(). I was using my variable $catlang instead of detailing it to title, title_fr,title_sp, title_kr
Brian, this script rocks!!!! I used many links scripts, all multi lingual will never display catego and subcategos in proper order.
Lionel
03-01-2007, 08:42 PM
Everything is fine now. All that is left is to figure out the category jump and the options so they too can order by alpha
Lionel
03-01-2007, 09:26 PM
I suspect this has to do with the serialized info. I can display everything in all languages, but they are properly sorted only on cat main. Subcats, $options and categoryjump are displaying them alpha by ttile, disregarding my $catlang variable. Depending of $vbulletin->userinfo[yplang], I select title, or title_fr, or title_sp etc...), but that seems not to matter to that serialized info. I tried with no luck to plug in an asort()
Lionel
03-01-2007, 10:01 PM
Any suggestions? I found the problem.
When building the function update_category_cache() it is ordering alphabetically as set in options. So it builds alpha according to the language named title. Therefore, the cache is already built for ALL users. And it does not matter if they have selected title_fr or title_sp. That cache displays by title. If I manually do the order by title_fr in the function, then it sorts by title_fr for all. Maybe it would be necessary to buid a cache for every language, and depending of selected language I can make it to look for $vbulletin->adv_links_cats_fr or $vbulletin->adv_links_cats_sp etc...?
I hope there is an easier solution :(
Brian
03-02-2007, 11:52 PM
Other than making a cache for every language, the only other thing I can think of would be adding some code (similar to the update_category_cache() function) that would query the database and rebuild the cache when a different language is selected. That might cut back just a bit on performance, but I don't think it would be significant unless you have a few hundred categories.
Lionel
03-03-2007, 12:29 AM
Did all that. Created new settings in datastore and everytime a catego is updated it inserts for all languages. But various part of the script use the original adv_links_cats name. So I tried doing an if $vbulletin->userinfo['lang']==whatever) then run this adv_links_cats _whatever but it is not happening. I'll have to take a closer look at it.
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.