Author |
Topic |
|
Id
Junior Member
USA
129 Posts |
Posted - 30 July 2001 : 15:49:43
|
When attempting to add members to the allowed member list 2 things happen When i try to add the first member in the list of members on the left, instead of it inserting the members name it inserts a blank field in the allowed member list and when i try to add the forum i get the following error
There has been a problem!
Syntax error in INSERT INTO statement.
If i go back, i can remove the blank field and submit again, but instead of it fixing the existing forum I end up with 2 forums instead of one.
Going insane one day at a time |
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 30 July 2001 : 16:10:02
|
do you have a URL I can look at ?
|
|
|
Id
Junior Member
USA
129 Posts |
|
gor
Retired Admin
Netherlands
5511 Posts |
|
Asdeus
Starting Member
7 Posts |
Posted - 31 July 2001 : 23:02:35
|
I did this (over ver 33.02), and now it works for me:
first, I replaced the new JS code with the old one (didn't even checked what changes, so I'll just post it all here):
<script language="JavaScript"> <!-- //################################################################################# //## Allowed User - Selection Code //#################################################################################
function selectUsers() { if (document.PostTopic.AuthUsers.length == 1) { document.PostTopic.AuthUsers.options[0].value = ""; return; } if (document.PostTopic.AuthUsers.length == 2) document.PostTopic.AuthUsers.options[0].selected = true else for (x = 0;x < document.PostTopic.AuthUsers.length - 1 ;x++) document.PostTopic.AuthUsers.options[x].selected = true; }
function MoveWholeList(strAction) { if (strAction == "Add") { if (document.PostTopic.AuthUsersCombo.length > 1) { for (x = 0;x < document.PostTopic.AuthUsersCombo.length - 1 ;x++) document.PostTopic.AuthUsersCombo.options[x].selected = true; InsertSelection("Add"); } } else { if (document.PostTopic.AuthUsers.length > 1) { for (x = 0;x < document.PostTopic.AuthUsers.length - 1 ;x++) document.PostTopic.AuthUsers.options[x].selected = true; InsertSelection("Del"); } } }
function InsertSelection(strAction) { var pos,user,mText; var count,finished;
if (strAction == "Add") { pos = document.PostTopic.AuthUsers.length; finished = false; count = 0; do //Add to destination { if (document.PostTopic.AuthUsersCombo.options[count].text == "") { finished = true; continue; } if (document.PostTopic.AuthUsersCombo.options[count].selected) { document.PostTopic.AuthUsers.length +=1; document.PostTopic.AuthUsers.options[pos].value = document.PostTopic.AuthUsers.options[pos-1].value; document.PostTopic.AuthUsers.options[pos].text = document.PostTopic.AuthUsers.options[pos-1].text; document.PostTopic.AuthUsers.options[pos-1].value = document.PostTopic.AuthUsersCombo.options[count].value; document.PostTopic.AuthUsers.options[pos-1].text = document.PostTopic.AuthUsersCombo.options[count].text; document.PostTopic.AuthUsers.options[pos-1].selected = true; } pos = document.PostTopic.AuthUsers.length; count += 1; }while (!finished); //finished adding finished = false; count = document.PostTopic.AuthUsersCombo.length - 1; do //remove from source { if (document.PostTopic.AuthUsersCombo.options[count].text == "") { --count; continue; } if (document.PostTopic.AuthUsersCombo.options[count].selected ) { for ( z = count ; z < document.PostTopic.AuthUsersCombo.length-1;z++) { document.PostTopic.AuthUsersCombo.options[z].value = document.PostTopic.AuthUsersCombo.options[z+1].value; document.PostTopic.AuthUsersCombo.options[z].text = document.PostTopic.AuthUsersCombo.options[z+1].text; } document.PostTopic.AuthUsersCombo.length -= 1; } --count; if (count < 0) finished = true; }while(!finished) //finished removing }
if (strAction == "Del") { pos = document.PostTopic.AuthUsersCombo.length; finished = false; count = 0; do //Add to destination { if (document.PostTopic.AuthUsers.options[count].text == "") { finished = true; continue; } if (document.PostTopic.AuthUsers.options[count].selected) { document.PostTopic.AuthUsersCombo.length +=1; document.PostTopic.AuthUsersCombo.options[pos].value = document.PostTopic.AuthUsersCombo.options[pos-1].value; document.PostTopic.AuthUsersCombo.options[pos].text = document.PostTopic.AuthUsersCombo.options[pos-1].text; document.PostTopic.AuthUsersCombo.options[pos-1].value = document.PostTopic.AuthUsers.options[count].value; document.PostTopic.AuthUsersCombo.options[pos-1].text = document.PostTopic.AuthUsers.options[count].text; document.PostTopic.AuthUsersCombo.options[pos-1].selected = true; } count += 1; pos = document.PostTopic.AuthUsersCombo.length; }while (!finished); //finished adding finished = false; count = document.PostTopic.AuthUsers.length - 1; do //remove from source { if (document.PostTopic.AuthUsers.options[count].text == "") { --count; continue; } if (document.PostTopic.AuthUsers.options[count].selected ) { for ( z = count ; z < document.PostTopic.AuthUsers.length-1;z++) { document.PostTopic.AuthUsers.options[z].value = document.PostTopic.AuthUsers.options[z+1].value; document.PostTopic.AuthUsers.options[z].text = document.PostTopic.AuthUsers.options[z+1].text; } document.PostTopic.AuthUsers.length -= 1; } --count; if (count < 0) finished = true; }while(!finished) //finished removing } }
function autoReload(objform) { var tmpCookieURL = '<%=strCookieURL%>'; if (objform.SelectSize.value == 1) { document.PostTopic.Message.cols = 45; document.PostTopic.Message.rows = 6; } if (objform.SelectSize.value == 2) { document.PostTopic.Message.cols = 80; document.PostTopic.Message.rows = 12; } if (objform.SelectSize.value == 3) { document.PostTopic.Message.cols = 90; document.PostTopic.Message.rows = 12; } if (objform.SelectSize.value == 4) { document.PostTopic.Message.cols = 130; document.PostTopic.Message.rows = 15; } document.cookie = tmpCookieURL + "strSelectSize=" + objform.SelectSize.value }
function OpenPreview() { var curCookie = "strMessagePreview=" + escape(document.PostTopic.Message.value); document.cookie = curCookie; popupWin = window.open('pop_preview.asp', 'preview_page', 'scrollbars=yes,width=750,height=450') } //--> </script>
Then, the forum members list still had all the selected members in it, and this was the problem... replace this line:
if not(Instr("," & tmpStrUserList & "," , "," & rsMember("MEMBER_ID") & ",",1) > 0) then
with this one:
if not(Instr("," & tmpStrUserList & "," , "," & rsMember("MEMBER_ID") & ",") > 0) then
(im not sure why the textual comparision of the Instr function is not working for this, but in this way, using the default binary, it does work.)
Hope this helps.
|
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 01 August 2001 : 06:33:24
|
This may be ok for yu, but the extra code was added to in response to a previous bug report recording the lists, so may not work for everyone.
Youre second correction howver, may have been causing the initial problem anyway, have you tried putting the code back and just making the second change?
|
|
|
Asdeus
Starting Member
7 Posts |
Posted - 01 August 2001 : 15:50:32
|
quote:
Youre second correction howver, may have been causing the initial problem anyway, have you tried putting the code back and just making the second change?
Yep, I tried changing back everything and fixing just the last line, but the bug was still there.
first click to add user: blank added second click: added user on second place on the list send: crash.
Fixing the instr just makes the members list display correctly (not showing the members already added to the selected member box on the forum members box).
I didn't knew about the previous bug, I'll try to fix the Js code on .02
could you pass the link to the previous bug topic?
|
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 01 August 2001 : 17:52:16
|
to be honest I had forgotten until people started getting problems with it, if your changes work for you, then stick with them, will try and do some testing myself
|
|
|
gor
Retired Admin
Netherlands
5511 Posts |
|
gor
Retired Admin
Netherlands
5511 Posts |
Posted - 17 August 2001 : 18:00:54
|
I really need someone to have a look at this, Javascript is not my thing, but I would very much like to fix this bug before releasing 3.3.03
Pierre Join a Snitz Mailinglist |
|
|
gor
Retired Admin
Netherlands
5511 Posts |
|
|
Topic |
|