Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons

Reply
 
Thread Tools
Points Addon for Profile Comments Details »»
Points Addon for Profile Comments
Version: 1.00, by Reeve of shinra Reeve of shinra is offline
Developer Last Online: Jan 2015 Show Printable Version Email this Page

Version: 3.5.3 Rating:
Released: 02-15-2006 Last Update: 02-15-2006 Installs: 11
 
No support by the author.

Points add on for the Profile Commenting System coded by Danny.VBT

This small add on lets you add or deduct points for new profile comments. You can use this with ebux, ucash, or any other system by changing the table and field info in the variable below.

QUICK NOTE: If your actually using decimals, this may round off the users points to the nearest whole #.

This is more or less all I needed but the same code could probably be reused for editing and deleting comments as well. If you want to enchance this in any way, by all means feel free to do so.

Step 1: Create a new phrase
(admincp -> languages and phrases -> phrase manager -> add new phrase)

Phrase Type: front end error messages
Product: vbulletin
Varname: error_not_enough_points
Text: Sorry but you do not have enough points to complete this action.

Step 2: Edit the "[Comments] Add Comment" plugin
(admincp -> Plugin System -> Plugin Manager)

Step 3: Add this code at the very top.
  • Change the cost to whatever you would like. Negative #'s deduct points. Postive #'s add points.
  • Change the table and field your points are stored in. If your are using ebux and do not have a table prefix, leave it alone.

PHP Code:
    /* **** Begin Points Hack **** */
    
    // Lets define some variables. 
    
$cost = -10// use negative numbers to deduct points for adding a comment
    
    // Where are your points stored? This is a default ebux without table prefix.
    
$pointstable 'user';                         // This is the table where the points are stored 
    
$fieldx      'ebux';                        // This is the field where users points are stored
    
    /* **** End Points Hack **** */ 

Step 4: Look for this code in the plugin

PHP Code:
    $addcomment $db->query_write("INSERT into " TABLE_PREFIX "space_comments (comment_title, comment_text, comment_date,  commenter_id, userid, commenter_name)
                                            VALUES ('" 
$db->escape_string($vbulletin->GPC['title']) . "','" $db->escape_string($parsed_text) . "','" TIMENOW "','" $vbulletin->userinfo['userid'] . "', '" $vbulletin->GPC['u'] . "','" $vbulletin->userinfo['username'] . "')
                                          "
); 
Step 5: Below that, add the following

PHP Code:
    /***** Begin Points Hack *****/
    
    // OKAY NO MORE EDITING! Lets begin doing points stuff
    
    // Lets see how many points the user has to start with
    
$userpointsqry $db->query_first("
        SELECT 
$fieldx FROM $pointstable 
        WHERE userid = " 
$vbulletin->userinfo['userid'] . "
    "
);
    
    
$userpoints = (int) $userpointsqry 0;
    
    
//Lets do a quick check to see if they have enough points. 
    
    
if ($cost 0)
        {
        if (
$userpoints abs($cost))
            {
            eval(
standard_error(fetch_error('error_not_enough_points')));
            }
        }
    
    
// A little math to add/subtract the cost from the users existing points.
    
$amt $userpoints $cost;
    
    
    
// Lets update the users points now that they have made a comment
    
$db->query_write("
        UPDATE 
$pointstable SET
        
$fieldx =  '" $db->escape_string($amt) . "'
        WHERE userid =  " 
$vbulletin->userinfo['userid']   . "
    "
);
    
/***** End Points Hack *****/ 
Step 6: Save it and your done!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 02-16-2006, 04:28 AM
mholtum's Avatar
mholtum mholtum is offline
 
Join Date: May 2004
Location: Arizona
Posts: 697
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmmm I am not seeing Front End Error Messages..

Could be a problem..
Reply With Quote
  #3  
Old 02-16-2006, 08:34 AM
amizone143 amizone143 is offline
 
Join Date: Jan 2006
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

any screenshot bro
Reply With Quote
  #4  
Old 02-16-2006, 08:37 AM
Snake's Avatar
Snake Snake is offline
 
Join Date: Mar 2005
Location: Cleveland, OH
Posts: 3,832
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks man, this is quite nice as I've just installed eStore and removed uShop. lol
Reply With Quote
  #5  
Old 02-16-2006, 12:53 PM
Reeve of shinra's Avatar
Reeve of shinra Reeve of shinra is offline
 
Join Date: Oct 2001
Location: NYC
Posts: 1,896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

amizone143: nothing to take a screen shot of. This just adds/subtracts points, trying together to already existing and great mods.
Reply With Quote
  #6  
Old 02-16-2006, 01:56 PM
The Chief's Avatar
The Chief The Chief is offline
 
Join Date: Aug 2005
Location: Montreal
Posts: 1,037
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

lookin good, I will definaetly try this out later on, when Danny upgrades the comments system
Reply With Quote
  #7  
Old 03-04-2006, 02:06 PM
trackpads's Avatar
trackpads trackpads is offline
 
Join Date: Aug 2003
Location: Armyville
Posts: 1,074
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, got a problem, instead of adding the points it replaces the points on hand with the number that I said to add by.

Help!
Reply With Quote
  #8  
Old 03-04-2006, 02:20 PM
trackpads's Avatar
trackpads trackpads is offline
 
Join Date: Aug 2003
Location: Armyville
Posts: 1,074
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by trackpads
Ok, got a problem, instead of adding the points it replaces the points on hand with the number that I said to add by.

Help!
Also, still doing it, it takes the number I put in the hack (+10) and replaces the onhand points with that number +2.

Any ideas?
Reply With Quote
  #9  
Old 09-23-2006, 08:31 PM
vbreal vbreal is offline
 
Join Date: Dec 2005
Posts: 441
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i guess this didnt work to well
Reply With Quote
  #10  
Old 10-02-2006, 08:54 PM
vbreal vbreal is offline
 
Join Date: Dec 2005
Posts: 441
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

did this ever work?
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:50 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08164 seconds
  • Memory Usage 2,311KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete