Having trouble with a custom tooltip BBCode

Started by Josh4596, April 09, 2015, 03:12:45 AM

Previous topic - Next topic

Josh4596

Hey, so I've been working on a tooltip bbc code, I got it working but I'm having several issues.

Issue #1: I want to have it direct to the current theme directory for the css file so I can have a different style per theme so I used this:

<link href="' . $settings['theme_url'] . '/CustomCoding/Tooltip.css" rel="stylesheet" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<a class="tooltip" href="#">{option2}<span class="{option1}">{content}</span></a>


That doesn't seem to work properly but this does:

<link href="Themes/default/SpryAssets/Tooltip.css" rel="stylesheet" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<a class="tooltip" href="#">{option2}<span class="{option1}">{content}</span></a>

Am I using that $settings['theme_url'] wrong? Or is it becausebthe personalized bbc mod is using html and not php? If the latter is true is it possible for me to add this bbc manually within a source file of smf?

Here's issue #2.

Using the second code provided above, it works in simple portal blocks & post previews but it doesn't work inside of posts once they're posted. Doesn't quite make sense to me that it works properly in a post preview but not in the post itself.

If you need anymore information or would like my tooltip.css file to test for yourself just let me know.

P.S. Sorry if this is the wrong section. Try to post in the right places.

Jade Elizabeth

Why don't you add the classes to the css file, or the css file to the index.template.php files for each theme? ...and then you can just input the code "<a class="tooltip" href="#">{option2}<span class="{option1}">{content}</span></a>"

If I am using theme A I will see the css only from theme A, and if I am using theme B I will see from theme B. I just need to add the css to the file in that theme, or link the new css file to the index.template.php file for that theme (make sure you put the new css file with the other css in that theme).

Then you don't have to work out all this extra stuff and can focus on making the tag work how you want :). Does that make sense? Sometimes I explain things weird.
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Kindred

which, I might add, is along the lines of what I suggested that you do in your other thread on this same subject...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Josh4596

Quote from: Kindred on April 14, 2015, 10:32:19 AM
which, I might add, is along the lines of what I suggested that you do in your other thread on this same subject...

You seem to have a problem with me. Not quite sure why. Only reason you'd have is that I disagreed with you on something in PM, pretty maturely might I add. I said I won't do it that way because I've already done it this way and it's not hurting anyone being set up the way I have it. You just seem to love to disagree with me and tell me what to do without going into a single bit of detail. Why don't you just not bother posting in my support threads anymore? Because what you've offered me hasn't really been support. I never asked for your opinion on how exactly to implement this as I did pretty much all of the work myself, I only asked a few questions on how to get it linking to theme properly and you didn't even offer an explanation on that, still figured it out myself..

@Jade Elizabeth Thanks for the suggestion and explanation, and thank you for not assuming that everyone on here asking for help knows what they're doing.

Kindred

I don't have a problem with you...

I just have a problem (in general) with hacked together and poorly comprised coding...  :P
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Jade Elizabeth

Quote from: Josh4596 on April 24, 2015, 02:38:36 PM
@Jade Elizabeth Thanks for the suggestion and explanation, and thank you for not assuming that everyone on here asking for help knows what they're doing.

No worries, I usually have no idea what I'm doing whether I'm helping or asking for help as it is ha ha. Most of us here are learning too, so we really need to have some support even if it's a really crappy explanation.

Quote from: Kindred on April 24, 2015, 03:49:08 PM
I don't have a problem with you...

I just have a problem (in general) with hacked together and poorly comprised coding...  :P

But people who are learning make that, that's how they learn! The code you made a year or two ago probably feels disgusting to you now, hell mine does I just want to shoot myself when I see it ha ha.

I'm going to guess Josh is new to SMF, or new to coding for SMF too because he wasn't sure on the way SMF deals with themes, etc. I have a very basic understanding but I still find myself looking for things in the wrong place....especially as I want to become more and more familiar with the software and what I am building for it requires a more intimate understanding. It's hard learning PHP but it feels 100 times harder learning SMF because it's so involved and there's not exactly a whole lot of documentation on it from a coding perspective (for example: what function/variable does what, what goes where, where do I start, what variable should I use, how should I be using the context array, how do I add user settings and store them, how do I use the attachment system to upload something new like a profile picture [not avatar], How do I use the BBC editors etc to make my own post screen for posting say profile comments, how do I allow attachments in those comments using the current system, how do I use the forum censor for those comments, etc etc [Pretty much all questions I am legitimately asking for my current project]).

In another note it took me 3 weeks to get a timestamp to display forum_time() because no one would help me figure out how it was written. It turns out it was a really quick and easy fix where I'd put the wrong thing inside it without realising and I could have been helped a lot more and achieved my goal 3 weeks earlier if someone had taken the time to explain how it worked and taken a good look at it instead of saying my forum was broken if it didn't work.
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Kindred

oh, absolutely Jade....   I understand that he is new to coding (or at least new to SMF coding) -- and yep my original code stuff was not so pretty either.

That is one of the things that is frustrating...   because he is ignoring the advice from folks who are trying to suggest to him how he can do it better.. :P
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Jade Elizabeth

Yeah but some of us (myself included) want to do it our way first (and when I do it my way is almost always harder lol)...we learn through the struggle ha ha. I think sometimes we also don't understand why our way is crap or yours is better too so figuring out both is helpful twofold. Sometimes we need it reeeeally dummed down lol. I know I do quite often.

It's really hard for both sides to communicate over the internet sometimes too, when it comes to code. If we were talking in the real world, or you were talking to Josh face to face I think You'd have shown him what I explained pretty badly about the file structure etc. He'd have understood right away then lol. Also with time limitations and not knowing what the other person knows it's really hard to come across the way you intend, and to be able to help someone in a time effective way that is informative too. It happens to all of us (me too, people think I am a right cow in some places LOL).
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Advertisement: