We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Add your own custom page; Simple but effective; By mikehead
Topic Started: Jan 23 2010, 12:45 AM (192 Views)
Reid
Member Avatar
È una trappola!

This topic has been moved from our official support board.

Originally posted by: mikehead
Add your own custom page; Simple but effective
 
What it does: adds a new page and a link next to the portal and hides the board too! You can also make the page members only (see bottom of post)
PREVIEW: Click Here, just click the link next to the portal

Ok first of all the link next to the portal. THIS CODE WAS NOT CREATED BY ME!

Quote:
 

<script type='text/javascript'>
<!--
// add link on the portal side of the submenu
// code by ticlo/Stefan
function addSubmenuLink(url, text, blank) {
var e
e = document.getElementById('submenu')
if (e && e.nodeName == 'TABLE') {
e.rows[0].cells[0].innerHTML += ' · <a href="' + url + '"' + (blank ? ' target="_blank"' : '') + '>' + text + '</a>'
}}
addSubmenuLink("YOURSITE/index.php?act=mypage", "Custom Page")
// -->
</script>


Change the blue to your site
Change the red to the name of the page you want
Change the purple to the name of the link you want

Replace the <% BOARD %> tag with this
Quote:
 
<div id="board"><% BOARD %></div>


Now put what you want on that site where you want it and then put this around it
Quote:
 
<div id="custompage">
.
.
.
. The stuff to go on the custom page here!.
.
</div>
<div id="notloggedin">
PUT SOME CODE HERE THAT PEOPLE WILL SEE IF THEY ARE NOT LOGGED IN!
</div>

<script>
notloggedin.style.display="none";
var userlinks = document.getElementById('userlinks');
var user = userlinks.getElementsByTagName('A')[0].innerHTML;
if(userlinks.innerHTML.match(/Guest/)){
namet = "guest";
}
else if(userlinks.innerHTML.match(/Logged/)){
namet = "logged" ;
}

custompage.style.display="none";
if (location.href.match("act=what you put in the red before") && namet="logged") {
custompage.style.display="block";
board.style.display="none";
notloggedin.style.display="none";
}
else if (location.href.match("act=what you put in the red before") && namet="guest") {
notloggedin.style.display="block";
custompage.style.display="none";
board.style.display="none";
}

else {
custompage.style.display="none";
}
</script>


Just change the orange words to what you want as an id (no spaces obviously, they all have to be the same)
Change the red to what you put in the red before
Delete whats in green if you want anyone to view your page, keep it if you want only members

Now click the link next to the portal and you will be taken to you page!

EDIT:NOT WORKING UNDER RECONSTRUCTION!
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Codes & Modifications · Next Topic »
Add Reply