>>  Site Map >>  Forums >>  Tips&Trick for Nukeplus&phpNUKE

Forum module - topics in forum:



Tips&Trick for Nukeplus&phpNUKE - รวบรวมกลเม็ดการพัฒนาเวปด้วย phpNUKE plus BB



สาเหตุที่ phpNUKE ช้า ตอน 3 "กำจัด header"

[highlight=pink:4fabca47e8][glow=white:4fabca47e8][face=impact:4fabca47e8]http://www.thaihealth.net/clinic/index.php

นี่คือวิธีการที่จะเอา phpBB มาแบบสมบูรณ์ คือเวลา forum ขึ้น จะไม่มี header และ side bar ของ phpNUKE เกะกะ เรียกได้ว่าเต็มพิกัด
ผมสมมุติว่าใช้ thaihealth theme นะครับ เราดูที่ส่วนหนึ่งของ themes/Thaihealth/theme.php

Code: :
function themeheader() {
    global $user, $banners, $sitename, $slogan, $cookie, $prefix, $dbi;
    cookiedecode($user);
    $username = $cookie[1];
    if ($username == "") {
        $username = "Anonymous";
    }
    global $slogan;
    echo "<body bgcolor=\"$bgcolor5\"  text=\"#000000\" link=\"000000\" vlink=\"000036\">";
    if ($banners) {
   include("banners.php");

    }
    $topics_list = "<select name=\"topic\" onChange='submit()'>\n";
    $topics_list .= "<option value=\"\">All Topics</option>\n";
    $toplist = sql_query("select topicid, topictext from ".$prefix."_topics order by topictext", $dbi);
    while(list($topicid, $topics) = sql_fetch_row($toplist, $dbi)) {
    if ($topicid==$topic) { $sel = "selected "; }
   $topics_list .= "<option $sel value=\"$topicid\">$topics</option>\n";
   $sel = "";
    }
    if ($username == "Anonymous") {
   $theuser = "&nbsp;&nbsp;<a href=\"modules.php?name=Your_Account&op=new_user\">Create an account";
    } else {
   $theuser = "&nbsp;&nbsp;Welcome $username!";
    }
    $tmpl_file = "themes/SFX/header.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
    echo "<table border=\"0 cellpadding=\"4\" cellspacing=\"0\" width=\"100%\" align=\"center\"><tr><td bgcolor=\"$bgcolor5\" \" \">"
        ."<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\" width=\"100%\"><tr><td valign=\"top\" width=\"150\" bgcolor=\"$bgcolor5\" >";
    blocks(left);
    echo "<img src=\"images/pix.gif\" border=\"0\" width=\"150\" height=\"1\"></td><td>&nbsp;&nbsp;</td><td width=\"100%\" valign=\"top\">";

}


สังเกตตรงที่ block(left) ให้ดี ตรงนี้จะเป็น landmark






สีแดงคือที่ผมใส่เพิ่มไป

function themeheader() {
global $user, $banners, $sitename, $slogan, $cookie, $prefix, $name,$dbi;
cookiedecode($user);
$username = $cookie[1];
if ($username == "") {
$username = "Anonymous";
}
global $slogan;
echo "";
if ($banners) {
include("banners.php");

}

//
if ($name!=='Forums') {
/* function to hide header and sidebar */
//

$topics_list = "<select name=\"topic\" onChange='submit()'>\n";
$topics_list .= "<option value=\"\">All Topics</option>\n";
$toplist = sql_query("select topicid, topictext from ".$prefix."_topics order by topictext", $dbi);
while(list($topicid, $topics) = sql_fetch_row($toplist, $dbi)) {
if ($topicid==$topic) { $sel = "selected "; }
$topics_list .= "<option $sel value=\"$topicid\">$topics</option>\n";
$sel = "";
}
if ($username == "Anonymous") {
$theuser = "&nbsp;&nbsp;<a href=\"modules.php?name=Your_Account&op=new_user\">Create an account";
} else {
$theuser = "&nbsp;&nbsp;Welcome $username!";
}
$tmpl_file = "themes/SFX/header.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
echo "<table border=\"0 cellpadding=\"4\" cellspacing=\"0\" width=\"100%\" align=\"center\"><tr><td bgcolor=\"$bgcolor5\" \" \">"
."<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\" width=\"100%\"><tr><td valign=\"top\" width=\"150\" bgcolor=\"$bgcolor5\" >";
blocks(left);
echo "</td><td>&nbsp;&nbsp;</td><td width=\"100%\" valign=\"top\">";
}
else {
echo "<table border=\"0 cellpadding=\"4\" cellspacing=\"0\" width=\"100%\" align=\"center\"><tr><td bgcolor=\"$bgcolor5\" \" \">"
."<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\" width=\"100%\"><tr><td valign=\"top\" width=\"10\" bgcolor=\"$bgcolor5\" >";

echo "</td><td>&nbsp;&nbsp;</td><td width=\"100%\" valign=\"top\">";
}

}

เท่านี้แหละครับ




สองตำแหน่งที่เป็นจุดกำหนด

จุดแรกคือจุดต่ำกว่า banner ลงมา จุดที่สองคือจุดที่เริ่ม leftblock เราจะคร่อมไม่ให้ตรงระหว่างสองจุดนี้ไม่แสดงเวลาเข้า module forums


ถ้าจะเอาแต่ left side bar ออก มีอยู่ในกระทู้แถวนี้แหละครับ






หมายเหตุ ผมไม่ได้ test กับ theme อื่น ๆ นะครับ โปรดระวังความเสียหายถ้าเกิดขึ้น บางทีมัน apply ไม่ได้นะครับ






ถามเพิ่มเติม เมื่อเรา logout ออกจากระบบแล้วโปรแกรมจะ redirect กลับสู่หน้าจอเดิม จะแก้ไฟล์ไหนให้ redirect ไปยัง หน้าแรกของเวปไซต์






ของผมใช้ ธีม sunset และเซ้คค่าทุกอย่างแล้วทำงานได้ แต่เวลา logout ออกมันจะ redirect กลับไปที่เดิม คือผู้ใช้ที่ล๊อคอินเข้ามาไม่สามารถออกจากระบบได้






ดูที่ modules/Your_Account/index.php
Code: :
function logout() {
    global $prefix, $db, $user, $cookie, $redirect;
    cookiedecode($user);
    $r_uid = $cookie[0];
    $r_username = $cookie[1];
    setcookie("user");
    $db->sql_query("DELETE FROM ".$prefix."_session WHERE uname='$r_username'");
    $db->sql_query("DELETE FROM ".$prefix."_bbsessions WHERE session_user_id='$r_uid'");
    $user = "";
    include("header.php");
    OpenTable();
    if ($redirect != "") {
        echo "<META HTTP-EQUIV=\"refresh\" content=\"3;URL=modules.php?name=$redirect\">";
    } else {
        echo "<META HTTP-EQUIV=\"refresh\" content=\"3;URL=index.php\">";
    }
    echo "<center><font class=\"option\"><b>"._YOUARELOGGEDOUT."</b></font></center>";
    CloseTable();
    include("footer.php");
}

ตรง $redirect นี่จะระบุให้เป็นไรก็ได้ครับ ในกรณีแก้แล้วไม่ดีขึ้น ให้ท่านลอง delete temporary internet file ในเครื่องท่าน และ c:/windows/cookies/* ด้วย






ขอบคุณครับ




Attention! T!sitemap page!คุณอยู่ที่ sitemap ของ ไทยเฮลท์ สุขภาพ โรค ไข้ ยา บทความ ข่าว ไปที่เนื้อหาเดิม-original content
เว็บสุขภาพ อัพเดตโดยแพทย์ โปรแกรม คลินิค บทความ ข่าว เกมส์ เกม และเรื่องโรคต่างๆ เช่น โรคเบาหวาน ไขมัน หัวใจ ไข้หวัดนก ไข้เลือดออก โรคเอดส์ คลิปวีดีโอ ค้นหา ข้อมูล ภาพ ของไทย

Search from web


เว็บ คีย์เวอร์ด คลิปวีดีโอ




ไทยเฮลท์

Valid HTML 4.01 Valid CSS