News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

AutoComplete conflict?

Started by biohazard388, April 04, 2012, 01:40:12 PM

Previous topic - Next topic

biohazard388

Hey all,

I'm an admin on a Sci-fi forum, and I recently tried adding this simple bit of code to our forum to allow our users to select different stylesheets. (or, in truth load a second sheet to change the look).


Link: hxxp:www.dynamicdrive.com/dynamicindex9/stylesheetswitcher.htm [nonactive]



Weird thing is, there must be some conflict arising our of its use because the auto-complete feature in the PM Sending page doesn't work anymore. I commented out the relevant code, and it began working again. I can't think why it would be conflicting (I'm new to javascript, so am not entirely sure what to look for in possible conflicting variable names or what-not.


Any advice?

Marcus Forsberg

There's actually a way to do this built in to SMF. Most do not know about this: Creating Multi-Style Themes. Using this method may help you along the way a little bit!

biohazard388

Thanks for the reply Marcus!



Being honest - and very nerdy here:

The reason we need the separate style sheets included is because we were having some fun switching out language packages on our forum. We were using this to include (at will) a seperate style sheet which overwrote the font-family to a custom @font-face declaration that used a custom font.



The way I was implementing this feature was with a simple radio button or drop-down menu selection at the bottom of the page. However, for some reason, it conflicted with the autocomplete feature. I have no idea why this would be a problem unless there is a javascript conflict somehow.






Another option I'm looking at is using IF logic to implement this.


For example:



if (($context['user']['is_logged'] && (action != pm)) {
     display the box
}





Trouble is, I'm going through all of this code, but cannot for the life of me figure out how to check to see if someone is on the PM page (to prevent the menu from showing up (and hopefully preventing the conflict?)






Marcus Forsberg

If that's your preferred way to solve it, then $_REQUEST['action'] will probably be the easiest way to check.

if (($context['user']['is_logged'] && ($_REQUEST['action'] !=' pm'))
// commence magic

vkot

I experienced the same problem with style switcher code similar to the one that biohazard388 mentioned.  I had to disable the code :(

It's not only the auto-complete, the pop-up message when receiving a new PM is also affected.
For specialized SMF installation/customization, Web Development, Linux Server Administration, click here.
Για εξειδικευμένες υπηρεσίες στα παραπάνω, πατήστε εδώ.

Petter B

I also have this problem. But I don´t have the style switcher code.
How can I find out what is causing this error?

live627

One of your scripts overrides window.onload with its own function. Please list your installed mods.

Kindred

First you posted to a solved thread that was potentially unrelated... Now you post the same question to yet another person's thread.   Please do not do that, cross posting the same question in multiple places is rude and against the rules.... Especially since the quests was answered in the other thread...
Сл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."

Petter B

Sorry, I thought you preferred reusing of old threads instead of starting new ones, I do in my forum.
I have now found out it is a custom made code in a SP-block that causes the problem.
Thank you all for your help :)

vkot

Quote from: Petter B on February 24, 2015, 01:34:36 AM
Sorry, I thought you preferred reusing of old threads instead of starting new ones, I do in my forum.

I thought so too. This is not the case, Kindred?
For specialized SMF installation/customization, Web Development, Linux Server Administration, click here.
Για εξειδικευμένες υπηρεσίες στα παραπάνω, πατήστε εδώ.

Illori

Quote from: vkot on August 11, 2015, 02:24:16 AM
I thought so too. This is not the case, Kindred?

nope, we rather users create a new topic on each issue as an old topic may or may not be the same exact issue. this also lets us track if the new person has their issue solved or not.

live627

That makes sense for the support boards, but coding? Seems more analog to me...

Kindred

except for the facts that a) the user had already started his own topic and this was now a duplicate, cross post and b) this user's question had nothing to do with the original poster's question - it was only tangentially related
Сл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."

Advertisement: