vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Tieing the Thank You hack with Reputation (https://vborg.vbsupport.ru/showthread.php?t=80401)

teedizz 04-22-2005 10:45 PM

Tieing the Thank You hack with Reputation
 
is it possible to where when someone hits the tahnk you button, it adds to your reputation? Im willing to pay for the hack if need be but I have to see proff that you can make it work....contact me if you can do so

teedizz 04-28-2005 06:38 PM

bump...tha last coder couldnt do it

tnguy3n 04-28-2005 09:10 PM

Quote:

Originally Posted by teedizz
is it possible to where when someone hits the tahnk you button, it adds to your reputation? Im willing to pay for the hack if need be but I have to see proff that you can make it work....contact me if you can do so

actually, it's very easy. althou i don't have "thank you" hack install on my board, by looking at the hack, you can add a query to insert to reputation table and update reputation field in user table when a use click on thank you button.

Of course, you must have "thank you" hack installed.

FIND: (in newreply.php)

PHP Code:

$DB_site->query("
        INSERT INTO "
TABLE_PREFIX ."thanks
        (userid, username, date, threadid)
        VALUES ('
$bbuserinfo[userid]', '" addslashes($bbuserinfo[username]) . "', " TIMENOW ", '$threadid')"); 

BELOW, ADD:
PHP Code:

$getreplevel $DB_site->query_first("
        SELECT reputationlevelid
        FROM " 
TABLE_PREFIX "reputationlevel
        WHERE 
$posts[userid] >= minimumreputation
        ORDER BY minimumreputation
        DESC LIMIT 1
    "
);
    
$replevelid intval($getreplevel['reputationlevelid']);
$DB_site->query_first("
        UPDATE " 
TABLE_PREFIX "user
        SET    reputation = reputation+1,
            reputationlevelid = 
$replevelid
        WHERE userid = 
$posts[userid]
    "
);
$DB_site->query("
        INSERT INTO "
TABLE_PREFIX ."reputation
        (postid, userid, reputation, whoadded, reason, dateline)
        VALUES ('
$posts[postid]', '$posts[userid]', '0',  '$bbuserinfo[userid]', '', " TIMENOW ")"); 

it updates 2 table, user + reputation.

note that this add-on has not been tested.

Marco van Herwaarden 04-29-2005 03:54 AM

[sql]WHERE $posts[userid] >= minimumreputation [/sql]
I didn't have my coffee yet, but you are selecting records that have a minimumreputation less-equal then a userid?

(anyway the test should be the other way round "tablefield <= value".

teedizz 04-29-2005 07:39 AM

thank you tnguy3n ...i will try it out.....so when someone hits the thank you button it will add to your reputation then right? Thats what the changes you provided will do?

that hack isnt gonna work for my hack..cause my hack doesnt have the same stuff in that file

teedizz 04-30-2005 06:47 PM

bump


All times are GMT. The time now is 09:54 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01612 seconds
  • Memory Usage 1,734KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete