Friday 16 March 2012

PHP Cara Membuat Fungsi Yang Sama Seperti $welcomeblock

Standard
PINDAHAN THREAD KARENA SALAH KAMAR !!!

Disini kita akan belajarcara membuat fungsi yang sama seperti $welcomeblock yuk ketutor

1.Buka File global.php lalu cari code ini

Kode PHP: (Select All)
// Load appropriate welcome block for the current logged in userif($mybb->user['uid'] != 0)
{
    
// User can access the admin cp and we're not hiding admin cp links, fetch it
    
if($mybb->usergroup['cancp'] == && $mybb->config['hide_admin_links'] != 1)
    {
        
$admin_dir $config['admin_dir'];
        eval(
"\$admincplink = \"".$templates->get("header_welcomeblock_member_admin")."\";");
    }
 
    if(
$mybb->usergroup['canmodcp'] == 1)
    {
        eval(
"\$modcplink = \"".$templates->get("header_welcomeblock_member_moderator")."\";");
    }
 
    
// Format the welcome back message
    
$lang->welcome_back $lang->sprintf($lang->welcome_backbuild_profile_link($mybb->user['username'], $mybb->user['uid']), $lastvisit);

    
// Tell the user their PM usage
    
$lang->welcome_pms_usage $lang->sprintf($lang->welcome_pms_usagemy_number_format($mybb->user['pms_unread']), my_number_format($mybb->user['pms_total']));
    eval(
"\$welcomeblock = \"".$templates->get("header_welcomeblock_member")."\";");
Fungsi code tersebut sama seperti welcomemember jika anda mau seperti welcome quest lihat code ini
Kode PHP: (Select All)
// Otherwise, we have a guestelse
{
    eval(
"\$welcomeblock = \"".$templates->get("header_welcomeblock_guest")."\";");
2.Jika anda ingin membuat fungsi sama dengan nama yang berbeda contoh dengan nama $sidebar yang dilihat tamu saja maka anda harus menuliskan code php seperti dibawah
Kode PHP: (Select All)
{
    eval(
"\$sidebar = \"".$templates->get("header_welcomeblock_sidebarq")."\";");

Anda harus membuat template didalam ACP dengan nama header_welcomeblock_sidebarq code php tersebut harus di taruh dibawah
Kode PHP: (Select All)
// Otherwise, we have a guestelse 

0 komentar:

Post a Comment