test
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • tophe Friend
    #135177

    Hi,
    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 6

    Reordering 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


    1. scrncap_janews_02
    Anonymous Moderator
    #278527

    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.

    tophe Friend
    #278533

    Thanks 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 {

    }
    Tophe

    noibihappy2009 Friend
    #289855

    I’m not really understand

    Hack blog.php and blog_item.php both of it ???
    What’s $num use for ?

    tophe Friend
    #289970

    Hi,
    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
    … etc

    As 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 Friend
    #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 Friend
    #290017

    Thank you.
    But still have prob with your patch on blog
    Example

    CatA | Cat B (for some reason these text is longer)
    ——– | ——-
    ——- | ——–
    xxxxxx x ——–
    xxxxxx x ——–
    xxxxxx x ——–
    Cat C | Cat D

    x: space (nothing show on)
    I want fix it like this
    CatA | Cat B (for some reason these text is longer)
    ——– | ——-
    ——- | ——–
    Cat C | ——–
    —– | ——–
    —– | ——–
    | Cat D

    Thank you so lot

Viewing 7 posts - 1 through 7 (of 7 total)

This topic contains 7 replies, has 3 voices, and was last updated by  noibihappy2009 15 years, 9 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum