First of all, IMO it's not a good idea to create these custom fields in BOTH tables. If these fields are thread related (unique in thread), create them in thread table, if they are message related (unique in a message but can be many in a thread) create them in post table.
If it is in thread table and you want to get it from there, you need to edit queries in showthread.php which gets data from thread table. You need to add these custom fields to SELECT queries so that they are got from db too. Here is an example:
$thread=$DB_site->query_first("SELECT threadid FROM thread WHERE forumid IN (0$forumslist) AND visible=1 AND (sticky=1 OR sticky=0) AND lastpost>='".($foruminfo[lastpost]-30)."' AND open<>10 ORDER BY lastpost DESC LIMIT 1");
should be:
$thread=$DB_site->query_first("SELECT threadid, custom1, custom2 FROM thread WHERE forumid IN (0$forumslist) AND visible=1 AND (sticky=1 OR sticky=0) AND lastpost>='".($foruminfo[lastpost]-30)."' AND open<>10 ORDER BY lastpost DESC LIMIT 1");
Now you can use this fields as:
$thread['custom1']
$thread['custom2']
Remember 2 important points:
1- there is not 1 query to change in showthread.php. This file have different queries for different actions, like: when user wants to read the last post, when he wants to read the newest post etc.. You have to go through entire file and modify all relevant SELECT commands that query thread table.
2- After you modify it, use "echo $thread['custom2'];" after the line you changed to make sure, query gets you data correctly. If it does, you can use it in showthread.php. But if you want to use it in postbit, postbit tempalte is parsed inside in admin/functions.php file inside "function getpostbit" and to use your new variables in that function, dont forget to add their name to the global list of the function..
Hope this helps.. :glasses:
|