| ดูกระทู้ก่อนนี้ :: ดูกระทู้ถัดไป |
| ผู้ส่ง |
ข้อความ |
kijakarn Site Admin


เข้าร่วมเมื่อ: Nov 14, 2002 ตอบ: 1584
Level: 33
|
ตอบ: จ. มค. 27, 2003 7:57 pm ชื่อกระทู้: สาเหตุที่ phpNUKE ช้า ตอน 3 "กำจัด header" |
|
|
[highlight=pink:4fabca47e8][glow=white:4fabca47e8][face=impact:4fabca47e8]กำจัดSidebar และ Headerใน Forums[/face:4fabca47e8][/glow:4fabca47e8][/highlight:4fabca47e8]
ตัวอย่างดูได้ที่ http://www.thaihealth.net/clinic/index.php
นี่คือวิธีการที่จะเอา phpBB มาแบบสมบูรณ์ คือเวลา forum ขึ้น จะไม่มี header และ side bar ของ phpNUKE เกะกะ เรียกได้ว่าเต็มพิกัด
ผมสมมุติว่าใช้ thaihealth theme นะครับ เราดูที่ส่วนหนึ่งของ themes/Thaihealth/theme.php
| โค้ด: | 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 = " ;; ;;<a href=\"modules.php?name=Your_Account&op=new_user\">Create an account";
} else {
$theuser = " ;; ;;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> ;; ;;</td><td width=\"100%\" valign=\"top\">";
}
|
สังเกตตรงที่ block(left) ให้ดี ตรงนี้จะเป็น landmark
_________________ เชิญสอบถามปัญหาในกระดานข่าวอันใหม่- .
แก้ไขครั้งสุดท้ายโดย kijakarn เมื่อ จ. มค. 27, 2003 8:18 pm, แก้ไขทั้งหมด 1 ครั้ง |
|
| กลับไปข้างบน |
|
 |
kijakarn Site Admin


เข้าร่วมเมื่อ: Nov 14, 2002 ตอบ: 1584
Level: 33
|
ตอบ: จ. มค. 27, 2003 8:01 pm ชื่อกระทู้: |
|
|
สีแดงคือที่ผมใส่เพิ่มไป
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 = " ;; ;;<a href=\"modules.php?name=Your_Account&op=new_user\">Create an account";
} else {
$theuser = " ;; ;;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> ;; ;;</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> ;; ;;</td><td width=\"100%\" valign=\"top\">";
}
}
เท่านี้แหละครับ
_________________ เชิญสอบถามปัญหาในกระดานข่าวอันใหม่- .
แก้ไขครั้งสุดท้ายโดย kijakarn เมื่อ จ. มค. 27, 2003 8:14 pm, แก้ไขทั้งหมด 1 ครั้ง |
|
| กลับไปข้างบน |
|
 |
kijakarn Site Admin


เข้าร่วมเมื่อ: Nov 14, 2002 ตอบ: 1584
Level: 33
|
ตอบ: จ. มค. 27, 2003 8:10 pm ชื่อกระทู้: สองตำแหน่งที่เป็นจุดกำหนด |
|
|
จุดแรกคือจุดต่ำกว่า banner ลงมา จุดที่สองคือจุดที่เริ่ม leftblock เราจะคร่อมไม่ให้ตรงระหว่างสองจุดนี้ไม่แสดงเวลาเข้า module forums
ถ้าจะเอาแต่ left side bar ออก มีอยู่ในกระทู้แถวนี้แหละครับ
_________________ เชิญสอบถามปัญหาในกระดานข่าวอันใหม่- . |
|
| กลับไปข้างบน |
|
 |
kijakarn Site Admin


เข้าร่วมเมื่อ: Nov 14, 2002 ตอบ: 1584
Level: 33
|
ตอบ: อ. มค. 28, 2003 8:57 am ชื่อกระทู้: |
|
|
หมายเหตุ ผมไม่ได้ test กับ theme อื่น ๆ นะครับ โปรดระวังความเสียหายถ้าเกิดขึ้น บางทีมัน apply ไม่ได้นะครับ
_________________ เชิญสอบถามปัญหาในกระดานข่าวอันใหม่- . |
|
| กลับไปข้างบน |
|
 |
บุคคลทั่วไป

Level: 83
|
ตอบ: ศ. กพ. 20, 2004 3:50 am ชื่อกระทู้: |
|
|
| ถามเพิ่มเติม เมื่อเรา logout ออกจากระบบแล้วโปรแกรมจะ redirect กลับสู่หน้าจอเดิม จะแก้ไฟล์ไหนให้ redirect ไปยัง หน้าแรกของเวปไซต์
|
|
| กลับไปข้างบน |
|
 |
clinictech EntryStar


เข้าร่วมเมื่อ: Feb 19, 2004 ตอบ: 1 ที่อยู่: THA
Level: 1
|
ตอบ: ศ. กพ. 20, 2004 5:26 am ชื่อกระทู้: |
|
|
| ของผมใช้ ธีม sunset และเซ้คค่าทุกอย่างแล้วทำงานได้ แต่เวลา logout ออกมันจะ redirect กลับไปที่เดิม คือผู้ใช้ที่ล๊อคอินเข้ามาไม่สามารถออกจากระบบได้
|
|
| กลับไปข้างบน |
|
 |
kijakarn Site Admin


เข้าร่วมเมื่อ: Nov 14, 2002 ตอบ: 1584
Level: 33
|
ตอบ: ศ. กพ. 20, 2004 7:51 am ชื่อกระทู้: |
|
|
ดูที่ modules/Your_Account/index.php
| โค้ด: | 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/* ด้วย
_________________ เชิญสอบถามปัญหาในกระดานข่าวอันใหม่- . |
|
| กลับไปข้างบน |
|
 |
บุคคลทั่วไป

Level: 83
|
ตอบ: ศ. กพ. 20, 2004 8:20 am ชื่อกระทู้: |
|
|
| ขอบคุณครับ
|
|
| กลับไปข้างบน |
|
 |
|