Two Plus Two Newer Archives  

Go Back   Two Plus Two Newer Archives > Two Plus Two > About the Forums
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-08-2007, 10:01 PM
Big_Jim Big_Jim is offline
Senior Member
 
Join Date: Jan 2005
Location: BEHIND YOU
Posts: 12,323
Default 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.
Reply With Quote
  #2  
Old 01-09-2007, 12:11 AM
_dave_ _dave_ is offline
Senior Member
 
Join Date: Feb 2005
Location: UK
Posts: 2,628
Default 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.
Reply With Quote
  #3  
Old 01-09-2007, 12:58 AM
Big_Jim Big_Jim is offline
Senior Member
 
Join Date: Jan 2005
Location: BEHIND YOU
Posts: 12,323
Default 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.
Reply With Quote
  #4  
Old 01-09-2007, 01:16 AM
_dave_ _dave_ is offline
Senior Member
 
Join Date: Feb 2005
Location: UK
Posts: 2,628
Default 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.
Reply With Quote
  #5  
Old 01-09-2007, 01:30 AM
Big_Jim Big_Jim is offline
Senior Member
 
Join Date: Jan 2005
Location: BEHIND YOU
Posts: 12,323
Default 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?
Reply With Quote
  #6  
Old 01-09-2007, 10:51 PM
_dave_ _dave_ is offline
Senior Member
 
Join Date: Feb 2005
Location: UK
Posts: 2,628
Default 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.
Reply With Quote
  #7  
Old 01-10-2007, 03:20 AM
Sniper Sniper is offline
Senior Member
 
Join Date: Jun 2005
Location: Finance Forum
Posts: 12,364
Default 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...
Reply With Quote
Reply


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 -4. The time now is 06:03 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.