Created
May 13, 2010 00:23
-
-
Save aaronmcadam/399320 to your computer and use it in GitHub Desktop.
LG Better Meta Sitemap implementation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $IN; | |
// Getting the last segment of the URL | |
if (sizeof($IN->SEGS) > 1) { | |
$last_seg = ($IN->QSTR == 'index') ? $IN->SEGS[sizeof($IN->SEGS)-1] : $IN->QSTR; | |
} else if (sizeof($IN->SEGS) == 0) { | |
$last_seg = "home"; | |
} | |
else { | |
$last_seg = ($IN->QSTR == 'index') ? $IN->SEGS[sizeof($IN->SEGS)] : $IN->QSTR; | |
} | |
// Setting weblog_id by Segment | |
switch( $IN->SEGS[1] ) { | |
case 'about' : | |
switch( $IN->SEGS[2] ) { | |
case 'news' : | |
$weblog_id = 16; | |
break; | |
case 'events' : | |
$weblog_id = 31; | |
break; | |
case 'people' : | |
$weblog_id = 23; | |
break; | |
case 'careers' : | |
$weblog_id = 24; | |
break; | |
case 'contact' : | |
$weblog_id = 25; | |
break; | |
case 'referrals' : | |
$weblog_id = 30; | |
break; | |
default : | |
$weblog_id = 6; | |
} | |
break; | |
case 'news' : | |
$weblog_id = 16; | |
if ( $IN->SEGS[2] == "story" ) { | |
$weblog_id = 4; | |
$last_seg = $IN->SEGS[3]; | |
} | |
break; | |
case 'products' : | |
$weblog_id = 8; | |
if ( $IN->SEGS[2] == "product" ){ | |
$weblog_id = 3; | |
} | |
break; | |
case 'solutions' : | |
$weblog_id = 14; | |
if ( $IN->SEGS[2] == "solution" ){ | |
$weblog_id = 15; | |
} | |
break; | |
case 'industries' : | |
$weblog_id = 12; | |
if ( sizeof($IN->SEGS) == 2 ) { | |
$weblog_id = 13; | |
} | |
break; | |
case 'blog' : | |
$weblog_id = 19; | |
if ( sizeof($IN->SEGS) == 3 ) { | |
$weblog_id = 20; | |
} | |
break; | |
default : | |
$weblog_id = 2; | |
} | |
?> | |
{exp:lg_better_meta_pl:template url_title="<?php echo $last_seg; ?>" weblog_id="<?php echo $weblog_id; ?>"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For creating a sitemap with LG Better Meta plugin