Last active
August 29, 2015 14:13
-
-
Save pratik60/8b400b46f303aa19b339 to your computer and use it in GitHub Desktop.
Litmus Test
This file contains 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
$lang = language_default('language'); | |
$rows = db_query("select * from url_alias where source like '%taxonomy%'")->fetchAll(); | |
$tids = db_select("taxonomy_term_data", "ttd") | |
->fields("ttd", array("tid", "language")) | |
->condition("ttd.language",$lang)->execute()->fetchAllKeyed(); | |
$bads = array('-0','-1','-2','-3','/' . $lang); | |
foreach ($rows as $row) { | |
$flag = 1; | |
foreach($bads as $bad) { | |
$tid = explode('/',$row->source); | |
if (strpos($row->alias,$bad) !== false && $flag==1) { | |
dsm($row->alias); | |
$flag = 0; | |
} | |
else if ($tids[$tid[2]]=='ko' && strpos($row->alias,$lang) !== false && $flag==1) { | |
dsm('DEFINITE ' . $row->alias); | |
$flag = 0; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment