User Profile Buttons not working

Forum
Last Post
Threads / Messages

SapphirePhoenix

Adoptable Site Owner
Member
Joined
Nov 22, 2015
Messages
81
Points
0
Age
19
Location
Australia
Mysidian Dollar
5,356
I'm currently using the main theme and the user profile buttons (adoptables, visitor messages...) are not working. This is my header.tpl:

Code:
<!DOCTYPE html>
<html>
<head>
<title>{$browser_title}</title>
{$header->loadFavicon("{$home}favicon.ico")}
{$header->loadStyle("{$home}{$temp}{$theme}/media/style-city.css")}
{$header->loadStyle("{$home}{$css}/menu.css")}
{$header->loadAdditionalStyle()}
<!--[if lte IE 6]>
{$header->loadStyle("{$home}{$css}/media/dropdown_ie.css")}
<![endif]-->
</head>
</html>
 
After inspecting your pages directly, what I've determined to likely be the problem is that two versions of jQuery are loading and conflicting. This is caused primarily by adding jQuery to a theme, and it's happened to various users in the past -- the thing is, the jQuery is a profile asset and I use it for many things while making mods. But originally, it was really only used to control things like the tabs on the profile, so rather than include it as part of the theme, it was loaded only on the profile page. This means that, if it's part of your theme, two copies of jQuery try to load - and bad things happen.

First, remove </html> from the end of your header. That belongs at the end of the page, not at the end of your header. In fact, I'm just going to recommend you change your header.tpl to this (I added a couple lines) -

Code:
<!DOCTYPE html>
<html>
<head>
<title>{$browser_title}</title>
{$header->loadFavicon("{$home}favicon.ico")}
{$header->loadStyle("{$home}{$temp}{$theme}/media/style-city.css")}
{$header->loadStyle("{$home}{$css}/menu.css")}
{$header->loadAdditionalStyle()}
<!--[if lte IE 6]>
{$header->loadStyle("{$home}{$css}/media/dropdown_ie.css")}
<![endif]-->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> 
<script src="{$home}{$js}/tabs.js"></script>
<script> $(function() { $("#profile").organicTabs(); }); </script>
</head>

Now check your template.tpl file - if you're loading jQuery at the end of your template file - remove it from template.tpl. We only need it in the header. (Alternatively, leave it there, and add the new lines I added to the end of your header below where jQuery loads in your template.tpl instead of putting them in the header as I did.) Either way, only load jQuery once and load all embedded scripts after it.

That said, the tabs on the profile actually load their own copy of jQuery and it's causing conflict. Open up inc/tabs.php and delete the contents of the file (but not the file itself). That'll remove the reference to the older version of jQuery and will stop the profile from loading it's own copy and confusing the other one, which was causing all the scripts to come to a screeching halt and stopping the tabs from switching.

This should fix things up.
 
Last edited:
It should! So long as jQuery is loading once and only once on the page, and before any embedded scripts.
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,280
Messages
33,130
Members
1,603
Latest member
Monako
BETA

Latest Threads

Latest Posts

Top