Hello,
Is there a php code to know the number of categories on my site with at least one gallery?
I would also need the numbers of models with at least one gallery?
For example <?php $categoriesnumber = .. ?>
Thank you.
Number of Categories and Models
Re: Number of Categories and Models
Well, you can do
<category num=1-100000>
<? $count++; ?>
</category>
<category num=1-100000>
<? $count++; ?>
</category>
Don't forget to run script update
Re: Number of Categories and Models
I have this code with another script which divide a list of categories by a specific number of ul ( columns ). Is it possible to do this with smartcj? I don't know what $categories stands for.
Code: Select all
<ul>
<?php $c = count($categories); $s = ceil($c / 5); foreach ($categories as $k => $v) : $n = $k + 1?>
<li><a href="<?=Inxy::url('best')->toCategory($v->name)?>" title="<?=$v->name?>" target="_blank"><?=ucfirst($v->name)?> <span>(<?=$v->published_gal_count?>)</span></a></li>
<?php if ($n % $s == 0) : ?>
</ul>
<ul>
<?php endif; ?>
<?php endforeach?>
</ul>
Re: Number of Categories and Models
well, looks like "php for beginners" might be a good book for you )
You can start with
<category num=1-100000>
<? $my_count++;
if ($my_count % 10 == 0) {
?>
</ul><ul>
<?
}
?>
</category>
If you need custom code - anybody with basic knowledge of PHP can do it
or you can save money by reading a some docs on this topic
You can start with
<category num=1-100000>
<? $my_count++;
if ($my_count % 10 == 0) {
?>
</ul><ul>
<?
}
?>
</category>
If you need custom code - anybody with basic knowledge of PHP can do it
or you can save money by reading a some docs on this topic
Don't forget to run script update