http://www.icyphoenix.com/viewtopic.php?f=35&t=7714
-----------------------------------
awex
Fri 11 Mar, 2011 11:04

Thanks Button For Each Post (thanks)
-----------------------------------
hello, wanted to ask if it is somehow possible to the Thanks button to attach each contribution.

So thank you all that can not only contributing writer.

mfg

sry for my bad english..google translator :) :oops:


-----------------------------------
spydie
Fri 11 Mar, 2011 11:12

Re: Thanks Button For Each Post (thanks)
-----------------------------------
got a mod that does what you want.

only need to translate it , 

you´ll get it this evening

[hr]

german:

Ich hab was du suchst.

muss ich nur uebersetzten.

kriegst du heute abend


-----------------------------------
awex
Fri 11 Mar, 2011 13:44

Re: Thanks Button For Each Post (thanks)
-----------------------------------
in a forum where I am active to thank all posts where to find useful ..I really appreciate

thx spydie





german: ja weil ich finde das halt gut wenn man auch den leuten danken kann die wo auf einem beitrag geantwortet haben.

danke dafür freue mich drauf


-----------------------------------
spydie
Sat 12 Mar, 2011 00:38

Re: Thanks Button For Each Post (thanks)
-----------------------------------
Here we go.

Important:

If you use this Mod, Please disable default Thanks Mod of Icy, or you´ll have 2 Thanks Mods running


-----------------------------------
awex
Sat 12 Mar, 2011 08:34

Re: Thanks Button For Each Post (thanks)
-----------------------------------
spydie good work. It worked without problems:) thanks for the great performance :v:  :v: 

 [img]http://www.icyphoenix.com/files/images/9131/awex_.jpg[/img]


-----------------------------------
spydie
Sat 12 Mar, 2011 10:34

Re: Thanks Button For Each Post (thanks)
-----------------------------------
I see one error in php

it should say

Dank gegeben and Erhaltene Danksagung.

probably my error, from translation.

Edit: nope, just checked my code, and it´s correct.

Important:

Disable thanks in ACP

Schalte im ACP die Danksagung aus. deshalb iss das doppelt


-----------------------------------
awex
Sat 12 Mar, 2011 12:18

Re: Thanks Button For Each Post (thanks)
-----------------------------------
yes I did.


das bild war noch bevor ich es abgeschalten habe.. und die rechtschreibung habe ich korrigiert.

thx

kannst du mir noch sagen wo ich im acp verteile dieses thema anschalten kann..finde das nirgends.


-----------------------------------
spydie
Sat 12 Mar, 2011 12:56

Re: Thanks Button For Each Post (thanks)
-----------------------------------
??

you enable and disable the thanks_2 function in the viewforum.php file

[code] // begin Thanks_2 mod
$activar_gracias = 1;  //  1= aktiviert , 0= desaktiviert.    
[/code]

$activar_gracias = [b]1[/b]

hier schaltest du an oder aus


-----------------------------------
KugeLSichA
Sun 20 Mar, 2011 21:19

Re: Thanks Button For Each Post (thanks)
-----------------------------------
Thanks spydie...

i was also looking for something similar...

downloaded... will install and test it later...


-----------------------------------
spydie
Sun 20 Mar, 2011 21:49

Re: Thanks Button For Each Post (thanks)
-----------------------------------
Was a quick thing, we did for some spanish users, 

I should have included the lang Vars in lang files, instedt of putting them straight in the Mod.

anyway. as far as i know, it´s working perfectly.


Edit
I just noticed, that from the midle part of the file, where the spanish text starts, there's some extra edits, you don´t realy need, if you don´t wan´t some users to be able to see some hidden (hide-mod) posts, aftyer having received or given xx thank´s or post´s done


This part is not necesary, if you don´t wanna use that option
[spoiler]###########################################################################
#--------------------------------------------------------------------------------------------------------------------
#
Si quereis, que ese mod trabaje con el hide,
o sea, que si uno da las gracias en el post se desbloque el hide.

#
#-----[ ABRIR / OPEN ]------------------------------------------
#

includes/bbcode.php

#
#-----[ BUSCAR / FIND ]------------------------------------------
#

// HIDE
        if($tag === 'hide')
        {
            if($this->is_sig && !$board_config['allow_all_bbcode'])
            {
                return $error;
            }
            if($item['iteration'] > 1)
            {
                return $error;
            }
            global $db, $topic_id, $mode;
            $show = false;
            if(defined('IS_ICYPHOENIX') && $userdata['session_logged_in'])
            {
                $sql = "SELECT p.poster_id, p.topic_id
                    FROM " . POSTS_TABLE . " p
                    WHERE p.topic_id = $topic_id
                    AND p.poster_id = " . $userdata['user_id'];
                $resultat = $db->sql_query($sql);
                $show = $db->sql_numrows($resultat) ? true : false;
                $db->sql_freeresult($result);

                $sql = "SELECT *
                    FROM " . THANKS_TABLE . "
                    WHERE topic_id = $topic_id
                    AND user_id = " . $userdata['user_id'];
                $resultat = $db->sql_query($sql);
                $show = ($db->sql_numrows($resultat) || ($show == true))? true : false;
                $db->sql_freeresult($result);

                if (($userdata['user_level'] == ADMIN) || ($userdata['user_level'] == MOD))
                {
                    $show = true;
                }
            }

#
#-----[ REEMPLAZAR POR]------------------------------------------
#

// HIDE
        if($tag === 'hide')
        {
            if($this->is_sig && !$board_config['allow_all_bbcode'])
            {
                return $error;
            }
            if($item['iteration'] > 1)
            {
                return $error;
            }
            global $db, $topic_id, $mode;
            $show = false;
            if(defined('IS_ICYPHOENIX') && $userdata['session_logged_in'])
            {
                $sql = "SELECT p.poster_id, p.topic_id
                    FROM " . POSTS_TABLE . " p
                    WHERE p.topic_id = $topic_id
                    AND p.poster_id = " . $userdata['user_id'];
                $resultat = $db->sql_query($sql);
                $show = $db->sql_numrows($resultat) ? true : false;
                $db->sql_freeresult($result);

                $sql = "SELECT *
                    FROM " . THANKS_2_TABLE . "
                    WHERE topic_id = $topic_id
                    AND user_id = " . $userdata['user_id'];
                $resultat = $db->sql_query($sql);
                $show = ($db->sql_numrows($resultat) || ($show == true))? true : false;
                $db->sql_freeresult($result);

                if (($userdata['user_level'] == ADMIN) || ($userdata['user_level'] == MOD))
                {
                    $show = true;
                }
            }

#
-------------------------------------------------------------------------
#

recommiendo, desactivar el thanks mod en el ACP, para no tener 2 thanks mods funcionando.



[/spoiler]

Edit.

If you use Prosilver or Prosilver based templates, you´ll need some tweaking with the Thank´s botton image code.

since they use sprites, and will show both status off the botton at the same time, without the tweak


-----------------------------------
KugeLSichA
Mon 21 Mar, 2011 16:39

Re: Thanks Button For Each Post (thanks)
-----------------------------------
ok no problem, spydie...

i´ve been working on a version to completly remove the OLD Thanks Mod, better: update your version so it works with the ACP settings from normal Thank MOD...

atm i cleaned up your code a bit.. and also exclude the lang vars to external lang files...

the problem from now is... i dont found a good translation for the following words... maybe you can halp me...

boton_gra
num_dad
num_agrad

after i´m done... a share these modifications here...


-----------------------------------
spydie
Mon 21 Mar, 2011 16:51

Re: Thanks Button For Each Post (thanks)
-----------------------------------
boton_gra = button_thanks
num_dad  = times_given
num_agrad = times_received


-----------------------------------
KugeLSichA
Mon 21 Mar, 2011 22:16

Re: Thanks Button For Each Post (thanks)
-----------------------------------
ok... i´m almost done... was a bit tricky... but works great...

just a quick gestion... anyone can make me a button for Icy style CYAN similar to this one (IP.com button maker doesnt have this style):
 [img]http://www.icyphoenix.com/files/images/6/modcp_split.gif[/img] 

but with the text:

Spanish: [b]graciacs[/b] OR [b]Graciacs[/b] (dont know whats better)
English: [b]Thanks[/b]
German: [b]Danke[/b]

now i do the last modifications for the Cash-MOD Addon...


-----------------------------------
spydie
Mon 21 Mar, 2011 23:22

Re: Thanks Button For Each Post (thanks)
-----------------------------------
spanish = Gracias not graciacs

BTW. The mod was using the original thank´s button. Why use a new one ??


-----------------------------------
TheSteffen
Thu 24 Mar, 2011 01:08

Re: Thanks Button For Each Post (thanks)
-----------------------------------
Here is the button for this 3 langs

It is for "frozen phoenix" = templates\icy_phoenix\images\cyan\


-----------------------------------
KugeLSichA
Thu 24 Mar, 2011 01:18

Re: Thanks Button For Each Post (thanks)
-----------------------------------
Many Thanks Steffen :)

[hr]

new version with all settings via ACP and more -> http://www.icyphoenix.com/viewtopic.php?f=2&t=7740


