vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Threads/Posts to add/remove reputation (https://vborg.vbsupport.ru/showthread.php?t=237007)

Thr33 02-27-2010 05:00 AM

Threads/Posts to add/remove reputation
 
Hey, on an old VBulletin forum board i used to moderate for they had a system set up where creating a thread would gain a user 1 reputation point, and posting a reply would deduct 1 reputation point. This was only active in a certain category. Does anyone know how to do this?

Videx 03-02-2010 01:55 AM

I am unaware of a mod that would do it. Sounds like a silly idea. Discourage people from responding to threads???

Thr33 03-03-2010 02:02 AM

i run a site where we have shares. i would to require them to keep a share ratio and to do this have 20 reputation to access the shares category. when you post a new thread (share) you are granted a reputation credit, when posting a post/reply (enabling hide hack function to reveal hidden content) it will cost you a rep credit.

understand what i mean? it wouldnt be a product, it would have to be a template edit.

Thr33 03-04-2010 08:37 AM

someone must know the template edit to add reputation on new thread???

ChopSuey 03-04-2010 12:02 PM

Have you checked the reputation settings? AdminCP > User Reputation ?

Thr33 03-04-2010 03:00 PM

yea ive looked around in all the user reputation areas and no options for what im looking for. looks like im gunna have to spend a good few hours studying the functions_reputation.php and try to duplicate the addreputation into newthread :(

Videx 03-04-2010 03:13 PM

I don't think the reputation system is what you want for this; it just wasn't designed with this in mind. Have you looked at other mods, like the various "thank you" hacks?

Just seems to me it would be easier to code this from the start than to try to mangle the rep system.

Thr33 03-05-2010 05:04 AM

i assumed it should really be as simple as grabbing the code from the form buttons where you add positive and negative reputation... but i cant seem to find the actual code that increases/decreases the rep level by one.. surely cant be as hard as im making it out...

djdrey 04-15-2010 10:11 PM

I'd say you should be able to do this with a 2 plugins.. One after newthread and another on reply.. That said, looking at the code, it seems like all the repuation add is handled in reputation.php, so you'd have to duplicate some of that code rather than call functions etc, which is a bit sucky (I'm still on 3.6.x, so later versions might vary).

eg.. this bit from reputation.php seems to do the adding
PHP Code:

    // init user data manager
    
$userdata =& datamanager_init('User'$vbulletinERRTYPE_STANDARD);
    
$userdata->set_existing($userinfo);
    
$userdata->set('reputation'$userinfo['reputation']);
    
$userdata->set('reputationlevelid'intval($reputationlevel['reputationlevelid']));

    (
$hook vBulletinHook::fetch_hook('reputation_add_process')) ? eval($hook) : false;

    
$userdata->pre_save();

    
/*insert query*/
    
$db->query_write("
        INSERT IGNORE INTO " 
TABLE_PREFIX "reputation (postid, reputation, userid, whoadded, reason, dateline)
        VALUES (
$postid$score$userid, " $vbulletin->userinfo['userid'] . ", '" $db->escape_string(fetch_censored_text($vbulletin->GPC['reason'])) . "','" TIMENOW "')
    "
); 



All times are GMT. The time now is 05:39 PM.

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.01014 seconds
  • Memory Usage 1,733KB
  • 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
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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