ตัวอย่าง API สำหรับ post กระทู้ phpbb3 เว็บบอร์ด

หมวดสำหรับแบ่งบันความ รู้ต่างๆ จะมีหมวดย่อยๆ ในหมวดนี้ เช่น php, SQL, XML, CSS

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

ภาพประจำตัวสมาชิก
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
โพสต์: 41411
ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
ติดต่อ:

ตัวอย่าง API สำหรับ post กระทู้ phpbb3 เว็บบอร์ด

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

ตัวอย่าง API สำหรับ post กระโพส phpbb3
เมื่อเรา จะโพสกระทู้ลงในบอร์ด phpbb สามารถใช้ API ตัวนี้ โพสให้ได้เลย
submit_post() จะใช้งานได้เมื่อ include common.php เข้ามาใช้งาน
ตัวอย่างโค้ด

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

// note that multibyte support is enabled here 
$my_subject = utf8_normalize_nfc(request_var('my_subject', '', true));
$my_text    = utf8_normalize_nfc(request_var('my_text', '', true));

// variables to hold the parameters for submit_post
$poll = $uid = $bitfield = $options = ''; 

generate_text_for_storage($my_subject, $uid, $bitfield, $options, false, false, false);
generate_text_for_storage($my_text, $uid, $bitfield, $options, true, true, true);

$data = array( 
    'forum_id'      => 2,
    'icon_id'       => false,

    'enable_bbcode'     => true,
    'enable_smilies'    => true,
    'enable_urls'       => true,
    'enable_sig'        => true,

    'message'       => $my_text,
    'message_md5'   => md5($my_text),
                
    'bbcode_bitfield'   => $bitfield,
    'bbcode_uid'        => $uid,

    'post_edit_locked'  => 0,
    'topic_title'       => $my_subject,
    'notify_set'        => false,
    'notify'            => false,
    'post_time'         => 0,
    'forum_name'        => '',
    'enable_indexing'   => true,
);

submit_post('post', $my_subject, '', POST_NORMAL, $poll, $data); 
ติดตาม 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
    ตอบกลับ
    แสดง
    โพสต์ล่าสุด

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

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