MyBB Community Forums
Group php script - Printable Version

+- MyBB Community Forums (
+-- Forum: Community Archive (
+--- Forum: Archived Forums (
+---- Forum: Miscellaneous Archive (
+----- Forum: Requests/Services/Jobs 2 (
+----- Thread: Group php script (/thread-98192.html)

Pages: 1 2 3 4 5

RE: Group php script - Tom K. - 2011-07-07

(2011-07-07, 08:55 PM)SergeMorel Wrote: This is for a visual basic program, a loader.
I need it as simple as possible, not in a user profile, it's to hard to get.
& I pay nothing :s

Well, to my knowledge, I'm the Visual Basic guru here Toungue I assume you're using vb.NET?

Ok, a question:
- are you trying to gather info from the profile to display in the application?

If so, please reply and I'll help you further. I have done something much like this before Smile

RE: Group php script - SergeMorel - 2011-07-07

Well, getting it from the user profile, is hard & slow
Yes I use & I want to display it in a listview
etc ...

EDIT : getting the script & just split some things would be MUCH faster

EDIT 2 : going to get some sleep, I'll see if you answered tomorrow :p

RE: Group php script - Tom K. - 2011-07-07

To be honest I would use XML Smile

Then you can call the specific parameters when you need them:


It would be generated by the php, and then you can easily read it in vb.NET using the "system.XML" namespace.

If you want I can work on the code in the morning (it's late here - off to bed Smile)

RE: Group php script - Euan T - 2011-07-08

I can write you this in just a second. I do agree with the above post about XML though - it should be slightly more efficient and certainly more easy to do. Saying that, I haven't used in a long time now Wink

RE: Group php script - Tom K. - 2011-07-08

Well, download the file locally and then read it using System.XML Smile there's plenty of documentation. Type " read XML" and you get plenty of hits.

Then you should create a php script that outputs the data in an XML form (which I can also help with) Smile

RE: Group php script - SergeMorel - 2011-07-08

Well, I'll figure the reading XML myself

It's the php part I need help with.

RE: Group php script - Euan T - 2011-07-08

Here you go:

header ("Content-Type:text/xml"); 
define("IN_MYBB", 1);
require_once "./global.php";

	$user = get_user(intval($mybb->input['uid']));
	$usergroupcache = $cache->read("usergroups");
	$doc = new DOMDocument();
	$doc->formatOutput = true;

	$u = $doc->createElement("user");
	$uid = $doc->createElement("uid");
	$name = $doc->createElement("username");
	$usertitle = $doc->createElement("usertitle");
	$postcount = $doc->createElement("postcount");
	$usergroup = $doc->createElement("usergroup");
	echo $doc->saveXML();

Works fine for me anyway Smile

RE: Group php script - SergeMorel - 2011-07-08

Sweet, that works, gives me this output :
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<img src="/images/usertitles/admin.png" alt="Administrator"/>

Now, can you make that with username ?
So I do

Because I login in my program & then get the info with their username.
The usergroup number is pretty useless , but whatever.
Is there any other things you can add ?
Like posted threads & stuff.

RE: Group php script - Euan T - 2011-07-08

I can make it use the username no problem Smile I can add just about anything that's stored in the database - just name what you want.

RE: Group php script - SergeMorel - 2011-07-08

euhm :
Join Date
Total Threads
Post counts (already have)
Online Status
Members Referred
What he/she is doing now on the forum (Can be together with online status)
Last visit (If they didn't visit for 2 days, I want to prevent them using the loader)

& getting it with username
Thanks !!!!!!!!!!