-
AuthorPosts
-
tophe Friend
tophe
- Join date:
- June 2006
- Posts:
- 24
- Downloads:
- 0
- Uploads:
- 2
- Thanks:
- 3
- Thanked:
- 2 times in 1 posts
November 7, 2008 at 11:32 pm #135177Hi,
Because I am putting number icons in the Category Names of the news item boxes, I need for the newsitem Category boxes to read left to right in their ordering…
— Please see the attached screen cap. Site is not live yet so no url posible.That is:
In ja_news I would like to make blog.php put category items on the page like this:
1 2 3
4 5 6– and NOT
1 3 5
2 4 6Reordering categories in the mod_janews module params… (from within Joomla Admin)… does not do it.
I have tried all sorts of tweaks to the FOR loops in blog.php… to no avail.Any help from a real programmer familiar with ja_news would be appreciated.
Thanks
Anonymous ModeratorJA Developer
- Join date:
- September 2014
- Posts:
- 9914
- Downloads:
- 207
- Uploads:
- 152
- Thanks:
- 1789
- Thanked:
- 2008 times in 1700 posts
November 8, 2008 at 3:14 am #278527Hi tophe,
You can change this script in this blog.php file:
<?php
$k = 0;
for ($z = 0; $z < $cols; $z ++) :
$cls = $cols==1?’full’:($z==0?’left’:($z==$cols-1?’right’:’center’));
?>
<div class=”jazin-<?php echo $cls;?>” style=”width:<?php echo $width;?>%”>
<?php for ($y = 0; $y < ($news / $cols) && $k<$news; $y ++) :
$params->set(‘blog_theme’, $themes[$k]);
$rows = $contents[$k];
if($catid) {
include(dirname(__FILE__).’/blog_item.php’);
}
$k++;
endfor; ?>
</div>
<?php endfor; ?>To
<?php for ($y = 0; $y < ($news ) ; $y ++) :
$cls = $y % $cols == 0 ?’left’:(($y + 1) % $cols == 0?’right’:’center’);
if($y % $cols == 0){
echo “<div style=’clear:both’></div>”;
}?>
<div class=”jazin-<?php echo $cls?>” style=”width:<?php echo $width;?>%”>
<?php
$params->set(‘blog_theme’, $themes[$y]);
$rows = $contents[$y];
if($catid) {
include(dirname(__FILE__).’/blog_item.php’);
}
?>
</div>
<?php
endfor; ?>You can use $y parameter for your requirement.
I had checked. It worked very good.1 user says Thank You to JA Developer for this useful post
tophe Friendtophe
- Join date:
- June 2006
- Posts:
- 24
- Downloads:
- 0
- Uploads:
- 2
- Thanks:
- 3
- Thanked:
- 2 times in 1 posts
November 8, 2008 at 4:06 am #278533Thanks JA Dev,
That solution worked a treat and saved some of my hair as well….
… once I translated the smiley !… For others the above sad-smiley = colon ((May you and your family grow rich and happy 😀
********
For anyone else trying to achieve this result:I varied blog_item.php as follows:
First, I setup a folder of number icons in joomla-root/images/num (make or find your own icons)Then, in blog_item.php at around line 25
$num = $y + 1 ; // the $y carries over from the blog.php solution as per "JA Dev" solution in this thread.
$str_imgNum = "<img src='images/num/num_gold_" . $num . ".gif' width='18' height='18' border='0'>";
?>
<div class="jazin-boxwrap jazin-theme<?php echo $cls_sufix;?>">
<div class="jazin-box">
<?php if ($showcattitle) : ?>
<div class="jazin-section clearfix">
<a href="<?php echo $catlink;?>" title="<?php echo trim(strip_tags($catdesc));?>">
<span><?php echo $str_imgNum ; ?>Â <?php echo $cattitle;?></span>
</a>
</div>
<?php endif; ?>
Also, you will probably want to look at ja.new.css for the appropriate classes
div.jazin-section a span {
…
}
Tophenoibihappy2009 Friendnoibihappy2009
- Join date:
- January 2009
- Posts:
- 62
- Downloads:
- 0
- Uploads:
- 8
- Thanked:
- 6 times in 1 posts
February 6, 2009 at 8:04 am #289855I’m not really understand
Hack blog.php and blog_item.php both of it ???
What’s $num use for ?tophe Friendtophe
- Join date:
- June 2006
- Posts:
- 24
- Downloads:
- 0
- Uploads:
- 2
- Thanks:
- 3
- Thanked:
- 2 times in 1 posts
February 6, 2009 at 8:46 pm #289970Hi,
If you look here…
http://d1152899.i86.quadrahosting.com.au/ – just a devevlopment site I’m working on.You see I have the news blocks witha NUMBER icon in each box – because my client wanted it to be so.
In the above post, $num is there to vary the tag for the icon:
<img src='images/num/num_gold_" . $num . ".gif'
so, with each loop cycle, I get:
num_gold_1.gif
num_gold_2.gif
num_gold_3.gif
… etcAs stated above,
First, I setup a folder of number icons in joomla-root/images/num (make or find your own icons)Of course, if you don’t wish to use number icons …. just ignore the post about varying blog_item.php
Hope that helps to clear it up… I thought I had made it clear 🙂
noibihappy2009 Friendnoibihappy2009
- Join date:
- January 2009
- Posts:
- 62
- Downloads:
- 0
- Uploads:
- 8
- Thanked:
- 6 times in 1 posts
February 7, 2009 at 9:48 am #290016<em>@JA Developer 89940 wrote:</em><blockquote>Hi tophe,
You can change this script in this blog.php file:
<?php
$k = 0;
for ($z = 0; $z < $cols; $z ++) :
$cls = $cols==1?’full’:($z==0?’left’:($z==$cols-1?’right’:’center’));
?>
<div class=”jazin-<?php echo $cls;?>” style=”width:<?php echo $width;?>%”>
<?php for ($y = 0; $y < ($news / $cols) && $k<$news; $y ++) :
$params->set(‘blog_theme’, $themes[$k]);
$rows = $contents[$k];
if($catid) {
include(dirname(__FILE__).’/blog_item.php’);
}
$k++;
endfor; ?>
</div>
<?php endfor; ?>To
<?php for ($y = 0; $y < ($news ) ; $y ++) :
$cls = $y % $cols == 0 ?’left’:(($y + 1) % $cols == 0?’right’:’center’);
if($y % $cols == 0){
echo “<div style=’clear:both’></div>”;
}?>
<div class=”jazin-<?php echo $cls?>” style=”width:<?php echo $width;?>%”>
<?php
$params->set(‘blog_theme’, $themes[$y]);
$rows = $contents[$y];
if($catid) {
include(dirname(__FILE__).’/blog_item.php’);
}
?>
</div>
<?php
endfor; ?>You can use $y parameter for your requirement.
I had checked. It worked very good.</blockquote>Thank you, and in this code what’s use for $y ?
noibihappy2009 Friendnoibihappy2009
- Join date:
- January 2009
- Posts:
- 62
- Downloads:
- 0
- Uploads:
- 8
- Thanked:
- 6 times in 1 posts
February 7, 2009 at 9:55 am #290017Thank you.
But still have prob with your patch on blog
ExampleCatA | Cat B (for some reason these text is longer)
——– | ——-
——- | ——–
xxxxxx x ——–
xxxxxx x ——–
xxxxxx x ——–
Cat C | Cat Dx: space (nothing show on)
I want fix it like this
CatA | Cat B (for some reason these text is longer)
——– | ——-
——- | ——–
Cat C | ——–
—– | ——–
—– | ——–
| Cat DThank you so lot
AuthorPostsViewing 7 posts - 1 through 7 (of 7 total)This topic contains 7 replies, has 3 voices, and was last updated by noibihappy2009 15 years, 11 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum
How to vary layout loop in blog.php (ja_news)
Viewing 7 posts - 1 through 7 (of 7 total)