The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Pull data from XML and put in postbit?!
OK, I'm completely lost. But I know this is simple stuff for you guys. I have a Age of Mythology Clan site, and I want to put the users rating into the postbit, under their name.
I think I've found out how to access this rating, which is ever-changing by going here: http://aom.stats.zone.msn.com/AOM_RC0/query/query.aspx?<?xml version="1.0"?><clr><cmd v="query"/><co g="AOM_RC0" s="100" z="1.0.3"/><qer id="ESO.Query.Example.68.184.73.72" np="0" nn="0" si="0" en="GX_Iron" et="ZS_Human" md="ZS_Lightning" rn="ZS_TopPlayers" tp="ZS_AllTime"/></clr> In the example above, GX_Iron should be a variable ($post[field5]) . My problem is how do I extract the field (parse?) "primaryrating" from the above resulting XML(link has the XML) and place(print?) it in the postbit? I've searched everywhere for this, but can't find a simple answer. Please help. Thanks, /DJ |
#2
|
||||
|
||||
$post[field5] should show profile field 5.
|
#3
|
|||
|
|||
OK, but what I really need is some php code to place the rating into the postbit.
|
#4
|
|||
|
|||
Here are some XML parsing functions if it helps: http://www.php.net/manual/en/ref.xml.php
|
#5
|
|||
|
|||
Ive read that as well as serveral others. Im beginning to understand some of it, but I don' know how to code php. If I had a sample bit of code, I know enough to be able to edit the code, but I certainly cannot write the code from scratch.
|
#6
|
||||
|
||||
to print stuff out on the page in php do
PHP Code:
|
#7
|
|||
|
|||
ok, but what I want to "print" is in an XML file at that link. How do I take "primary rating" out of the XML file and "print" that?
|
#8
|
|||
|
|||
OK, below is some code that takes the "rating" off that page.
PHP Code:
2 things: 1- What extranious things can I remove from that code, so its more streamlined? Can I 86 the microtime stuff? 2- Where in global.php should I put the finished code, so that I can pull $rating and have it show up wherever I put that variable? Thanks alot for the help guys. /DJ |
#9
|
|||
|
|||
*bump*
|
#10
|
||||
|
||||
Are you trying to do this every post? This is going to slow you down A LOT I would think. Maybe you should make some sort of script to run once a day to grab the rankings and put them in a user field.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|