Customizing SMF > Tips and Tricks
Admin notepad
ryanbsoftware:
i belive fopen is whats its called, the system used for the agreement, for my admin nopepad mod would that be beter or worse than storing it in the db, also if i use that how would i tell it to ask for ftp info to chmod the AdminNotes.txt file to 777, or can i not do that?
[Unknown]:
I would recommend you use the database, personally - a row in the settings table, for example. A flat file is better for something that rarely changes, and an "admin notepad" is something I would expect to (if used) change every once and a while. For that, the database is probably better.
-[Unknown]
ryanbsoftware:
ok, and it would require a bit more work ratheer than basically copying the agreement file code over, lol, but ok, now i have to figure out how to setup the query.
Trekkie101:
Maybe something like this:
http://www.w3schools.com/sql/sql_insert.asp
http://www.w3schools.com/sql/sql_update.asp
http://www.w3schools.com/sql/sql_create.asp
im still learning but those are useful.
ryanbsoftware:
ok i think i got a query
--- Quote --- SELECT value
FROM `smf_settings`
WHERE variable 'AdminPad'
LIMIT 0 , 30
--- End quote ---
and
--- Quote --- SELECT value
FROM `smf_settings`
WHERE variable IS 'AdminPad'
LIMIT 0 , 30
--- End quote ---
after adding a valude AdminPad in the settings table with valuse being what is show in the adminpad. The problem is is that when i try this query in phpmyadmin to make sure it will work i get this error
--- Quote --- MySQL said:
#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ''AdminPad' LIMIT 0, 30' at line 1
--- End quote ---
I thought in the smf_settings table it would find the row where varibale is adminpad and return what the value is. How would I do that? And http://www.w3schools.com/sql/sql_select.asp didn't really help, that just proved to me i got the basic syantax right. :-\
Navigation
[0] Message Index
[#] Next page
Go to full version