Please, I need your help fixing this code...

Discussion in 'PHP' started by Divvy, Feb 25, 2011.

  1. #1
    Hello friends,

    Can someone help me fix some bugs that my template have...

    my website:
    http://www.celebridadesdespidas.com (adult content)

    1- strange character in the top middle... If I choose Russian language, the character disappears... but If I choose English, appears!
    2- when you click in "open", shows a menu popup full of code lines... is a mess!

    Please, can someone help me?

    I think that the problem is in login.tpl file:
    <?php
    if ($is_logged == TRUE){
    
    $login_panel = <<<HTML
    					<div class="login-link">
    								
    HTML;
    
    if ($user_group[$member_id['user_group']]['allow_admin']) {
    $login_panel .= <<<HTML
    								 <a href="{$adminlink}" class="admin-link" target="_blank">Àäìèíöåíòð</a>
    HTML;
    }
    else {
    $login_panel .= <<<HTML
    
    HTML;
    }
    $login_panel .= <<<HTML
    							
    								<a href="{$link_addnews}" class="add-link">Îïóáëèêîâàòü</a>
                                     <a href="{$link_profile}" class="profile-link">Èíôîðìàöèÿ î Âàñ</a>
                                     <a href="{$link_pm}" class="pm-link">Ñîîáùåíèÿ ({$member_id['pm_unread']} | {$member_id['pm_all']})</a>								 
    
    								 <a href="{$link_logout}" class="lu-link">Âûõîä</a>
    								 <div style="clear: both; height: 1px;"></div>
    							</div>
    HTML;
    
    } else {
    $login_panel = <<<HTML
    							
    								
                                  
    									<div class="l-color">	
    										<form method="post" action='' style="margin: 0; padding: 0;">
    											<table width="200" cellpadding="0" cellspacing="0">
    												<tr>
    													<td valign="top" width="140">
    														Âàøå èìÿ
    													</td>
    													<td valign="top" width="140">
    														Ïàðîëü
    													</td>
    												</tr>
    												<tr>
    													<td valign="top" style="padding-top: 5px;">
    														<input name="login_name" type="text" class="login-input-text" title="Âàøå èìÿ íà ñàéòå" value="ëîãèí" onblur="if(this.value=='') this.value='ëîãèí';" onfocus="if(this.value=='ëîãèí') this.value='';" />
    													</td>
    													<td valign="top" style="padding-top: 5px;">
    														<input name="login_password" type="password" class="login-input-text" title="Âàø ïàðîëü" value="ïàðîëü" onblur="if(this.value=='') this.value='ïàðîëü';" onfocus="if(this.value=='ïàðîëü') this.value='';" />
    													</td>
    												</tr>
    												<tr>
    													<td valign="top" colspan="2" style="padding-top: 7px;">
    														<input onclick="submit();" type="image" class="enter" src="{THEME}/images/enter.jpg" value="âõîä" /><input name="login" type="hidden" id="login" value="submit" />
    														<div style="float: left;padding: 7px 0 0 5px;" class="fix-moz"><a href="{$link_regist}" title="ðåãèñòðàöèÿ íà ñàéòå">Ðåãèñòðàöèÿ</a> / <a href="{$link_lost}" title="âîññòàíîâëåíèå ïàðîëÿ">Âñå çàáûë?</a></div>
    													</td>
    												</tr>
    											</table>
    										</form>
    									</div>
                                    
    HTML;
    }
    ?>
    PHP:
     
    Divvy, Feb 25, 2011 IP
  2. Divvy

    Divvy Well-Known Member

    Messages:
    785
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    128
    #2
    Please, can someone help me?
     
    Divvy, Feb 27, 2011 IP
  3. Divvy

    Divvy Well-Known Member

    Messages:
    785
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    128
    #3
    Please, someone...
     
    Divvy, Feb 28, 2011 IP
  4. biiccs

    biiccs Member

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #4
    You should use "utf-8" unicode for you file at first. At second you should use
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    Code (markup):
    in head of you html page.
     
    biiccs, Feb 28, 2011 IP
  5. JohnRazmus

    JohnRazmus Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Or if that doesn't work, you can force the page to not show bad characters using php:

    <?php ob_start(); ?>
    bad content stuff that won't show
    <?php ob_end_clean(); ?>
     
    JohnRazmus, Feb 28, 2011 IP
  6. Divvy

    Divvy Well-Known Member

    Messages:
    785
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    128
    #6
    Thank you guys, but didnt work :(

    I changed from UTF-8 to windows-1251 only to translate the template language from Russian to English.

    See the differences with UTF-8 and windows-1251:

    windows-1251:
    [​IMG]

    UTF-8:
    [​IMG]

    Any more ideas? :)
     
    Divvy, Mar 1, 2011 IP