inherit
Jack of All Trades, Master of None
27090
0
May 30, 2013 20:36:34 GMT -8
Stinky666
8,818
July 2004
stinky666
|
Post by Stinky666 on Feb 27, 2013 4:53:31 GMT -8
For some reason, i am thinking this can be accomplished via the template mods, but I honestly have no clue whether I am right or not. I hope it doesn't have to be a plugin. A H&F code would be fine. I'm looking for topic titles and names to cut off/shorten after a specific amount of characters, so it remains on one line etc. So for example, instead of: This is a loooooooong topic titleIt would auto change to: This is a loooooooon...Of course, the character cut off amount would be changed depending on whoever is using it and what theme it's on. if anyone can just confirm what type of code this has to be (temp mod, h&f, plugin), even that would be appreciated. pawl, Peter, Brian=D
|
|
inherit
tunesrcoolii@gmail.com
86185
0
Oct 3, 2013 8:48:20 GMT -8
tunescool
4,399
August 2006
tunescool
|
Post by tunescool on Feb 27, 2013 4:56:18 GMT -8
and to choose which links, like i just need my main page last posts
|
|
#eb7100
33409
0
1
Nov 24, 2024 4:27:37 GMT -8
Brian
48,130
November 2004
smashmaster3
|
Post by Brian on Feb 27, 2013 10:15:09 GMT -8
I have this at the bottom of the Home template for the Err Bear theme. It's also very old. If a link has the class lastpost its text will cut off after 22 characters. This requires you to manually change each link to have that class in your layout templates, though.
|
|
inherit
Jack of All Trades, Master of None
27090
0
May 30, 2013 20:36:34 GMT -8
Stinky666
8,818
July 2004
stinky666
|
Post by Stinky666 on Feb 27, 2013 10:22:07 GMT -8
I have this at the bottom of the Home template for the Err Bear theme. It's also very old. If a link has the class lastpost its text will cut off after 22 characters. This requires you to manually change each link to have that class in your layout templates, though. You're awesome. Is there any easy way to add a bit into it so it's not JUSt the lastpost ? For example I see this bit: if(threads[ti].className == "lastpost" if I wanted subject name too, could I add that in easily? Not sure how though if so.. ?
|
|
#eb7100
33409
0
1
Nov 24, 2024 4:27:37 GMT -8
Brian
48,130
November 2004
smashmaster3
|
Post by Brian on Feb 27, 2013 11:23:53 GMT -8
You'd have to find something unique to that particular link so it doesn't get every link ever on the page.
An alternative for the Last Post links on the main page could be if(threads[ti].href.indexOf('/threads/recent') != -1) since every thread URL in that column contains that string.
You might be able to get away with /thread/ if you want it everywhere, but I haven't tested it. It's just a lot of work to get it to work automatically as opposed to adding a class to every link you want it applicable to.
|
|
inherit
Jack of All Trades, Master of None
27090
0
May 30, 2013 20:36:34 GMT -8
Stinky666
8,818
July 2004
stinky666
|
Post by Stinky666 on Feb 27, 2013 11:27:52 GMT -8
You'd have to find something unique to that particular link so it doesn't get every link ever on the page. An alternative for the Last Post links on the main page could be if(threads[ti].href.indexOf('/threads/recent') != -1) since every thread URL in that column contains that string. You might be able to get away with /thread/ if you want it everywhere, but I haven't tested it. It's just a lot of work to get it to work automatically as opposed to adding a class to every link you want it applicable to. I'm more or less after it for EVERY "hyper link". And by hyperlink, I don't mean ones created in posts. I mean: Thread list subject, main page, Info center.. and even display names. Edit: Just to say, I haven't tested this yet, and wont do for a short while (a day or 2) because I am having a rest on themes (got some done in PaintShopPro, so still only ideas atm).
|
|
inherit
Jack of All Trades, Master of None
27090
0
May 30, 2013 20:36:34 GMT -8
Stinky666
8,818
July 2004
stinky666
|
Post by Stinky666 on Mar 3, 2013 14:56:14 GMT -8
Brian I attempted this earlier, and failed. Nothing changed at all Looking at my theme: stinky666themes2.freemessageboards.com to change the board topic title to be 22 characters, what exactly do I need to do? Thanks
|
|
inherit
tunesrcoolii@gmail.com
86185
0
Oct 3, 2013 8:48:20 GMT -8
tunescool
4,399
August 2006
tunescool
|
Post by tunescool on Mar 4, 2013 15:21:30 GMT -8
is there any way to get it to not include the one in the infocenter. or have it cut off at the end of a word month at the end, 27t 30t look weird
|
|
inherit
tunesrcoolii@gmail.com
86185
0
Oct 3, 2013 8:48:20 GMT -8
tunescool
4,399
August 2006
tunescool
|
Post by tunescool on Mar 6, 2013 2:37:02 GMT -8
is there any way to get it to not include the one in the infocenter. or have it cut off at the end of a word month at the end, 27t 30t it looks weird
|
|
inherit
Jack of All Trades, Master of None
27090
0
May 30, 2013 20:36:34 GMT -8
Stinky666
8,818
July 2004
stinky666
|
Post by Stinky666 on Mar 6, 2013 2:51:33 GMT -8
We should both tag him to annoy him Brian!!!
|
|
inherit
tunesrcoolii@gmail.com
86185
0
Oct 3, 2013 8:48:20 GMT -8
tunescool
4,399
August 2006
tunescool
|
Post by tunescool on Mar 6, 2013 6:31:40 GMT -8
it doesnt work on sub boards
|
|
inherit
Jack of All Trades, Master of None
27090
0
May 30, 2013 20:36:34 GMT -8
Stinky666
8,818
July 2004
stinky666
|
Post by Stinky666 on Mar 6, 2013 17:06:20 GMT -8
Ok so Brian, I have: <span class="lastpost">$[board.last_thread.recent_link]</span> for the board list, for example, and I have tried the code in different layout templates, and even the main footer.. <script type="text/javascript"> var threads = document.getElementsByTagName('a'); var thread_max = 12; for(var ti=0; ti < threads.length; ti++) { if(threads[ti].className == "lastpost" && threads[ti].innerHTML.length > thread_max) threads[ti].innerHTML = threads[ti].innerHTML.substring(0,thread_max)+"..."; } </script> Nothing
|
|
#eb7100
33409
0
1
Nov 24, 2024 4:27:37 GMT -8
Brian
48,130
November 2004
smashmaster3
|
Post by Brian on Mar 7, 2013 10:32:51 GMT -8
That's because the code is looking for <a> elements with the lastpost class, not spans. You need to make the actual links have the lastpost class or you'll be cutting off HTML instead of just text.
|
|
inherit
Jack of All Trades, Master of None
27090
0
May 30, 2013 20:36:34 GMT -8
Stinky666
8,818
July 2004
stinky666
|
Post by Stinky666 on Mar 7, 2013 17:34:03 GMT -8
That's because the code is looking for <a> elements with the lastpost class, not spans. You need to make the actual links have the lastpost class or you'll be cutting off HTML instead of just text. Ummmmm Brian You're my hero. You thought that was gonna lead to me screwing up.... again? Thanks again Ricky Brian - saw the other thread where you said it'd be the death of you
|
|
inherit
133146
0
Nov 16, 2024 15:51:08 GMT -8
Alanna 🥀🖤
3,564
November 2008
alannab
|
Post by Alanna 🥀🖤 on Oct 1, 2013 0:38:12 GMT -8
This isn't working for me for some reason. I have the character count as 10 and it's still really long! adoxography.boards.net/
|
|