Author |
Topic |
withanhdammit
Junior Member
USA
236 Posts |
Posted - 11 March 2005 : 12:14:33
|
I'd like to automatically authorize all users when they join my forum to have a Photo Album "account" so they can immediately start posting photos.
Any ideas?
Thanks!
h |
|
Roger Fredriksson
Average Member
Sweden
556 Posts |
Posted - 11 March 2005 : 12:49:36
|
What do you mean by "automatically", are you using another login then the one given by Snitz. In that case you could use universal login mod. I am going to do it that way and you could download my attemt so far from www.avgifter.com/pm/universal.zip |
rf/www.avgifter.com |
|
|
withanhdammit
Junior Member
USA
236 Posts |
Posted - 11 March 2005 : 14:18:02
|
If a user wants to be able to upload photos, the admin has to give them rights to do this. I want these rights to be automatically assigned when someone joins my forum, so the admin doesn't have to do it.
h |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 14 March 2005 : 07:06:28
|
Which photo album mod are you using? Can you post a link to it and a *.txt copy of your register.asp file?
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
|
|
withanhdammit
Junior Member
USA
236 Posts |
Posted - 16 March 2005 : 22:46:35
|
Hi Shaggy,
Sorry for the late reply, I must have missed your reply somewhere.
It's Wesley Brown's Photo album v 1.82 and register.asp is up at http://thepoopsheet.dnjhome.com/register.txt
Thanks! |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 18 March 2005 : 05:56:42
|
Don't see anything in there that would handle this feature. Can you post a link to the mod in question; can't seem to find it.
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
|
|
withanhdammit
Junior Member
USA
236 Posts |
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 18 March 2005 : 08:59:29
|
My post Paddy's day eyes are a bit tired; I can't for the life of me see whereabouts in the database that setting is stored for each member. Did you have to make any changes to the db when applying it?
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
|
|
withanhdammit
Junior Member
USA
236 Posts |
Posted - 18 March 2005 : 09:01:00
|
Nope, no db changes at all...
h |
I reject your reality and substitute my own. |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 18 March 2005 : 09:09:50
|
Very strange, 'cause I see references to all sorts of non-Snitz tables in the mod files, such as ALBUM, ALBUM_CONFIG, ALBUM_USERS, etc. You definitely didn't set these up? All I can tink is that the members who are allowed to upload images are held in ALBUM_USERS but, without knowing the structure of that table, I caouldn't tell you how to go about making the necessary changes.
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
|
|
withanhdammit
Junior Member
USA
236 Posts |
Posted - 18 March 2005 : 09:19:02
|
Yeah, I see those fields in the db also, but there's no .dbs file with the mod, so I'm not entirely sure. I've installed so many mods on this forum, that I can't really remember exactly how I set it up. In any case, I'll email you a link to download an access .mdb copy of my forum db (I use Sql2k).
h |
I reject your reality and substitute my own. |
|
|
rodham
New Member
65 Posts |
Posted - 19 March 2005 : 18:10:03
|
If you are using MSSQL, you could setup the following trigger on the FORUM_MEMBERS table so that it creates the needed records whenever a new record is inserted. Works for me!
CREATE TRIGGER [ADD_ALBUM_USER] ON [FORUM_MEMBERS] FOR INSERT AS INSERT INTO FORUM_ALBUM_USERS SELECT MEMBER_ID, M_NAME FROM inserted WHERE MEMBER_ID = inserted.MEMBER_ID
INSERT INTO FORUM_ALBUM_CAT SELECT "Main Album" AS Photo_Cat_Name, inserted.MEMBER_ID as Member_id FROM inserted Where MEMBER_ID = inserted.MEMBER_ID
|
|
|
withanhdammit
Junior Member
USA
236 Posts |
Posted - 19 March 2005 : 18:18:26
|
I am using MSSQL...where would I set the trigger on the table?
Thanks!
h |
I reject your reality and substitute my own. |
|
|
rodham
New Member
65 Posts |
Posted - 19 March 2005 : 21:05:06
|
The simplest way is thru the SQL Enterprise Manager, drill down to the tables for your forum, locate FORUM_MEMBERS and right click on it, choose "all task" and then "manage triggers".
In the Name dropdown make sure that <new> is selected. Replace the text: CREATE TRIGGER [TRIGGER NAME] ON [FORUM_MEMBERS] FOR INSERT, UPDATE, DELETE AS with: CREATE TRIGGER [ADD_ALBUM_USER] ON [FORUM_MEMBERS] FOR INSERT AS INSERT INTO FORUM_ALBUM_USERS SELECT MEMBER_ID, M_NAME FROM inserted WHERE MEMBER_ID = inserted.MEMBER_ID
INSERT INTO FORUM_ALBUM_CAT SELECT "Main Album" AS Photo_Cat_Name, inserted.MEMBER_ID as Member_id FROM inserted Where MEMBER_ID = inserted.MEMBER_ID
Check the syntax, then choose "Ok" and then close.
Create a new member and the two ALBUM tables will also have the required records.
Good luck. |
|
|
withanhdammit
Junior Member
USA
236 Posts |
Posted - 19 March 2005 : 23:02:18
|
I got an error with your code, so I looked at what I was replacing, and I had to change it to:
CREATE TRIGGER [ADD_ALBUM_USER] ON [dbName].[FORUM_MEMBERS]
FOR INSERT
AS
INSERT INTO FORUM_ALBUM_USERS
SELECT MEMBER_ID, M_NAME
FROM inserted
WHERE MEMBER_ID = inserted.MEMBER_ID
INSERT INTO FORUM_ALBUM_CAT
SELECT "Main Album" AS Photo_Cat_Name, inserted.MEMBER_ID as Member_id
FROM inserted
Where MEMBER_ID = inserted.MEMBER_ID
With that change, it created the permissions/table entries properly, but it did not create the folders. Any ideas on how to do that?
h |
I reject your reality and substitute my own. |
|
|
rodham
New Member
65 Posts |
Posted - 20 March 2005 : 07:25:44
|
Yes you are correct in your changes... it depends on the version of SQL.
In the file ToFileSystem.asp around line 293 CHANGE:
strPath = Server.MapPath(bdir) & "\" & strUserName& "\" &strFileName
TO:
strPath = Server.MapPath(bdir) & "\" & strUserName& "\"
AND ADD BELOW IT:
' This user is valid and may be uploading their first file
' Check for folder and create if needed
If Not objFSO.FolderExists(strPath) Then
objFSO.CreateFolder(strPath)
objFSO.CreateFolder(strPath & "tn\")
end if
strPath = strPath & strFileName
|
Edited by - rodham on 20 March 2005 07:35:11 |
|
|
Topic |
|