Skip to content

Instantly share code, notes, and snippets.

@yordanzhelevdev
Created June 15, 2018 08:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yordanzhelevdev/54fd8515606a3775e31fa80cff5be694 to your computer and use it in GitHub Desktop.
Save yordanzhelevdev/54fd8515606a3775e31fa80cff5be694 to your computer and use it in GitHub Desktop.
<?php
// Links
$res = ads_data(array('position' => 3));
if ($res) links_html($res);
// Boxes
$cats_data = categories_data();
?>
<div id="cats" class="cl pw">
<?php
foreach ($cats_data['level1'] as $cat_id) {
$data = $cats_data['data'][$cat_id];
if (!$data['on_first']) continue;
$url = cat_url($cat_id);
$submenu = '';
if ($data['children']) {
foreach ($data['children'] as $sub_id) {
$subdata = $cats_data['data'][$sub_id];
if ($subdata['on_first'])
$submenu .= '<li><a href="'.cat_url($sub_id).'" title="'.$subdata['title'].'">'.$subdata['title'].'</a></li>';
}
}
$res = ads_data(array('cat_id' => $cat_id, 'position' => "4,5"), 4, 'ad_position, ad_order, ad_id');
$data['title'] = '<a href="'.$url.'" title="'.$data['title'].'">'.$data['title'].'</a>';
?>
<article class="fl clr menu-<?php echo $cat_id; ?>">
<div class="rel minh cl">
<h2><?php echo $data['title']; ?></h2>
<?php if ($submenu) { ?>
<ul class="fr">
<?php echo $submenu; ?>
</ul>
<?php } ?>
<a href="<?php echo $url ?>" class="col"><?php echo $lang['all']; ?> &rsaquo;</a>
</div>
<?php if ($res) ads_html($res); ?>
</article>
<?php
}
?>
</div>
<?php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment