Customizing SMF > Modifications and Packages
Thank-O-Matic (Updated for SMF 2.0.4)
Cutter65:
--- Quote from: Sabrinova on August 06, 2012, 03:15:07 PM ---My Thank-o-matic is malfunctioning. Please can you point me in the right direction to fix it?
In a member's profile, when I click to view their "Thank you posts", I see four categories. "Mesages (become)", "Topics (become)", "Messages (given)" and "Topics (given)". Now I can click on Messages (become) and go through pages 1, 2,..., etc quite happily, but when I click on Messages (given) I see page 1, but clicking on page 2, or indeed any other page number under Messages (given) takes me instead to the corresponding page number of Messages (become).
Except with the admins. I don't know whether it's because we're admins or because we're with only ones with over a thousand thanks, but clicking on Messages (given) in an administrator's profile displays the error
--- Quote ---Column 'id_msg' in where clause is ambiguous
File: /home/chalkcat/public_html/Sources/Profile-ThankYouPost.php
Line: 199
--- End quote ---
where line 199 is the last line of the following - yes the );
--- Code: ---// Find this user's posts. The left join on categories somehow makes this faster, weird as it looks.
$looped = false;
while (true)
{
$request = $smcFunc['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.smileys_enabled,
m.subject, m.poster_time
, m.thank_you_post_counter, m.thank_you_post
FROM ' . (!$context['is_given'] ? '{db_prefix}messages AS m' : '{db_prefix}thank_you_post AS tp
INNER JOIN {db_prefix}messages AS m ON (m.id_msg = tp.id_msg)') . '
INNER JOIN {db_prefix}topics AS t ON (' . ($context['is_topics'] || $context['is_topics_given'] ? 't.id_first_msg = m.id_msg' : 't.id_topic = m.id_topic') . ')
INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)
LEFT JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat)
WHERE ' . ($context['is_given'] ? 'tp' : 'm') . '.id_member = {int:current_member}
AND m.thank_you_post = 1
' . (!empty($board) ? 'AND m.id_board=' . $board : '') . '
' . (empty($range_limit) ? '' : '
AND ' . $range_limit) . '
AND {query_see_board}
' . ($context['user']['is_owner'] ? '' : 'AND m.approved = {int:is_approved} AND t.approved = {int:is_approved}') . '
ORDER BY m.id_msg ' . ($reverse ? 'ASC' : 'DESC') . '
LIMIT ' . $start . ', ' . $maxIndex,
array(
'current_member' => $memID,
'is_approved' => 1,
)
);
--- End code ---
Please help, this is the only issue now preventing my forum from being 100% perfect :'(
It has just been brought to my attention that also clicking on the topics (given) then on page 2 shows messages (become) page 2.
The other problem I'm having more and more frequently is that the Received Thank You stats on the memberlist and profiles keeps resetting itself and I have to keep running the recount to bring them back again :-\
--- End quote ---
I did some testing and the line 199 error only happens with members that have given over 1000 thank you's. Must be something to do with the 4 digit number.
ChalkCat:
That's exactly when mine shows too. And how on earth is it that when I pressed the "optimize tables" button, it actually wiped the table?? Oh yeah, really optimized :o
I think we may need the mod author to fix these things....
ChalkCat:
Ok, I think I have identified the bit of code that's causing the index problems when viewing the thank you posts from within a member's profile. Remember how the second page of everything returns to "Messages (become)"?
In Profile-ThankYouPost.php, we have this on line 53:
--- Code: ---// Okay special case woa never thought i will insert them :D but this will be a nice feature :D
$context['is_messages_given'] = isset($_GET['sa']) && $_GET['sa'] == 'messages_given' ? true : false;
$context['is_topics_given'] = isset($_GET['sa']) && $_GET['sa'] == 'topics_given' ? true : false;
$context['is_given'] = $context['is_messages_given'] || $context['is_topics_given'];
$context['is_messages'] = !($context['is_given'] || $context['is_topics']);
--- End code ---
But then, when we come to the page index on line 145, we have this:
--- Quote ---// Make sure the starting place makes sense and construct our friend the page index.
$context['page_index'] = constructPageIndex($scripturl . '?action=profile;u=' . $memID . ';area=showThankYouPosts' . ($context['is_topics'] ? ';sa=topics' : ''), $context['start'], $msgCount, $maxIndex);
$context['current_page'] = $context['start'] / $maxIndex;
--- End quote ---
I'm no coder, so if I'm wrong it wouldn't surprise me, however it seems to me that the buttons are actually hardcoded to all point to the same page.
Please can anyone confirm whether this is the case and suggest how to fix it?
(I'm still working on the reset issue too....)
loplo:
--- Quote from: loplo on August 15, 2012, 02:57:07 PM ---Hey guys,
I have some errors wile installing. I've tried installing the script manually and the only thing I can't solve is that I can't find
--- Code: ---<hr class="post_separator" />';
--- End code ---
in: ./Themes/core/Display.template.php
Any help is appreciated.
--- End quote ---
anyone?!
ChalkCat:
--- Quote from: loplo on September 11, 2012, 04:52:04 PM ---
--- Quote from: loplo on August 15, 2012, 02:57:07 PM ---Hey guys,
I have some errors wile installing. I've tried installing the script manually and the only thing I can't solve is that I can't find
--- Code: ---<hr class="post_separator" />';
--- End code ---
in: ./Themes/core/Display.template.php
Any help is appreciated.
--- End quote ---
anyone?!
--- End quote ---
Search for // Show the member's signature? It should be just below that section and a little above // Show the lower breadcrumbs.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version