สอบถาม core ที่ทำงาน หลังจาก ลบโพสต์ สำหรับของ phpBB ครับ

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

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

flook
PHP VIP Members
PHP VIP Members
โพสต์: 3751
ลงทะเบียนเมื่อ: 06/06/2022 9:43 am

สอบถาม core ที่ทำงาน หลังจาก ลบโพสต์ สำหรับของ phpBB ครับ

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

อยากทราบว่า core ที่ทำงาน หลังจาก ลบโพสต์ สำหรับของ phpBB ใช้ core อะไรแล้วทำงานแบบไหน
เบื้องต้นผมลอง
  • core.modify_submit_post_data
  • core.posting_modify_submit_post_after
ซึ่งไม่เข้าทำงาน $event['mode']

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

  if ($event['mode'] == 'delete') {
  }
ภาพประจำตัวสมาชิก
eange08
PHP VIP Members
PHP VIP Members
โพสต์: 16184
ลงทะเบียนเมื่อ: 22/12/2020 10:09 am

Re: สอบถาม core ที่ทำงาน หลังจาก ลบโพสต์ สำหรับของ phpBB ครับ

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

ส่วนลบโพสต์ ต้องดู event ในไฟล์ functions_posting.php จะมีส่วนการลบโพสต์ ลองดูที่ event นี้ดูค่ะ

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

/**
	* This event allows to modify the conditions for the post deletion
	*
	* @event core.handle_post_delete_conditions
	* @var	int		forum_id		The id of the forum
	* @var	int		topic_id		The id of the topic
	* @var	int		post_id			The id of the post
	* @var	array	post_data		Array with the post data
	* @var	bool	is_soft			The flag indicating whether it is the soft delete mode
	* @var	string	delete_reason	Description for the post deletion reason
	* @var	bool	force_delete_allowed		Allow the user to delete the post (all permissions and conditions are ignored)
	* @var	bool	force_softdelete_allowed	Allow the user to softdelete the post (all permissions and conditions are ignored)
	* @var	string	perm_check		The deletion mode softdelete|delete
	* @since 3.1.11-RC1
	*/
ต้องเช็คตัว checkbox ควบคู่ด้วยฟังกชั่นนี้

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

if (confirm_box(true))
		{ 
		....
		}
flook
PHP VIP Members
PHP VIP Members
โพสต์: 3751
ลงทะเบียนเมื่อ: 06/06/2022 9:43 am

Re: สอบถาม core ที่ทำงาน หลังจาก ลบโพสต์ สำหรับของ phpBB ครับ

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

eange08 เขียน: 27/01/2023 11:08 am ส่วนลบโพสต์ ต้องดู event ในไฟล์ functions_posting.php จะมีส่วนการลบโพสต์ ลองดูที่ event นี้ดูค่ะ

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

/**
	* This event allows to modify the conditions for the post deletion
	*
	* @event core.handle_post_delete_conditions
	* @var	int		forum_id		The id of the forum
	* @var	int		topic_id		The id of the topic
	* @var	int		post_id			The id of the post
	* @var	array	post_data		Array with the post data
	* @var	bool	is_soft			The flag indicating whether it is the soft delete mode
	* @var	string	delete_reason	Description for the post deletion reason
	* @var	bool	force_delete_allowed		Allow the user to delete the post (all permissions and conditions are ignored)
	* @var	bool	force_softdelete_allowed	Allow the user to softdelete the post (all permissions and conditions are ignored)
	* @var	string	perm_check		The deletion mode softdelete|delete
	* @since 3.1.11-RC1
	*/
ต้องเช็คตัว checkbox ควบคู่ด้วยฟังกชั่นนี้

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

if (confirm_box(true))
		{ 
		....
		}
สามารถทำงานได้ครับ
ตอบกลับโพส
  • Similar Topics
    ตอบกลับ
    แสดง
    โพสต์ล่าสุด

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

สมาชิกกำลังดูบอร์ดนี้: ไม่มีสมาชิกใหม่ และบุคลทั่วไป 101