Page 1 of 1
OBBLM Custom tabs
Posted: Sun Jun 14, 2015 2:44 am
by mzukerman
Does anyone have any custom tabs in OBBLM? For example, I'd like a simple HTML page that I can put some league history on. Another tab would be links to sites like this one or even to specific posts.
Posted: Sun Jun 14, 2015 7:24 pm
by Shteve0
Hello mate. Should be inherently plausible. Something similar to the 'Rules' section, yeah?
Re: OBBLM Custom tabs
Posted: Sun Jun 14, 2015 8:28 pm
by mzukerman
Yeah, just like that. We're using the Rules section though. Can we stand up another tab?
Re: OBBLM Custom tabs
Posted: Sun Jun 14, 2015 10:36 pm
by Shteve0
I don't see why not. I've got a couple of deadlines this morning but I'll take a look for you this afternoon.
Re: OBBLM Custom tabs
Posted: Thu Jul 16, 2015 10:49 pm
by dodger
You definitely can. I've added a Links tab to our page:
http://wppl.obblm.com
I want to say there were two maybe three different files/sections of code involved in getting it to add and load though.
Re: OBBLM Custom tabs
Posted: Thu Jul 16, 2015 11:09 pm
by dodger
Ok, in /lib/class_htmlout.php I added this:
<li><a href="index.php?section=rules"><?php echo $lng->getTrn('menu/rules');?></a></li>
<li><a href="index.php?section=links">Links</a></li>
<li><a href="index.php?section=about">OBBLM</a></li>
In index.php I added this:
// Check if a menu-link was picked, and execute section code from sections.php accordingly.
switch ($_GET['section'])
{
case 'login': sec_login(); break;
case 'admin': sec_admin(); break;
case 'teamlist': sec_teamlist(); break;
case 'coachlist': sec_coachlist(); break;
case 'rules': sec_rules(); break;
case 'links': sec_links(); break;
case 'about': sec_about(); break;
case 'matches': sec_matcheshandler(); break; // Tournaments, matches, match reports, recent matches, upcoming matches etc.
case 'objhandler': sec_objhandler(); break; // Object profiles, object standings.
default: sec_main();
}
And in sections.php this:
/*************************
*
* LINKS
*
*************************/
function sec_links() {
global $lng, $credits;
title("LINKS");
?>
Place the HTML for your new tab here and set display name in Title above.
<?php
}
Re: OBBLM Custom tabs
Posted: Mon Jul 20, 2015 11:00 pm
by funnyfingers
Moving forward with OBBLM, I have created some code updates that will load the menus dynamically from the modules. Also will load the module dynamically instead of needed to make edits in multiple locations. No ETA, but something that will happen.
Re: OBBLM Custom tabs
Posted: Tue Jul 21, 2015 4:54 pm
by mzukerman
Thanks guys!