mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Fixed bug about news editing and deleting. News can now be edited by any admin.
This commit is contained in:
@@ -172,7 +172,7 @@ client
|
||||
body += "<br><font size='1'><a href='byond://?src=\ref[src];rotatedatum=\ref[D];rotatedir=left'><<</a> <a href='byond://?src=\ref[src];datumedit=\ref[D];varnameedit=dir'>[dir2text(A.dir)]</a> <a href='byond://?src=\ref[src];rotatedatum=\ref[D];rotatedir=right'>>></a></font>"
|
||||
if(istype(A,/mob))
|
||||
var/mob/M = A
|
||||
body += "<br><font size='1'><a href='byond://?src=\ref[src];datumedit=\ref[D];varnameedit=ckey'>[M.ckey ? M.ckey : "No ckey"]</a> / <a href='byond://?src=\ref[src];datumedit=\ref[D];varnameedit=real_name'>[M.real_name ? M.real_name : "No real name"]</a></font>"
|
||||
body += "<br><font size='1'><a href='byond://?src=\ref[src];datumedit=\ref[D];varnameedit=key'>[M.key ? M.key : "No key"]</a> / <a href='byond://?src=\ref[src];datumedit=\ref[D];varnameedit=real_name'>[M.real_name ? M.real_name : "No real name"]</a></font>"
|
||||
else
|
||||
body += "<b>[D]</b>"
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ client/proc/display_all_news_list()
|
||||
output += "[date] <b>[N.title]</b><br>"
|
||||
output += "[N.body]<br>"
|
||||
output += "<small>authored by <i>[N.author]</i></small>"
|
||||
if(admin && N.author == src.key)
|
||||
if(src.holder)
|
||||
output += " <a href='?src=\ref[news_topic_handler];client=\ref[src];action=remove;ID=[N.ID]'>Delete</a> <a href='?src=\ref[news_topic_handler];client=\ref[src];action=edit;ID=[N.ID]'>Edit</a>"
|
||||
output += "<br>"
|
||||
output += "<br>"
|
||||
@@ -182,7 +182,7 @@ client/verb/read_news()
|
||||
display_all_news_list()
|
||||
|
||||
client/proc/remove_news(ID as num)
|
||||
if(src.holder)
|
||||
if(!src.holder)
|
||||
src << "<b>You tried to modify the news, but you're not an admin!"
|
||||
return
|
||||
|
||||
@@ -201,7 +201,7 @@ client/proc/remove_news(ID as num)
|
||||
display_all_news_list()
|
||||
|
||||
client/proc/edit_news(ID as num)
|
||||
if(src.holder)
|
||||
if(!src.holder)
|
||||
src << "<b>You tried to modify the news, but you're not an admin!"
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user