vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=34)
-   -   Rap Battle System -=RBS=- (https://vborg.vbsupport.ru/showthread.php?t=68161)

Hades-1 11-19-2004 07:00 PM

Quote:

Originally Posted by KingPooky
First of all, I want to thank you for creating this hack. It's cool as hell, and best of all, easy to install.

For those of you who are having problems with normal, everyday polls being closed whenever someone votes, I believe I have found the solution.

Open POLL.PHP and find
PHP Code:

        //RBS
        
$battlesys $DB_site->query_first("SELECT * FROM " TABLE_PREFIX "battlesys_battles WHERE pollid = '".$pollinfo['pollid']."'");
        
$votestowin $battlesys['votestowin'];
        
$splitoptions explode("|||"$pollinfo['options']);
        
$maxvotes 0;
        
$leastvotes 0;
        foreach (
$splitvotes as $number => $vote)
        {
            global 
$maxvotes;
            global 
$leastvotes;
            global 
$splitoptions;
            if ( 
$vote $maxvotes ) {
                
$maxvotes $vote;
                
$winner $splitoptions[$number];
                global 
$winner;
            }
            if ( 
$vote $leastvotes or $vote == ) {
                
$leastvotes $vote;
                
$loser $splitoptions[$number];
                global 
$loser;
            }
        }
        if ( 
$maxvotes >= $votestowin )
        {
            
$DB_site->query_first("UPDATE " TABLE_PREFIX "poll SET active = '0' WHERE pollid = '".$pollinfo['pollid']."'"); //close poll
            //$winnerinfo = $DB_site->query("SELECT * FROM " . TABLE_PREFIX . "user WHERE username = '".$winner."'");
            
$DB_site->query("UPDATE user SET bs_wins = bs_wins + 1 WHERE username = '".$winner."'");
            
$DB_site->query("UPDATE user SET bs_loses = bs_loses + 1 WHERE username = '".$loser."'");
            
        }
        
//RBS 

And replace with
PHP Code:

        //RBS
        
$battlesys $DB_site->query_first("SELECT * FROM " TABLE_PREFIX "battlesys_battles WHERE pollid = '".$pollinfo['pollid']."'");
        if(
$battlesys)
        {
            
$votestowin $battlesys['votestowin'];
            
$splitoptions explode("|||"$pollinfo['options']);
            
$maxvotes 0;
            
$leastvotes 0;
            foreach (
$splitvotes as $number => $vote)
            {
                global 
$maxvotes;
                global 
$leastvotes;
                global 
$splitoptions;
                if ( 
$vote $maxvotes ) {
                    
$maxvotes $vote;
                    
$winner $splitoptions[$number];
                    global 
$winner;
                }
                if ( 
$vote $leastvotes or $vote == ) {
                    
$leastvotes $vote;
                    
$loser $splitoptions[$number];
                    global 
$loser;
                }
            }
            if ( 
$maxvotes >= $votestowin )
            {
                
$DB_site->query_first("UPDATE " TABLE_PREFIX "poll SET active = '0' WHERE pollid = '".$pollinfo['pollid']."'"); //close poll
                //$winnerinfo = $DB_site->query("SELECT * FROM " . TABLE_PREFIX . "user WHERE username = '".$winner."'");
                
$DB_site->query("UPDATE user SET bs_wins = bs_wins + 1 WHERE username = '".$winner."'");
                
$DB_site->query("UPDATE user SET bs_loses = bs_loses + 1 WHERE username = '".$loser."'");
                
            }
        }    
        
//RBS 


This should fix that problem. Enjoy!


nobody said thank you for posting this so let me be the first

thank you!

Pro 11-24-2004 10:10 PM

started workin on this again...

i got the LOSSES to come up finally - now im starting on the KO's part... i think it might be easy... we'll see... im not a pro but i know enough to get stuff working!

:)

James T. Brock - if you see this hit me up on aim: thajoker714

Pro 11-24-2004 10:12 PM

P.S.

I'll post updates soon... just give me some time to test them... a few days or so... i should have the LOSS and K.O. updates for you all - then if i get to start on a new CHALLENGE system - i'll have MindTrix post the new updates in a zip file...

Pro 11-24-2004 10:34 PM

hmmm... while testing this on my site the person i "battled" (just for test purposes) ended up recieving 1 win out of 6 battles - although now i have 6 losses LOL... so i gotta look into this again... something's not right.

i've started looking into the Challenge system as well...

deb0 11-29-2004 02:37 AM

Has anyone tried to use this for other competitions like graphics, poetry, etc...?

Jmonto 11-30-2004 02:40 AM

is there a post limit that a user must have before being able to vote? also does it show who voted?

mopfool 12-01-2004 04:24 PM

I need some help :)

1) When trying to add a line that contains an apostrophe (') as a favorite (when posting a reply to a battle), I get a database error. Otherwise, it works fine.

2) This is a pretty general question. You can't select your favorite line in the quick reply box, so is there any way to turn off the quick reply box for just the rap battle forum and leave it on for all others?

Thanks,
mopfool=]

N1Co 12-05-2004 01:33 AM

Slashes don't get added on data submitted to the database (quotes (') don't get escaped), which is quite imortant :| !

dndog 12-05-2004 03:22 PM

I notice on the Rap Battle System, you added extra blanks to the postbit:

https://vborg.vbsupport.ru/attachmen...chmentid=20108

How could I just incorporate a few fields into my regular postbit?

That would be great!

-dndog

MajorFm.com 12-28-2004 01:42 AM

Just what i was looking for!! thanks man!!


All times are GMT. The time now is 12:02 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.01242 seconds
  • Memory Usage 1,774KB
  • 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)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete