The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

How do I make users see only their started threads in a forum?

3 posters

Go down

Solved How do I make users see only their started threads in a forum?

Post by Zellogi February 24th 2015, 7:08 am

Okay, I'm an administrator of a forum, me and my friend (he's the founder) are making it for a game we play, and we have a section where you can report other players for stuff like hacking or glitch abuse. We wanted to make it so threads can be seen by moderators, administrators, and only the user who started it. For example:

We have Admin, Player 1, and Player 2.

Player 1 reports Player 2 for hacking.
Player 1 and Admin can see the thread, Player 2 cannot.

Now, I know you can assign usergroups to prevent viewing, but that's not what I mean. I want the "Player Report" section to be visible, but not the threads inside. I want them to be viewable only by staff members and the user who started it. Kind of like a support ticket is only visible to the staff and person who created it. Is it possible to make a forum like this?


Last edited by Zellogi on February 25th 2015, 11:13 am; edited 1 time in total
Zellogi
Zellogi
Forumember

Male Posts : 38
Reputation : 1
Language : English
Location : USA

http://nogamenostory.userboard.net/

Back to top Go down

Solved Re: How do I make users see only their started threads in a forum?

Post by Zellogi February 25th 2015, 6:39 am

Bump.. no response yet.
Zellogi
Zellogi
Forumember

Male Posts : 38
Reputation : 1
Language : English
Location : USA

http://nogamenostory.userboard.net/

Back to top Go down

Solved Re: How do I make users see only their started threads in a forum?

Post by _Twisted_Mods_ February 25th 2015, 7:00 am

i have posted a script for this before just give me time to search threw my post and see if i can find it
_Twisted_Mods_
_Twisted_Mods_
Helper
Helper

Male Posts : 2083
Reputation : 336
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Solved Re: How do I make users see only their started threads in a forum?

Post by _Twisted_Mods_ February 25th 2015, 9:48 am

ok well i never posted it because the issue was solved b4 i could they ended up useing groups

before you decide to do this i just want to let you know this is going to be pointless if someone disables javascript 

but anyways goto acp>modules>javascript management

create a name script

title:your choice
placement : in sub forums

copy and paste the code below
Code:
$(function(){
   if(_userdata.user_level==1) return;
var   forumid = "/f6-spell-list";
   if(location.pathname==forumid){
      $('.forumline tbody > tr > td >.topictitle').each(function(){
   var aname   = $(this).parent().parent().find('.name').text();
   if(_userdata.username==aname){}else{
         $(this).parent().parent().remove();
   };
});   
};   
});

replace
Code:
/f6-spell-list

with the end of the forum url the topics will be in

then save


also something i would recommend that would be more secure is a html form that the user can fill out and it will send you a pm
_Twisted_Mods_
_Twisted_Mods_
Helper
Helper

Male Posts : 2083
Reputation : 336
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Solved Re: How do I make users see only their started threads in a forum?

Post by Zellogi February 25th 2015, 10:20 am

Thank you for your help, I will give the javascript a try. If you don't mind, can you also post how to create the HTML form, because I'm not sure how to do that. I appreciate your help though!


Edit:
After testing the JavaScript, it works in hiding the topic from the forum, but I can still access the topic I posted through the "Last Posts" section. Is there a way to disable that too?
Zellogi
Zellogi
Forumember

Male Posts : 38
Reputation : 1
Language : English
Location : USA

http://nogamenostory.userboard.net/

Back to top Go down

Solved Re: How do I make users see only their started threads in a forum?

Post by _Twisted_Mods_ February 25th 2015, 10:43 am

you will have to open a new topic for the html page

but for the last post

create a new script
placement:homepage

Code:
$(function(){
   $('.forumline tr:contains(yourforumtitle) td:last').attr('style','display:none');
});

replace yourforumtitle with the title of the forum .. its cap sensitive
_Twisted_Mods_
_Twisted_Mods_
Helper
Helper

Male Posts : 2083
Reputation : 336
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Solved Re: How do I make users see only their started threads in a forum?

Post by Zellogi February 25th 2015, 11:12 am

Thank you. This solves my question.
Zellogi
Zellogi
Forumember

Male Posts : 38
Reputation : 1
Language : English
Location : USA

http://nogamenostory.userboard.net/

Back to top Go down

Solved Re: How do I make users see only their started threads in a forum?

Post by Van-Helsing February 25th 2015, 12:03 pm

Hello @Zellogi,
Another solution is to create a new javascript as a second solution:

Placement: In the topics

and add the following code:
Code:

    $(function(){
    var login = _userdata["session_logged_in"];
    if(login === 0) {
    var message ='<img style="margin-right:6px;vertical-align: middle;" src="http://i.imgur.com/b8PNmbE.png" /><p style="display:inline; position:relative; top:1px;">To view this post you need to <a href="/register">Register</a> or <a href="/login" rel="hideodsigin">Login</a> on your account.</p>';
    var p = $('.post').find('.postbody div:eq(0)');
    var post1 = $('.post').find('.postbody div:eq(0)')[0];
    $(p).not(post1).html('<div style="background-color:rgba(255,217,217,.5); border:1px solid rgba(255,100,100,.7); border-radius:2px; padding:8px 12px;">
    '+message+'</div>');
    }
    });
Van-Helsing
Van-Helsing
Hyperactive

Male Posts : 2431
Reputation : 116
Language : English, Greek

http://itexperts.forumgreek.com/

Back to top Go down

Solved Re: How do I make users see only their started threads in a forum?

Post by _Twisted_Mods_ February 25th 2015, 12:16 pm

thats for post not topics
_Twisted_Mods_
_Twisted_Mods_
Helper
Helper

Male Posts : 2083
Reputation : 336
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Solved Re: How do I make users see only their started threads in a forum?

Post by _Twisted_Mods_ February 25th 2015, 12:16 pm

Topic solved and archived
_Twisted_Mods_
_Twisted_Mods_
Helper
Helper

Male Posts : 2083
Reputation : 336
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Back to top

- Similar topics

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