Author |
Topic  |
Andy Humm
Average Member
  
United Kingdom
908 Posts |
Posted - 15 May 2008 : 18:08:27
|
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
< |
|
JJenson
Advanced Member
    
USA
2121 Posts |
Posted - 16 May 2008 : 01:26:51
|
I could be wrong but have you tried if Reply_MemberName = "" then< |
 |
|
Shaggy
Support Moderator
    
Ireland
6780 Posts |
Posted - 16 May 2008 : 04:24:59
|
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.” |
 |
|
Andy Humm
Average Member
  
United Kingdom
908 Posts |
Posted - 16 May 2008 : 05:55:17
|
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
Support Moderator
    
Ireland
6780 Posts |
Posted - 16 May 2008 : 06:12:43
|
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.” |
 |
|
Andy Humm
Average Member
  
United Kingdom
908 Posts |
Posted - 16 May 2008 : 06:23:34
|
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>"
< |
 |
|
Andy Humm
Average Member
  
United Kingdom
908 Posts |
Posted - 16 May 2008 : 07:09:18
|
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
Development Team Leader
    
Australia
2085 Posts |
Posted - 16 May 2008 : 08:24:20
|
I use the following code for what you want, in 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 And also:
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:
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 |
 |
|
Andy Humm
Average Member
  
United Kingdom
908 Posts |
Posted - 16 May 2008 : 08:53:42
|
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
Junior Member
 
United States
410 Posts |
Posted - 16 May 2008 : 11:22:08
|
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
Average Member
  
United Kingdom
908 Posts |
Posted - 16 May 2008 : 12:50:27
|
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< |
Edited by - Andy Humm on 16 May 2008 13:07:42 |
 |
|
texanman
Junior Member
 
United States
410 Posts |
Posted - 16 May 2008 : 13:04:06
|
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
Average Member
  
United Kingdom
908 Posts |
Posted - 16 May 2008 : 13:08:50
|
Texanman I was editting my reply above and the fix is there,, Thank you..
The endif was replaced with & vbNewLine
< |
Edited by - Andy Humm on 16 May 2008 13:10:12 |
 |
|
texanman
Junior Member
 
United States
410 Posts |
Posted - 16 May 2008 : 13:11:35
|
You are welcome! :-)< |
 |
|
MaD2ko0l
Senior Member
   
United Kingdom
1053 Posts |
Posted - 16 May 2008 : 13:24:05
|
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.< |
© 1999-2010 MaD2ko0l |
 |
|
Andy Humm
Average Member
  
United Kingdom
908 Posts |
Posted - 16 May 2008 : 13:33:12
|
Yes but, I did not know where to start in the profilelink function. Ideas? < |
Edited by - Andy Humm on 16 May 2008 13:42:50 |
 |
|
Topic  |
|