Jump to content

Thread Tagging


ThriftStoreTeeth
 Share

Recommended Posts

Help me Obi Wan Kenobi Arceus! You're my only hope!

I'm trying to set up some Discord webhooks based on what threads are tagged with. I know the webhook itself is working with the 'pull all new threads and replies' option. The issue seems to be that its filtering out any tags I include on the thread creation page. For example, I put just the word 'open' in the tags field with nothing else, but it doesn't show up at the top of the thread/on the subforum view. If I edit the tag in with the little + after the thread is created, the tag shows up but it still doesn't send to the Discord server.

 

Not sure if I'm missing something, but my brain is doing a dumb that I'm going to blame on it being 5am and not being able to shift properly out of code and graphics mode.

 

Also, if you remember off the top of your head, where the hecky heck is .secondary used? I figured its a button, but I can't seem to track the darn thing down...

Candide: An original dystopian RPG

Link to comment
Share on other sites

If you are adding only one tag, you still need to separate by a comma. The comma is what triggers the script that adds it to the hidden field that sends with the post information. It needs to separate out of the text field. 

Fuck it's cold this morning. 

I believe it's used for like one or two buttons buried in the software. Like, I'm talking the recover password button or something. 

nusignature.png nusignature.png

I am the darkness, always watching, always listening, ALWAYS THERE.
(If you're interested in Plain of Ice, message me, it's private. Bleach site, non-canon.)

Link to comment
Share on other sites

@Arceus  OHHHHHHH!!!!! Okay, that makes sense now! I tried a combo adding a # and hitting enter cause that's what I'm used to, but didn't even think about adding commas because it was only one tag lol and no worries. I just copied over the colours from .primary when I realized I couldn't find it since I figured it was a button too. Thank you again! 

 

One last thing, and then I promise I'm done. I noticed there's a button-based theme switcher for the admin panel, and I want to do something similar to replace the 'Change Theme' dropdown. After some poking around in the admin version of the frame template, and found the php that makes it do the thing. I found snippets on StackOverflow that look about the same for a PHP CSS switcher, so I think all I need to do is change "if($user->admin_variant == 'dark')" to the non-admin equivalent, but I can't seem to figure out what that is. Am I on the right track with that, or is there something else I should try instead? 

I've already tried swapping the variable out for "$user->scheme == 'dark'" but it doesn't seem to do anything, and keeping the original if statement for the dropdown just gives me a 500 HTML error for the whole page.

Candide: An original dystopian RPG

Link to comment
Share on other sites

Nooo nonono you're doing that WAY too complicated. Just copy the URLs and recreate the front-end switcher with a button link running on the output of $theme->scheme, it's way simpler. Here's the button-based switcher for Winterlight so you can see what I mean.

                  <div class="floatright">
                        ',($theme->scheme == 'dark' ? '<a href="'.$settings->url.'/&theme=3&themevar=light"><span class="far fa-lightbulb" aria-label="Turn on the light"></span></a>' : '<a href="'.$settings->url.'/&theme=3&themevar=dark"><span class="fas fa-lightbulb" aria-label="Turn off the light"></span></a>'),'
                  </div>

Remember you'll likely have to add $theme to the global line before using it in the template.

Make absolute SURE the URLs are right before using this. If you don't have a theme #3 or variants named light and dark, it WILL implode on you and you can't fix this any other way than going into the database. (Default Eros is 1.)

nusignature.png nusignature.png

I am the darkness, always watching, always listening, ALWAYS THERE.
(If you're interested in Plain of Ice, message me, it's private. Bleach site, non-canon.)

Link to comment
Share on other sites

@Arceus Uhm... yeah, I broke it >.< I didn't see the edit about URLs making things implode, and it did the 'splode. Where do I go/what do I gotta do to fix it? And once its fixed, how would I find out what the variants are called? I've only edited the defaults.

Sorry for needing so much help with this. PHP/self-hosting is still new to me. I really do appreciate how helpful you've been though! Like, words can't express the appreciation!

Candide: An original dystopian RPG

Link to comment
Share on other sites

Whoops.

Uh if you haven't made a new theme, then the default Eros ones are light and dark like I have set up here. I actually don't have a way of seeing what variants are available for a theme right now without getting into the database.

 

So to fix the splodey, you'll get into the database, then get into the _registered table, find yourself, and then you'll change the reg_theme entry to 1.

image.png

Mine's 3, but pretend it's 1 lol

nusignature.png nusignature.png

I am the darkness, always watching, always listening, ALWAYS THERE.
(If you're interested in Plain of Ice, message me, it's private. Bleach site, non-canon.)

Link to comment
Share on other sites

@Arceus Okay, I did that and saved it and everything but the second I go back to my site, it forces theme back to 3 as soon as the page loads. I also tried putting the original dropdown theme switcher back in and tried it again, and it still did it.

Candide: An original dystopian RPG

Link to comment
Share on other sites

Hrm. What exactly did you do? Like give me a run-down and code snippets.

nusignature.png nusignature.png

I am the darkness, always watching, always listening, ALWAYS THERE.
(If you're interested in Plain of Ice, message me, it's private. Bleach site, non-canon.)

Link to comment
Share on other sites

@Arceus Not a ton, really. I added $theme to the global line for the menu strip, took this out

            if(!empty($page->themes) && count( (array) $page->themes[0]->variants) > 1)
            {
                  echo '
                  <span class="optchange">
                        <a href="#" id="changetheme">'.$text->changetheme.'</a>
                        <div class="optdrop" id="themeopt" style="display: none">';
                        foreach($page->themes as $theme)
                        {
                              foreach($theme->variants as $varkey => $var)
                              {
                                    echo '
                                    <a href="',$settings->url,'/&theme=',$theme->id,'&themevar=',$varkey,'">',$theme->name,': ',$var->name,'</a>';
                              }
                        }
                        echo '
                        </div>
                  </span>';
            }

and replaced it all with this:

            if(!empty($page->themes) && count( (array) $page->themes[0]->variants) > 1)
            {
                  echo '
',($theme->scheme == 'dark' ? '<a href="'.$settings->url.'/&theme=3&themevar=light"><span class="far fa-lightbulb" aria-label="Turn on the light"></span></a>' : '<a href="'.$settings->url.'/&theme=3&themevar=dark"><span class="fas fa-lightbulb" aria-label="Turn off the light"></span></a>'),'';

            }

Then when everything went sideways, I took the second code out and put the first back in.

 

I do have a second admin account that I preregistered for a friend and was using to test some stuff as well before I promoted him to an admin. I can hijack that account for myself. Like maybe delete the one I borked from the database, and change his account from id_registered 2 to id_registered 1. Not sure if that'll break anything, but I also haven't posted any threads with the account I borked either.

Edited by ThriftStoreTeeth

Candide: An original dystopian RPG

Link to comment
Share on other sites

Ah, actually.

Try clearing your cookies for your site, then set the theme back to 1 in database, and THEN load the page, because I think Vesta might be resetting it based on what you've got for your theme in cookies (this is for guest switching).

nusignature.png nusignature.png

I am the darkness, always watching, always listening, ALWAYS THERE.
(If you're interested in Plain of Ice, message me, it's private. Bleach site, non-canon.)

Link to comment
Share on other sites

@Arceus ...yknow, I should've known to clear my cookies now that you say it, but instead my brain was just hitting the panic button cause things were broken lol That worked! Thank you so much! I really appreciate you helping/answering all the weird questions I've thrown down this last week. I don't know many people that wouldn't have just told me to F off by now, or refused to walk me through learning this stuff. I shall eat a cookie in yours and Vesta's honour!

  • You're Welcome 1

Candide: An original dystopian RPG

Link to comment
Share on other sites

Trust me, you've yet to get anywhere near the weirdest question I've ever gotten.

nusignature.png nusignature.png

I am the darkness, always watching, always listening, ALWAYS THERE.
(If you're interested in Plain of Ice, message me, it's private. Bleach site, non-canon.)

Link to comment
Share on other sites

@Arceus The temptation to be a smartass and ask if Vesta can somehow control smart home tech, but I'm sure there's a way to Rube-Goldberg that through Discord integrations... I am curious about what the weirdest thing you've been asked is though 👀

 

Also, I'm going to throw it out there that if you ever want someone for CSS/HTML or graphics (even if its just to off-load something you've been putting off), my inbox is always open. I'm not the 100% most amazing coder or Photoshopper out there, but I'm pretty competent with it.

 

ETA: Nvm. Answered my own question lol

Edited by ThriftStoreTeeth

Candide: An original dystopian RPG

Link to comment
Share on other sites

I don't think so. ... if it can, well, I didn't teach it that.

And I can't remember the semantics of it, but it required loading something on the index page that has no business being loaded there (basically it was a CPU overload begging to happen). There've been a few other doozies but mostly I've blocked them out for the sheer stupidity of them. I used to work internet support, too, and also supported tech systems in a K-12 school district. I've seen some Shit.

I'm a pretty nice person though, and can tell the difference between ignorance and actual stupidity. I'm even known to be nice to trolls. It takes a lot to get under my skin. Genuinely not knowing something and asking about it won't do it.

nusignature.png nusignature.png

I am the darkness, always watching, always listening, ALWAYS THERE.
(If you're interested in Plain of Ice, message me, it's private. Bleach site, non-canon.)

Link to comment
Share on other sites

@Arceus Give me the rest of the week, and far more coffee than any human being has any business consuming, and we'll find out! 

Guessing it was something that would end up in a recursive script running. But yeah, I can see how that would be a problem lol I used to admin RP forums on a self-contained site built with broken custom/modded Invision code, and seen my members do/try to do some crazy shit with code too. Now I don't trust anyone with code on my sites cause the only person who breaks them is me, damn it!

I can tell, and I really do appreciate it, honestly! There's not a lot of people who are okay with someone digging into the guts of their stuff, poking things to see what they do/understand how it works better, and then being asked for help with cleaning up the mess the curious idiot made.

Candide: An original dystopian RPG

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use, Guidelines and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.