1. Skip to Menu
  2. Skip to Content
  3. Skip to Footer>

IT TheLodge 2 We are proud to announce the release of our January 2012 Premium Joomla Template IT TheLodge 2
A complete hotel based template that accepts instantly your website bookings, even through PayPal..

View Demo or Read More

Welcome, Guest
Please Login or Register.    Lost Password?

Characters like !?@ ect dont show on the mainmenu
(1 viewing) (1) Guest
Go to bottom
Post Reply
Post New Topic
Page: 1234567
TOPIC: Characters like !?@ ect dont show on the mainmenu
Re:Characters like !?@ ect dont show on the mainme 2 Years, 11 Months ago #4317
Thank you it works.
I have another problems with templates and soon will have to ask you for further help
JacekT


Enter code here   
Please note: although no board code and smiley buttons are shown, they are still usable.
jacekt
Posts: 15
graphgraph
User Offline Click here to see the profile of this user
Reply Quote
 
Re:Characters like !?@ ect dont show on the mainmenu 2 Years, 11 Months ago #4394
Hi,
The problem is that the function used for splitting the menu title into two parts is str_word_count which is not utf-8 compliant.

I have created a modification that uses multibyte functions to split the title. Works great under FF,IE,Chrome and Safari.

All you need to do is modify the file (create backup first):

\templates\it_spotlight\html\mod_mainmenu\helper.php

and replace this block (in _getItemData function):

Code:


/*---------------------------------------------------------------------------  added to split the menu name into first word and the rest */
$var = str_word_count($item->name, 1);

$firstword = ($var[0]);
$restofname = "";

$i = 1;
while (!empty($var[$i])) :
$restofname .= " ".$var[$i];
$i++;
endwhile;

$tmp->name = "";
if (!empty($restofname)){
$tmp->name .= '<span><![CDATA['.$firstword.']]></span>';
$tmp->name .= '<span class="sub">'.$restofname.'</span>';
}
else
$tmp->name  = '<span><![CDATA['.$item->name.']]></span>';
/*--------------------------------------------------------------------------- end of new code */



To this block:

Code:


/*----- added to split the menu name into first word and the rest */

//UTF-8 support for main menu titles modified by Marton Feovenyessy (feovenyessy@gmail.com)

$tmp_tomb = mb_ereg('[\w]+[\s|\.|\?|\!|[0-9]]+',$item->name,$regs);
$eredmeny_hossz=mb_strlen($regs[0]);
$focim=($eredmeny_hossz>0)?$regs[0]:$item->name;
$focim_hossz=mb_strlen($focim);
$teljes_hossz=mb_strlen($item->name);
$alcim_hossz=$teljes_hossz-$focim_hossz;
$alcim=($teljes_hossz>$focim_hossz)?mb_substr($item->name,$focim_hossz,$alcim_hossz,'utf-8'):"";

$tmp->name = "";
if (!empty($alcim)) {
$tmp->name .= '<span><![CDATA['.$focim.']]></span>';
$tmp->name .= '<span class="sub">' . $alcim . '</span>';
}
else
$tmp->name  = '<span><![CDATA['.$item->name.']]></span>';

/*--------------------------------------------------------------------------- end of new code */



And voilá, you're good to go.

http://rapidshare.com/files/202776143/helper.php.zip.html


Enter code here   
Please note: although no board code and smiley buttons are shown, they are still usable.
!!!UTF-8 main menu titles mod!!!

Reply Quote
 
Re:Characters like !?@ ect dont show on the mainmenu 2 Years, 9 Months ago #5158
Hi
I have the same problem with it_breeze.
This file could not be downloaded anymore, so i try to change code manualy, but i'v got blank page.
Could someone help me please. I also need UTF-8 character coding.

Thanks


Enter code here   
Please note: although no board code and smiley buttons are shown, they are still usable.
kixon
Posts: 16
graphgraph
User Offline Click here to see the profile of this user
Reply Quote
 
Re:Characters like !?@ ect dont show on the mainmenu 2 Years, 9 Months ago #5171
Hi,
What kind of chars are you experiencing the issue. Is it with the mainmenu only or with the content?

Also please specify the problem that the file can not be downloaded anymore


Enter code here   
Please note: although no board code and smiley buttons are shown, they are still usable.
Alvin
Posts: 2267
graphgraph
User Online Now Click here to see the profile of this user
Gender: Male alvini_icetheme IceTheme Location: Tirana Albania
Alvin Konda
-------------------
IceTheme
CEO
Reply Quote
 
Re:Characters like !?@ ect dont show on the mainmenu 2 Years, 9 Months ago #5217
Hi

Problem are only with mainmenu. (more accurate with second line of meinmenu)
I need to show slovenian chars like š &#269; ž ...

I mean file, which was attached two posts above.

thanks


Enter code here   
Please note: although no board code and smiley buttons are shown, they are still usable.
kixon
Posts: 16
graphgraph
User Offline Click here to see the profile of this user
Reply Quote
 
Re:Characters like !?@ ect dont show on the mainmenu 2 Years, 9 Months ago #5236
Hi,
You mean that when you replace the file your site stop working?


Enter code here   
Please note: although no board code and smiley buttons are shown, they are still usable.
Alvin
Posts: 2267
graphgraph
User Online Now Click here to see the profile of this user
Gender: Male alvini_icetheme IceTheme Location: Tirana Albania
Alvin Konda
-------------------
IceTheme
CEO
Reply Quote
 
Go to top
Post Reply
Post New Topic
Page: 1234567
Moderators: Andel, juljan, Brunilda, Tomi

Earn 20% of every sale that is generated from your website and generate and extra income! Join Affiliate Program

Newsletter Subscribe

Subscribe to our newsletters to be notified about our important news.