เเจ้ง error "Call to undefined function..."

สำหรับผู้ที่ เริ่มต้น Programming - PHP มีอะไร แนะนำ หรือข้อสงสัยต้องบอร์ด นี้ คนที่มีความรู้ แบ่งปันคนอื่นบ้างนะ ปัญหาการเขียนโปรแกรม แบบ OOP Session Cookies php network

Moderator: mindphp, ผู้ดูแลกระดาน

ภาพประจำตัวสมาชิก
thatsawan
PHP VIP Members
PHP VIP Members
โพสต์: 28508
ลงทะเบียนเมื่อ: 31/03/2014 10:02 am
ติดต่อ:

เเจ้ง error "Call to undefined function..."

โพสต์ที่ยังไม่ได้อ่าน โดย thatsawan »

ต้องการปิดการทำงาน ถ้าไม่มีการเปิดจะไม่สามารถเข้าหน้านี้ได้
- ผลคือ ปิดการทำงานได้เเล้วค่ะ

โค้ด: เลือกทั้งหมด

if($config['.....']==1) { 
} else {
	trigger_error('NOT_AUTHORISED');
}
- เเต่ไม่สามารถเปิดได้ ทำให้
Call to undefined function tmb_topic_portal_list() ฟังก์ชั่นนี้ใช้เเสดงข้อมูล

โค้ด: เลือกทั้งหมด

function tmb_topic_portal_list()
{
    global $db, $cache, $portal_config;
        global $user, $config, $template, $phpbb_admin_path, $phpEx; 
        $action    = request_var('action', '');
        $start        = request_var('start', 0);
        $mode_url   =    append_sid("tmbnews.$phpEx", 'mode=form');
        $sql = "SELECT COUNT(*) AS total_entries FROM " . M_POST_TOPIC_PORTAL_TABLE;
        $result = $db->sql_query($sql);
    $log_count = (int) $db->sql_fetchfield('total_entries');
    $db->sql_freeresult($result);
     
        $sql    = //.....
        $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);
    while ($row = $db->sql_fetchrow($result)){
            if( $row['add_by']==$user->data['user_id']) {
                       //....
                         }
            $template->assign_block_vars('links', array(
                        //..
                ));
    }
        $db->sql_freeresult($result);                                
        $template->assign_vars(array(
//...
                       ));        
    return $portal_config;
}
 
ถ้าไม่ปิดไม่มีโค้ด เปิด - ปิด ... จะทำงานได้ปกติค่ะ
ภาพประจำตัวสมาชิก
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
โพสต์: 41410
ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
ติดต่อ:

Re: เเจ้ง error "Call to undefined function..."

โพสต์ที่ยังไม่ได้อ่าน โดย mindphp »

Call to undefined function tmb_topic_portal_list()
คือมันไม่ได้โหลด ไฟล์ที่เราสร้าง function นี้เข้ามาใช้ หรือ ไม่เข้าไปเงื่อนไขที่ สร้างฟังก์ชั่นนั้นไว้
โดยอาจจะหยุดการทำงานไปก่อน
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ภาพประจำตัวสมาชิก
thatsawan
PHP VIP Members
PHP VIP Members
โพสต์: 28508
ลงทะเบียนเมื่อ: 31/03/2014 10:02 am
ติดต่อ:

Re: เเจ้ง error "Call to undefined function..."

โพสต์ที่ยังไม่ได้อ่าน โดย thatsawan »

ทำได้เเว้ว....

โค้ด: เลือกทั้งหมด

if($config['tmb_news_enable']==1) {
switch ($mode)
{
     //....    
    default:
                tmb_topic_portal_list();        
    break;
}
}else {
    trigger_error('NOT_AUTHORISED');
}
function tmb_topic_portal_list()
{
//...
}

 
ไม่ต้องครอบ if - else ตรงฟังก์ชั่น if - else เฉพาะตอนเรียก เข้าใจถูกรึป่าว ไม่เเน่ใจค่ะ เเต่หนูทำมันเปิด - ปิดได้ :-D
ภาพประจำตัวสมาชิก
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
โพสต์: 41410
ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
ติดต่อ:

Re: เเจ้ง error "Call to undefined function..."

โพสต์ที่ยังไม่ได้อ่าน โดย mindphp »

น่าจะถูกนะครับ ...
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ตอบกลับโพส
  • Similar Topics
    ตอบกลับ
    แสดง
    โพสต์ล่าสุด

ผู้ใช้งานขณะนี้

สมาชิกกำลังดูบอร์ดนี้: Amazon [Bot] และบุคลทั่วไป 113