Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > Premium Archives > RPG Integration Hack
a few questions about user ids in battle.php Details »»
a few questions about user ids in battle.php
Version: , by Chief Corn Chief Corn is offline
Developer Last Online: Jan 2018 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 03-16-2005 Last Update: Never Installs: 0
 
No support by the author.

our battles are set to public and i'm sure logging into battles is determined by user id, so is there any reason for the password field when creating a battle? i was thinking of just making it a hidden input type. but if people were to view the source of the page and retrieve for example value="nopassword" would they be able to login? if i was to remove it completely from the form would it process correctly?

and in the browse battles page i'm trying to get the user ids. what i'm trying to do is make the user's names in the battles in progress a link so when you click it it opens rpg.php?userid= in a pop up window showing their stats.

Show Your Support

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

Comments
  #2  
Old 03-17-2005, 07:07 AM
Revan's Avatar
Revan Revan is offline
 
Join Date: Jan 2004
Location: Norway
Posts: 1,671
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The password function, at the best of my imagination at the time of writing this, used for added security. URL/form spoofs are always a risk, so there's no reason why it can't be in there.
I believe removing it would mean heavy altering of the battle files (possibly all 3 of them), and template changes.
You are welcome to attempt this yourself, but be warned; I cannot provide support for errors caused of modifications to the code for obvious reasons. Always make backups

I believe you can use $owner[userid] and $opponent[userid] to generate links out of their respective names (which is which is easy to spot in the template).
I have to wonder, why would you want to generate such links, when all stats displayed in the rpg.php (apart from Battle Statistics) are displayed in the battle template itself?
If there's a valid reason for this, I would consider adding it to the next version, see
Reply With Quote
  #3  
Old 03-17-2005, 08:02 AM
Chief Corn Chief Corn is offline
 
Join Date: Nov 2002
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the password deal i'll play around with it a bit. i just want one less thing to fill out.

this is the rpg_battle_browsemiddle template. those were the ones i used in the template but they don't output anything. if you could picture what's happening in this html, it's trying to make the names clickable so you could compare the challengers and opponents stats with a click.

HTML Code:
        <tr><td align="center"><b>$row[battlenumber]</b> </td>
	<td width="20%" align="center"><a href="http://www.treethugs.com/forum/rpg.php?userid=$owner[userid]" onclick="window.open('http://www.treethugs.com/forum/rpg.php?userid=$owner[userid]','popup','width=300,height=290,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=50,top=50'); return false">$row[owner]</a> </td>
	<td width="20%" align="center"><a href="http://www.treethugs.com/forum/rpg.php?userid=$opponent[userid]" onclick="window.open('http://www.treethugs.com/forum/rpg.php?userid=$opponent[userid]','popup','width=300,height=290,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=50,top=50'); return false">$row[opponent]</a> </td>
                <td width="20%" align="center">$gamestate </td>
                <td width="20%" align="center">$$row[wager] </td>
                <td width="20%" align="center">$turn </td>
<td width="20" align="center"><a href="battlefight.php?do=enterbattle&battlenumber=$row[battlenumber]">view</a></td>
</tr>
the reason i want to be able to see the stats of challengers and opponents is to make it easier for my users on who to bet on the battles used in conjunction with the hack vBookie. i'll make that a suggestion after you get your rpg hack out of beta...for users to be able to bet on the fights. so after creating the battle have it automatically kick out the betting thread (like vBookie if you tried that hack), which would also act as the battle report when it's over. it would make a good pre/post battle conversation. as of right now i'm just doing everything manually, problem is when i'm not around for the battle... i don't know what happened. ;P

you'll also see a few other things i'm trying to add to the battle browse page. like brining the top 10 players on there, settled bookie events, etc. i just can't figure out how to make them show...

the link to see what it is i'm trying to do:
site: http://www.treethugs.com/forum/battle.php?do=browse
user: vBorg
pass: test
Reply With Quote
  #4  
Old 03-17-2005, 08:10 AM
Revan's Avatar
Revan Revan is offline
 
Join Date: Jan 2004
Location: Norway
Posts: 1,671
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It doesn't work because I assumed you meant inside the battle, not on the browse page.
When I get home (~4h) I'll see about giving you the code to add to be able to fetch the userid of the participants

As for the vBookie integration, I have never touched that hack and I don't plan to, so if you can get the stuff working OK you could always release it as an addon here on vBorg
Reply With Quote
  #5  
Old 03-17-2005, 02:06 PM
Cyricx Cyricx is offline
 
Join Date: Aug 2002
Location: Missouri
Posts: 1,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

O wow, I hadn't even thought of integrating with Vbookie, awesome idea Chief!

I hope you'll release it if you get it
Reply With Quote
  #6  
Old 03-17-2005, 02:06 PM
Revan's Avatar
Revan Revan is offline
 
Join Date: Jan 2004
Location: Norway
Posts: 1,671
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

use $row[ownerid] and $row[opponentid] to have the JScript work
Reply With Quote
  #7  
Old 03-17-2005, 03:04 PM
Chief Corn Chief Corn is offline
 
Join Date: Nov 2002
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Revan
use $row[ownerid] and $row[opponentid] to have the JScript work
weeeeeeee. it works, thank you for that.

i have removed the password field from the form, and as well as from the auto PMs sent. i setup a battle me vs vBorg. then created another test account to see if i could log in as a differnt user with the correct battle # and password, and it didn't work. i also tried the url with the battle # and password, and that didn't login either. so it should be fine since i removed the login and password from the rpg_battle_browse template, unless there's other ways of logging in.

cyricx, well integrating vbookie isn't going to be easiest thing for me to do. :nervous: i don't know php...but i do know how to cut and paste. so it's just trial and error hoping it spits something out to html. i'll release my findings but it won't be the most efficient code... :lick:
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 11:04 AM.


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.06054 seconds
  • Memory Usage 2,262KB
  • Queries Executed 20 (?)
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
  • (1)bbcode_html
  • (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
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (6)postbit
  • (7)postbit_onlinestatus
  • (7)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete