#1
|
|||
|
|||
PM URLs
As best I can find, the URL for sending a private message is always:
http://forumserver.twoplustwo.com/se...amp;User=XXXXX Where XXXXX is the User ID number. I was wondering if there was any URL I could use that would send it to a specific user name instead of the ID number. Something like: http://forumserver.twoplustwo.com/sendprivate.php?Cat=0&Name='XXXXX' If there is not, is there some other method somebody could recommend? What is the easiest way to get somebody's user ID, if given only a username? I ask because I'm hosting a website that I want people to be able to PM various users through. |
#2
|
|||
|
|||
Re: PM URLs
Hi Big_Jim,
If you ckick on someone's 2p2 name (to view their profile) there is a user=XXXXX string in the url there - e.g. you are "User=25427" - is this the same user ID as you are looking for? dave. |
#3
|
|||
|
|||
Re: PM URLs
Dave,
Yeah, that's the User ID that I'm looking for, but what I really want is an easy way to automatically retrieve somebody's user ID, given a username. The way that I want the website to work is to have usernames listed in a column on a table, and have a link to "PM User". Ideally, the page would just pull their userid off of 2+2. Otherwise, I'll just have to do it manually, which isn't really a big problem, but it would be easier, the other way. I'm working in php, if somebody has a suggestion. |
#4
|
|||
|
|||
Re: PM URLs
Well you could write a script (PERL, PHP, whatever - I'd use AutoHotkey [img]/images/graemlins/smile.gif[/img] ) to HTTP get the profile pages for each user id and then parse them to extract the username, save results to a PHP include file on your server, and have php load them into an asociative array for quick lookup on your site.
Run the script every few days to update the include file with new users if need be. First run might take a while, but subsequent runs would be no worse than a regular poster refreshing a few 10s of threads each day (NB I have no idea how many users actually join 2p2 each day) dave. |
#5
|
|||
|
|||
Re: PM URLs
Is there an easier way to get a users profile, than to use the search function on their username, and then click on their name, in one of the results?
|
#6
|
|||
|
|||
Re: PM URLs
The easiest way would be to run an SQL query on the database behind the forums, I'd imagine only Chuck and maybe Ryan could do this for you. Maybe any red can, I don't know... I suggest asking one of them [img]/images/graemlins/smile.gif[/img] It would be a whole lot nicer to the servers than a script retriving what ~10K pages? (I also have no idea how many users there are in total).
Of course if your desired list is quite short you could just get the IDs manually by as you say searching their name and grabbing the ID from the results. I can think of no easier manual method than this, sorry. Maybe you greens have an easier method, I don't know what tools you have available for user finding as a mod. I'd speak to a red, probably the best option. Even if they can't directly help (by running SQL on the database), I'd want to know how frequently a script could be set to fetch pages before it is considered "abuse". Running as fast as your connection supports, depending on your connection, could cause an unreasonable increase in load on the servers the reds would not be pleased with. Maybe a crawler type script is causing the frequent 2p2 outages I have been experienbcing here over the last few days - or maybe my ISP is falling apart lol. Roughly how many names do you want IDs for? dave. |
#7
|
|||
|
|||
Re: PM URLs
[ QUOTE ]
I also have no idea how many users there are in total... [/ QUOTE ] At the moment, 2+2 has 73,903 Registered Users, and climbing... |
|
|