Deleted member n/a to Former Member - نوشته شده در (2300 Views)
Average Member
Andy Humm
مطلب: 908
908
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

<
 پیش‌فرض مرتب‌سازی برای تاریخ DESC به معنی جدیدترین است  
 تعداد در صفحه 
نوشته شده در
Advanced Member
JJenson
مطلب: 2121
2121
I could be wrong but have you tried
if Reply_MemberName = "" then<
نوشته شده در
Support Moderator
Shaggy
مطلب: 6780
6780
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.
<
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.”
نوشته شده در
Average Member
Andy Humm
مطلب: 908
908
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<
نوشته شده در
Support Moderator
Shaggy
مطلب: 6780
6780
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".
<
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.”
نوشته شده در
Average Member
Andy Humm
مطلب: 908
908
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'

Syntax error

/forumtest/search_mod.asp, line 796

Response.Write " strLastAuthor = "<br />"by: <span class=""spnMessageText"">" & profileLink(Topic_LastPostAuthorName,Topic_LastPostAuthor) & "</span>"


<
نوشته شده در
Average Member
Andy Humm
مطلب: 908
908
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.
<
نوشته شده در
Development Team Leader
Classicmotorcycling
مطلب: 2085
2085
I use the following code for what you want, in topic.asp:
Code:

			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
And also:
Code:
	if Member_Name = "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(Member_Name,"display"),TMember_ID) & "</span></b></font><br />" & vbNewLine
end if
And in forum.asp:
Code:
			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.<
Cheers,

David Greening
نوشته شده در
Average Member
Andy Humm
مطلب: 908
908
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<
نوشته شده در
Junior Member
texanman
مطلب: 410
410
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
<
نوشته شده در
Average Member
Andy Humm
مطلب: 908
908
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<
شما باید یک متن وارد کنید