Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Group php script
#11
(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
#12
Well, getting it from the user profile, is hard & slow
Yes I use vb.net & I want to display it in a listview
like
username
usergroup
postcount
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
#13
To be honest I would use XML Smile

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

<site>
     <user>
          <username>Tom</username>
          <usergroup>Admins</usergroup>
     </user>
</root>

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)
#14
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 vb.net in a long time now Wink
#15
Well, download the file locally and then read it using System.XML Smile there's plenty of documentation. Type "vb.net 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
#16
Well, I'll figure the reading XML myself

It's the php part I need help with.
Anyone?
#17
Here you go:

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

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

	$u = $doc->createElement("user");
	$doc->appendChild($u);
	
	$uid = $doc->createElement("uid");
	$uid->appendChild($doc->createTextNode($user['uid']));
	
	$name = $doc->createElement("username");
	$name->appendChild($doc->createTextNode($user['username']));
	
	$usertitle = $doc->createElement("usertitle");
	$usertitle->appendChild($doc->createTextNode($user['usertitle']));
	
	$postcount = $doc->createElement("postcount");
	$postcount->appendChild($doc->createTextNode($user['postnum']));
	
	$usergroup = $doc->createElement("usergroup");
	$usergroup->appendChild($doc->createTextNode($usergroupcache[$user['usergroup']]['title']));
	
	$u->appendChild($uid);
	$u->appendChild($name);
	$u->appendChild($usertitle);
	$u->appendChild($postcount);
	$u->appendChild($usergroup);
	
	echo $doc->saveXML();
}
?>

Works fine for me anyway Smile
#18
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.
<user>
<uid>1</uid>
<username>SergeMorel</username>
<usertitle>
<img src="/images/usertitles/admin.png" alt="Administrator"/>
</usertitle>
<postcount>29</postcount>
<usergroup>4</usergroup>
</user>

Now, can you make that with username ?
So I do myforum.com/userinfo.php?username=SergeMorel

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.
#19
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.
#20
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 !!!!!!!!!!


Forum Jump:


Users browsing this thread: 1 Guest(s)