Not Solved Show/Hide Info User on Postbit
#1
Not Solved
Good morning, everyone. I wanted to know, if possible, if there is a possibility to show/hide user data in the postbit. If possible, how do I achieve the required result? Thanks in advance, as always, for your help.
Reply
#2
Not Solved
if you want add this feature for users to be able show or hide information for own postbit, you must define a custom field for each field and ask if they want be active or not , then in template (with condition in template plugin) you can check if that field was active (or any value you set) then show that field otherwsie not displayed
Reply
#3
Not Solved
Perhaps I have explained myself wrongly. I meant some kind of spoiler in the user info in the postbit. I have seen that some people use bootstrap but if I activate it in my forum all the tables change.
Reply
#4
Not Solved
(2024-09-17, 12:47 PM)SELLECK87 Wrote: Perhaps I have explained myself wrongly. I meant some kind of spoiler in the user info in the postbit. I have seen that some people use bootstrap but if I activate it in my forum all the tables change.

you mean you want be able hid/show info with a button in postbit?
if yes you can add button with css you want or a div element , then with Jquery on click toggle display elements status.
for example :
1. you add a element in postbit element
<button id="togglepostbit">Show/hid<button>
2. add below jquery code before </head> tag in showthread template (if you want for only showthread)
			<script type="text/javascript">
			$('# togglepostbit').on('click',  function (e) {
				e.preventDefault();
				$('#postbitbox').toggle();		
	});
			</script>
Reply
#5
Not Solved
You could use the HTML Summary tag.

Change the .... Template Sets >> "Your Templates" >> Post Bit Templates >> postbit_author_user

to:

<details>
	<style>.show-user-details {cursor: help;}</style>
  <summary class="show-user-details">Details</summary>
	{$lang->postbit_posts} {$post['postnum']}<br />
	{$lang->postbit_threads} {$post['threadnum']}<br />
	{$lang->postbit_joined} {$post['userregdate']}
	{$post['replink']}{$post['profilefield']}{$post['warninglevel']}
</details>

The style is just changing the cursor/pointer .... a choice here:
https://www.w3schools.com/cssref/pr_class_cursor.php
Reply
#6
Not Solved
(2024-09-17, 01:43 PM)Mostafa.Shiraali Wrote:
(2024-09-17, 12:47 PM)SELLECK87 Wrote: Perhaps I have explained myself wrongly. I meant some kind of spoiler in the user info in the postbit. I have seen that some people use bootstrap but if I activate it in my forum all the tables change.

you mean you want be able hid/show info with a button in postbit?
if yes you can add button with css you want or a div element , then with Jquery on click toggle display elements status.
for example :
1. you add a element in postbit element
<button id="togglepostbit">Show/hid<button>
2. add below jquery code before </header> tag in showthread template (if you want for only showthread)
			<script type="text/javascript">
			$('# togglepostbit').on('click',  function (e) {
				e.preventDefault();
				$('#togglepostbit').toggle();			});
			</script>

in my showthread template there is no </header>.
Reply
#7
Not Solved
that was a typo from Mostafa, he means </head>
support ended 
Reply
#8
Not Solved
It stays that way for me. The button does not go. This is my css

.togglepostbit {
	position: relative;
    display: inline-block;
    margin-top: 0.5rem;
    width: 50px;
    height: 26px;
    background-color: hsl(0, 0%, 85%);
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.25s ease-in;
}


Attached Files Thumbnail(s)
   
Reply
#9
Not Solved
Thanks for this idea .... I quite like it .... it looks rather neat!

So, if you don't mind then I will steal the idea and use it Big Grin 

But I am just using the HTML "Summary" tag as it does all that I need (with a small bit of css).

   

and on click:

   
Reply
#10
Not Solved
(2024-09-17, 04:02 PM)SELLECK87 Wrote:
(2024-09-17, 01:43 PM)Mostafa.Shiraali Wrote:
(2024-09-17, 12:47 PM)SELLECK87 Wrote: Perhaps I have explained myself wrongly. I meant some kind of spoiler in the user info in the postbit. I have seen that some people use bootstrap but if I activate it in my forum all the tables change.

you mean you want be able hid/show info with a button in postbit?
if yes you can add button with css you want or a div element , then with Jquery on click toggle display elements status.
for example :
1. you add a element in postbit element
<button id="togglepostbit">Show/hid<button>
2. add below jquery code before </header> tag in showthread template (if you want for only showthread)
			<script type="text/javascript">
			$('# togglepostbit').on('click',  function (e) {
				e.preventDefault();
				$('#togglepostbit').toggle();			});
			</script>

in my showthread template there is no </header>.

yes that is head tag , sorry for typo , and button not work for you because you are using classname , so for classname you must change jquery selector from
 $('# togglepostbit') 
to
 $('.togglepostbit')
# comes before ID
. comes before ClassName
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)