Is it possible to replace a :smile: phrase throughout a DB with : ) (without the space obviously)????? I need to know because I imported posts from another (non VB) message board and all the emoticon "calls" are different than what I would like them to be. Is there any way I can replace all these in like 20,000 posts lol???
Also, this was a post only import, so all the usernames come up as userid=0. Are these names actually saved to any place that I could possibly individually add userid's to them?
I'm guessing the answer is no for both of these, but maybe somebody else has done this before? If anyone can offer any suffestions I'd appreciate it. THANKS! :classic:
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
k just ran it again (thinking it would work somehow) and it did sort of... but it did this:
Database error in vBulletin 2.2.9:
Invalid SQL: UPDATE post SET userid=5 WHERE userid=0 AND username=Dark Master
mysql error: You have an error in your SQL syntax near 'Master' at line 1
mysql error number: 1064
how do I delete user Id's? that last one seemed to make a user ID 5 which I don't want unless it is an actual user lol. any help? I don't want to just delete the user, but also the id, if that's possible.
hmm, shouldn't happen normally, but try this code instead..
PHP Code:
<?php
require('global.php');
$usernames=$DB_site->query("SELECT DISTINCT username FROM post WHERE userid=0");
while ($username=$DB_site->fetch_array($usernames)) {
//does user exist?
$user=$DB_site->query_first("SELECT userid FROM user WHERE username='".addslashes($username[username])."'");
if(intval($user[userid])==0) {
$DB_site->query("INSERT INTO user (userid,username,password,joindate) VALUES (NULL,'".addslashes($username[username])."',MD5('".addslashes($username[username])."'),".time().")");
$userid=$DB_site->insert_id();
$DB_site->query("INSERT INTO userfield (userid) VALUES ($userid)");
$DB_site->query("UPDATE post SET userid=".intval($userid)." WHERE userid=0 AND username='".addslashes($username[username])."'");
} else {
$DB_site->query("UPDATE post SET userid=".intval($user[userid])." WHERE userid=0 AND username='".addslashes($username[username])."'");
}
well the only thing is when clicking to go to the profile it still goes to this:
.../forums/member.php?action=getinfo&userid=0
so no profile and it also doesn't make the "post started a link." should it? if not then I guess this does work fine. just in case though, if I deleted the user then what querie would I run to update the user Id's and only have the original 4? so the next person who registeres would be 5, and so on? thanks.
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@"domain.com" and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
it was worth a try. thanks. it did work for that one user but then it didn't update the user information on old posts, like when I click the profile it still went to userid=0. i really don't think that this is possible :-/ lol. maybe it's just me and me lack of "knowing what I'm doing" but I guess the old users can just reregister lol. 3 mods already have (one under the same name as their old one) and when I open it to public, I can just leave a note in the registration pages about it. i don't wanna keep you here lol. thanks anyway. the search and replace hack you told me about was awesome. thanks.