News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Thank-O-Matic

Started by enik, June 12, 2007, 12:18:59 PM

Previous topic - Next topic

Cutter65

Quote from: Sabrinova on August 11, 2012, 09:52:57 AM
Ok, I'm going for a different angle.  In order to identify whether the problem is within this mod or to do with my own setup, please can other users confirm that you either do or don't have the same problem as me for my two issues:

1) Thank you received stats resetting themselves to 0.

2) From the "Thank you posts" within a member's profile, clicking on page 2 of Messages (became) redirects to Messages (received), except within an Administrator's profile where it throws up an error.

Thank you  ;)

I have the same problem. Just noticed it today.

Chalky

Quote from: Cutter65 on August 27, 2012, 06:54:54 AM
Quote from: Sabrinova on August 11, 2012, 09:52:57 AM
Ok, I'm going for a different angle.  In order to identify whether the problem is within this mod or to do with my own setup, please can other users confirm that you either do or don't have the same problem as me for my two issues:

1) Thank you received stats resetting themselves to 0.

2) From the "Thank you posts" within a member's profile, clicking on page 2 of Messages (became) redirects to Messages (received), except within an Administrator's profile where it throws up an error.

Thank you  ;)

I have the same problem. Just noticed it today.

Thanks Cutter!  Maybe it isn't just my setup then, but a bug in the mod itself...  I did ask for help on the author's support forum, but I was told the number of mods I have installed is an "atrocity" and then was asked for an admin account to look at it, so I've decided to try an uninstall and re-install first, which, due to the number of mods I have will need many manual edits, so it's the job I have planned for my holiday.

I'm happy to hand over my files to anyone who thinks they can help, and the symptoms of the problem are obvious to all, but I'm reluctant, rightly or wrongly, to hand over admin permissions for this to someone who is not, to my knowledge, an SMF team member.  Nor do I understand why an admin account would be necessary in this instance  :-\

Cutter65

I also get this error when I try to run Maintenance.

Repair and optimize Thank-O-Matic tables give this error

forum/index.php?action=admin;area=maintainThankYouPost;sa=maintain;activity=optimize
Database Error: Operand should contain 1 column(s)
File: /public_html/forum/Sources/ThankYouPost-Maintaince.php
Line: 603

601: 'msg_ids' => $msg_ids,
602: )
==>603: );
604:    
605: $_REQUEST['start'] +=$increment;

Chalky

I just tried that for the first time and didn't have a problem, it said it "executed successfully"  :-\

Chalky

Quote from: Sabrinova on August 27, 2012, 08:08:48 AM
I just tried that for the first time and didn't have a problem, it said it "executed successfully"  :-\


Damn, damn, damn!!!  Urgent problem!  Since I hit the button to optimize tables, my names of who have thanked posts no longer show up when clicking on the link!!!  This at least was working before.

Please, somebody, how can I fix this?  I took a DB backup just before, can I overwrite the thanks table or something from the backup?  Would that fix it or just make it worse??  Damnn, why does nothing with this mod do what it's supposed to do????

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

QuoteColumn 'id_msg' in where clause is ambiguous
File: /home/chalkcat/public_html/Sources/Profile-ThankYouPost.php
Line: 199

where line 199 is the last line of the following - yes the );

// 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,
)
);


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  :-\

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.

Chalky

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....

Chalky

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:

// 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']);


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;

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
<hr class="post_separator" />';
in: ./Themes/core/Display.template.php

Any help is appreciated.

anyone?!

Chalky

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
<hr class="post_separator" />';
in: ./Themes/core/Display.template.php

Any help is appreciated.

anyone?!

Search for // Show the member's signature?  It should be just below that section and a little above // Show the lower breadcrumbs.

loplo

No joy.
Here's what I have there:

// Show the member's signature?
if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled'])
echo '
<div class="signature" id="msg_', $message['id'], '_signature">', $message['member']['signature'], '</div>';

echo '
</div>
</div>
</div>';
}

echo '
</form>';
echo '
</div>
<a id="lastPost"></a>';

echo '
<div class="clearfix marginbottom" id="postbuttons_lower">
<div class="nav floatright">', template_button_strip($normal_buttons, 'top'), '</div>
<div class="middletext floatleft">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#top"><strong>' . $txt['go_up'] . '</strong></a>' : '', '</div>
<div class="clear">', $context['previous_next'], '</div>
</div>';

// Show the lower breadcrumbs.

Chalky

Ok, my core theme doesn't have it either.  If it helps, here is where it should be in the default theme:

echo '
</div>
</div>
<span class="botslice"><span></span></span>
</div>

';

echo '
<hr class="post_separator" />
</div>';
}

echo '
</form>
</div>
<a id="lastPost"></a>';


With the thanks mod installed, my file looks like this (bear in mind there are several other mods here too, so yours wouldn't look like this)

// Show the member's signature?
if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled'])
echo '
<div class="signature" id="msg_', $message['id'], '_signature">', $message['member']['signature'], '</div>';

if (!empty($modSettings['ptoup_user_feed_on_signature']))
echo'
<div id="twitter_div">
<ul id="twitter_update_list"></ul></div>
<script type="text/javascript" src="../Themes/default/scripts/blogger.js"></script>
<script text="text/javascript" src="http://twitter.com/statuses/user_timeline/',$message['member']['ptweet']['id'],'.json?callback=twitterCallback2&count=', !empty($modSettings['ptoup_signature_feed_count']) ? $modSettings['ptoup_signature_feed_count'] : '5','"></script>';

echo '
</div>
</div>
<span class="botslice"><span></span></span>
</div>

';

// Show the Thank You list or the link or.... nothing? XD
echo '
<div class="ThankOMatic ', $message['approved'] ? ($message['alternate'] == 0 ? 'windowbg' : 'windowbg2') : 'approvebg', '" style="display: '.($message['thank_you_post']['isThankYouPost'] ? 'block' : 'none').';" id="ThankOMaticID' . $message['id'] . '">
<span class="error" id="ErrorThankOMaticID' . $message['id'] . '"></span>';
// Output the Template for Thank-O-Matic (Normal found in the index.template.php)
// It will fall back into a standard function, if this template_thank_you_post doesn't exists!
if ($message['thank_you_post']['isThankYouPost'])
{
// Mistake? Function not loaded oO.
if (empty($context['call_thank_you_post_func']))
loadThankYouTemplateFunctions();

// Call the correct function =D
$context['call_thank_you_post_func']($message['thank_you_post'], $message['id']);
}
echo '
</div>
<hr class="post_separator" />
</div>';
}

echo '
</form>
</div>
<a id="lastPost"></a>';

// Show the page index... "Pages: [1]".
echo '
<div class="pagesection">
', template_button_strip($normal_buttons, 'right'), '
<div class="pagelinks floatleft">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#top"><strong>' . $txt['go_up'] . '</strong></a>' : '', '</div>
<div class="nextlinks_bottom">', $context['previous_next'], '</div>
</div>';

// Show the lower breadcrumbs.


So with your file you could try inserting the thanks code here (obviously keep a copy of your file for back-up as I'm only guessing)

// Show the member's signature?
if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled'])
echo '
<div class="signature" id="msg_', $message['id'], '_signature">', $message['member']['signature'], '</div>';

echo '
</div>
</div>
</div>';

<<<-------------HERE------------->>>

}

echo '
</form>';
echo '
</div>
<a id="lastPost"></a>';

echo '
<div class="clearfix marginbottom" id="postbuttons_lower">
<div class="nav floatright">', template_button_strip($normal_buttons, 'top'), '</div>
<div class="middletext floatleft">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#top"><strong>' . $txt['go_up'] . '</strong></a>' : '', '</div>
<div class="clear">', $context['previous_next'], '</div>
</div>';

// Show the lower breadcrumbs.

[/quote]

loplo

Thanks for the idea.

Next issue is with ./Themes/core/Stats.template.php

I have to find this and replace it.
echo '
<span>', $poster['time_online'], '</span>
</dd>';
}


Unfortunately the code there looks like this:
echo '
<tr>
<td width="60%" valign="top">', $poster['link'], '</td>
<td width="20%" align="', $context['right_to_left'] ? 'right' : 'left', '" valign="top">', $poster['time_online'] > 0 ? '<img src="' . $settings['images_url'] . '/bar.gif" width="' . $poster['time_percent'] . '" height="15" alt="" />' : '&nbsp;', '</td>
<td width="20%" align="right" valign="top" nowrap="nowrap">', $poster['time_online'], '</td>
</tr>';


and I have to replace it with:
echo '
<span>', $poster['time_online'], '</span>
</dd>';
}

// Thank-O-Matic Stats
if (!empty($modSettings['thankYouPostStatsEnabled']))
{
echo '
</dl>
<div class="clear"></div>
</div>
<span class="botslice"><span></span></span>
</div>
</div>
</div>
<div class="flow_hidden">
<div id="most_thank_you_receive">
<h3 class="catbg"><span class="left"></span>
<img src="', $settings['images_url'], '/buttons/thank_you_b.png" class="icon" alt="" /> ', $txt['thank_you_post_Top10Receive'], ' <span class="smalltext">(', $txt['thank_you_post_became_display'], ' / ', $txt['thank_you_post_made_display'], ')</span>
</h3>
<div class="windowbg">
<span class="topslice"><span></span></span>
<div class="content">
<dl class="stats">';

foreach ($context['top_ThankOMatic_Receive'] as $poster)
echo '
<dt>', $poster['link'], '</dt>
<dd>', $poster['thank_you_post_became'], '/', $poster['thank_you_post_made'], '</dd>';

echo '
</dl>
<div class="clear"></div>
</div>
<span class="botslice"><span></span></span>
</div>
</div>
<div id="most_thank_you_given">
<h3 class="catbg"><span class="left"></span>
<img src="', $settings['images_url'], '/buttons/thank_you_b.png" class="icon" alt="" /> ', $txt['thank_you_post_Top10Given'], ' <span class="smalltext">(', $txt['thank_you_post_made_display'], ' / ', $txt['thank_you_post_became_display'], ')</span>
</h3>
<div class="windowbg2">
<span class="topslice"><span></span></span>
<div class="content">
<dl class="stats">';

foreach ($context['top_ThankOMatic_Given'] as $poster)
echo '
<dt>', $poster['link'], '</dt>
<dd>', $poster['thank_you_post_made'], '/', $poster['thank_you_post_became'], '</dd>';
}


Donno what to replce now. Damn!

Chalky

Although it says Find and Replace, all the edit does in effect is it adds the code that begins // Thank-O-Matic Stats after the code that's already there (after the } if you have one), so I'd try just pasting that in  ;)

loplo

Unfortunately there's no closing }. Dilemma :)

Chalky

Quote from: loplo on September 18, 2012, 08:50:58 AM
Unfortunately there's no closing }. Dilemma :)

Then if nobody suggests anything better, I'd just stick the code after the </tr>'; anyway and see if it works  ;)

I may be giving away too much here about how I do my manual edits  O:)  Thing is though, as long as you keep a copy of your original file to hand, if you get a template parse error you can just shove your original back in while you try pasting the code somewhere else.  This strategy usually gets me there in the end :)

loplo

Thanks! It's working, or at least it's shown. I'll start testing it, to see if it's fully functional. Thanks for your help.

Chalky


hellboy78

the version 125 works also for SMF 1.1.16 ????

thanks

jobam

Hello everyone!

That 's the first time I approach the construction of a forum .. I would say it should not be too bad ... lol

I have 'a problem with this mod: Thank-O-Matic.

Using SMF 2.2 and the version of the mod specifically for this release (3.0).

When you installed all the tests are positive, including those which use the Theme (Extreme Ibz).

The installation appears to be successful .. except that tthere is no signs of Thank-O-Matic anywhere.. zero.. nada...

After the installation should send me back to the configuration pages, but I go back to the main screen.

I tried to do it all using only the basic theme, but the result is' the same.

I do not even see in the configuration panel.

Add that to now I am working in local XAMMP installing on my pc.

There 'some kind soul who could help me?


Thanks in advance

[nofollow]


Advertisement: