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)

Logik 08-13-2004 07:16 PM

Im workin on the top 5 emcees right now.

Logik 08-13-2004 07:18 PM

ok, open up index.php, and anywhere in there, add this code:
Code:

// top5emcees
$best = $DB_site->query("SELECT userid, username, bs_wins, bs_loses FROM user ORDER BY rank DESC LIMIT 5");
while ($besttop = mysql_fetch_array($best)):
        ++$besttopnbsp;
  $count=$count+1;
$rat = ($besttop[bs_wins] * 3) - ($besttop[bs_loses]);

$ranking = $DB_site->query_first("SELECT rank FROM user WHERE username= '".$bbuserinfo[username]."'");
$ratio .="$rat<br>";
$bestbattler .= "$count <a href=http://www.flowsession.net/forum/member.php?u=$besttop[userid]>$besttop[username]</a> ($besttop[bs_wins]/$besttop[bs_loses])<br>";
   
$DB_site->query("UPDATE user SET rank = $rat WHERE username = '".$bbuserinfo[username]."'");       

endwhile;

Go to your templates, and whereever u want it to show up, add:
Code:

<br>
<if condition="$bbuserinfo['userid']">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="thead" width="100%" valign="top">
<normalfont><b>Top 5 Emcees</b></normalfont></td>
</tr>
<tr><td>
$bestbattler</td>

</tr>
</table>
</if>
<br>

I believe thats it.. That shows the ranking, name, and battle. It sorts by ranking.. ( i used a simple formula for ranking). Im havin trouble gettin the rankin in the postbit, it doesnt show up for some reason.. so ifa nyone wants to help with that, then feel free.

Battle_Ring 08-13-2004 10:51 PM

^ I keep getting a database error...

Invalid SQL: SELECT userid, username, bs_wins, bs_loses FROM user ORDER BY rank DESC LIMIT 5
mysql error: Unknown column 'rank' in 'order clause'

Logik 08-13-2004 11:30 PM

oo yea lol... in your phpmyadmin, add the row "rank" to your user table.. my fault

str8ballin 08-15-2004 12:38 AM

Quote:

Originally Posted by C.Birch
its killing everyday poll's for me

when voteing on a everyday poll you get the error screen, but your vote goes on the poll but it closes the poll.

error:

Database error in vBulletin 3.0.3:

Invalid SQL: UPDATE user SET bs_wins = bs_wins + 1 WHERE username = 'Who's David?'
mysql error: 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 's David?'' at line 1

mysql error number: 1064

Date: Friday 13th of August 2004 10:23:25 AM
Script: http://community.ultimate-music.net/poll.php
Referer: http://community.ultimate-music.net/...06257&posted=1
Username: CarlBirch
IP Address: 217.43.193.87

i have removed the edit from poll.php for now.

I too am experiencing this error, I get

---------
Database error in vBulletin 3.0.1:

Invalid SQL: UPDATE user SET bs_wins = bs_wins + 1 WHERE username = 'He's finished'
mysql error: 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 's finished'' at line 1

mysql error number: 1064
----------

Seems the exact same error.

If I get this runnin without any errors I will be very grateful for this hack and appreciate MindTrix sharin this with us.

influence 08-15-2004 03:12 PM

hey mindtrix, thanks for this. even though this looks like the one given to me but the 2.2 one without the quote fav line part but I might use this ONLY if its BUGS FREE

also suggested features... maybe the KO addon ( only if i know PHP then I can code a simple ... if vote result = 5-0 then add point to field 3 with feild one being win and field 2 being lose ).

also maybe a battle record statistic to show all past battles and who that member battle.

since this is free, I can't give out my other ideas since it might take a while to do those but both of those should be something easy to do

Romeos Tune 08-16-2004 02:19 AM

Ok.... I'm having a problem if someone tries to quote a line with a ' in it. Like in he'll or we're. Somehow we need to add something in the code that will allow punctuation marks..... Here's the error:

Invalid SQL: INSERT INTO vb3_battlesys_favlines VALUES ('', 'Ask 5 minute HH, I bet he'll agree', 'Storm', '38')
mysql error: You have an error in your SQL syntax near 'll agree', 'Storm', '38')' at line 1

mysql error number: 1064

I'll try and find this but I'm just learning this stuff so my chances aren't good...... :D

Romeos Tune 08-16-2004 02:23 AM

btw..... This is in the modification to the file "newreply.php"

Liquid1ce 08-17-2004 01:48 AM

i dont think they are supporting it anymore ????

shame this could have been a great hack

Romeos Tune 08-17-2004 04:00 AM

No doubt a shame..... My users are going crazy for it but I'm gonna have to uninstall it... And my site isn't even a music site... lol

MindTrix 08-17-2004 07:54 AM

I dont think i clicked the thing to say that i was giving support for the hack ;) At the moment im swamped with work and other things, but i will post bug fixes as soon as i can get the time to fix them. Sorry. Should be soon hopefully

Liquid1ce 08-17-2004 10:16 AM

would it not be better to clone the poll & make it for the battle system then you can change the POLL: bit to say Battle: etc

Virulent1 08-17-2004 09:24 PM

got it installed ... and as for u the person below me.. :devious: stfu

influence 08-17-2004 09:38 PM

^ maybe if you reply with a respectable comment or in a matured way without all that foul language then maybe I can help u

BTW, thank you mindtrix, I will be waiting for the fixes an also maybe Hopefully those 2 features I suggested

Sean S 08-17-2004 09:56 PM

Quote:

Originally Posted by influence
^ maybe if you reply with a respectable comment or in a matured way without all that foul language then maybe I can help u

BTW, thank you mindtrix, I will be waiting for the fixes an also maybe Hopefully those 2 features I suggested

thank you so much for such an awsome hack. I would like to ask you this, don't know if this would be a feature request/addon or anything but it would be greatly appericiated if you could help.

Would it be possible to insert images as well too? By that I mean, have the option that selects the "favorite part of the battle" to use images or [IMG] tags? thank you.

moley 08-21-2004 09:14 PM

has anyone tried this hack with vb3.0.1? I want to add it but i'm to busy atm to upgrade my forums.

influence 08-22-2004 05:22 PM

have too many bugs in it. i would wait until he finish fixing it

Flow Fusion 08-23-2004 11:29 PM

So far so good. Thanks alot I'm really glad for this. Now that I have said thank you for the hard and free work I'll make a request.

Matter of fact I was just wondering if I remove the new reply and new thread template edits as well as the index.php edits will this hack still work?

I want members to have all types of battles and the info to just update on their postbit. That's all I would like from this hack but I don't want to edit and it not work.

Again thank you for the hack and your time.

donBLACK 08-24-2004 12:38 PM

Database error in vBulletin 3.0.1:

Invalid SQL: SELECT * FROM vb3_battlesys_favlines ORDER BY RAND() LIMIT 1
mysql error: Table 'kwash_forum.vb3_battlesys_favlines' doesn't exist

mysql error number: 1146

i keep gettin this...i did everything over and over lol...but i keep gettin a database error

Liquid1ce 08-26-2004 08:44 AM

Any updates or have you all gone private on this?

J-TEK 08-26-2004 09:24 PM

Theres only been one release so far right?

aranthorn 08-30-2004 06:21 PM

I had this installed, but had to take it out. It would close any poll after a user voted. Strange...

Romeos Tune 08-30-2004 07:17 PM

Same thing on my site.... They really liked it too...

THE REAL BLAZE 09-06-2004 10:59 PM

Quote:

Originally Posted by donBLACK
Database error in vBulletin 3.0.1:

Invalid SQL: SELECT * FROM vb3_battlesys_favlines ORDER BY RAND() LIMIT 1
mysql error: Table 'kwash_forum.vb3_battlesys_favlines' doesn't exist

mysql error number: 1146

i keep gettin this...i did everything over and over lol...but i keep gettin a database error



You need to run ALL the queries in the RBS file in the download. That should do it.

i am willing to help write features for this hack....

Romeos Tune 09-18-2004 02:36 PM

Is there one of these somewhere that you can pay for?

kisersose 09-28-2004 02:32 AM

i was looking forward to this too... to bad I didn't seen all these bugs until after I've installed it.

to bad, could be a dope hack if you can fix the minor bugs

???`S?LV?R???` 10-05-2004 04:01 AM

Yeah, that's what I heard about this hack too... that's basically what's been keeping me from installing it.

Gio 10-12-2004 03:09 PM

This is too cool. I didnt even know I needed this until I saw it.

KingPooky 10-16-2004 06:29 PM

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!

James T Brock 10-16-2004 07:44 PM

I was going to install this until I saw all the bugs! Still, great job by the author for offering this for free. But hopefully someone can either update this hack or another author can use this to make another one with perhaps more features?

Pro 10-21-2004 12:45 AM

Any future releases???

i'd be willing to help out if you need it MindTrix...

i'll take it and install it - see what comes out... any add-ons or bug fixes i come up with - i'll keep you informed...

thanks for the hack!

James T Brock 10-21-2004 01:03 AM

Pro, I think the original author got frustrated and abandoned the project. If you could improve on his script, I think most people, the original author included, would be greatly appreciative!

Pro 10-21-2004 03:11 AM

hmmm... there's been like 160 Downloads and only 39 installs???

CLICK INSTALL!!! GIVE PEOPLE CREDIT!

If you don't click Install people won't be helping out with this System!

Romeos Tune 10-21-2004 03:13 AM

That's because people have had to uninstall the hack because of errors........ :D

Pro 10-21-2004 03:13 AM

Quote:

Originally Posted by James T Brock
Pro, I think the original author got frustrated and abandoned the project. If you could improve on his script, I think most people, the original author included, would be greatly appreciative!

Yeah, i'm currently testing it on thesirkle.com...

hopefully i'll have some good additions, bug fixes, etc. within the next week.

i'm taking a big risk with it on my site as a live hack - but oh well... i'm also testing it myself on another site as well... private site... hopefully i can get some bugs out, make it better, etc.

ANY ADDITIONS you guys would want - let me know... i can only try - but hopefully i'll get it!

:squareeyed:

Pro 10-21-2004 03:14 AM

Quote:

Originally Posted by Romeos Tune
That's because people have had to uninstall the hack because of errors........ :D

I havn't found any errors yet... can you enlighten me? i know the POLL was one - but someone threw a fix for that up already...

Romeos Tune 10-21-2004 03:20 AM

You can read through the thread and see.... Let's see..... I had one where it wasn't updating the losses and couldn't figure out why..... I didn't try the poll fix 'cuz I just figured I'd wait 'til it's final or I start seeing positive feedback....

James T Brock 10-21-2004 10:28 AM

Quote:

Originally Posted by Pro
ANY ADDITIONS you guys would want - let me know... i can only try - but hopefully i'll get it!

(1) Needs KO's along with wins and loses.

(2) A better stats system so that it counts top 10 users, who has the most KO's, most loses, best win percentage.

(3) I've seen the script in action and have it downloaded, but have been reluctant to install it on my forums until the original author (or someone else) is willing to support it. Does the current script allow the amount of votes to be set to any number we want, or does it have to stay at five? I want to be able to set it at twenty votes.

DaPro 10-22-2004 11:15 PM

Could you make it so, that if you install this hack for a forum that has child forums that it works in also those child forums. Make it an option tho because I am sure not all people want it like that, could just be me :).

James T Brock 10-31-2004 02:45 AM

Is anyone at all still working on this thing? I posted a paid request in the services forum, and no-one took me up on my offer to recieve money just for modifying this code for a few simple custom features.


All times are GMT. The time now is 07:40 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.01899 seconds
  • Memory Usage 1,872KB
  • 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_code_printable
  • (2)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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