The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
DataManager: How to add a user to another user's Ignore List?
Hello,
How can you add a user to another user's Ignore List using either the DataManager or one of the vBulletin functions accessible via global.php ? Thanks! |
#2
|
|||
|
|||
I think it can be done using the datamanager, but when it's done from the user profile it seems the code boils down to this:
Code:
$ignoring_userid = X; $ignored_userid = Y; $vbulletin->db->query_write("INSERT IGNORE INTO " . TABLE_PREFIX . "userlist (userid, relationid, type, friend) VALUES ($ignoring_userid, $ignored_userid, 'ignore', 'no') "); build_userlist($ignoring_userid); (a couple of lines from profile.php, the if ($_POST['do'] == 'doaddlist') section around lines 672 and 798). |
#3
|
|||
|
|||
Quote:
|
#4
|
|||
|
|||
Well, it looks like ignored users are kept in two places - one is in the ignorelist column of the usertextfield table. That one can be set using the datamanager. The other one is the userlist table, like is being set by the query posted above. It turns out that build_userlist() takes care of setting the ignorelist via the datamanager, so you'd still have to do a query to create a row in usertextfield.
|
#5
|
|||
|
|||
Quote:
If so, then what is the DataManager code we need to use on top of the query code you already provided? Thanks again, kh99, you're a huge help around here. Your prompt and thorough responses are always appreciated. |
#6
|
|||
|
|||
build_userlist() takes care of the datamanager part. If you want to see that code you can look at includes/functions_databuild.php. Since the lists set by the user datamanager are comma-separated lists, if you're adding one userid to a list you have to get the existing list first then build a new list with the added value. Or do like build_userlist() does and query the userlist table to rebuild the comma-separated lists (hope that makes sense).
By the way, since you're only talking about the ignore list, I think you can save some work by callling build_userlist() like this: Code:
build_userlist($ignoring_userid, array('ignore')); If you leave off the second parameter it will build all lists. |
#7
|
|||
|
|||
Quote:
PHP Code:
Is that correct? |
#8
|
|||
|
|||
I believe that represents everything you need to do to add a user to another user's ignore list, based on looking at the code that does it from the profile. But I haven't actually tried it myself.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|