Hide topics from specific member
5 posters
Page 1 of 1
Hide topics from specific member
This is the code I get from Ace 1 to hide posts from specific member
$(function() {
$('a[href="/u1"]').parents("div.post").css("display", "none");
});
Now, I want to hide the topic from specific member .. Is it possible ?
$(function() {
$('a[href="/u1"]').parents("div.post").css("display", "none");
});
Now, I want to hide the topic from specific member .. Is it possible ?
Last edited by TamDonCo on July 15th 2016, 3:16 am; edited 1 time in total
Re: Hide topics from specific member
Please use the BBCode code tags when posting coding.
- Code:
[code]$(function() {
$('a[href="/u1"]').parents("div.post").css("display", "none");
});[/code]
- Code:
$(function() {
$('a[href="/u1"]').parents("div.post").css("display", "none");
});
The topic was posted in the wrong section, so I have moved it to the correct section.
|
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Hide topics from specific member
I want to hide topics from user 1 so no one can see his/her topics
Re: Hide topics from specific member
APE wrote:user one is the founders account
sorry misunderstand
I can replace user 100 , 1 is just my example in the code
Re: Hide topics from specific member
ok the code is the same all you need to do is change u1 with u100
so under the code you already have ad the same code again but just change the u1 to u100 then to do this for more then 2 just add the same code again and then add the new number
like this:
so under the code you already have ad the same code again but just change the u1 to u100 then to do this for more then 2 just add the same code again and then add the new number
like this:
- Code:
$(function() {
$('a[href="/u1"]').parents("div.post").css("display", "none");
});
$(function() {
$('a[href="/u100"]').parents("div.post").css("display", "none");
});
Re: Hide topics from specific member
Thanks APE
I know that but that code we hide posts but I want to hide topics
I know that but that code we hide posts but I want to hide topics
Re: Hide topics from specific member
Hello, try using this javascript code in all pages:
This code removes all links that redirect to the topic built by the specific member. If you are in that topic the script will redirect you to other page.
I hope it is useful.
- Code:
$(function(){
//////////////////////
var specificMember = 'username'; //Edit
//////////////////////
var path = location.pathname;
var userTopic = '';
if(/^\/t\d+/.test(path)){
topic(cleanHref(path));
}
$('a[href^="/t"]').each(function(){
var t = $(this);
topic( cleanHref(t.attr('href')), t);
});
function cleanHref(href){
return href.replace(/#\d+$/,'').replace(/^\/t\d+p\d+/, href.match(/^\/t\d+/));
}
function topic(url, a){
$.get(url, function(data){
userTopic = $(data).find('.postprofile dt:eq(0)').text();
}).done(function(){
if(userTopic == specificMember){
a ? a.remove() : location.href = '/';
};
});
}
});
This code removes all links that redirect to the topic built by the specific member. If you are in that topic the script will redirect you to other page.
I hope it is useful.
Re: Hide topics from specific member
Thanks Araik
I am on the right track, the topic is still there but can not get in because it 's hidden, if we can hide the whole thing, very good
look at the pictures
before
after
I am on the right track, the topic is still there but can not get in because it 's hidden, if we can hide the whole thing, very good
look at the pictures
before
after
Re: Hide topics from specific member
I can't see the pictures. Can you prove other hosting (ex. imgur)?
Re: Hide topics from specific member
Ok, here's the corrected code. Let me know any problem:
- Code:
$(function(){
//////////////////////
var specificMember = 'username'; //Edit
//////////////////////
var path = location.pathname;
var userTopic = '';
if(/^\/t\d+/.test(path)){
topic(cleanHref(path));
}
$('a[href^="/t"]').each(function(){
var t = $(this);
topic( cleanHref(t.attr('href')), t);
});
function cleanHref(href){
return href.replace(/#\d+$/,'').replace(/^\/t\d+p\d+/, href.match(/^\/t\d+/));
}
function topic(url, a){
$.get(url, function(data){
userTopic = $(data).find('.postprofile dt:eq(0)').text();
}).done(function(){
if(userTopic == specificMember){
a ? delete_a(a) : location.href = '/';
};
});
}
function delete_a(a){
a.closest('.forumbg li.row, .forabg .lastpost, .forabg .search li.row').remove();
a.remove();
}
});
Re: Hide topics from specific member
Thank You So much, Araik
It works fine
Maybe I ask you here , I asked in other problem room , no solution
back to the Ace 1 code
$(function() {
$('a[href="/u1"]').parents("div.post").css("display", "none");
});
this code will hide the user posts from members, but when members logout as guests, they can see posts
Anyway to hide posts from guests too ??
It works fine
Maybe I ask you here , I asked in other problem room , no solution
back to the Ace 1 code
$(function() {
$('a[href="/u1"]').parents("div.post").css("display", "none");
});
this code will hide the user posts from members, but when members logout as guests, they can see posts
Anyway to hide posts from guests too ??
Re: Hide topics from specific member
One question per thread, please. If you want to invite someone in your thread, you can mention his/her username.
Problem solved & topic archived.
|
Similar topics
» Like system Disabled for a specific Member
» Signature Content Height Specific Member
» Recent Topics of a specific forum
» First post reminder in specific topics
» Adding a background onto a specific member's profile page.
» Signature Content Height Specific Member
» Recent Topics of a specific forum
» First post reminder in specific topics
» Adding a background onto a specific member's profile page.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum