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.

Subforums and topics

3 posters

Go down

Subforums and topics Empty Subforums and topics

Post by Sui May 16th 2013, 9:24 pm

hi , so i was doing my forum and basically what bugs me is the following situation: i was doing a Category (in this case called Simulation Racing Games) and inside it i wanted to make many subforums with the game name for example F1 2013 , Grid 2 and so on.. So i made them as a subforum, AND inside this subforum i had to make an other subforum to divide it between like Championship with Assists or without Assists , my point is , basically it keeps showing an other category with Topics and i kinda wanted to remove it like in the following picture picture so that it would just show the main subforums and people wouldnt be able to create topics outside of it...
thanks in advance for your help!
avatar
Sui
New Member

Male Posts : 12
Reputation : 1
Language : English

Back to top Go down

Subforums and topics Empty Re: Subforums and topics

Post by Ultron's Vision May 16th 2013, 9:34 pm

You can lock the topics inside the forum and only enable creating new forums in the desired categories.
Ultron's Vision
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

Subforums and topics Empty Re: Subforums and topics

Post by Sui May 16th 2013, 10:08 pm

Ultron's Vision wrote:You can lock the topics inside the forum and only enable creating new forums in the desired categories.

i actually locked the forum as you could see in the picture , but yet it still shows the sort of category for topics , i dont really know where to disable that for the subforum , it would help me alot if you could point out every step , thanks in advance!
avatar
Sui
New Member

Male Posts : 12
Reputation : 1
Language : English

Back to top Go down

Subforums and topics Empty Re: Subforums and topics

Post by Ultron's Vision May 16th 2013, 10:14 pm

You cannot, but if you can provide me your forum URL, I can find some CSS for you to hide it.
Ultron's Vision
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

Subforums and topics Empty Re: Subforums and topics

Post by Sui May 17th 2013, 6:55 am

Ultron's Vision wrote:You cannot, but if you can provide me your forum URL, I can find some CSS for you to hide it.
http://racingarena.forumotion.com/

EDIT: so anyone found out the CSS code?
avatar
Sui
New Member

Male Posts : 12
Reputation : 1
Language : English

Back to top Go down

Subforums and topics Empty Re: Subforums and topics

Post by Ultron's Vision May 17th 2013, 2:08 pm

You can try adding this...

Code:
div.main.paged {
display: none !important;
}
Ultron's Vision
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

Subforums and topics Empty Re: Subforums and topics

Post by Sui May 17th 2013, 2:11 pm

Ultron's Vision wrote:You can try adding this...

Code:
div.main.paged {
display: none !important;
}

woha it actually worked... but the problem is that now every Topic has been turned off... so basically every topic is hidden lol... any way to fix it?
like i just want the Topic thing to be hidden if there isnt any topic created in that section , like to not show a Category with TOPIC [0] because its really ugly to see..,
avatar
Sui
New Member

Male Posts : 12
Reputation : 1
Language : English

Back to top Go down

Subforums and topics Empty Re: Subforums and topics

Post by Ultron's Vision May 17th 2013, 2:18 pm

Ah, my bad...

Try doing it like...

Code:
div.paged {
display: none !important;
}

this.

If you could give me a list of all forums where you want it hidden, I could do something with jQuery for you, too.
Ultron's Vision
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

Subforums and topics Empty Re: Subforums and topics

Post by Sui May 17th 2013, 2:26 pm

Ultron's Vision wrote:Ah, my bad...

Try doing it like...

Code:
div.paged {
display: none !important;
}

this.

If you could give me a list of all forums where you want it hidden, I could do something with jQuery for you, too.

that didnt work.. the outcome was the same of the last command..
regarding the forums i want it hidden... its kinda of a problem because this forum is still in construction and basically if i dont understand properly the command i feel that i would need everytime to ask someone to fix it for me or something...
all though the main forum i want it to disappear from is this : http://racingarena.forumotion.com/f1-f1-2013
but obviously without also messing up the topics in the subforum...
avatar
Sui
New Member

Male Posts : 12
Reputation : 1
Language : English

Back to top Go down

Subforums and topics Empty Re: Subforums and topics

Post by Ultron's Vision May 17th 2013, 2:49 pm

Okay, remove all previous CSS I gave you and add this as a new JavaScript page (Administration Panel -> Modules -> HTML and JavaScript -> JavaScript pages -> Create a new JavaScript), check "In all the pages" and name it whatever you like.

Code:
if(window.location.pathname.indexOf("/f1") == 0){

jQuery('div.paged').css('display','none');

}
Ultron's Vision
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

Subforums and topics Empty Re: Subforums and topics

Post by Sui May 17th 2013, 2:55 pm

Ultron's Vision wrote:Okay, remove all previous CSS I gave you and add this as a new JavaScript page (Administration Panel -> Modules -> HTML and JavaScript -> JavaScript pages -> Create a new JavaScript), check "In all the pages" and name it whatever you like.

Code:
if(window.location.pathname.indexOf("/f1") == 0){

jQuery('div.paged').css('display','none');

}

nothing changed lol. like if the command did nothing.
avatar
Sui
New Member

Male Posts : 12
Reputation : 1
Language : English

Back to top Go down

Subforums and topics Empty Re: Subforums and topics

Post by Ultron's Vision May 17th 2013, 3:11 pm

Bah.

Try this...

Code:
jQuery(document).ready(function(){

if(jQuery(location).attr('href').indexOf('/f1-') > -1){

jQuery('div.main-head:nth-of-type(1)').css('display','none');
jQuery('div.main-content:nth-of-type(1)').css('display','none');

}

});
Ultron's Vision
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

Subforums and topics Empty Re: Subforums and topics

Post by Sui May 17th 2013, 3:22 pm

Ultron's Vision wrote:Bah.

Try this...

Code:
jQuery(document).ready(function(){

if(jQuery(location).attr('href').indexOf('/f1-') > -1){

jQuery('div.main-head:nth-of-type(1)').css('display','none');
jQuery('div.main-content:nth-of-type(1)').css('display','none');

}

});

nope still nothing changed... i dont get it...
avatar
Sui
New Member

Male Posts : 12
Reputation : 1
Language : English

Back to top Go down

Subforums and topics Empty Re: Subforums and topics

Post by Sui May 17th 2013, 7:46 pm

bump
still need help Sad
avatar
Sui
New Member

Male Posts : 12
Reputation : 1
Language : English

Back to top Go down

Subforums and topics Empty Re: Subforums and topics

Post by Ultron's Vision May 17th 2013, 9:35 pm

I got more ideas on this subject.

Code:
window.onload = function(){
if(window.location == "http://racingarena.forumotion.com/f1-f1-2013" || window.location == "http://www.racingarena.forumotion.com/f1-f1-2013"){
var cnthead = document.getElementsByClassName("main-head");
var cnt = document.getElementsByClassName("main-content");
cnthead[1].style.display = "none";
cnt[1].style.display = "none";
}
};
Ultron's Vision
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

Subforums and topics Empty Re: Subforums and topics

Post by Sui May 17th 2013, 10:07 pm

Ultron's Vision wrote:I got more ideas on this subject.

Code:
window.onload = function(){
if(window.location == "http://racingarena.forumotion.com/f1-f1-2013" || window.location == "http://www.racingarena.forumotion.com/f1-f1-2013"){
var cnthead = document.getElementsByClassName("main-head");
var cnt = document.getElementsByClassName("main-content");
cnthead[1].style.display = "none";
cnt[1].style.display = "none";
}
};

yay it worked!
now just to make sure that i understood how this javascript works.. for eventual new forums that i want to have the same effect i just have to write down a new javascript with between the "" the forum link?

EDIT: tried doing the thing above for other pages , it worked for the new page that i added but basically it removes the effect from the previous one, so its like the thing can only be used in a single forum... any ideas?
avatar
Sui
New Member

Male Posts : 12
Reputation : 1
Language : English

Back to top Go down

Subforums and topics Empty Re: Subforums and topics

Post by Ultron's Vision May 17th 2013, 10:24 pm

I'll elaborate...

window.onload is called when the whole document has loaded.
if the location of the current window is "http://example.com" or "http://www.example.com", look for the div containers with the empty topic list in it, then specify the second element of the array the methods used returns (arrays start counting at 0, so if you refer to the first element, you write [0], second one [1] etc.) and apply an inline style to it.
Then end the function. What other pages do you need it for?
Ultron's Vision
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

Subforums and topics Empty Re: Subforums and topics

Post by SLGray May 17th 2013, 10:33 pm

Sui wrote:
Ultron's Vision wrote:Bah.

Try this...

Code:
jQuery(document).ready(function(){

if(jQuery(location).attr('href').indexOf('/f1-') > -1){

jQuery('div.main-head:nth-of-type(1)').css('display','none');
jQuery('div.main-content:nth-of-type(1)').css('display','none');

}

});

nope still nothing changed... i dont get it...

Sui wrote:bump
still need help Sad
Please don't double/triple post. Your post need to be separated by 24 hours before bumping, replying or adding more information. Please use the edit button instead!

First Reminder


Subforums and topics Slgray10

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

Male Posts : 51463
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Subforums and topics Empty Re: Subforums and topics

Post by Sui May 17th 2013, 11:40 pm

Please don't double/triple post. Your post need to be separated by 24 hours before bumping, replying or adding more information. Please use the edit button instead!
First Reminder
@SLGray im sorry, but i actually bumped because i thought people just lost interest in trying to find a solution... won't happen again.

@Ultron basically i will need this function to work for every subforum that i consider as Category instead of topics ... but since i dont think you can create a Category into Category , im doing it this way...
Regarding what you tried to explain me i'm actually new in all this CSS / HTML / Javascript thing.. i dont have any basics about it basically so the way you tried to explain to me was kinda confusing... i hope that by showing me how to fix also this forum ill understand better how the function works.
avatar
Sui
New Member

Male Posts : 12
Reputation : 1
Language : English

Back to top Go down

Subforums and topics Empty Re: Subforums and topics

Post by Ultron's Vision May 18th 2013, 2:57 pm

Okay, I rewrote the script to fit your needs.

Code:
window.onload = function(){

var mncnt = document.getElementsByClassName("main-content");
var mnhead = document.getElementsByClassName("main-head");

if(window.location.pathname.indexOf("/f")>-1){

for(var i = 0; i < mncnt.length; i++){

if(mncnt[i].getElementsByClassName("tcl").firstChild.data == "No message."){
mncnt[i].style.display = "none";
mnhead[i].style.display = "none";
}

}

}

};

If you want me to explain how that works, you can contact me on Skype. My Skype is on my profile here.
Ultron's Vision
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

Back to top


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