Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/67070?pagenum=1
05 November 2025, 06:47
Topic
Andy Humm
Deleted member n/a to Former Member
15 May 2008, 18:08
I am looking to replace a deleted member's reply name from 'n/a' to 'Former Member' in the search.asp listing The Code which displays the author is: lines 545-548
if IsNull(Topic_LastPostAuthor) then strLastAuthor = "" else strLastAuthor = "<br />by: <span class=""spnMessageText"">" & profileLink(Topic_LastPostAuthorName,Topic_LastPostAuthor) & "</span>" I have utilised this if statement within topic.asp if Reply_MemberName = "n/a" then Response.Write " <p><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strSiteBGColor & """><b><span class=""spnMessageText"">Former Member</span></b></font><br />" & vbNewLine else Response.Write " <p><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b><span class=""spnMessageText"">" & profileLink(ChkString(Reply_MemberName,"display"),Reply_Author) & "</span></b></font><br />" & vbNewLine end if I can not get the if statement slotted into the search.asp to do the same text replacement Any help would be greatly appreciated.
andy
<
Replies ...
JJenson
16 May 2008, 01:26
I could be wrong but have you tried if Reply_MemberName = "" then<
Shaggy
16 May 2008, 04:24
Run an SQL query to update all member's usernames to "Former Member" WHERE M_NAME='n/a'.
Edit pop_delete.asp and change all occurrences of n/a to Former Member.
Done.
<
Andy Humm
16 May 2008, 05:55
Shaggy, thanks so far, I think I tried an SQL query a while ago with the topic.asp occurances of n/a which needed to be changed but this kept the links back to the member profile detail. The code below starting "if Reply_MemberName = "n/a" then... was used in topic and it did remove the link and change n/a to Former Member.
The string that displays the author name in search.asp and search_mod.asp is strLastAuthor = "<br />by: <span class=""spnMessageText"">" & profileLink(Topic_LastPostAuthorName,Topic_LastPostAuthor) & "</span>" What I was asking if you could amalgamate the string into an 'if statement' so that all occurances of 'n/a' get the link removed and Former Member displayed..
I did have a go but there appears to be another if routine in the first block of code if IsNull shown above on first thread.
The search.asp and search_mod.asp
files linked to text files. The code for the author display: search - line 548 and search_mod - line 793 thanking you andy<
Shaggy
16 May 2008, 06:12
Sorry, brain seems to be a bit fried today for some reason. If I understand what you're trying to do correctly, you'll need to edit the profileLink function (it should be in either inc_func_common.asp or inc_func_member.asp) and have it output just "Former Member" if the first argument equals "n/a".
<
Andy Humm
16 May 2008, 06:23
Apols too: could you steer us in the right direction as this coding is sometimetime brain surgery. I am having a go at search_mod but keep getting synax errors..
if IsNull(Topic_LastPostAuthor) then strLastAuthor = "" else if Topic_LastPostAuthor = "n/a" then Response.Write " by: Former Member" & vbNewLine else " strLastAuthor = "& "by:" & <span class=""spnMessageText"">" & profileLink(Topic_LastPostAuthorName,Topic_LastPostAuthor) & "</span>" synax error on red Microsoft VBScript compilation error '800a03ea'
I have the following code: if IsNull(Topic_LastPostAuthor) then strLastAuthor = "" end if if Topic_LastPostAuthor = "n/a" then Response.Write "Former Member" & vbNewLine else strLastAuthor = "<br />by: <span class=""spnMessageText"">" & profileLink(Topic_LastPostAuthorName,Topic_LastPostAuthor) & "</span>" & vbNewLine
Which seems not to be picking up the 'n/a' but continues to display 'by: n/a' which I believe indicates the else element is working. <
Classicmotorcycling
16 May 2008, 08:24
I use the following code for what you want, in topic.asp:
if Topic_MName = "n/a" then Response.Write "Not Available" & vbNewLine else Response.Write "<span class=""spnMessageText"">" & profileLink(chkString(Topic_MName,"display"),Topic_Author) & "</span>" & vbNewLine end if
I hope that helps. I can not give you the line numbers as we all have different code lines.<
Andy Humm
16 May 2008, 08:53
Dave, I recall you kindly provided this code to us a while ago, thanking you once again, but I am trying to get it to work within the search.asp file. See my last post above where I have added the code, tried, but not working. The links to the search.asp and search_mod.asp are above (16 May 2008:05:55:17) in another of my replies.. Thanking you and hope for a solution..
andy<
texanman
16 May 2008, 11:22
Could this work? :-)
if IsNull(Topic_LastPostAuthor) then strLastAuthor = "" elseif Topic_LastPostAuthor = "n/a" then strLastAuthor = "Former Member" else strLastAuthor = "<br />by: <span class=""spnMessageText"">" & profileLink(Topic_LastPostAuthorName,Topic_LastPostAuthor) & "</span>" end if <
Andy Humm
16 May 2008, 12:50
Thank you texanman I did try that and receive the following error message: Microsoft VBScript compilation error '800a0400' Expected statement /forumtest/search_mod.asp, line 797 end if ^ Working with your suggestion and mine above I came up with the following: if IsNull(Topic_LastPostAuthor) then strLastAuthor = "" end if if Topic_LastPostAuthorName = "n/a" then strLastAuthor = "<br />by: Former Member" & vbNewLine else strLastAuthor = "<br />by: <span class=""spnMessageText"">" & profileLink(Topic_LastPostAuthorName,Topic_LastPostAuthor) & "</span>" & vbNewLine I initially did not get any change, and kept changing the str in red and hey presto we have a fix!
Thank you all andy<
texanman
16 May 2008, 13:04
May be you need to remove that end if. I think no extra if statement is added to the original code.
I will try removing and if it doesn't work add one more end if LOL. Who knows!<
Andy Humm
16 May 2008, 13:08
Texanman I was editting my reply above and the fix is there,, Thank you..
The endif was replaced with & vbNewLine
<
texanman
16 May 2008, 13:11
You are welcome! :-)<
MaD2ko0l
16 May 2008, 13:24
like shaggy sugests...whoudl it not be easiler to edit the profilelink function to do what you want to do? thay way it affects every page.<
Andy Humm
16 May 2008, 13:33
Yes but, I did not know where to start in the profilelink function. Ideas?
Code:
function profileLink(fName, fID) if instr(fName,"img src=") > 0 then strExtraStuff = "" else strExtraStuff = " title=""View " & fName & "'s Profile""" & dWStatus("View " & fName & "'s Profile") end if if strUseExtendedProfile then strReturn = "<a href=""pop_profile.asp?mode=display&id=" & fID & """" & strExtraStuff & ">" else strReturn = "<a href=""JavaScript:openWindow3('pop_profile.asp?mode=display&id=" & fID & "')""" & strExtraStuff & ">" end if profileLink = strReturn & fName & "</a>" end function
<
MaD2ko0l
16 May 2008, 14:10
try this.
added parts in red
Code:
function profileLink(fName, fID) if instr(fName,"img src=") > 0 then strExtraStuff = "" else strExtraStuff = " title=""View " & fName & "'s Profile""" & dWStatus("View " & fName & "'s Profile") end if if fName = "n/a" then fName = "Former Member" profileLink = fName else if strUseExtendedProfile then strReturn = "<a href=""pop_profile.asp?mode=display&id=" & fID & """" & strExtraStuff & ">" else strReturn = "<a href=""JavaScript:openWindow3('pop_profile.asp?mode=display&id=" & fID & "')""" & strExtraStuff & ">" end if end if
profileLink = strReturn & fName & "</a>" end function
<
Andy Humm
16 May 2008, 17:20
Thanks MaD2ko0l<
MaD2ko0l
16 May 2008, 20:17
your welcome<
texanman
09 July 2008, 08:17
What kind of issues one should expect when deleting a member with replies? I have seen somewhere this is not recommended, but there was no further explanation as to what happens.
Thanks<
AnonJr
09 July 2008, 08:21
Mostly you lose the context for the post. If you have a topic with two deleted members contributing, how do you know who said what and if there were 1, 2, or 3 people talking?
Really it comes down to why are you deleting the member? If you don't want them around then lock them. If they are not around just let it be. You're not going to get a significant percentage of your space back by deleting them.<
ruirib
09 July 2008, 08:31
The posts are retrieved with an INNER JOIN. If there is no author member, the posts will not be retrieved! It's that simple!<
texanman
09 July 2008, 10:26
Thanks guys I usually don't delete a member with topics or replies. One of admins today deleted a member and that is why I was wondering.
So, what I did for now was to comment out the portion of the code that shows the delete icon in members.asp.
Regards<
ruirib
09 July 2008, 10:35
Originally posted by texanman Thanks guys I usually don't delete a member with topics or replies. One of admins today deleted a member and that is why I was wondering.
So, what I did for now was to comment out the portion of the code that shows the delete icon in members.asp.
Regards
Using the icon raises no issues, because the member is not deleted from the DB. Some data is removed and his name is changed to 'n/a', but there is a database record to be retrieved, so no data loss occurs. The problems occur if you delete a member directly in the database, or using mod setup, for example.<