Quantcast
Channel: Digital Grin Photography Forum - SmugMug APIs, Hacks & Tricks
Viewing all articles
Browse latest Browse all 147

Bottom Java Spontaneously Combusted!

$
0
0
Hi all,

Today I was happy I'd finally get to sleep early and my only obsession on my smugmug site was seeing how pretty it is.

I followed Andy's tutorial on how to have a nice site with multiple pages and a custom navbar. I also added some bottom java from Andy's tutorial, some to switch the "gallery comments" text to "guests" in my guestbook and "my ramblings" in my blog, and finally I added some more bottom java to have my contact link from the bottom of my smugmug popup when a viewer clicks on the top link in my navbar.

It was all working splendidly, the only thing I did before I noticed everything not working is try to switch my galleries link in the HTML section of my navbar from a category (Nature) to galleries. That was the last bit of code before I was to be completly satisfied. upon switching Nature to categories though, not only did that not work for some reason, but my previously working "Find" page and the java I described above to change text and have my popup contact box stopped working. I am hoping you guys have some insight.

I thought this portion of my css code from Andy's tutorial (http://demo.smugmug.com/gallery/5568786_7mHz6) was responsible for making my galleries page work (like it used to work for my find page)

/* GALLERIES PAGE */

.galleries #bioBox,
.galleries #slideshowBox,
.galleries #photoVideoBox {
display: none;
}

.galleries #galleriesBox,
.galleries #categoriesBox,
.galleries #featuredBox {
display: block;
}


that is also where the top portion of my bottom java comes from:

function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}

if (hasPath("galleries"))
YD.addClass(document.body, "galleries");

if (hasPath("find"))
YD.addClass(document.body, "find");


the next part is to modify the text:

function ModifyText ()

{
if (YD.hasClass(document.body, "gallery_28540878"))
{
var objElement = YD.get("comment")
if (objElement != null)
{
var str = new String(objElement.innerHTML);
str = str.replace(/\gallery comments/gi, 'My Ramblings:');
objElement.innerHTML = str;
}
}
}

{
if (YD.hasClass(document.body, "gallery_28531462"))
{
var objElement = YD.get("comment")
if (objElement != null)
{
var str = new String(objElement.innerHTML);
str = str.replace(/\gallery comments/gi, 'Guests:');
objElement.innerHTML = str;
}
}
}

YE.onAvailable("comment", ModifyText);


the only way I could get it to work on both pages was to put it all in the same command parentheses (if thats what its called). that came from this link (http://help.smugmug.com/customer/por...y-comments%22-).

And finally, the last of the java is for my contact info from this link:
http://dgrin.com/showthread.php?t=18...t=contact+link


//--------------------------------------------------------------------------------------------------
// Install Email Contact Link (for pro accounts only)
//
// Version 1.1
//--------------------------------------------------------------------------------------------------

YE.onDOMReady(InitMyContactButton);

function InitMyContactButton()
{
InitMyContactButton.extraContactUsButtons = new Array;
var contacts = Sizzle(".customContactButton");
// look in Easy Customizer navbar too
var navEntries = Sizzle("#customNav li a");
for (var j = 0; j < navEntries.length; j++)
{
var str = navEntries[j].href;
if (str.search(/\/customcontact/i) != -1)
{
navEntries[j].onclick = function () {return false;};
contacts.push(navEntries[j]);
break;
}
}
var nick, o, matches;

// see if the nickname is already defined in the page
try {
nick = NickName || SM.hostConfig.nickname ; // get standard nickname
} catch (e) {}

// see if the nickname is in the URL
if (!nick)
{
try {
matches = window.location.host.match(/^(www.)?(.*)\.smugmug\.com$/i);
nick = matches[2];
} catch (e) {}
}

// see if we can get the nickname from one of the built-in contact links on the page
if (!nick)
{
// hack - NickName doesn't exist on some pages so we try to pull it from the password prompt or the standard footer
o = YD.get("contactUsButtonWrapper") || YD.get("contactUsButtonWrapperFooter");
matches = o.onmouseover.to

to reiterate, I have no idea what happened to this java that I did not touch and then decided to fail me. Please help me!

my site is www.jik-wildlife-photography.smugmug.com

Viewing all articles
Browse latest Browse all 147

Trending Articles