Add more links to this script
2 posters
Page 1 of 1
Add more links to this script
Is it possible to add more links to this script...
- Code:
jQuery(function() {
if (document.location.href.indexOf('/f9-graphics-design') > -1 ) {
jQuery('.page-title').after('<div class="rules"><strong><span style="font-size: 18px;"><i class="fa fa-exclamation-triangle"></i> Forum rules</span></strong>
<br>
Hello and welcome to the community.</div>');
}
});
Last edited by Mati on September 5th 2015, 4:02 pm; edited 1 time in total
Re: Add more links to this script
Hi @Mati,
You mean for the condition, correct ? If so you can use regular expressions like this :
The forum ids are where you see "1|2|9" separate each individual forum id by a bar. ( | )
You mean for the condition, correct ? If so you can use regular expressions like this :
- Code:
jQuery(function() {
if (/\/f(?:1|2|9)-/.test(window.location.href)) {
jQuery('.page-title').after('<div class="rules"><strong><span style="font-size: 18px;"><i class="fa fa-exclamation-triangle"></i> Forum rules</span></strong><br>Hello and welcome to the community.</div>');
}
});
The forum ids are where you see "1|2|9" separate each individual forum id by a bar. ( | )
Re: Add more links to this script
Hi @Ange Tuteur
I'm not sure if I explained good but here is what I want to do
In the Forum Directory "Promote Your Forum" category I have 10 forums
And I want to add this code for each of them without adding the links
Forum link -> http://forumdirectory.forumotion.net/
I'm not sure if I explained good but here is what I want to do
In the Forum Directory "Promote Your Forum" category I have 10 forums
And I want to add this code for each of them without adding the links
- Code:
jQuery(function() {
if (document.location.href.indexOf('/f10-computers-internet') > -1 ) {
jQuery('.page-title').after('<div class="rules"><strong><span style="font-size: 18px;"><i class="fa fa-exclamation-triangle"></i> Forum rules</span></strong>
<br>
Welcome to Forum Directory! We want to thank you for wanting to submit your forum into our Forum Directory. \n We want to provide you with the best service possible, \n so if you have any suggestions, \n we will be glad to hear them.
<br>
<br>
<strong><span style="font-size: 18px;"><i class="fa fa-exclamation-circle"></i> Guidelines:</span></strong><br>
Before posting a new topic for our Forum Directory, \n we ask that you read through these few guidelines we have.
<br>
You are required to have minimum of 2 posts.
<br>
You may bump your topic every 12 hours.
<br>
We ask that you use the template when you open a new topic.
</div>');
}
});
Forum link -> http://forumdirectory.forumotion.net/
Re: Add more links to this script
Are you going to be using the same message for each section, or will they be different. Let me know
Re: Add more links to this script
Oh, in that case, you should be able to use the solution in this message. Just replace the after() content with whatever you want in those sections, and of course change the forum IDs to the ones you want it in.
Re: Add more links to this script
I got that @Ange Tuteur and how about this code?
- Code:
$(function() {
if (location.pathname == '/post' && location.search == '?f=10&mode=newtopic') {
$('#text_editor_textarea').val('[b]Field 1[/b]:\n[b]Field 2[/b]: Don\'t fill this field in\n[b]Field 3[/b]:');
}
});
Re: Add more links to this script
We should be able to do the same thing, except we'll only check for a match in location.search. ^^
10|11|12 is the same as the last script; the ids of the forums.
- Code:
$(function() {
if (/f=(?:10|11|12)&mode=newtopic/.test(window.location.search)) {
$('#text_editor_textarea').val('[b]Field 1[/b]:\n[b]Field 2[/b]: Don\'t fill this field in\n[b]Field 3[/b]:');
}
});
10|11|12 is the same as the last script; the ids of the forums.
Similar topics
» Help needed for a script to add https to some links
» Suggested Script (Need Someone that can read script)
» register Script (I Need The Script)
» script help
» Script Src
» Suggested Script (Need Someone that can read script)
» register Script (I Need The Script)
» script help
» Script Src
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum