...

View Full Version : help with my tpl file



jon22
09-19-2009, 06:25 PM
Hi, i wondered if someone could help me quick, im trying to display some categories in blocks but i cant seem to get a div around the title and the sub cats without the page messing up. here is my tpl file for the navigation


<!-- BEGIN: navcategories -->
<div id="builtNav">
<p>{TITLE}</p>




<!-- BEGIN: group -->

{LINKGROUP}

<!-- BEGIN: li -->

<a href="{LINKDATA}"
class="{FONTSTYLE}">{DATA}</a>

<!-- BEGIN: openul -->

{OPENUL}

<!-- END: openul -->

<!-- BEGIN: subli -->

<a href="{SUBLINKDATA}"
class="{SUBFONTSTYLE}">{SUBDATA}</a>{COMMA}

<!-- END: subli -->

<!-- BEGIN: closeul -->

{CLOSEUL}

<!-- END: closeul -->

<!-- END: li -->

<!-- END: group -->

</div>

<!-- END: navcategories -->


And the php file

<?php
/*
+--------------------------------------------------------------------------
| AffiliStore 2
| ========================================
| Web: http://www.affilistore.com
| Email: admin (at) affilistore (dot) com
| License Type: AffiliStore 2 is NOT open source software and limitations apply
| Licence Info: Visit AffiliStore website and click on 'Licence'
+--------------------------------------------------------------------------
*/
if (eregi(".inc.php",$HTTP_SERVER_VARS['PHP_SELF']) || eregi(".inc.php",$_SERVER['PHP_SELF'])) {
echo "<html>\r\n<head>\r\n<title>Forbidden 403</title>\r\n</head>\r\n<body><h3>Forbidden 403</h3>\r\nThe document you are requesting is forbidden.\r\n</body>\r\n</html>";
exit;
}


// link group listings
$getListGroupNames = mysql_query("SELECT * FROM affiliSt_categories ORDER BY linkGroup ASC");
$listGroupNames = mysql_fetch_assoc($getListGroupNames);


$box_content = new XTemplate ("skins/".$configSkin['value']."/styleTemplates/navcategories.tpl");


// get link groups
do {
$groupresult = $listGroupNames['linkGroup'];
if ($storedGroupCategory != $groupresult && $groupresult != NULL) {
if ($listGroupNames['linkGroup'] == 'None') {
$box_content->assign("LINKGROUP",'<div class="linkGroup">Links</div>');
} else {
$box_content->assign("LINKGROUP",'<div class="linkGroup">'.$listGroupNames['linkGroup'].'</div>');
}

// category listing
$getNavCategory = mysql_query("SELECT * FROM affiliSt_categories WHERE parent = '0' ORDER BY name ASC");
$navCategoryList = mysql_fetch_assoc($getNavCategory);
$storedCategory = '';

// create navigation from category and brond list
do {
$catresult = $navCategoryList['id'];
if ($storedCategory != $catresult && $navCategoryList['linkGroup'] == $listGroupNames['linkGroup']) {
if ($catresult == $_GET['nc']) {
$box_content->assign("FONTSTYLE",'catNavOn');
} else {
$box_content->assign("FONTSTYLE",'catNavOff');
}

if ($navOpt[7] == 1) {
// html perma
$box_content->assign("LINKDATA",$installDir['value'].'categories/'.$catresult.'/'.urltxt($navCategoryList['name']).'.html');
} else {
// php link
$box_content->assign("LINKDATA",$installDir['value'].'index.php?case=categories&nc='.$catresult);
}

$box_content->assign("DATA",$navCategoryList['name']);



// brand listing
$sql = sprintf("SELECT * FROM affiliSt_categories WHERE parent = %s ORDER BY RAND()",
quote_smart($catresult));
$getNavBrands = mysql_query($sql, $databaseConnect) or die(mysql_error());
$navBrandList = mysql_fetch_assoc($getNavBrands);

if ($navCategoryList['subLinks'] == 1 && $navBrandList['id'] != NULL) {


$box_content->assign("OPENUL","<span>");
$box_content->parse("navcategories.group.li.openul");
$brandvalues = array();
$brandlinkvalues = array();
$brandrow = 0;

do {
$theresult = $navBrandList['id'];
if ($storedBrand != $theresult) {

if ($navOpt[7] == 1) {
// html perma
$brandlinkvalues[$brandrow] = $installDir['value'].'subcategories/'.$catresult.'/'.$theresult.'/'.urltxt($navCategoryList['name']).'/'.urltxt($navBrandList['name']).'.html';
} else {
// php link
$brandlinkvalues[$brandrow] = $installDir['value'].'index.php?case=subcategories&nc='.$catresult.'&nb='.$theresult;
}

$brandvalues[$brandrow] = $navBrandList['name'];

$storedBrand = $theresult;
$brandrow++;
} else {
$theresult = $navBrandList['id'];
}


} while ($navBrandList = mysql_fetch_assoc($getNavBrands));


$brandcount = count($brandvalues);
if ($brandcount < 4) {
$totalsublinks = $brandcount;
} else {
$totalsublinks = 4;
}


$nums = randiff(0,$brandcount,4);
$var1 = $nums[0];
$var2 = $nums[1];
$var3 = $nums[2];
$var4 = $nums[4];

if($brandcount > 1) {
for ($i=0; $i<$totalsublinks; $i++) {
$box_content->assign("SUBFONTSTYLE",'brandNavOff');
$box_content->assign("SUBLINKDATA",$brandlinkvalues[$var.$i]);
$box_content->assign("SUBDATA",$brandvalues[$var.$i]);
if ($i != $totalsublinks-1) {
$box_content->assign("COMMA",',&nbsp;');
} else {
$box_content->assign("COMMA",'...<br />');
}
$box_content->parse("navcategories.group.li.subli");
}
}

$box_content->assign("CLOSEUL","</span>");
$box_content->parse("navcategories.group.li.closeul");



}
// end sub nav


$box_content->parse("navcategories.group.li");


$storedCategory = $catresult;
} else {
$catresult = ucwords(strtolower($navCategoryList['id']));
}

} while ($navCategoryList = mysql_fetch_assoc($getNavCategory));


$box_content->parse("navcategories.group");
$storedGroupCategory = $groupresult;
} else {
$groupresult = $listGroupNames['linkGroup'];
}
} while ($listGroupNames = mysql_fetch_assoc($getListGroupNames));




$box_content->assign("TITLE","Categories");
$box_content->assign("SKIN",$configSkin['value']);
$box_content->parse("navcategories");
$box_content = $box_content->text("navcategories");
?>

Im just wondering if its the php, i dont know any php so im pretty stuck, heres a link (http://www.demo8.jamtitewebdesign.com/) to my site, im trying to get the categories in the middle to display in blocks and columns of 3 or 4. does anyone know how i can acheive this and if its a php or css issue?

If someone could provide a solution i would be very grateful and could pay you in kind, or money.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum