News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

"View Member Topics"

Started by Sarke, March 05, 2007, 03:56:55 AM

Previous topic - Next topic

Sarke

Any chance we get to see this included in the next release of SMF?  It's been in the DE for a while...

Show Posts
* View Member Posts | View Member Topics | View Member Attachments 

My MODs          Please don't PM me for support, post in the appropriate topic.

KGIII

Posts and topics are already there. Attachments doesn't seem to work even if adding it to the URL. (I tried that one.)

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

Sarke

Topics aren't there for me on either of my two SMF 1.1.2 forums, and one is vanilla with the default theme.  Is there an option that needs to be enabled?

My MODs          Please don't PM me for support, post in the appropriate topic.

KGIII

I don't recall needing to add any additional mods or anything to enable this? But now that I look at a plain version... How odd... Alright - I am not sure where it came from on mine?

*sighs* I thought it was default - I am still, for the life of me, not sure where it came from.


<a href="', $scripturl, '?action=profile;u=', $context['member']['id'], ';sa=showTopics">', $txt[460], ' ', $txt[462], '.</a><br />


That is in the Profile.template.php under:


<a href="', $scripturl, '?action=profile;u=', $context['member']['id'], ';sa=showPosts">', $txt[460], ' ', $txt[461], '.</a><br />


And Profile.english.php has:

Quote
$txt[462] = 'topics of this person';

Hmm... I will dig into it more if this isn't what managed to make it show up for me? I can also give you a list of the mods installed but that is really quite a large list so might not help much.




My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

Sarke

Looks like you have the "Show Topic" mod installed.

My MODs          Please don't PM me for support, post in the appropriate topic.

KGIII

Long list.

That's it though - I don't seem to have it installed. Ah the mystery... I will look into it though.

Quote
1. The Simpsons Avatars 1.0 
2. Lots-of-Avatars-Boys2 1.0 
3. Sci-Fi Avatars 1.0 
4. Metal Slug Avatars 1.0 
5. Metal Gear Avatars 1.0 
6. Scotland 1.0 
7. Gmail Field 1.1 
8. Users Online Today Mod 1.4.0 
9. SSI NewsArchive 1.3 
10. BBCode Bar For Signature 1.0 
11. Ad Managment 2.0 
12. MessagePreviewOnHover 1.3 
13. Reg Bar 1.0 
14. Global Announcements 1.0 
15. Bear Tabs 1.0 
16. SMF Gallery Lite 1.6.6 
17. URL Popup 1.0 
18. Googlebot & Spiders Mod 2.0.2 
19. Ignore user 1.2 
20. Spoiler Tag 0.3.0 
21. User Email System 1.1.3 
22. SMF Links 1.6.2 
23. PM On Registration 1.0.2 
24. New Topic Button 1.0 
25. Signature Settings Mod 1.0 
26. All Topics Unsubscriber 1.1 
27. Membergroup Color Legend 1.1 
28. Mark Selected Topics As Read 1.0 
29. Page Number 1.0 
30. Electric Guitar Avatars 1.0 
31. WOW dancing avatars 1.0 
32. Stars to Profile 1.0.1 
33. Gender On Registration 1.0 
34. Subject Statistics In Subject 2 
35. Affiliate System 1.0 
36. Hide Tag 1.2.1 
37. Admin Notepad 1.0 
38. RSS Feed Icon 1.1 
39. Move Old Topics 1.2 
40. Profile User Action 1.1 
41. vMulticolor-Stars Mod 0.99 
42. VisualWarning 1.30 
43. Custom Action Mod 2.04 
44. Custom Profile Field Mod 3.16 
45. View Single PM 1.1 
46. GarbledURLs 1.0 
47. Mod List Color Alternate 1.0 
48. Member posts recount 0.5 
49. Trim Url 1.0.2 
50. Topic Ratings 1.03 
51. Global Headers Footers 1.3 
52. SMF 1.1.1 Update Package 1.1.1 
53. Free Smileys 0.8 
54. Tagging System 1.0.2 
55. Digg Topic 1.0 
56. Wikipedia BBCode (English) 1.0 
57. Add PM Info To header (v1.0) 1.0 
58. IMDB BBCode 1.0 
59. Integrated Chat 2.7 
60. FontandSizeDropdown1.1 1.1 
61. Board Notes 1.0.7 
62. Monthly Statistics on Profile 1.0 
63. Increase/Decrease Postbox Size 1.0 
64. Enhanced Calendar 1.0 
65. Pretty URLs - Base 0.3 
66. Pretty URLs - Extention: none 0.3 
67. Language Drop 1.1 
68. Custom Edit Times 1.1 
69. Zodiac 13Moon 1.1 
70. Search Topic 1.01 
71. Wrap Text Around Image 1.0 
72. SMF 1.1.2 Update Package 1.1.2 
73. Anime Avatars 2.0 
74. Dogs Avatars 1.1.2 
75. Cats Avatars 1.1.2 
76. vReportBoard Mod 0.97

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

karlbenson

holy crap!  thats one long list of mods.

KGIII

My goal was to find out how many I could get installed before it crapped out on me. Then I discovered that I actually liked some of them so I haven't bothered removing them. Oddly - I don't appear to have the mod installed (or recall making manual edits) that caused this. Go figure?

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

SaltedWeb

Looks like a record in mods. should have a contest. LOL
Knowing your limitations makes you human, exceeding these limitations makes you worthy of being human.

kelkun

 Sources/Profile.php

find
// Show all posts by the current user
function showPosts($memID)
{


add before
// Show all topics by the current user <><><><><><><><><><><><><><><>
function showTopics($memID)
{
global $txt, $user_info, $scripturl, $modSettings, $db_prefix;
global $context, $user_profile, $ID_MEMBER, $sourcedir;

// If just deleting a message, do it and then redirect back.
if (isset($_GET['delete']))
{
checkSession('get');

// We can be lazy, since removeMessage() will check the permissions for us.
require_once($sourcedir . '/RemoveTopic.php');
removeMessage((int) $_GET['delete']);

// Back to... where we are now ;).
redirectexit('action=profile;u=' . $memID . ';sa=showTopics;start=' . $_GET['start']);
}

// Is the load average too high to allow searching just now?
if (!empty($context['load_average']) && !empty($modSettings['loadavg_show_posts']) && $context['load_average'] >= $modSettings['loadavg_show_posts'])
fatal_lang_error('loadavg_show_posts_disabled', false);

// Default to 10.
if (empty($_REQUEST['viewscount']) || !is_numeric($_REQUEST['viewscount']))
$_REQUEST['viewscount'] = '10';

// If this is a large forum, try a temporary table.
if ($modSettings['totalMessages'] > 100000 && $user_profile[$memID]['posts'] > 100)
{
db_query("
DROP TABLE IF EXISTS {$db_prefix}topics_posted_in", false, false);

// Let's try to avoid as many locks as possible.
$have_temp_table = db_query("
CREATE TEMPORARY TABLE {$db_prefix}topics_posted_in (
PRIMARY KEY (ID_TOPIC)
)
SELECT ID_TOPIC, ID_BOARD
FROM {$db_prefix}messages
WHERE ID_MEMBER = $memID
GROUP BY ID_TOPIC", false, false);
}

// The join on topics here, although unnecessary, forces the use of the participation index.
$request = db_query("
SELECT COUNT(m.ID_MSG)
FROM ({$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b)
WHERE m.ID_MEMBER = $memID
AND t.ID_TOPIC = m.ID_TOPIC
AND b.ID_BOARD = t.ID_BOARD
AND t.ID_FIRST_MSG = m.ID_MSG
AND $user_info[query_see_board]", __FILE__, __LINE__);
list ($msgCount) = mysql_fetch_row($request);
mysql_free_result($request);

// View all the topics, or just a few?
$maxIndex = isset($_REQUEST['view']) && $_REQUEST['view'] == 'all' ? $msgCount : $modSettings['defaultMaxMessages'];

// Make sure the starting place makes sense and construct our friend the page index.
$context['page_index'] = constructPageIndex($scripturl . '?action=profile;u=' . $memID . ';sa=showTopics', $_REQUEST['start'], $msgCount, $maxIndex);
$context['start'] = $_REQUEST['start'];
$context['current_page'] = $context['start'] / $maxIndex;
$context['current_member'] = $memID;

$context['page_title'] = $txt[4582] . ' ' . $user_profile[$memID]['realName'];

// Find this user's posts.  The left join on categories somehow makes this faster, weird as it looks.
// !!!SLOW This query uses a filesort.
$request = db_query("
SELECT
b.ID_BOARD, b.name AS bname, c.ID_CAT, c.name AS cname, m.ID_TOPIC, m.ID_MSG,
t.ID_MEMBER_STARTED, t.ID_FIRST_MSG, t.ID_LAST_MSG, m.body, m.smileysEnabled,
m.subject, m.posterTime
FROM (" . (empty($have_temp_table) ? '' : "{$db_prefix}topics_posted_in AS pi, ") . "{$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b)
LEFT JOIN {$db_prefix}categories AS c ON (c.ID_CAT = b.ID_CAT)
WHERE " . (empty($have_temp_table) ? '' : "t.ID_TOPIC = pi.ID_TOPIC
AND ") . "m.ID_MEMBER = $memID
AND m.ID_TOPIC = t.ID_TOPIC
AND t.ID_BOARD = b.ID_BOARD
AND $user_info[query_see_board]
AND t.ID_FIRST_MSG = m.ID_MSG
ORDER BY m.ID_MSG DESC
LIMIT $_REQUEST[start], $maxIndex", __FILE__, __LINE__);
// Start counting at the number of the first message displayed.
$counter = $_REQUEST['start'];
$context['posts'] = array();
$board_ids = array('own' => array(), 'any' => array());
while ($row = mysql_fetch_assoc($request))
{
// Censor....
censorText($row['body']);
censorText($row['subject']);

if ($row["ID_FIRST_MSG"] == $row["ID_MSG"]) {

// Do the code.
$row['body'] = parse_bbc($row['body'], $row['smileysEnabled'], $row['ID_MSG']);
// And the array...
$context['posts'][++$counter] = array(
'body' => $row['body'],
'counter' => $counter,
'category' => array(
'name' => $row['cname'],
'id' => $row['ID_CAT']
),
'board' => array(
'name' => $row['bname'],
'id' => $row['ID_BOARD']
),
'topic' => $row['ID_TOPIC'],
'subject' => $row['subject'],
'start' => 'msg' . $row['ID_MSG'],
'time' => timeformat($row['posterTime']),
'timestamp' => forum_time(true, $row['posterTime']),
'id' => $row['ID_MSG'],
'can_reply' => false,
'can_mark_notify' => false,
'can_delete' => false,
'delete_possible' => ($row['ID_FIRST_MSG'] != $row['ID_MSG'] || $row['ID_LAST_MSG'] == $row['ID_MSG']) && (empty($modSettings['edit_disable_time']) || $row['posterTime'] + $modSettings['edit_disable_time'] * 60 >= time()),
);


if ($ID_MEMBER == $row['ID_MEMBER_STARTED'])
$board_ids['own'][$row['ID_BOARD']][] = $counter;
$board_ids['any'][$row['ID_BOARD']][] = $counter;
}


}
mysql_free_result($request);

// These are all the permissions that are different from board to board..
$permissions = array(
'own' => array(
'post_reply_own' => 'can_reply',
'delete_own' => 'can_delete',
),
'any' => array(
'post_reply_any' => 'can_reply',
'mark_any_notify' => 'can_mark_notify',
'delete_any' => 'can_delete',
)
);

// For every permission in the own/any lists...
foreach ($permissions as $type => $list)
foreach ($list as $permission => $allowed)
{
// Get the boards they can do this on...
$boards = boardsAllowedTo($permission);

// Hmm, they can do it on all boards, can they?
if (!empty($boards) && $boards[0] == 0)
$boards = array_keys($board_ids[$type]);

// Now go through each board they can do the permission on.
foreach ($boards as $board_id)
{
// There aren't any posts displayed from this board.
if (!isset($board_ids[$type][$board_id]))
continue;

// Set the permission to true ;).
foreach ($board_ids[$type][$board_id] as $counter)
$context['posts'][$counter][$allowed] = true;
}
}

// Clean up after posts that cannot be deleted.
foreach ($context['posts'] as $counter => $dummy)
$context['posts'][$counter]['can_delete'] &= $context['posts'][$counter]['delete_possible'];
}



find

'showPosts' => array(array('profile_view_any', 'profile_view_own'), array('profile_view_any')),
add after
'showTopics' => array(array('profile_view_any', 'profile_view_own'), array('profile_view_any')),
find
$context['profile_areas']['info']['areas']['showPosts'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=showPosts">' . $txt['showPosts'] . '</a>';
add after
   
$context['profile_areas']['info']['areas']['showTopics'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=showTopics">' . $txt['showTopics'] . '</a>';
         

languages/Profile.english.php
find
$txt[461] = 'posts of this person';
add after
Code:
$txt[462] = 'topics of this person';

find


$txt[458] = 'Latest posts of: ';
add after

$txt[4582] = 'Latest topics of: ';
find
$txt['showPosts'] = 'Show Posts';

add after

$txt['showTopics'] = 'Show Topics';

Profile.template.php
Find
// Template for showing all the posts of the user, in chronological order.
function template_showPosts()
{


add before:
// Template for showing all the posts of the user, in chronological order.  <><><><><><><><><>
function template_showTopics()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;

echo '
<table border="0" width="85%" cellspacing="1" cellpadding="4" class="bordercolor" align="center">
<tr class="titlebg">
<td colspan="3" height="26">
&nbsp;<img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" align="top" />&nbsp;', $txt['showTopics'], '
</td>
</tr>';

// Only show posts if they have made some!
if (!empty($context['posts']))
{
// Page numbers.
echo '
<tr class="catbg3">
<td colspan="3">
', $txt[139], ': ', $context['page_index'], '
</td>
</tr>
</table>';

// Button shortcuts
$quote_button = create_button('quote.gif', 145, 'smf240', 'align="middle"');
$reply_button = create_button('reply_sm.gif', 146, 146, 'align="middle"');
$remove_button = create_button('delete.gif', 121, 31, 'align="middle"');
$notify_button = create_button('notify_sm.gif', 131, 125, 'align="middle"');

// For every post to be displayed, give it its own subtable, and show the important details of the post.
foreach ($context['posts'] as $post)
{
echo '
<table border="0" width="85%" cellspacing="1" cellpadding="0" class="bordercolor" align="center">
<tr>
<td width="100%">
<table border="0" width="100%" cellspacing="0" cellpadding="4" class="bordercolor" align="center">
<tr class="titlebg2">
<td style="padding: 0 1ex;">
', $post['counter'], '
</td>
<td width="75%" class="middletext">
&nbsp;<a href="', $scripturl, '#', $post['category']['id'], '">', $post['category']['name'], '</a> / <a href="', $scripturl, '?board=', $post['board']['id'], '.0">', $post['board']['name'], '</a> / <a href="', $scripturl, '?topic=', $post['topic'], '.', $post['start'], '#msg', $post['id'], '">', $post['subject'], '</a>
</td>
<td class="middletext" align="right" style="padding: 0 1ex; white-space: nowrap;">
', $txt[30], ': ', $post['time'], '
</td>
</tr>
<tr>
<td width="100%" height="80" colspan="3" valign="top" class="windowbg2">
<div class="post">', $post['body'], '</div>
</td>
</tr>
<tr>
<td colspan="3" class="windowbg2" align="', !$context['right_to_left'] ? 'right' : 'left', '"><span class="middletext">';

if ($post['can_delete'])
echo '
<a href="', $scripturl, '?action=profile;u=', $context['current_member'], ';sa=showPosts;start=', $context['start'], ';delete=', $post['id'], ';sesc=', $context['session_id'], '" onclick="return confirm(\'', $txt[154], '?\');">', $remove_button, '</a>';
if ($post['can_delete'] && ($post['can_mark_notify'] || $post['can_reply']))
echo '
', $context['menu_separator'];
if ($post['can_reply'])
echo '
<a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], '">', $reply_button, '</a>', $context['menu_separator'], '
<a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], ';quote=', $post['id'], ';sesc=', $context['session_id'], '">', $quote_button, '</a>';
if ($post['can_reply'] && $post['can_mark_notify'])
echo '
', $context['menu_separator'];
if ($post['can_mark_notify'])
echo '
<a href="' . $scripturl . '?action=notify;topic=' . $post['topic'] . '.' . $post['start'] . '">' . $notify_button . '</a>';

echo '
</span></td>
</tr>
</table>
</td>
</tr>
</table>';
}

// Show more page numbers.
echo '
<table border="0" width="85%" cellspacing="1" cellpadding="4" class="bordercolor" align="center">
<tr>
<td colspan="3" class="catbg3">
', $txt[139], ': ', $context['page_index'], '
</td>
</tr>
</table>';
}
// No posts? Just end the table with a informative message.
else
echo '
<tr class="windowbg2">
<td>
', $txt[170], '
</td>
</tr>
</table>';
}

Sarke

OK?  You just copied the Show Topics mod here?

Credit should go to megamoose.  Besides, that's not the point of this topic.

My MODs          Please don't PM me for support, post in the appropriate topic.

Advertisement: