Welcome Guest [Log In] [Register]
We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Multiquote (on) Multiquote (off)
Add Reply
BBCode in Topic Titles
Topic Started: Mar 17 2012, 06:44 PM (6,100 Views)
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Code Name: BBCode in Topic Titles

What the code does: This code will allow you to use the color, bold, underline, italic and strike-through BBCode tags in topic titles. Preview

How to use the code: Install as instructed, no editing is required.

How to install the code:

Admin CP Posted Image Themes Posted Image Board Template Posted Image Below the Board
Code:
 
<script type="text/javascript" src="http://z3.ifrm.com/63/1/0/p476647/BBCode_in_Topic_Titles.js"></script>
Edited by Cory, Oct 29 2016, 12:50 AM.
Offline Profile Quote Post Goto Top
 
2wise69
Member Avatar
Member
[ *  * ]
Awesome! Im using this code as well!
Offline Profile Quote Post Goto Top
 
docrikowski
Member Avatar
Zetaboards Enthusiast
[ * ]
Hi, it looks great but in the forum home page you see the codes in the Topic Titles (pic). Any way to fix it?
Thanks in Advance.

Posted Image
Edited by docrikowski, Mar 18 2012, 12:00 PM.
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Sorry about that, I've updated the code in the first post, see if that fixes it.
Offline Profile Quote Post Goto Top
 
docrikowski
Member Avatar
Zetaboards Enthusiast
[ * ]
Works perfectly. Thanks a lot. :)

EDIT: Just noticed that on the browser and tab bar it still shows the code. I don't know if that can be fixed. It's not a major issue but if it could be fixed it would be great. Thanks in advance.

Posted Image
Edited by docrikowski, Mar 19 2012, 07:31 AM.
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Code:
 
$('title').html($('title').html().replace(/\[(.+?)\](.+?)\[\/(.+?)]/gi,'$2'));
You can replace that with the following to eliminate any text between the brackets ([-]) in the title, essentially meaning BBCode.
Code:
 
$('title').html($('title').html().replace(/\[(.+?)\]/gi,''));
Offline Profile Quote Post Goto Top
 
docrikowski
Member Avatar
Zetaboards Enthusiast
[ * ]
Thanks a lot. It works very well now. :)
Offline Profile Quote Post Goto Top
 
wwjdstamper-ZNR
Member
[ * ]
Is there any way of not having it show the code in the portal on recent posts?
Offline Profile Quote Post Goto Top
 
GenSozo
Member Avatar
Member
[ * ]
Does this work for poll titles as well?
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
I updated the code for portal compatibility. However, some of the BBCode might show at the end of the title when cutoff by the ellipsis.

Yes, it works for all topic titles.
Offline Profile Quote Post Goto Top
 
Joshua J
Member Avatar
Member
[ *  *  * ]
dnt work for me still please hlp
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Link to your board?
Offline Profile Quote Post Goto Top
 
Longshot1-ZNR
Member Avatar
Retired Navy
[ * ]
Worked for me, but on the home page the topic title is not there and I have to post the title in the post then copy and paste it into the title block, can't do it in the title block.
Offline Profile Quote Post Goto Top
 
Ogk
Member
[ * ]
Nothing appears

Posted Image
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Can I see a link to both of your boards? I do not have this issue on my test board.
Offline Profile Quote Post Goto Top
 
Longshot1-ZNR
Member Avatar
Retired Navy
[ * ]
Sure Cory here it is

My Webpagehttp://s1.zetaboards.com/Outdoors__America/index/
Looks like I got that one figured out Cory, still having issues with the 24 hour thing though, lol.

Is there anyway to make this accessible to Admins only ?
Edited by Longshot1-ZNR, Apr 6 2012, 02:45 PM.
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Code:
 
<script type="text/javascript">
(function ($) {
$('table.posting').closest('form').submit(function (event) {
var value = $('input[name="title"]').val();
if (value.indexOf('[/') >= 0 && !$('#menu_acp').length) {
event.preventDefault();
alert('Only administrators are allowed to use BBCode in topic titles')
}
});
})(jQuery);
</script>
Place that below the code to only allow administrators the usage of BBCode in topic titles.
Offline Profile Quote Post Goto Top
 
Longshot1-ZNR
Member Avatar
Retired Navy
[ * ]
Thanks again Cory, you are good !
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
I found out what the issue was with the topic titles disappearing in the last post info column, I have fixed this issue.
Offline Profile Quote Post Goto Top
 
Dannyy
Member Avatar
Member
[ *  * ]
Hi, I've encountered a problem with the BBCode tags displaying when viewing the subforum. In my current forums, it looks like this:
Posted Image

However, I tried applying the same exact code in a test board, but do not run into this problem:
Posted Image

--
Link to problematic board: http://killorgy.com/index/

EDIT***

I've found the problem. I can't use any symbols, such as parentheses, curly braces, brackets, dashes, or even underscores in the topic titles; this will offset the code.

Would it be possible to allow these special characters?
Edited by Dannyy, May 2 2012, 09:19 PM.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
ZetaBoards - Free Forum Hosting
Free Forums with no limits on posts or members.
Go to Next Page
« Previous Topic · ZetaBoards Codes & Modifications · Next Topic »
Add Reply