The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

How can you show piece of HTML on your post to members?

View previous topic View next topic Go down

Solved How can you show piece of HTML on your post to members?

Post by manunitedfanlive on June 8th 2013, 7:07 pm

Hey,

Was wondering is it possible to show a piece of HTML on a post only to members. Guests can access the page and can see the text and some other html but they can't see one code of HTML. Is that possible?

manunitedfanlive
Forumember

Male Posts : 60
Reputation : 1
Language : English
Location : London

http://manunitedlive.englishboards.com/

Back to top Go down

Solved Re: How can you show piece of HTML on your post to members?

Post by SLGray on June 8th 2013, 7:15 pm

Use the hide tags:
Code:
[hide]HIDDEN CONTENT[/hide]
Members will have to reply to the topic to see the hidden content.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36663
Reputation : 2444
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Solved Re: How can you show piece of HTML on your post to members?

Post by manunitedfanlive on June 8th 2013, 7:17 pm

How do you mean? So no members can see it unless themselves have posted in the topic?

manunitedfanlive
Forumember

Male Posts : 60
Reputation : 1
Language : English
Location : London

http://manunitedlive.englishboards.com/

Back to top Go down

Solved Re: How can you show piece of HTML on your post to members?

Post by SLGray on June 8th 2013, 7:23 pm

Correct.



When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36663
Reputation : 2444
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Solved Re: How can you show piece of HTML on your post to members?

Post by manunitedfanlive on June 8th 2013, 7:23 pm

Oh right not so good no other way ?

manunitedfanlive
Forumember

Male Posts : 60
Reputation : 1
Language : English
Location : London

http://manunitedlive.englishboards.com/

Back to top Go down

Solved Re: How can you show piece of HTML on your post to members?

Post by SLGray on June 8th 2013, 7:30 pm

Sorry it is not possible.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36663
Reputation : 2444
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Solved Re: How can you show piece of HTML on your post to members?

Post by manunitedfanlive on June 8th 2013, 7:31 pm

OK, Thanks for you help appreciate it very much.

manunitedfanlive
Forumember

Male Posts : 60
Reputation : 1
Language : English
Location : London

http://manunitedlive.englishboards.com/

Back to top Go down

Solved Re: How can you show piece of HTML on your post to members?

Post by Ultron's Vision on June 8th 2013, 7:32 pm

I haven't found a solution via template editing, but you can use this JavaScript.
Assuming you are using the code tags (below, a reminder of what code tags look like), enter this under Administration Panel -> Modules -> HTML & JavaScript -> JavaScript pages management -> Create a new JavaScript, give it any title and check "In all the pages".

Code:
[code]These are code tags.[/code]

Code:
jQuery(document).ready(function(){ // this is JavaScript now

if(!(jQuery('#i_icon_mini_logout'))){

jQuery('td.code').each(function(){

jQuery(this).replaceWith('<td class="logged_out">You are currently logged out. <a href="/login">Log back in</a> or <a href="/register">register</a> to view this content.</td>');

});

}

});


Ultron's Vision
Forumember

Male Posts : 634
Reputation : 45
Language : English | German | HTML | JavaScript | PHP | C++ | Perl | Java
Location : Vienna, Austria

http://duelacademy.net

Back to top Go down

Solved Re: How can you show piece of HTML on your post to members?

Post by manunitedfanlive on June 8th 2013, 7:35 pm

Hmm.. not entirely sure of what you mean?

manunitedfanlive
Forumember

Male Posts : 60
Reputation : 1
Language : English
Location : London

http://manunitedlive.englishboards.com/

Back to top Go down

Solved Re: How can you show piece of HTML on your post to members?

Post by Ultron's Vision on June 8th 2013, 7:55 pm

Assume that you are using the code tags to display some HTML to your users so that they can make their own HTML documents or whatever.

You'd have something written like
Code:
<!DOCTYPE html>
<html>
<head>
<title>Your Document's Title</title>
<link rel="stylesheet" type="text/css" href="yourcssfilehere.css">
<meta name="robots" content="index, follow, noodp">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Access-Origin-Allow-Control" content="*">
</head>
<body>
<!-- and so on -->
</body>
</html>

With the JavaScript I provided above, only logged in users will actually see that text.

Ultron's Vision
Forumember

Male Posts : 634
Reputation : 45
Language : English | German | HTML | JavaScript | PHP | C++ | Perl | Java
Location : Vienna, Austria

http://duelacademy.net

Back to top Go down

Solved Re: How can you show piece of HTML on your post to members?

Post by manunitedfanlive on June 8th 2013, 8:09 pm

No its not for code tags, It's OK don't really need it would have been good to have it but since it seems like it's not possible it's OK Thanks for all you guys help! Smile

manunitedfanlive
Forumember

Male Posts : 60
Reputation : 1
Language : English
Location : London

http://manunitedlive.englishboards.com/

Back to top Go down

Solved Re: How can you show piece of HTML on your post to members?

Post by Ultron's Vision on June 8th 2013, 8:42 pm

You can always implement that code and tell your members to post HTML only within code tags Wink

Ultron's Vision
Forumember

Male Posts : 634
Reputation : 45
Language : English | German | HTML | JavaScript | PHP | C++ | Perl | Java
Location : Vienna, Austria

http://duelacademy.net

Back to top Go down

Solved Re: How can you show piece of HTML on your post to members?

Post by SLGray on June 9th 2013, 12:32 am

Topic Solved & Locked


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36663
Reputation : 2444
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum