Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Deleted member n/a to Former Member
 New Topic  Reply to Topic
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 15 May 2008 :  18:08:27  Show Profile  Reply with Quote
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  Show Profile  Visit JJenson's Homepage  Reply with Quote
I could be wrong but have you tried
if Reply_MemberName = "" then<
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 16 May 2008 :  04:24:59  Show Profile  Reply with Quote
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.”
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 16 May 2008 :  05:55:17  Show Profile  Reply with Quote
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<
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 16 May 2008 :  06:12:43  Show Profile  Reply with Quote
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.”
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 16 May 2008 :  06:23:34  Show Profile  Reply with Quote
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>"



<
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 16 May 2008 :  07:09:18  Show Profile  Reply with Quote
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.
<
Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2085 Posts

Posted - 16 May 2008 :  08:24:20  Show Profile  Reply with Quote
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
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 16 May 2008 :  08:53:42  Show Profile  Reply with Quote
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<
Go to Top of Page

texanman
Junior Member

United States
410 Posts

Posted - 16 May 2008 :  11:22:08  Show Profile  Reply with Quote
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
<
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 16 May 2008 :  12:50:27  Show Profile  Reply with Quote
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
Go to Top of Page

texanman
Junior Member

United States
410 Posts

Posted - 16 May 2008 :  13:04:06  Show Profile  Reply with Quote
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!<
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 16 May 2008 :  13:08:50  Show Profile  Reply with Quote
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
Go to Top of Page

texanman
Junior Member

United States
410 Posts

Posted - 16 May 2008 :  13:11:35  Show Profile  Reply with Quote
You are welcome! :-)<
Go to Top of Page

MaD2ko0l
Senior Member

United Kingdom
1053 Posts

Posted - 16 May 2008 :  13:24:05  Show Profile  Visit MaD2ko0l's Homepage  Reply with Quote
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
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 16 May 2008 :  13:33:12  Show Profile  Reply with Quote
Yes but, I did not know where to start in the profilelink function. Ideas?
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
<

Edited by - Andy Humm on 16 May 2008 13:42:50
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.43 seconds. Powered By: Snitz Forums 2000 Version 3.4.07