TeamUlysses / ulx

ULX: A powerful administration addon for Garry's Mod
https://ulyssesmod.net
Other
163 stars 73 forks source link

MOTD url and php queries after navigating #180

Open crizztoffer opened 4 years ago

crizztoffer commented 4 years ago

Steps to reproduce

  1. Load any motd PHP site with navigation links and print_r($_GET('steamid') or vardump the steamid so it can be seen when first opened.
  2. click a link to another page that also print_r($_GET('steamid') or vardump's the same thing

Expected behavior

%steamid% and %map% only pull on the init and not on page refresh - if it is possible, it should be called for each 'area' of the motd when it is refreshed. I'm investigating how to do this. If a MOTD has multiple pages that can be displayed using a navigation set / menu - the links clicked should also allow the queries to be performed on them as well

Actual behavior

php queries initiate on derma load not on webpage load. - confirmed.

confirmed in: /addons/ulx/lua/ulx/modules/cl/motdmenu.lua lines 37-41 "else -- URL url = string.gsub( url, "%%curmap%%", game.GetMap() ) url = string.gsub( url, "%%steamid%%", steamid ) html:OpenURL( url ) end"

I have a php email script that allows users to send messages to admins through the MOTD. It's done on a contact us link in the MOTD and does function correctly. If I set the MOTD to the contact us page itself, on the initial load of the MOTD the server queries the information and can be pulled from $GET['steamid'] which allows me to format the messages they send to include their persona name. But this value isn't reported on the loading of the contact us page when navigated to from the MOTD menu as it should. So I can't $_POST information from the contact us form which includes their persona name and performs all the actions for relaying the message(s) to admins.

Error(s) in server console, if any

no errors

Error(s) in player's console, if any

no errors

Version

ULib v2.63d (05/12/18) ULX v3.73d (05/21/18)