FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » Show own threads?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Show own threads? [message #163596 is a reply to message #163586] Thu, 11 November 2010 11:07 Go to previous messageGo to previous message
Ernesto is currently offline  Ernesto   Sweden
Messages: 413
Registered: August 2005
Karma:
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&amp;id={VAR: u->id}&amp;topic=1&amp;{DEF: _rsid}">Show all topics started by {VAR: u->alias}</a>


[Updated on: Thu, 11 November 2010 15:54]

Report message to a moderator

[Message index]
 
Read Message icon5.gif
Read Message icon6.gif
Read Message
Read Message
Read Message icon6.gif
Read Message
Read Message icon6.gif
Previous Topic: Include a PHP and Template file
Next Topic: Embedding audio via html
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 22:34:55 GMT 2024

Total time taken to generate the page: 0.04870 seconds