game
Junior Member
Code Digger
Posts: 59
game said 0 great things
|
Post by game on Aug 25, 2012 1:03:32 GMT -8
Tested in IE, FF and Chrome This code adds 2 rows to the top of your forum which contains the latest topics that the user has participated in and a custom title bar. It also adds a welcome message to guest. The catch is that you need to use Proboards Rectangle Banner instead of the Leaderboard. It's actually not too big of a difference because this code sets focus to the latest topics on page load.( Only on Main Page) The latest topics are only displayed on the main page. It also hides the table that normally surrounds the banner and in result, the only thing that is displayed is the banner itself. Preview( Log In With User name::TestDummy Password: latesttopics) You can edit the title bar text for both members and guest at the top of the footer code. You can also edit style for both rows in the style sheet that I provided. How To Use In your admin panel, go to General Setting and choose the Rectangle Banner. Be sure to choose at least 1 latest topic to be displayed You can edit your guest message and log in box there also. Save the settings and enter the code. Global Header<style type = "text/css"> /*Latest Topics Styles*/ #LTPI_titlebar { background-color: blue; color: white; } #LTPI_row { color: black; background-color: white; padding: 5px 15px 10px 15px; } #LTPI_row a { color: blue; } </style> Global Footer<script type = "text/javascript"> //Most Recent Topics Participated in Displayed On Main Page //Placement: Global Footer //Coded By Game
//Edit Title Bar Welcome Message For Guest var TitleBarGuestMessage = "Hello Guest!";
//Edit Title Bar Welcome Message For Members var TitleBarMemberMessage = "Welcome Back "+pb_displayname+"!";
//No Need To Edit Below var LTPItable = document.getElementById("rectangle_table"); //Main Banner Table var LTPI = document.getElementById("rectangle_right_side"); //Most Recent Topics LTPItable.style.width = "100%"; LTPI.style.display = "none"; //Main Banner Table Shortcuts to Elements var shortcutA = LTPI.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode; var shortcutB = shortcutA.previousSibling.parentNode.parentNode.parentNode.parentNode. parentNode.parentNode; var shortcutC = shortcutA.firstChild; shortcutA.previousSibling.parentNode.parentNode.cellSpacing = "0"; shortcutA.previousSibling.style.display = "none"; shortcutB.className = ""; shortcutB.bgColor = "transparent"; shortcutC.align = "center"; shortcutC.style.backgroundColor = "transparent"; shortcutC.className = ""; if (pb_action == "home") {//Only Display Latest Topics, Focus and Rows On Main Page var i; var td = document.getElementsByTagName("td"); for (i = 0; i < td.length; i++) { if (td[i].className == "titlebg" && td[i].colSpan == "2") { //Assign forum table id td[i].parentNode.parentNode.parentNode.id = "forum"; } } //Add 2 rows to top of forum var table = document.getElementById("forum"); var titlerow = table.insertRow(0); var titlerowcell1 = titlerow.insertCell(0); titlerowcell1.className = "titlebg"; titlerowcell1.colSpan = "5"; titlerowcell1.id = "LTPI_titlebar"; var LTPIrow = table.insertRow(1); var LTPIrowcell1 = LTPIrow.insertCell(0); LTPIrowcell1.colSpan = "5"; LTPIrowcell1.innerHTML = LTPI.innerHTML; LTPIrowcell1.id = "LTPI_row"; //Assign Guest/Member Welcome Messages if (pb_username == "Guest") { titlerowcell1.innerHTML = TitleBarGuestMessage } else { titlerowcell1.innerHTML = TitleBarMemberMessage } //Set focus on Latest Topics for Main Page if(pb_action=="home"){ setTimeout(function(){window.scrollTo(0,table.scrollHeight)}, 2000)};
} </script>
|
|