mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
working profile and editing of profile
This commit is contained in:
1 parent
5072a31aab
commit
9fe4cf0188
27 files changed
+459
-51
No files matched your search
@@ -270,4 +270,10 @@ AddEventHandler('onResourceStop', function(resource)
|
||||
ClearPedTasks(GetPlayerPed(-1)) -- Leave here until launch as it'll fix any stuck animations.
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
|
||||
|
||||
Citizen.CreateThread(function()
|
||||
Citizen.Wait(0)
|
||||
Phone()
|
||||
end)
|
||||
@@ -41,8 +41,15 @@ RegisterNUICallback('phone:createTweet', function(data)
|
||||
end)
|
||||
|
||||
RegisterNUICallback('phone:getOrCreateTwitterProfile', function()
|
||||
print('phone:getOrCreateTwitterProfile')
|
||||
ESX.TriggerServerCallback('phone:getOrCreateTwitterProfile', function(profile)
|
||||
sendMessage('getOrCreateTwitterProfile', profile)
|
||||
end)
|
||||
end)
|
||||
|
||||
RegisterNUICallback('phone:updateTwitterProfile', function(data)
|
||||
sendMessage('updateProfileLoading', true)
|
||||
ESX.TriggerServerCallback('phone:updateTwitterProfile', function(result)
|
||||
sendMessage('updateProfileResult', result)
|
||||
TriggerEvent('phone:getOrCreateTwitterProfile')
|
||||
end, data)
|
||||
end)
|
||||
@@ -8,6 +8,8 @@ Config.PhoneAsItem = false
|
||||
|
||||
Config.twitter = {}
|
||||
Config.twitter.characterLimit = 240
|
||||
Config.twitter.allowEdtiableProfileName = true
|
||||
Config.twitter.showAvatars = true
|
||||
Config.twitter.enableEmojis = true
|
||||
Config.twitter.renderImages = true -- whether or not links to images are automatically rendered on the UI
|
||||
Config.twitter.maxImages = 3 -- max amount of images that can be attached to a single tweet
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 149 KiB |
@@ -104,3 +104,33 @@ ESX.RegisterServerCallback('phone:getOrCreateTwitterProfile', function(source, c
|
||||
cb(result)
|
||||
end)
|
||||
end)
|
||||
|
||||
function updateProfile(identifier, data, cb)
|
||||
print(identifier)
|
||||
print(data)
|
||||
MySQL.Async.execute('UPDATE npwd_twitter_profiles SET avatar_url = @avatar_url, profile_name = @profile_name, bio = @bio, location = @location, job = @job WHERE identifier = @identifier',
|
||||
{
|
||||
['identifier'] = identifier,
|
||||
['avatar_url'] = data.avatar_url,
|
||||
['profile_name'] = data.profile_name,
|
||||
['bio'] = data.bio,
|
||||
['location'] = data.location,
|
||||
['job'] = data.job,
|
||||
}, function(result)
|
||||
print('result1: ', result)
|
||||
cb(result)
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
ESX.RegisterServerCallback('phone:updateTwitterProfile', function(source, cb, data)
|
||||
local _source = source
|
||||
local xPlayer = ESX.GetPlayerFromId(_source)
|
||||
local _identifier = xPlayer.getIdentifier()
|
||||
|
||||
updateProfile(_identifier, data, function(result)
|
||||
print('result2: ', result)
|
||||
cb(result)
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in new issue
Block a user