add own code in postings.php

Discussion forum for MOD Writers regarding MOD Development.
Locked
Ostas
Registered User
Posts: 26
Joined: Wed May 28, 2008 1:41 pm

add own code in postings.php

Post by Ostas » Wed Jul 29, 2009 12:01 am

Hey there,
I´m going to write my own bridge-mod and i have a problem:
I want to find the line which has to be executed when a new post is written so that i can add my own code there.
I want to have access to the post details like author, post_id, topic_id and content.
I checked the postings.php but i dont know which line i have to edit.
Can somebody help me?
Thanks in advance

User avatar
A_Jelly_Doughnut
Former Team Member
Posts: 34457
Joined: Sat Jan 18, 2003 1:26 am
Location: Where the Rivers Run
Contact:

Re: add own code in postings.php

Post by A_Jelly_Doughnut » Wed Jul 29, 2009 2:20 am

The post ID is not determined until after the post is entered in the database, so you need to be looking at includes/functions_posting.php:

Code: Select all

		$sql = 'INSERT INTO ' . POSTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_data[POSTS_TABLE]['sql']);
		$db->sql_query($sql);
		$data['post_id'] = $db->sql_nextid();
THis is the first place where post ID is available.
A Donut's Blog
"Bach's Prelude (Cello Suite No. 1) is driving Indiana country roads in Autumn" - Ann Kish

Ostas
Registered User
Posts: 26
Joined: Wed May 28, 2008 1:41 pm

Re: add own code in postings.php

Post by Ostas » Wed Jul 29, 2009 2:52 pm

Thanks!
It works perfect

Locked

Return to “[3.0.x] MOD Writers Discussion”