Author |
Topic |
leatherlips
Senior Member
USA
1838 Posts |
Posted - 25 July 2009 : 11:53:44
|
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. |
Mangione Magic Forum - The Music of Chuck Mangione
My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD |
Edited by - leatherlips on 25 July 2009 11:55:19 |
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 25 July 2009 : 12:07:17
|
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 |
|
|
leatherlips
Senior Member
USA
1838 Posts |
Posted - 25 July 2009 : 22:41:54
|
OK, I've tried to do something and I kind of have it working. But it does this:
[This picture is for members only]Full URL of the image 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:
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' I changed it to this:
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 Where is it getting the URL from? |
Mangione Magic Forum - The Music of Chuck Mangione
My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD |
Edited by - leatherlips on 25 July 2009 22:43:24 |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 26 July 2009 : 03:41:40
|
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. |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 26 July 2009 : 05:41:08
|
Something like this may do ya ....
|
Edited by - Carefree on 26 July 2009 20:18:57 |
|
|
leatherlips
Senior Member
USA
1838 Posts |
|
Classicmotorcycling
Development Team Leader
Australia
2084 Posts |
Posted - 26 July 2009 : 18:09:27
|
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. |
Cheers, David Greening |
|
|
leatherlips
Senior Member
USA
1838 Posts |
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 26 July 2009 : 20:07:45
|
quote: 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. |
Edited by - Carefree on 26 July 2009 20:19:35 |
|
|
leatherlips
Senior Member
USA
1838 Posts |
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 26 July 2009 : 22:06:17
|
quote: 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. |
Edited by - Carefree on 26 July 2009 22:10:25 |
|
|
leatherlips
Senior Member
USA
1838 Posts |
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 26 July 2009 : 23:41:39
|
The code I wrote isn't in the file. Where did you make the changes? Here's your "inc_func_common.asp" with the changes applied.
|
Edited by - Carefree on 26 July 2009 23:56:01 |
|
|
leatherlips
Senior Member
USA
1838 Posts |
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 27 July 2009 : 17:12:13
|
I'll look at the mp3 portion to check for you. |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 27 July 2009 : 18:14:45
|
OK I have it working for hiding MP3s on my server. Try the file for yours. |
|
|
Topic |
|