News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Thank-O-Matic

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

Previous topic - Next topic

Arvacon


Shambles

That looks like a mod gone sour. Your aeva problem can be logged in the aeva support board, but for now here's a fixed version. Keep your original Display.template.php as a backup.


Arvacon

How can I thank you?! ;D
I don't have words to say!
Cheers!
It seems forum is functional again, without errors at the log file  :laugh:
I will test it and I will tell you tomorrow if I had any other issue, but as it seems now, everything run smooth and quiet.

Thanks for everything my friend!

Ps: I don't care so much about aewa, it is old version, maybe that is why it has bugs and I think this bug was exists from before.

Shambles

Είστε πολύ ευπρόσδεκτοι.

Arvacon

Your Greeks are good!  8)
Να είσαι πάντα καλά φίλε μου!

Kindred

when you have to manually do a mod edit, you can't just replace the code

the reason the auto-edit failed in the first place is that some other mod has already touched the code in that area - you have to use human intuition to understand when has to be ADDED to make the new mod work correctly. If you just replace the code with the one from this mod, then you are UNDOING the edits from a previous mod.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

ForumACK

error:
Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation 'ifnull'
Dosya: /home/forumack/public_html/Sources/ThankYouPost.php
Satır: 616

Kindred

you have a problem in your database.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arvacon

Quote from: Kindred on May 27, 2013, 03:12:28 PM
when you have to manually do a mod edit, you can't just replace the code

the reason the auto-edit failed in the first place is that some other mod has already touched the code in that area - you have to use human intuition to understand when has to be ADDED to make the new mod work correctly. If you just replace the code with the one from this mod, then you are UNDOING the edits from a previous mod.

Thanks for the advice.

Shambles

I believe these are outstanding bugs in this mod:


Quote from: Liam_michael on January 15, 2012, 07:23:36 PM
I noticed a problem with the mod:

When I go ahead to delete my "Thank you" from a post I thanked, it deletes all the thank you's that other members made on that same post as well.

Is there a fix to this?


Quote from: shazoo! on July 10, 2012, 06:17:06 PM
Version 2.0.2

I have the option for can remove own thanks, but it doesn't seem to be working.  the Delete option just doesn't come up.
It does show if you have the Delete Thank You Post Member option for "Any Member", but not if you check "Own Member"

Has anyone encounter this and found a fix?

Simple Site Designs

Quote from: Skaty on April 16, 2013, 08:28:09 AM
Thank you.  I added this code in display.php but i think there have to be something for display.template.com. I added the codes abode, but can't see the most thanked topic or post. There is missing something :(

  // Count up the thanks and work out if we have a winning post
  $bigthx = 0;
  foreach($context['thank_you_post'] as $thxmsgid => $thxpost) {
    if(is_numeric($thxmsgid)) {
      $thisthx = count($thxpost['fulllist']);
      if($thisthx > $bigthx) {
        $bigthx   = $thisthx;
        $bigthxid = $thxmsgid;
      }
    }
  }
  // $scripturl.'?topic='.$context['current_topic'].'msg'.$bigthxid.'#msg'.$bigthxid

Hi Skaty,

This is the href for the most thanked post.
$scripturl.'?topic='.$context['current_topic'].'msg'.$bigthxid.'#msg'.$bigthxid
You need to add a link somewhere that goes to it.


Draffi

One question, please:

What i need to change, that my actual "Thank-you-list" (what looks like this on the first picture)

looks like the RC4/RC5 Thank you-Version (look second picture, please).

Thank you in advance!

D.

realJedi

Hey there :)

Some days ago I updated the German language files for my SMF 2.0.4 but TOM appears in English now. Is there a German translation and where (which file/s) would I have to insert the translated stuff?

Thank you

Booda

realJedi

So.. I translated all that stuff into German by myself now. Am I the only one or did someone else find some of the english used in this mod atrocious? It was really hard to decipher what function could eventually be meant by the author.

Kindred

If you understand Spanish, you'll probably get a better translation.
IIRC, the author(s) of this more are Spanish-speaking.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

mtxpert

Getting these errors when I attempt to install:
   Type    Action    Description
*    1.    Execute Modification    ./SSI.php    Test successful
*    2.    Execute Modification    ./Sources/Display.php    Test successful
*    3.    Execute Modification    ./Sources/Load.php    Test failed
      1.    Replace    ./Sources/Load.php    Test successful
      2.    Replace    ./Sources/Load.php    Test successful
      3.    Replace    ./Sources/Load.php    Test successful
      4.    Replace    ./Sources/Load.php    Test failed
      5.    Replace    ./Sources/Load.php    Test successful
      6.    Replace    ./Sources/Load.php    Test successful
      7.    Replace    ./Sources/Load.php    Test successful
*    4.    Execute Modification    ./Sources/ManageBoards.php    Test successful
*    5.    Execute Modification    ./Sources/ManagePermissions.php    Test successful
*    6.    Execute Modification    ./Sources/ManageSettings.php    Test successful
*    7.    Execute Modification    ./Sources/Memberlist.php    Test successful
*    8.    Execute Modification    ./Sources/MoveTopic.php    Test successful
*    9.    Execute Modification    ./Sources/Profile-Modify.php    Test successful
*    10.    Execute Modification    ./Sources/RemoveTopic.php    Test successful
*    11.    Execute Modification    ./Sources/Security.php    Test successful
*    12.    Execute Modification    ./Sources/SplitTopics.php    Test successful
*    13.    Execute Modification    ./Sources/Stats.php    Test successful
*    14.    Execute Modification    ./Sources/Subs.php    Test successful
*    15.    Execute Modification    ./Sources/Subs-Boards.php    Test successful
*    16.    Execute Modification    ./Themes/default/Display.template.php    Test successful
*    17.    Execute Modification    ./Themes/default/ManageBoards.template.php    Test successful
*    18.    Execute Modification    ./Themes/default/Profile.template.php    Test successful
*    19.    Execute Modification    ./Themes/default/Memberlist.template.php    Test successful
*    20.    Execute Modification    ./Themes/default/Stats.template.php    Test successful
*    21.    Execute Modification    ./Themes/default/css/index.css    Test successful
*    22.    Execute Modification    ./Themes/default/languages/Admin.english.php    Test successful
*    23.    Execute Modification    ./Themes/default/languages/index.english.php    Test successful
*    24.    Execute Modification    ./Themes/default/languages/ManageBoards.english.php    Test successful
*    25.    Execute Modification    ./Themes/default/languages/ManagePermissions.english.php    Test successful
*    26.    Execute Modification    ./Themes/default/languages/Errors.english.php    Test successful
*    27.    Execute Modification    ./Themes/default/languages/ManageSettings.english.php    Test successful
*    28.    Execute Modification    ./Themes/default/languages/Profile.english.php    Test successful
*    29.    Execute Modification    ./Themes/default/languages/Stats.english.php    Test successful
*    30.    Execute Modification    ./Themes/default/languages/Modifications.english.php    Test successful
   31.    Execute Modification    ./Themes/default/languages/Admin.spanish_es.php    Skipping file
   32.    Execute Modification    ./Themes/default/languages/index.spanish_es.php    Skipping file
   33.    Execute Modification    ./Themes/default/languages/ManageBoards.spanish_es.php    Skipping file
   34.    Execute Modification    ./Themes/default/languages/ManagePermissions.spanish_es.php    Skipping file
   35.    Execute Modification    ./Themes/default/languages/Errors.spanish_es.php    Skipping file
   36.    Execute Modification    ./Themes/default/languages/ManageSettings.spanish_es.php    Skipping file
   37.    Execute Modification    ./Themes/default/languages/Profile.spanish_es.php    Skipping file
   38.    Execute Modification    ./Themes/default/languages/Stats.spanish_es.php    Skipping file
   39.    Execute Modification    ./Themes/default/languages/Modifications.spanish_es.php    Skipping file
   40.    Execute Modification    ./Themes/default/languages/Admin.spanish_latin.php    Skipping file
   41.    Execute Modification    ./Themes/default/languages/index.spanish_latin.php    Skipping file
   42.    Execute Modification    ./Themes/default/languages/ManageBoards.spanish_latin.php    Skipping file
   43.    Execute Modification    ./Themes/default/languages/ManagePermissions.spanish_latin.php    Skipping file
   44.    Execute Modification    ./Themes/default/languages/Errors.spanish_latin.php    Skipping file
   45.    Execute Modification    ./Themes/default/languages/ManageSettings.spanish_latin.php    Skipping file
   46.    Execute Modification    ./Themes/default/languages/Profile.spanish_latin.php    Skipping file
   47.    Execute Modification    ./Themes/default/languages/Stats.spanish_latin.php    Skipping file
   48.    Execute Modification    ./Themes/default/languages/Modifications.spanish_latin.php    Skipping file
   49.    Extract Tree    ./Sources    
   50.    Extract Tree    ./Themes    
   51.    Execute Code    db/install.php    

Install in Other Themes
To use this modification in themes other than the default, the package manager needs to make additional changes to the other themes. If you'd like to install this modification in the other themes, please select these themes below.
      Core Theme
      Execute Modification    ./Themes/core/Display.template.php    Test failed
      1.    Replace    ./Themes/core/Display.template.php    Test failed
      2.    Replace    ./Themes/core/Display.template.php    Test successful
      3.    Replace    ./Themes/core/Display.template.php    Test successful
      4.    Replace    ./Themes/core/Display.template.php    Test successful
      5.    Replace    ./Themes/core/Display.template.php    Test failed
      6.    Add Before    ./Themes/core/Display.template.php    Test failed
      7.    Replace    ./Themes/core/Display.template.php    Test successful
      Execute Modification    ./Themes/core/Memberlist.template.php    Test successful
      1.    Replace    ./Themes/core/Memberlist.template.php    Test successful
      Execute Modification    ./Themes/core/Stats.template.php    Test failed
      1.    Replace    ./Themes/core/Stats.template.php    Test failed
      Execute Modification    ./Themes/core/css/index.css    Test successful
      1.    Add Before    ./Themes/core/css/index.css    Test successful
      Cargo
      Execute Modification    ./Themes/cargo_20/css/index.css    Test successful
      Citiez
      Execute Modification    ./Themes/citiez_20a/css/index.css    Test successful
      theme1
      Execute Modification    ./Themes/theme1/css/index.css    Test successful
      DSv1
      Execute Modification    ./Themes/dsv1_20/css/index.css    Test successful
      DSv4
      Execute Modification    ./Themes/dsv4_20/css/index.css    Test successful
      Expo
      Execute Modification    ./Themes/expo_20/css/index.css    Test successful
      Express
      Execute Modification    ./Themes/express_20/css/index.css    Test successful
      Gearbox
      Execute Modification    ./Themes/gearbox_20a/css/index.css    Test successful
      IceCube
      Execute Modification    ./Themes/icecube_20/css/index.css    Test successful
      Indigo
      Execute Modification    ./Themes/indigo_20/css/index.css    Test successful
      Joli
      Execute Modification    ./Themes/joli_20a/css/index.css    Test successful
      laGusta
      Execute Modification    ./Themes/lagusta_20a/css/index.css    Test successful
      Micolo
      Execute Modification    ./Themes/micolo_20a/css/index.css    Test successful
      Noize
      Execute Modification    ./Themes/noize_20/css/index.css    Test successful
      Scratch
      Execute Modification    ./Themes/scratch_20/css/index.css    Test successful
      SurfandTurf
      Execute Modification    ./Themes/surfandturf_20/css/index.css    Test successful
      Twotone
      Execute Modification    ./Themes/twotone_20b/css/index.css    Test successful
      Urban
      Execute Modification    ./Themes/urban_20/css/index.css    Test successful
      Vivanto
      Execute Modification    ./Themes/vivanto_20a/css/index.css    Test successful
      Zentoa
      Execute Modification    ./Themes/zentoa_20b/css/index.css    Test successful
      Zone99
      Execute Modification    ./Themes/zone99_20/css/index.css    Test successful

I'd really like this to be installed on my forum at http://ecoboostperformanceforum.com but I don't want to wreck it by just trying to install anyhow.

dimspace

It is failing only in three places in the core theme.

you will have to manually edit display.template and Stats.template in core with the following changes

display template

find

echo '
<form action="', $scripturl, '?action=quickmod2;topic=', $context['current_topic'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm" style="margin: 0;" onsubmit="return oQuickModify.bInEditMode ? oQuickModify.modifySave(\'' . $context['session_id'] . '\', \'' . $context['session_var'] . '\') : false">';

replace with

// AJAX Style Thank You Post
if (!empty($modSettings['thankYouPostAJAX']))
{
echo '
<script language="JavaScript" type="text/javascript">
var thank_you_ajax_url = smf_scripturl + \'?action=thankyouajax;topic=' . $context['current_topic'] . '\';

function thankyou(msg_id) {
// Follow the link if no ajax support...
if (!window.XMLHttpRequest)
return true;

// Standard Variables
var elementName = "ThankOMaticID" + msg_id;
var elementButton = "buttonThxID" + msg_id;
var elementLockButton = "thank_lock_button_" + msg_id;
var elementDeleteButton = "thank_delete_button_" + msg_id;

// Tell him that something loading :)
ajax_indicator(true);

// Remove the Thank You Button :)
document.getElementById(elementButton).style.display = "none";
document.getElementById(elementLockButton).style.display = "none";
document.getElementById(elementDeleteButton).style.display = "none";

var thank_you_ajax_thx = thank_you_ajax_url + ";sa=thx;msg=" + msg_id;
var data = ThankYouLoadTextData(thank_you_ajax_thx, elementName, elementButton, elementDeleteButton, elementLockButton);

return !data;
}

function ThankYouLoadTextData(url, elementName, elementButton, elementDeleteButton, elementLockButton) {
if (!window.XMLHttpRequest)
return false;

request = new XMLHttpRequest();
request.onreadystatechange = function() {
if (request.readyState != 4)
return;
if (request.responseText != null && request.status == 200) {
if (request.responseText.substr(0, 7) == "#ERROR#") {
setInnerHTML(document.getElementById("Error" + elementName), request.responseText.substr(7));
document.getElementById(elementName).style.display = "block";
document.getElementById(elementButton).style.display = "inline";
document.getElementById(elementLockButton).style.display = "none";
document.getElementById(elementDeleteButton).style.display = "none";
ajax_indicator(false);
}
else {
document.getElementById(elementName).style.display = "block";
setInnerHTML(document.getElementById(elementName), request.responseText);
document.getElementById(elementButton).style.display = "none";
document.getElementById(elementLockButton).style.display = "inline";
document.getElementById(elementDeleteButton).style.display = "inline";
ajax_indicator(false);
}
return false;
}
else {
return true;
}
}
// Load the Request!
request.open("GET", url, true);
request.send(null);
return request;
}
</script>';
}

echo '
<form action="', $scripturl, '?action=quickmod2;topic=', $context['current_topic'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm" style="margin: 0;" onsubmit="return oQuickModify.bInEditMode ? oQuickModify.modifySave(\'' . $context['session_id'] . '\', \'' . $context['session_var'] . '\') : false">';


find

if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
echo '
</ul>';

replace with

if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
echo '
</ul>';

// Thank-O-Matic okay close the ul on sometimes :D
elseif (($message['thank_you_post']['post'] && !$message['thank_you_post']['locked']) || (($message['thank_you_post']['lock'] || $message['thank_you_post']['delete']) && $message['thank_you_post']['isThankYouPost']))
echo '
</ul>';


find
<hr class="post_separator" />';
add before

';

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


in stats.template
find

echo '
<span>', $poster['time_online'], '</span>
</dd>';
}

replace 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>';
}


theres also a parse fail in /Sources/Load.php
find

mem.birthdate, mem.member_ip, mem.member_ip2, mem.icq, mem.aim, mem.yim, mem.msn, mem.posts, mem.last_login,
mem.karma_good, mem.id_post_group, mem.karma_bad, mem.lngfile, mem.id_group, mem.time_offset, mem.show_online,

replace with

mem.birthdate, mem.member_ip, mem.member_ip2, mem.icq, mem.aim, mem.yim, mem.msn, mem.posts, mem.last_login,
mem.karma_good, mem.id_post_group, mem.karma_bad, mem.lngfile, mem.id_group, mem.time_offset, mem.show_online,
mem.thank_you_post_made, mem.thank_you_post_became, last_thank_you_time,


Bear in mind however, you wont find something exactly the same (hence the reason the parsing has failed), so you will need to bear in mind other mods when you make the edit.

So backup all three of those files before doing the manual edits.

dimspace

If you arent confident with the edits upload

themes/core/display.template.php
themes/core/stats.template.php

and
sources/load.php

and if i get a chance when i pass by tomorrow will do them

I assume you are using 2.0.2 - 2.0.4

mtxpert

I am using 2.0.4
I could not find <hr class="post_separator" />'; in Display.template.php
Nor echo '
                        <span>', $poster['time_online'], '</span>
                     </dd>';
   }
Within State.template.php

I'm ok copy/replace if I find exactly what you put but I'm afraid to break code if I put it in the wrong place.
I don't want to breaky my forum, just had quite a few member join in last 48 hours and the last thing I want to do is break it :)
BTW, thanks so much for your offer of help. I really, really appreciate it.




TheListener

mtxpert

which theme are you using?

Do you use notepad##?

Advertisement: