Convert server side paths to use /u/

This commit is contained in:
Robin Ward
2017-03-28 14:27:54 -04:00
parent 45a257815a
commit 14410b71fb
38 changed files with 82 additions and 80 deletions

View File

@ -194,7 +194,7 @@ begin
["categories", "/categories"],
["home", "/"],
["topic", "/t/oh-how-i-wish-i-could-shut-up-like-a-tunnel-for-so/69"]
# ["user", "/users/admin1/activity"],
# ["user", "/u/admin1/activity"],
]
tests = tests.map{|k,url| ["#{k}_admin", "#{url}#{append}"]} + tests

View File

@ -98,8 +98,6 @@ EOM
def import_users
puts '', "creating users"
username = nil
total_count = mysql_query("SELECT count(*) count FROM #{TABLE_PREFIX}userdata WHERE last_login > '#{IMPORT_AFTER}';").first['count']
batches(BATCH_SIZE) do |offset|
@ -404,7 +402,7 @@ EOM
User.find_each do |u|
ucf = u.custom_fields
if ucf && ucf["import_id"] && ucf["import_username"]
Permalink.create( url: "#{BASE}/user-id-#{ucf['import_id']}.html", external_url: "/users/#{u.username}" ) rescue nil
Permalink.create( url: "#{BASE}/user-id-#{ucf['import_id']}.html", external_url: "/u/#{u.username}" ) rescue nil
print '.'
end
end