richm
11-11-2005, 08:21 PM
I am following up from a request in General Discussion for an Easy way to edit links while viewing the public site. Rather than put a login-in on the public site, my approach is to place an EDIT button on each link as long as the user is accessing the site from an "Editor" IP address.
The mod below creates a field for setting up this approved IP address, and adds an EDIT button to each link. This would still require a one-time login once the EDIT button is pressed, but you could continue to edit once you are logged in.
I am new to PHP and to this directory, and I have not tested this. This is being offered for discussion and feedback. Also, I have some questions below, but this is a start.
Content visible to registered users only.
Known problems:
1. IP Lookup
I imagine that the get_client_id() function is slow, and that it should be run once and stored in a variable, rather than run for every link that is displayed. However, I am not really certain where this should be done.
2. Returning to Directory after FIRST Edit
When I tested this earlier, I recall that there was some sort of problem returning to the directory after the FIRST edit (after having to login). I recall having to press the back key to get back. After login, however, it returned to the directory just fine.
Any ideas or feedback?
The mod below creates a field for setting up this approved IP address, and adds an EDIT button to each link. This would still require a one-time login once the EDIT button is pressed, but you could continue to edit once you are logged in.
I am new to PHP and to this directory, and I have not tested this. This is being offered for discussion and feedback. Also, I have some questions below, but this is a start.
Content visible to registered users only.
Known problems:
1. IP Lookup
I imagine that the get_client_id() function is slow, and that it should be run once and stored in a variable, rather than run for every link that is displayed. However, I am not really certain where this should be done.
2. Returning to Directory after FIRST Edit
When I tested this earlier, I recall that there was some sort of problem returning to the directory after the FIRST edit (after having to login). I recall having to press the back key to get back. After login, however, it returned to the directory just fine.
Any ideas or feedback?