[RC1] Thank Post by User v0.3.2

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Post Reply
alexi02
Registered User
Posts: 271
Joined: Fri Mar 05, 2004 2:15 am
Location: Australia
Contact:

Post by alexi02 » Mon Nov 13, 2006 10:58 pm

apocan wrote: thanks alexi it is working very well but i couldnt do the users name bold.how can i make?

as you can see at http://www.trf1.net/forum


It's easy.

Open index.php

Find

Code: Select all

$top_5_thanked_users .= '<a href="' . $temp_url . '">' . $row[$x]['username'] . '</a> (' . $row[$x]['user_thanks_received'] . ')';
Replace with

Code: Select all

$top_5_thanked_users .= '<b><a href="' . $temp_url . '">' . $row[$x]['username'] . '</a></b> (' . $row[$x]['user_thanks_received'] . ')';

apocan
Registered User
Posts: 9
Joined: Tue Jul 25, 2006 2:22 pm
Contact:

Post by apocan » Tue Nov 14, 2006 3:45 pm

ooo finally this mod is in the best form in my forum.thanks for your great work alexi.really thanks...this is a great mode...

apocan
Registered User
Posts: 9
Joined: Tue Jul 25, 2006 2:22 pm
Contact:

Post by apocan » Wed Nov 15, 2006 10:19 am

and can we show this in profile page and memberlist page?

senyafin
Registered User
Posts: 69
Joined: Wed Jul 05, 2006 5:53 pm
Contact:

Post by senyafin » Thu Nov 16, 2006 2:36 pm

alexi02 wrote: Hm, use this code instead.


Hello alexi,
sorry for the delay - i was away from desk a few days.
The new code works well! Thanks.
If i use the Search Engine i get an sql error exactly in that line
(search string: any word plus wildcard)

Code: Select all

Could not obtain post information

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3

SELECT forum_id FROM phpbb_posts WHERE post_id =

Line : 1788
File : bbcode.php
Do you have an idea why i get that error?

alexi02
Registered User
Posts: 271
Joined: Fri Mar 05, 2004 2:15 am
Location: Australia
Contact:

Post by alexi02 » Fri Nov 17, 2006 1:26 am

senyafin wrote: If i use the Search Engine i get an sql error exactly in that line
(search string: any word plus wildcard)

Do you have an idea why i get that error?


Ah, I think I forgot the if statement before the code.

So replace the forum_id code with this:

Code: Select all

                        if ($postrow) {
                        // Hidden message not shown for this forum_id 
                        $sql = "SELECT forum_id 
                                FROM " . POSTS_TABLE . " 
                                WHERE post_id = " . $postrow[$i]['post_id']; 

                        if ( !($result = $db->sql_query($sql)) ) { 
                           message_die(GENERAL_ERROR, "Could not obtain post information", '', __LINE__, __FILE__, $sql); 
                        } 

                        $forum_id_check = $db->sql_fetchrow($result); 
                        $db->sql_freeresult($result); 

                        if ($forum_id_check['forum_id'] == 1) { 
                           $show = false; 
                        } 
                        // Hidden message not shown for this forum_id
                        }

senyafin
Registered User
Posts: 69
Joined: Wed Jul 05, 2006 5:53 pm
Contact:

Post by senyafin » Fri Nov 17, 2006 11:40 pm

Hello alexi,

thank you as always for your assistance.
I've changed your last the code a little bid (you've show me the way already in one of the earlier posts) and now it works

here the code (thanks dont show the hidded message/ reply show it)

Code: Select all

                        if ($postrow) {
                        // Hidden message not shown for this forum_id
                        $sql = "SELECT forum_id
                                FROM " . POSTS_TABLE . "
                                WHERE post_id = " . $postrow[$i]['post_id'];

                        if ( !($result = $db->sql_query($sql)) ) {
                           message_die(GENERAL_ERROR, "Could not obtain post information", '', __LINE__, __FILE__, $sql);
                        }

                        $forum_id_check = $db->sql_fetchrow($result);
                        $db->sql_freeresult($result);

                        $user_posted = $db->sql_numrows($resultat) ? true : false;

                        if ($forum_id_check['forum_id'] == 1 && !$user_posted) {
                           $show = false;
                        }
                        // Hidden message not shown for this forum_id
                        }
Tia
Pascal

senyafin
Registered User
Posts: 69
Joined: Wed Jul 05, 2006 5:53 pm
Contact:

Post by senyafin » Sun Nov 26, 2006 12:45 am

alexi,


is there any chance to move Topics (instead of a reply) to the top position if someone has Thanked to a topic?


Tia
Pascal

s60Addict
Registered User
Posts: 49
Joined: Tue Sep 26, 2006 5:08 pm

Post by s60Addict » Tue Jan 02, 2007 3:30 pm

hey, a suggestion...

can u introduce AJAX in this mod??? like the vBulletin mod ??

Thanks..

TC

enkigur
Registered User
Posts: 74
Joined: Sun Mar 25, 2007 9:49 pm

Re: [BETA] Thank Post by User 0.2.5a

Post by enkigur » Tue Apr 17, 2007 11:10 pm

can someona give the codes for "top 5 thanked users" which will work in phpbb plus 1.53?...

User avatar
3Di
Former Team Member
Posts: 13890
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: [BETA] Thank Post by User 0.2.5a

Post by 3Di » Tue Apr 17, 2007 11:30 pm

enkigur wrote: can someona give the codes for "top 5 thanked users" which will work in phpbb plus 1.53?...


not supported here.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

enkigur
Registered User
Posts: 74
Joined: Sun Mar 25, 2007 9:49 pm

Re: [BETA] Thank Post by User 0.2.5a

Post by enkigur » Wed Apr 18, 2007 1:39 am

3Di wrote:
enkigur wrote: can someona give the codes for "top 5 thanked users" which will work in phpbb plus 1.53?...


not supported here.


but in page 6 "alexi02" has given the codes for normal phpbb version...
i think there isn't much difference...

User avatar
Laubi
Registered User
Posts: 3
Joined: Tue Apr 24, 2007 6:36 pm
Location: Köln die Schönste Stadt am Rhein
Contact:

Re: [BETA] Thank Post by User 0.2.5a

Post by Laubi » Tue Apr 24, 2007 6:58 pm

To hello, I the Mod “Thank post office by user” inserted and I would like the contribution message under that, see picture away having and but gladly in the profile have, see picture can me there one please help, I create nen Mod to insert however then already hears it on with my knowledge in things php greeting Tom

sorry for my bad English I work with translations a program


ich möchte gern den Text
"Danksagungen: 77
Erhielt 169 Danksagungen für 103 Beiträge" unter dem Avantar weg haben und ins Profil haben.Kann mir da bitte einer helfen?
Attachments
THX mod.JPG
THX mod.JPG (88.81 KiB) Viewed 1842 times

User avatar
Laubi
Registered User
Posts: 3
Joined: Tue Apr 24, 2007 6:36 pm
Location: Köln die Schönste Stadt am Rhein
Contact:

Re: [BETA] Thank Post by User 0.2.5a

Post by Laubi » Thu Apr 26, 2007 11:50 am

Laubi wrote: To hello, I the Mod “Thank post office by user” inserted and I would like the contribution message under that, see picture away having and but gladly in the profile have, see picture can me there one please help, I create nen Mod to insert however then already hears it on with my knowledge in things php greeting Tom

sorry for my bad English I work with translations a program


ich möchte gern den Text
"Danksagungen: 77
Erhielt 169 Danksagungen für 103 Beiträge" unter dem Avantar weg haben und ins Profil haben.Kann mir da bitte einer helfen?




can none help me?

alexi02
Registered User
Posts: 271
Joined: Fri Mar 05, 2004 2:15 am
Location: Australia
Contact:

Re: [BETA] Thank Post by User 0.2.5a

Post by alexi02 » Fri Apr 27, 2007 1:17 pm

So you want the thanks and thanked numbers to be displayed on the profile page?
If so, follow this:

Open includes/usercp_profile.php

Find

Code: Select all

$search = '<a href="' . $temp_url . '">' . sprintf($lang['Search_user_posts'], $profiledata['username']) . '</a>';
After Add

Code: Select all

//
// Start Thank Post by User Mod
//

// If the user isn't anonymous
if ($profiledata['user_id'] != ANONYMOUS) {

// From Users SQL
$sql = "SELECT user_posts, user_thanks_given, user_thanks_received
        FROM " . USERS_TABLE . "
        WHERE user_id = " . $profiledata['user_id'];

if ( !($result = $db->sql_query($sql)) ) {
  message_die(GENERAL_ERROR, "Could not obtain user information", '', __LINE__, __FILE__, $sql);
}

$user_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);

// Thanked Posts SQL
$sql = "SELECT COUNT(thanks_count) AS thanks_count
        FROM " . POSTS_TABLE . "
        WHERE poster_id = " . $profiledata['user_id'] . "
        AND thanks_count <> 0";

if ( !($result = $db->sql_query($sql)) ) {
  message_die(GENERAL_ERROR, "Could not obtain posts information", '', __LINE__, __FILE__, $sql);
}

$thanked_post_count = $db->sql_fetchrow($result);
$db->sql_freeresult($result);

$thanks_given = $user_row['user_thanks_given'];
$thanks_received = $user_row['user_thanks_received'] . ' ' . $lang['Thanks_thanked_2'] . ' ' . $thanked_post_count['thanks_count'] . ' ' . $lang['Thanks_thanked_3'];

}
else {
   $thanks_given = "";
   $thanks_received = "";
}

//
// End Thank Post by User Mod
//

Find

Code: Select all

'INTERESTS' => ( $profiledata['user_interests'] ) ? $profiledata['user_interests'] : '&nbsp;',
After Add

Code: Select all

        'THANKS_GIVEN' => $thanks_given,
        'THANKS_RECEIVED' => $thanks_received,
Find

Code: Select all

'L_INTERESTS' => $lang['Interests'],
After Add

Code: Select all

        'L_THANKS_GIVEN' => $lang['Thanks_thanks'],
        'L_THANKS_RECEIVED' => $lang['Thanks_thanked_1'],

Open templates/subSilver/profile_view_body.tpl

Find

Code: Select all

                <tr>
                  <td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_INTERESTS}:</span></td>
                  <td> <b><span class="gen">{INTERESTS}</span></b></td>
                </tr>
After Add

Code: Select all

                <tr>
                  <td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_THANKS_GIVEN}:</span></td>
                  <td> <b><span class="gen">{THANKS_GIVEN}</span></b></td>
                </tr>
                <tr>
                  <td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_THANKS_RECEIVED}:</span></td>
                  <td> <b><span class="gen">{THANKS_RECEIVED}</span></b></td>
                </tr>

User avatar
Laubi
Registered User
Posts: 3
Joined: Tue Apr 24, 2007 6:36 pm
Location: Köln die Schönste Stadt am Rhein
Contact:

Re: [BETA] Thank Post by User 0.2.5a

Post by Laubi » Fri Apr 27, 2007 8:29 pm

THX THX alexi,

that is which I wanted, I have a German translation for your MOD

Code: Select all

#-----[ OPEN ]---------------------------------
#

language/lang_german/lang_main.php

#
#-----[ FIND ]---------------------------------
#

?>

#
#-----[ BEFORE, ADD ]---------------------------------
#

//
// Start Thank Post by User Mod
//

$lang['Thanks_title'] = 'Danke für den nützlichen Beitrag';
$lang['Thanks_text'] = 'Sage diesem user Danke für seinen nützlichen Beitrag.';
$lang['Thanks_thanked_by'] = '<b>Folgende Benutzer sagen Danke</b>';

$lang['Thanks_thanks'] = 'Danksagungen';
$lang['Thanks_thanked_1'] = 'Erhielt';
$lang['Thanks_thanked_2'] = 'Danksagungen für';
$lang['Thanks_thanked_3'] = 'Beiträge';

$lang['Thanks_not_logged_in'] = 'Du bist nicht eingeloggt.';
$lang['Thanks_no_post_specified'] = 'Es wurde kein Beitrag ausgewählt.';
$lang['Thanks_no_such_post'] = 'Der gewählte Beitrag existiert nicht.';
$lang['Thanks_anonymous'] = 'Du kannst dich nicht für einen anonymen Beitrag bedanken.';
$lang['Thanks_self'] = 'Du kannst dich nicht für deinen eigenen Beitrag bedanken.';
$lang['Thanks_already_thanked'] = 'Du hast dich für diesen Beitrag bereits bedankt..';
$lang['Thanks_success_1'] = 'Du hast dich erfolgreich für den Beitrag von';
$lang['Thanks_success_2'] = 'im Thema';
$lang['Thanks_success_3'] = 'bedankt.';
$lang['Thanks_success_back'] = 'Wenn du nicht warten kannst oder dein Browser die Weiterleitung nicht unterstützt, klicke bitte hier.';
$lang['Thanks_success_redirect'] = 'Du wirst in 5 Sekunden zum Thema weitergeleitet.';


//
// End Thank Post by User Mod
//

Post Reply

Return to “[2.0.x] MODs in Development”