Advertisement
qlstudio

qtranslate code

Apr 16th, 2013
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.81 KB | None | 0 0
  1.             <div class="language">
  2.                 <ul>
  3. <?php
  4.            
  5.             // translation options ##
  6.             if ( function_exists ( 'qtrans_generateLanguageSelectCode' ) ) {
  7.                 #echo qtrans_generateLanguageSelectCode('text');
  8.                 global $q_config;
  9.                 $language_count = 0;
  10.                 foreach(qtrans_getSortedLanguages() as $language ) {
  11.                    
  12.                     // highlight ##
  13.                     $classes = array('lang-'.$language);
  14.                     if( $language == $q_config['language'] ) {
  15.                                             $classes[] = 'active';
  16.                     }
  17. ?>
  18.                     <li class="<?php echo implode( ' ', $classes); ?>">
  19. <?php
  20.  
  21.                         // add opening pipe ##
  22.                         if ( $language_count == 0 ) {
  23.                             #echo 'language'. $language;
  24.                             //echo '|';
  25.                         }
  26.                        
  27.                         $url = qtrans_convertURL('',$language);
  28.  
  29. ?>
  30.                          <a href="<?php echo $url; ?>" hreflang="<?php echo $language; ?>" title="<?php echo $q_config['language_name'][$language]; ?>">
  31.                             <?php echo $q_config['language_name'][$language] ?></a>&nbsp;
  32.                     </li>
  33. <?php
  34.                            
  35.                 $language_count ++;
  36.                 } // endforeach;
  37.                    
  38.             }
  39.                        
  40. ?>
  41.                 </ul>
  42.             </div>
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56. <?php
  57. /* css */
  58. /*
  59.  
  60.  
  61.  
  62. #header .right .language {
  63.     float: right;
  64.     width: 90px;
  65.     clear: both;
  66.     height: 49px;
  67.     position: relative;
  68.     z-index: 3;
  69. }
  70.  
  71. #header .right .language ul {
  72.     float: right;
  73.     width: 72px;
  74.     text-align: right;
  75.     list-style-type: none;
  76.     padding-top: 15px;
  77. }
  78.  
  79. #header .right .language ul li {
  80.     float: left;
  81.     background: url("images/lan_bg.gif") no-repeat 0 0;
  82.     text-align: center;
  83.     margin: 0 4px 0 0;
  84.     width: 27px;
  85.     height: 17px;
  86.     overflow: hidden;
  87. }
  88.  
  89. #header .right .language ul li a {
  90.     color: #fff;
  91.     font-size: 0.7em;
  92.     text-decoration: none;
  93.     padding: 2px 7px 2px 7px;
  94.     float: left;
  95.     display: block;
  96. }
  97.  
  98. #header .right .language ul li a:hover {
  99.     color: #feec9c;
  100. }
  101.  
  102. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement