|Printable Version of Topic
Click here to view this topic in its original format
|Jcink.com Forums > Feedback and Discussion > Odds and Ends Scripts|
|Posted by: Dusty Jul 16 2017, 03:16 AM|
| Hi there. Didn't like the idea of starting separate new threads, so I'm just going to start dumping all of my itty bitty scripts in here as they're created.
Mobile-friendly quote/code highlight and copy
CSS transitions friendly
Fixes redundant #QUOTE/#CODE IDs
JQuery recent topics filter/non-index cache
Filters and excludes topics by forum ID
Tooltip compatible, tooltip hover contains timestamp
Stock, parses into <li> elements
Updates on index page visit
Example courtesy of Delphi
JQuery shout-box adaptation
Expanded styling (user specific, etc)
Filtered doHTML/JC Ink BB code (prevents script execution/etc)
Auto-refresh and manual refresh
Not iframe based
Uses Font Awesome by default, but you do you
JQuery inline award menu
Currently in super beta
Appends an inline menu to the post-row template
Enables saving awards to be quickly re-used
|Posted by: Delphi Jul 16 2017, 08:18 AM|
| Easy to install, exactly what I needed, and although a little lippy the developer is a pretty awesome dude (He also doesn't mind when you ask him a gazillion unrelated questions) .
|Posted by: owl Jul 16 2017, 01:50 PM|
| These are really neat Dusty, I'll have to crack into some of these and play with them on my sites.
RE: Requests, if you're still taking them then it would be awesome (though I have no idea if it's possible) to do something about making the shoutbox a little more modern, particularly if there was some sort of sound indication if a new message was made?
Might not be possible, but I figured I'd try my luck. At any rate, thanks for the awesome scripts you've made already!
|Posted by: Dusty Jul 17 2017, 03:09 AM|
| Thanks Owl, and Delphi (though, y'know, maybe slightly less for that lippy comment )
I took a minute to explore the shoutbox settings page, and that actually seems entirely doable. I don't see why not, at least - there's enough to make a suitable c-box replacement, even. The username wouldn't be adjustable like they are with c-boxes, but anything else.. shooould? be doable.
Out of curiousity, what sort of modernization were you thinking about? Notification sounds should be simple enough.
|Posted by: kjrod98 Jul 17 2017, 01:58 PM|
|Oh, that recent topics code and the quote/code code are perfect.
If you're able to get notification noises for the cbox to work too, it'd be really nice to use the standard jcink cbox as an OOC chatbox instead of having to rely on cbox/ishoutbox/others. (Right now I've been using jcink's one as an in-character one, but it's so tedious to have to rely on a separate one)
Actually, that gives me an idea. Would it be possible to add a dropdown to the jcink cbox post form, that would have two options, one for IC and another for OOC (OOC being default, of course)? Depending on what is selected, that option specified could add a class/id to that particular comment, and then the frame could be switched into tabs to only show comments with that particular class/id. Theoretically it would mimic having a separate cbox for each/separate channels of a sort.
No clue how feasible the above would be, I haven't looked at the cbox code in... years, at this point lol. I've also been up and without coffee, so if that makes zero sense at all let me know.
|Posted by: owl Jul 17 2017, 09:36 PM|
I know some people have requested, in the past, that the avatar show up along side the messages but I don't think that's a make or break situation - any other modernization outside of a sound notification is mostly to do with style, and I think most of that could be handled with CSS (that being said if it's possible to inject some extra classes in there, that would be fantastic).
RE: Usernames, would it be possible to have a setting that:
1. Always used the name of the parent account, no matter what account was posting, or
2. Used a custom profile field to pull a preferred name?
I think it'd be a really useful script with or without any username customization, though - it's as simple as posting.
One thing that would be neat (if possible) would be the ability to delete your own posts with the variable shoutbox the way you can on /index.php?act=Shoutbox (which would hopefully eliminate some issues with posting with the wrong username) but that's all extra.
Thanks for considering this, by the way!
|Posted by: Rosalieart Jul 20 2017, 01:55 PM|
| Personally, if you're doing requests, i'd love some sort of tweak if possible to allow keys from the miniprofile to be used in the post rows section for custom html templates! not sure if it's possible though, haha.
Alternately, some sort of script that appends a sort of 'dice roll' to the posts that isn't editable members and can be set to spit out a line of text for random events, like "You found 20 coins!" "A slime has appeared."
Neither are vital or pressing, but both would be useful, i think!
|Posted by: Dusty Aug 5 2017, 04:35 AM|
whew lads. I'll upload this tomorrow or sometime when I'm not a zombie
kjrod98 that would certainly be possible, but you're killing me homie.
just kidding it wouldn't be too difficult at all. Maybe not right this second though!
Rosalieart Iii don't know that the random events would be possible (or at least, not in an un-editable fashion) actually. The only thing I can think of is removing the edit button (circumventable by editing the URL) or using the alert system to preserve a copy of the original roll in an admin's inbox, but I'm on my phone so I can't even check if that's an (ab)usable feature in the alert settings.
The miniprofile elements moved to the post would be totally doable, I'm just not sure why you would want to?
|Posted by: Rosalieart Aug 5 2017, 09:06 PM|
|re: miniprofile elements -- I have a custom post template that includes a top info bar section where I'd like to put, for example, the member's post count or some other miniprofile variables pertaining to the player and leave the miniprofile for IC information essentially. Plugging the keys in directly didn't make them display, probably because they're meant to be in the miniprofile one and not the post row template itself /shrugs either way, not a big issue haha.|
|Posted by: Dusty Aug 13 2017, 04:02 AM|
| Wheee, JQ Shoutbox is up. Should work for y'all, but I dunno.
As far as miniprofile elements, that's a fairly specific implementation, but you could do something general by writing a string with the miniprofile variables in it, and parsing it to distribute with .addClass()
|Posted by: multiplicity! Aug 13 2017, 05:01 AM|
I accomplish this by using CSS and HTML so it loads with the page, not after. Namely because it doesn't have a loading issue when I use the CSS/HTML method.
|Posted by: kjrod98 Aug 13 2017, 11:06 AM|
| Gonna have a go at testing the shoutbox code. It looks really nice!
|Posted by: Chlocelot Aug 14 2017, 05:51 PM|
|Dusty, I would just like to love on you a little and say thank you, thank you, thank you for these. I've been looking EVERYWHERE for the quote/code things. You Rock!|
|Posted by: Ekko Oct 24 2017, 01:13 PM|
| These scripts are so amazing!
So I tried out the Recent Topics filter and while it did indeed filter out the forums I didn't want showing on it (advertising forum most especially, so my Recent Topics clip wasn't full of link-backs) it seems to have done too well of a job. Now my Recent Topics isn't showing anything. When a post is made, it will pop up on the Recent Topics for a couple hours and then vanish. Not sure what's causing this?
The url of the site is: https://tortall.jcink.net
|Posted by: Dusty Oct 24 2017, 02:05 PM|
| I can't find your recent topics location, but I did just catch a dumb bug regarding the selector. Might fix it for you.
In other news, updated the JQ Shoutbox to enable channels:
Should work, no promises.
|Posted by: Ekko Oct 24 2017, 02:21 PM|
| Ah, my bad. Our Recent Topics clip is down in the footer/board stats area beneath "Today's Topics". In which it's completely blank. xD Will update and see if it does anything.
EDIT: ... I see what the issue is. If all of the "recent topics" are from forums you have hidden, it just shows nothing, like a display:none; effect rather than bumping the topics from the forums you DO want displayed up. Hahaha..
|Posted by: Dusty Oct 24 2017, 03:07 PM|
|JC Ink has a hard limit of 15 recent topics, so if the 15 most recent posts are all from excluded forums then it will show up as blank. Make sure to adjust the maximum setting in System Settings > Topics Posts & Polls|
|Posted by: Chlocelot Nov 8 2017, 07:03 PM|
I have tried saving your codes and just wanted to know if I am doing something wrong, specifically with quote and code boxes.
When I paste the code into the wrapper with <script> tags, it works perfectly but I tried creating a .js file with Notepad++ to load into the file manager, but if I do that, it stops working and I'm not sure why.
Am I missing something or is it not possible to upload and link that script?
|Posted by: Dusty Nov 8 2017, 07:30 PM|
|Link me to ya' page boyyo|
|Posted by: kjrod98 Dec 12 2017, 06:39 PM|
|Dusty - Loving the shoutbox, it's perfect!|
|Posted by: kjrod98 Jan 5 2018, 08:21 PM|
|Dusty -Found an error with the shoutbox, it won't parse messages if member group prefix/suffix have span tags or other styling in them.
Member group styling, they're all the same, just different classnames.
At first I thought it was the double quotes, so I switched them to single quotes and no change after I cleared the cbox of the original offending posts.
As you can see on my http://kjsage.jcink.net/ I have the cbox working as intended, with no member group styling and the exact same skin/webpage setup.
|Posted by: Dusty Jan 6 2018, 02:25 AM|
| Oh neat kjrod98 ! That's an easy fix, I think, depending on what kind of functionality you were looking for. Were you hoping to have the suffix/prefixes ported into the jq-box alongside the name, so that your name would be, in this case, pink?
For a temporary fix, this is just a selector mixup, and you shooould be able to fix it by editing line 173
and change it to
Also, now that I'm looking at my older scripts.. holy mudda of terrible coding practices.
|Posted by: kjrod98 Jan 6 2018, 08:35 AM|
| Dusty - I just needed it working, so the temporary fix works perfectly. I actually hadn't thought of making the member group styles apply to the cbox, could be neat to do if my other members wanted it but I'm fine either way.
Being able to see our own mistakes is a good thing! I know I cringed when looking through my old skins for a piece of code to use on this one, myself.
|Posted by: Dusty Jan 6 2018, 02:38 PM|
All fixed and uploaded to github! The latest script avoids using the :not selector, and adds an extra setting to use the logged-in member username complete with member group prefix and suffix.
|Posted by: kjrod98 Jan 6 2018, 06:53 PM|
Tested and it works quite nicely.
|Posted by: Verridith Jan 10 2018, 10:55 AM|
|Love the recent topics filter!! Using it on my board <3|
|Posted by: kjrod98 Feb 6 2018, 02:28 PM|
| Hmm, one of my members noticed that the notification sound for the shoutbox plays constantly and they're right LOL. (I always have music playing in the background so never hear chats going off at all. For now the one on-site is dead since we're all using skype to plan things, so made me jump a bit to hear it going off on it's own)
Also seems like the volume controls aren't working though that -might- be me just having the freebie version of fontawesome instead of the paid version? (unsure, could be entirely wrong though)
|Posted by: Dusty Feb 6 2018, 06:58 PM|
|kjrod98 whoops, I goofed! Both issues should be fixed (although as far as the volume controls, you can change the selectors down at the bottom of the script itself if you need to)|
|Posted by: kjrod98 Feb 6 2018, 07:50 PM|
|Dusty - all working now ^^ Thank you!|
|Posted by: Dusty Feb 22 2018, 05:31 AM|
| I'm a terrible person with terrible coding practices
(john i'm so sorry for spamming your servers aaaaaaa)
award images are just stand-ins for demonstrative purpose, but are creditable to rpg-d
this script appends a quick awards menu upon activation, which will prompt the user to log in (ACP session ID can be cached in localStorage, if desired). The 'Create New' tab enables the admin to create and send a new award to several accounts, whereas the 'Saved Awards' tab enables the admin to instead select several saved award 'templates' to be sent to those accounts.
This is preeeeetty rough stuff right now, but if you're interested in bug testing (because who doesn't love being a guinea pig?), you can find the download and installation instructions at https://github.com/duuuuuuuuuuuusty/JCF-Quick-Award
|Posted by: PANSY PARKINSON Feb 23 2018, 02:07 PM|
|Hey Dusty, loving all of these lil mods<3 Just wanted to pop in and say that lol.|
|Posted by: kjrod98 Apr 16 2018, 06:59 PM|
| Made a slight addition to the shoutbox code on my own site to unlink guest names for consistency, figured I'd share. Only works when user group prefix/suffix is set to false because laziness and unsure of how to go about that.
|Posted by: molzify Jun 30 2018, 12:18 PM|
| Dusty I feel like a massive noob for this but I don't know how to get the avatars working in the shoutbox! I know it gives directions on the github but I'm incredibly confused still XD
Like... where do I put the <div class="avatar"> < !-- |avatar| --></div> and then do I do this: "default_avatar_location = '.avatar img'," ?
|Posted by: Dusty Jul 1 2018, 12:45 AM|
| No biggy, I've been meaning to update these scripts!
The avatar element goes in your wrapper, somewhere. It can be set to display:none; and it'll still function. Then give the script its selector string in that variable, formatted like you would any regular CSS
|Posted by: molzify Jul 1 2018, 10:06 AM|
| Nope, I'm still managing to screw it up still :/
Heres what I have
|Posted by: Dusty Jul 1 2018, 02:51 PM|
|I'm not confident right now since I'm on my phone, but I believe the avatar variable resolves to an image element itself, rather than the direct URL. You'd need to do <div class='avie'><!-- |avatar| --></div> I think|
|Posted by: molzify Jul 1 2018, 03:42 PM|
|Man these avatars really don't want to show up XD I've tried deleting "img" in both the CSS and the settings, then alternating them and that hasn't worked either.|
|Posted by: Dusty Jul 3 2018, 04:37 PM|
|Sorry, I keep forgetting to check back in. Could I get a link to the page it's hosted on?|
|Posted by: molzify Jul 3 2018, 07:51 PM|
|I've made a thread over in general support as I dont want to hijack this thread with my problems XD https://forum.jcink.com/index.php?showtopic=29914|