The Forum has been Updated
The code has been upgraded to the latest .NET core version. Please check instructions in the Community Announcements about migrating your account.
I was wanting to try to add a feature that would only be seen by members only. For example, lets say I only wanted members to see the pictures in the post. The members would see the entire post as normal:
Duis blandit nulla amet ea quis volutpat suscipit exerci eros duis dolore feugiat, commodo, duis vero, velit suscipit enim sed autem odio. Vulputate zzril blandit eum eum facilisi vero feugait iriure, et consequat. Molestie, accumsan velit ipsum praesent accumsan dolore delenit in hendrerit, at enim dolor.
Ea qui ut commodo odio consequat consectetuer augue dignissim ea ut velit sed accumsan veniam. Ut nostrud vulputate, magna nulla exerci eu in illum luptatum autem commodo nibh nibh. Augue tation hendrerit suscipit, consequat nulla enim, suscipit ea velit nulla molestie. In autem, ut consequat, exerci blandit, esse, aliquip dolore, eros veniam aliquip duis, vel.
But a non member would see something like this:
Duis blandit nulla amet ea quis volutpat suscipit exerci eros duis dolore feugiat, commodo, duis vero, velit suscipit enim sed autem odio. Vulputate zzril blandit eum eum facilisi vero feugait iriure, et consequat. Molestie, accumsan velit ipsum praesent accumsan dolore delenit in hendrerit, at enim dolor.
[This picture is for members only]
Ea qui ut commodo odio consequat consectetuer augue dignissim ea ut velit sed accumsan veniam. Ut nostrud vulputate, magna nulla exerci eu in illum luptatum autem commodo nibh nibh. Augue tation hendrerit suscipit, consequat nulla enim, suscipit ea velit nulla molestie. In autem, ut consequat, exerci blandit, esse, aliquip dolore, eros veniam aliquip duis, vel.
If I can be shown how to do that, then I think I can figure out how to make it work with other forum tags.
Duis blandit nulla amet ea quis volutpat suscipit exerci eros duis dolore feugiat, commodo, duis vero, velit suscipit enim sed autem odio. Vulputate zzril blandit eum eum facilisi vero feugait iriure, et consequat. Molestie, accumsan velit ipsum praesent accumsan dolore delenit in hendrerit, at enim dolor.
Ea qui ut commodo odio consequat consectetuer augue dignissim ea ut velit sed accumsan veniam. Ut nostrud vulputate, magna nulla exerci eu in illum luptatum autem commodo nibh nibh. Augue tation hendrerit suscipit, consequat nulla enim, suscipit ea velit nulla molestie. In autem, ut consequat, exerci blandit, esse, aliquip dolore, eros veniam aliquip duis, vel.
But a non member would see something like this:
Duis blandit nulla amet ea quis volutpat suscipit exerci eros duis dolore feugiat, commodo, duis vero, velit suscipit enim sed autem odio. Vulputate zzril blandit eum eum facilisi vero feugait iriure, et consequat. Molestie, accumsan velit ipsum praesent accumsan dolore delenit in hendrerit, at enim dolor.
[This picture is for members only]
Ea qui ut commodo odio consequat consectetuer augue dignissim ea ut velit sed accumsan veniam. Ut nostrud vulputate, magna nulla exerci eu in illum luptatum autem commodo nibh nibh. Augue tation hendrerit suscipit, consequat nulla enim, suscipit ea velit nulla molestie. In autem, ut consequat, exerci blandit, esse, aliquip dolore, eros veniam aliquip duis, vel.
If I can be shown how to do that, then I think I can figure out how to make it work with other forum tags.
Sist redigert av
Postet den
it would be different for different tags, as they are not all parsed by the same function
The code is in inc_func common, the majority of codes are parsed using the docode function, image however are parsed in the ReplaceImageTags function.
I will take a look at the code later and work out where to put your code if you get stuck
The code is in inc_func common, the majority of codes are parsed using the docode function, image however are parsed in the ReplaceImageTags function.
I will take a look at the code later and work out where to put your code if you get stuck
Postet den
OK, I've tried to do something and I kind of have it working. But it does this:
It does not show the picture but then it does show the full url of the pictures location. How can I get rid of the URL?
This is what I changed in inc_func_common.asp:
I changed it to this:
Where is it getting the URL from?
Code:
[This picture is for members only]Full URL of the imageThis is what I changed in inc_func_common.asp:
Code:
ImgTags(1,1,1) = "[img ]"
ImgTags(1,2,1) = "[/img]"
ImgTags(1,1,2) = "<img name='img' src="""
ImgTags(1,2,2) = """ border=""0"" style='cursor:default'Code:
ImgTags(1,1,1) = "[img ]"
ImgTags(1,2,1) = "[/img]"
if mlev > 0 then
ImgTags(1,1,2) = "<img name='img' src="""
ImgTags(1,2,2) = """ border=""0"" style='cursor:default' onClick='doimage(this,event)'>"
else
ImgTags(1,1,2) = "<div>[This picture is for members only]"
ImgTags(1,2,2) = "</div>"
end if
Sist redigert av
Postet den
you need to do the change where it does the replace rather than where it defines the tags, all you have done is replace the [img] tags, not what was inside them.
Postet den
Something like this may do ya ....
Code:
Look for the following line (appx: 1281)
ReplaceImageTags = strTempString
Change it to say:
if mLev > 0 then
ReplaceImageTags = strTempString
else
if instr(strTempString,"<img") then
ReplaceImageTags = "<div>[Image for members only!]</div>"
else
ReplaceImageTags = strTempString
end if
end if
Sist redigert av
Postet den
Carefree, I tried what you suggested. It however seems to replace everything with that. I'm not sure why. Take a look at my test forum: www.mangionemagic.com/forumtest
It replaced the forum descriptions, signatures along with the pictures and any other tags in use.
It replaced the forum descriptions, signatures along with the pictures and any other tags in use.
Postet den
OK, I have had a look at this and very simple to do, around line 999 of of a fresh inc_func_common.asp:
Change the following code:
To the following:
It worked for me. Let me know how you go.
Change the following code:
Code:
If strFirstPart <> "" Then
If UCase(Left(strFirstPart, 5)) = "[IMG]" Then
ReplaceURLs = ReplaceURLs & "<a href=""" & strArray2(0) & """ target=""_blank"">" & strFirstPart & "</a>" & strSecondPartf
ElseIf UCase(Left(strArray2(0), 7)) = "HTTP://" ThenTo the following:
Code:
If strFirstPart <> "" Then
If UCase(Left(strFirstPart, 5)) = "[IMG]" Then
if mlev > 0 then
ReplaceURLs = ReplaceURLs & "<a href=""" & strArray2(0) & """ target=""_blank"">" & strFirstPart & "</a>" & strSecondPart
else
Response.Write "<div>[This picture is for members only]</div><br />"
end if
ElseIf UCase(Left(strArray2(0), 7)) = "HTTP://" ThenIt worked for me. Let me know how you go.
Cheers,
David Greening
David Greening
Postet den
Classicmotorcycling,
I don't have any of the code you listed. I think I remember a long time ago changing that to make any link that pointed to a page in my site to open in the same window. Here is the section of code I have that I think resembles what you are referring to. The part in red is what I tried to add according to your directions. It currently does not work for me. The pictures show rather you are logged in or not.
I don't have any of the code you listed. I think I remember a long time ago changing that to make any link that pointed to a page in my site to open in the same window. Here is the section of code I have that I think resembles what you are referring to. The part in red is what I tried to add according to your directions. It currently does not work for me. The pictures show rather you are logged in or not.
Code:
if instr(ucase(strArray2(0)),"MANGIONEMAGIC.COM")>0 then
ReplaceURLs=ReplaceURLs&roTag&strArray2(0)&rc3Tag&strFirstPart&rc2Tag&strSecondPart
elseif ucase(left(strFirstPart,5))="[IMG]" then
if mlev > 0 then
ReplaceURLs=ReplaceURLs&"<a href="""&strArray2(0)&""" target=""_blank"">"&strFirstPart&"</a>"&strSecondPart
else
Response.Write "<div>[This picture is for members only]</div><br />"
end if
elseif ucase(left(strArray2(0),7))="HTTP://" then
Sist redigert av
Postet den
Originally posted by leatherlips
Carefree, I tried what you suggested. It however seems to replace everything with that. I'm not sure why. Take a look at my test forum: www.mangionemagic.com/forumtest
It replaced the forum descriptions, signatures along with the pictures and any other tags in use.
OK, I put a condition to check for the presence of a image tag before making the change. Try the new version. It works here.
Sist redigert av
Postet den
Carefree,
It works a little better. But it is also hiding my mp3 tags along with the img tags.
It works a little better. But it is also hiding my mp3 tags along with the img tags.
Postet den
Originally posted by leatherlips
Carefree,
It works a little better. But it is also hiding my mp3 tags along with the img tags.
That shouldn't be possible. It only hides strings which include "<img". Post a link to your "inc_func_common.asp" in .txt for me to look at.
Sist redigert av
Email Member
Message Member
Post Moderation
Filopplasting
If you're having problems uploading, try choosing a smaller image.
Forhåndsvis post
Send Topic
Loading...