Simple Machines Community Forum

SMF Support => Bahasa Indonesia (Indonesian) => Language Specific Support => Modifikasi (Mods) => Topic started by: apadong.net on March 01, 2009, 10:56:15 AM

Title: [tanya] Cara ganti tag Mods
Post by: apadong.net on March 01, 2009, 10:56:15 AM
Saya lagi coba modif mods Hidden for Guest (http://custom.simplemachines.org/mods/index.php?mod=756) supaya kompatibel dg SMF 1.1.8 yang saya pake disertai dg penambahan fungsi lain supaya sesuai dg kebutuhan saya.

Cuma yg jd kendala, ada yg bisa bantu supaya saya bisa mengubah kode tag-nya?

Contoh,saya pengen ubah tag-nya dari:
[logged]...[/logged]

jadi:
[sembunyi]...[/sembunyi]

tenkyu ;)
Title: Re: [tanya] Cara ganti tag Mods
Post by: vmgamer on March 25, 2009, 10:53:56 PM
Hihihi
sik, tak coba
Title: Re: [tanya] Cara ganti tag Mods
Post by: vmgamer on March 25, 2009, 11:03:07 PM
./Themes/default/Post.template.php

Find: [Select]

'list' => array('code' => 'list', 'before' => '[list]\n[li]', 'after' => '[/li]\n[li][/li]\n[/list]', 'description' => $txt[261]),

Add After: [Select]


array(),
'lockguest' => array('code' => 'logged', 'before' => '[sembunyi]','after' => '[/sembunyi]', 'description' => $txt['description_lock_guests']),
Title: Re: [tanya] Cara ganti tag Mods
Post by: vmgamer on March 25, 2009, 11:07:15 PM
./Sources/Load.php

Find:

// Replace all vulgar words with respective proper words.

Add Before:

// this function will search for [sembunyi] and [/sembunyi] codes
function preparehidecontent($mensaje){
   global $user_info ,$txt;
   $notloged = $user_info['is_guest'];
   $indice = 0;
   $incode = 0;
   $devuelto = "";
   $maximo = strlen($mensaje);
   $estado = 0;
   if($notloged){
      while($indice < $maximo){
         switch($estado){
            case 0: {if($mensaje[$indice] == "["){
                       if(substr($mensaje,$indice+1,7)=="sembunyi]"){
                          $estado = 1;
                          $indice += 7; //más el del final son siete
                          if($incode == 0)
                          $devuelto .= "<center><table style=\"width:90%;height:64px;padding: 10px; text-align: center; margin: 0 1ex 2ex 1ex;border: 2px dashed #cc5566\"><tr><td>".$txt['hide_for_guests1']."<br>".$txt['hide_for_guests2']."</td></tr></table></center>";
                          else
                          $devuelto .= "< <".$txt['hide_for_guests0']. "> >";
                       }
                       else if(substr($mensaje,$indice+1,5)=="code]"){
                          $devuelto .= $mensaje[$indice];
                          $incode = 1;
                       }
                       else if(substr($mensaje,$indice+1,6)=="/code]"){
                          $devuelto .= $mensaje[$indice];
                          $incode = 0;
                       }
                       else{
                          $devuelto .= $mensaje[$indice];
                       }
                    }
                    else{
                       $devuelto .= $mensaje[$indice];
                    }
                    }break;
            case 1: {if($mensaje[$indice] == "["){
                       if(substr($mensaje,$indice+1,8) == "/sembunyi]"){
                          $estado = 0;
                          $indice += 8;
                       }
                    }
                    }break;
         }
         $indice++;
      }
   }
   else{
      while($indice < $maximo){
         switch($estado){
            case 0: {if($mensaje[$indice] == "["){
                       if(substr($mensaje,$indice+1,7)=="sembunyi]"){
                          $estado = 1;
                          $indice += 7;
                          //$devuelto .= "<table style=\"width:90%;height:64px;padding:10px;margin:0 1ex 2ex 1ex; border: 2px dashed #006600\"><tr><td>";
                       }
                       else{
                          $devuelto .= $mensaje[$indice];
                       }
                    }
                    else{
                       $devuelto .= $mensaje[$indice];
                    }
                    }break;
            case 1: {if($mensaje[$indice] == "["){
                       if(substr($mensaje,$indice+1,8) == "/sembunyi]"){
                          $estado = 0;
                          $indice += 8; //más el del final son ocho
                          //$devuelto .= "</td></tr></table>";
                       }
                       else{
                          $devuelto .= $mensaje[$indice];
                       }
                    }
                    else{
                       $devuelto .= $mensaje[$indice];
                    }
                    }break;
         }
         $indice++;
      }   
   }
   return $devuelto;
}
Title: Re: [tanya] Cara ganti tag Mods
Post by: vmgamer on March 25, 2009, 11:09:12 PM
Saya kira itu :)
Title: Re: [tanya] Cara ganti tag Mods
Post by: apadong.net on March 28, 2009, 07:44:24 PM
tararenkyu..tak coba dulu ya..
Title: Re: [tanya] Cara ganti tag Mods
Post by: reviewsquad on April 13, 2009, 07:25:12 AM
It works!! Saya udah nyoba en berhasil dengan sukses... thx tutorialnya!