Welcome Guest [Log In] [Register]
This board has been archived and is no longer accepting new questions. If you have a support question for your ZetaBoard, please visit us at the new support board. Registration is free and easy.


Visit the NEW ZetaBoards Support forum!

Username:   Password:
Add Reply
Using jQuery to create new pages
Topic Started: Jun 21 2008, 04:51 PM (1,675 Views)
simcityfreak4
Member Avatar
Member
[ * ]
When a user goes to this link at my ZB: http://s1.zetaboards.com/EXV2/index/gallery/

It loads up a gallery. But I am having trouble with my code:

Code:
 

if(location.href.indexOf("index/gallery/") != -1 || location.href.indexOf("index/gallery") != -1){
document.write('</div>')
var url = "http://localhost/galleryx/zb/index.php?b=" + board + "&m=" + member + "&2=" + GX3[1] + "&3=" + GX3[2] + "&4=" + GX3[3] + "&5=" + GX3[4];
GX4 = "<script src='" + url + "' type='text/javascript'><\/script>";
$(".category").toggle();
$("#foot_links").html("");
$("#foot_wrap").before(GX4);
}


I have used this same code before like this:

Code:
 

if(location.href.indexOf("index/gallery/") != -1 || location.href.indexOf("index/gallery") != -1){
document.write('</div>')
if(member != "Guest")
{
GX2 = "<iframe frameborder='0' height='2000' scrolling='0' src='http://galleryx.commx.info/index3.php?b=<?php echo $BoardC; ?>&u="+member+"' width='100%'></iframe>";
}
if(member == "Guest")
{
GX2 = "<dl class='notice info'><dt>Notice</dt><dd>You must <a href='"+main_url+"login/'>Log In</a> or <a href='"+main_url+"register/'>Register</a> so you can view the gallery!</dd></dl>";
}
Navigation = $("#nav");
Navigation.append("<li>→</li>  <li><span>Gallery</span></li>");
$(".category").toggle();
$("#foot_links").html("");
$("#foot_wrap").before(GX2);
}


And it worked just fine. It is suppose to place the code in the variable above the bar with the time and theme chooser, but the first code doesn't do that. It places it below that bar like this:

Posted Image

Does anyone know how to move the code above the time and theme choose bar?
Edited by simcityfreak4, Jun 21 2008, 04:56 PM.
Offline Profile Quote Post Goto Top
 
slayer766
Member
[ * ]
Try changing $("#foot_wrap").before(GX2); to $("#foot_wrap").after(GX2);
Offline Profile Quote Post Goto Top
 
simcityfreak4
Member Avatar
Member
[ * ]
(I need help with the first code, not the 2nd one. I said that in my post)

I tried that for the first code and it didn't help. :(
Offline Profile Quote Post Goto Top
 
Chris
Member Avatar
Member
[ *  *  *  * ]
I have a really simple method. :)

Quote:
 
$(".category:eq(0)").before(Content);
$(".category").remove();


Replace Content with the variable containing what should show up.
Offline Profile Quote Post Goto Top
 
simcityfreak4
Member Avatar
Member
[ * ]
So like this?

Code:
 

if(location.href.indexOf("index/gallery/") != -1 || location.href.indexOf("index/gallery") != -1){
var url = "http://localhost/galleryx/zb/index.php?b=" + board + "&m=" + member + "&2=" + GX3[1] + "&3=" + GX3[2] + "&4=" + GX3[3] + "&5=" + GX3[4];
GX4 = "</div><script src='" + url + "' type='text/javascript'><\/script>";
$(".category:eq(0)").before(GX4);
$(".category").remove();
}


I tried that and it was still the same :/
Offline Profile Quote Post Goto Top
 
Ben
Member Avatar
v_ben > c

Is there a reason you are not using the website maker to create this new page?
Offline Profile Quote Post Goto Top
 
simcityfreak4
Member Avatar
Member
[ * ]
/index/gallery looks better than /index/pages/gallery
Offline Profile Quote Post Goto Top
 
Ben
Member Avatar
v_ben > c

simcityfreak4
Jun 22 2008, 06:49 PM
/index/gallery looks better than /index/pages/gallery
Firstly, that's a stupid reason. The website maker is there precisely so you don't need to use clever JavaScript tricks to create new pages for your board. Secondly, it would be pages/gallery, not index/pages/gallery.
Offline Profile Quote Post Goto Top
 
simcityfreak4
Member Avatar
Member
[ * ]
See, the code I am using is suppose to make it easy so you don't have to use the website maker. It manages your board template and makes it easy to add codes. You add codes to the code I am making and it automatically adds it into the correct board template boxes. The gallery code I am making is a plugin for that code and if I have to use the website maker, it kinda defeats the purpose of making it easier for members to add a suite of codes easily.
Offline Profile Quote Post Goto Top
 
Chris
Member Avatar
Member
[ *  *  *  * ]
Ben
Jun 22 2008, 07:43 PM
simcityfreak4
Jun 22 2008, 06:49 PM
/index/gallery looks better than /index/pages/gallery
Firstly, that's a stupid reason. The website maker is there precisely so you don't need to use clever JavaScript tricks to create new pages for your board. Secondly, it would be pages/gallery, not index/pages/gallery.
I don't use the website maker because of the several issues it has at the moment.

1) </textarea> breaks the box
2) $ translates into the html version of $, so jQuery does not work.

He is modeling it after my Thunder Arcade mod (yes.. I know you took my stuff without asking again :P ) which explains why it doesn't use a web page.
Edited by Chris, Jun 22 2008, 09:31 PM.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · jQuery Help · Next Topic »
Add Reply