|
|
|
|
|
Re: Show own threads? [message #163596 is a reply to message #163586] |
Thu, 11 November 2010 11:07 |
Ernesto
Messages: 413 Registered: August 2005
Karma: 0
|
Senior Member |
|
|
A little tweak of the source files is required - It was a simple fix. You can perhaps even apply this yourself. For a release patch, we would also have to patch users.inc.t for path_info support as well as add a link in the template(s)
Anyhow, here we go:
File: (located in DATA_ROOT/src)
showposts.php.t
Find something like this, around row 26
if (!isset($_GET['start']) || !($start = (int)$_GET['start'])) {
$start = 0;
}
After that, insert the following:
if (isset($_GET['topic'])) {
$tm = 1;
} else {
$tm = '';
}
Find the following, around row 46 (52 after you pasted in the above)
$c = uq('SELECT /*!40000 SQL_CALC_FOUND_ROWS */ f.name, f.id, m.subject, m.id, m.topic_stamp
FROM {SQL_TABLE_PREFIX}msg m
INNER JOIN {SQL_TABLE_PREFIX}thread t ON m.thread_id=t.id
INNER JOIN {SQL_TABLE_PREFIX}forum f ON t.forum_id=f.id
INNER JOIN {SQL_TABLE_PREFIX}cat c ON c.id=f.cat_id
WHERE '.$qry_limit.' m.apr=1 AND m.topicer_id='.$uid.'
ORDER BY m.topic_stamp '.$SORT_ORDER.' LIMIT '.qry_limit($THREADS_PER_PAGE, $start));
Replace all that with this:
if($tm) {
$sql = 'SELECT /*!40000 SQL_CALC_FOUND_ROWS */ f.name, f.id, m.subject, m.id, m.post_stamp, t.id AS thread_id
FROM {SQL_TABLE_PREFIX}thread t
INNER JOIN {SQL_TABLE_PREFIX}msg m ON t.root_msg_id=m.id
INNER JOIN {SQL_TABLE_PREFIX}forum f ON t.forum_id=f.id
INNER JOIN {SQL_TABLE_PREFIX}cat c ON c.id=f.cat_id
WHERE '.$qry_limit.' m.apr=1 AND m.poster_id='.$uid.'
ORDER BY m.post_stamp '.$SORT_ORDER.' LIMIT '.qry_limit($THREADS_PER_PAGE, $start);
} else {
$sql = 'SELECT /*!40000 SQL_CALC_FOUND_ROWS */ f.name, f.id, m.subject, m.id, m.post_stamp
FROM {SQL_TABLE_PREFIX}msg m
INNER JOIN {SQL_TABLE_PREFIX}thread t ON m.thread_id=t.id
INNER JOIN {SQL_TABLE_PREFIX}forum f ON t.forum_id=f.id
INNER JOIN {SQL_TABLE_PREFIX}cat c ON c.id=f.cat_id
WHERE '.$qry_limit.' m.apr=1 AND m.poster_id='.$uid.'
ORDER BY m.post_stamp '.$SORT_ORDER.' LIMIT '.qry_limit($THREADS_PER_PAGE, $start);
}
$c = uq($sql);
Rebuild the theme and then the URL to show just the topics you started, use the following:
index.php?t=showposts&id=1&topic=1
Replace the ID with whatever member you wish.
If you wanna enter a link to Show all Topics started inside a template, it should look something like this
<a href="{ROOT}?t=showposts&id={VAR: u->id}&topic=1&{DEF: _rsid}">Show all topics started by {VAR: u->alias}</a>
Ginnunga Gaming
[Updated on: Thu, 11 November 2010 15:54] Report message to a moderator
|
|
|
Re: Show own threads? [message #163597 is a reply to message #163596] |
Thu, 11 November 2010 15:46 |
The Witcher
Messages: 675 Registered: May 2009 Location: USA
Karma: 3
|
Senior Member |
|
|
Now that is the type of instructions I like to see! Thanks!
Although I will leave it until it is incorporated as a release, I do appreciate your taking the time and effort to provide step by step instructions.
For anyone confused about finding the correct row or line numbers, pasting the file into a PHP editor works for me (there are some decent free ones on line).
"I'm a Witcher, I solve human problems; not always using a sword!"
|
|
|