test
Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • Ing. Ervin Zatko EASY Friend
    #195049

    Hi

    I use JA Muzic template and in JA Slideshow modul missing random sorting. Please send me solution how I can add this function.

    Thank you
    Ervin

    chavan Friend
    #523852

    1. Go to this File : modules/mod_jaslideshow/mod_jaslideshow.xml

    Replace this code

    <field
    name="source-articles-sort_order_field"
    type="list"
    default="created"
    label="SORT_ORDER_BY"
    description="SORT_ORDER_BY_DESC">
    <option value="created">DATE</option>
    <option value="ordering">ORDER</option>
    <option value="hits">HITS</option>
    </field>

    with

    <field
    name="source-articles-sort_order_field"
    type="list"
    default="created"
    label="SORT_ORDER_BY"
    description="SORT_ORDER_BY_DESC">
    <option value="created">DATE</option>
    <option value="ordering">ORDER</option>
    <option value="hits">HITS</option>
    <option value="rand">RANDOM</option>
    </field>

    2. Go to this File : modules/mod_jaslideshow/helpers/helper.php

    Replace this code

    case 'hits':
    $orderby = 'i.hits';
    break;

    with


    case 'hits':
    $orderby = 'i.hits';
    break;

    case 'rand':
    $orderby = ' RAND() ';
    break;

    Ing. Ervin Zatko EASY Friend
    #524095

    Thank you for your reply. Sorry, but it dont work.
    I get these warnings:

    Warning: Invalid argument supplied for foreach() in componentscom_contentmodelsarticles.php on line 491
    Warning: Invalid argument supplied for foreach() in modulesmod_jaslideshowmod_jaslideshow.php on line 302

    chavan Friend
    #524102

    can you post your ftp details in PM. I will fix it for you

    Ing. Ervin Zatko EASY Friend
    #525298

    Hello….

    Please contact me or send me a solution !!!!

    Ervin

    mykenzy00 Friend
    #525531

    I tried it and got the same error. This would be a great feature for the slideshow mod.

    chavan Friend
    #525554

    @easypc

    the admin Url of your test site is not working. please fix that and let me know so i can get the warning and also get the random video done.

    chavan Friend
    #525555

    @mykenzy00

    Go to Administrator -> site -> Configuration -> server tab -> set error reporting to “none”

    mykenzy00 Friend
    #525583

    OK I recreated the error and turned off error reporting

    chavan Friend
    #525852

    @easypc

    I have fixed the Module random for you. Please check and confirm,

    <em>@easypc 413070 wrote:</em><blockquote>Thank you for your reply. Sorry, but it dont work.
    I get these warnings:

    Warning: Invalid argument supplied for foreach() in componentscom_contentmodelsarticles.php on line 491
    Warning: Invalid argument supplied for foreach() in modulesmod_jaslideshowmod_jaslideshow.php on line 302</blockquote>

    chavan Friend
    #525853

    @mykenzy00

    Undo all the above suggested post. Do the following

    1. Go to this File : modules/mod_jaslideshow/mod_jaslideshow.xml


    <field
    name="source-articles-sort_order"
    type="list"
    default="DESC"
    label="ASC_OR_DESC"
    description="ASC_OR_DESC_DESC">
    <option value="ASC">ASC</option>
    <option value="DESC">DESC</option>
    </field>

    With


    <field
    name="source-articles-sort_order"
    type="list"
    default="DESC"
    label="ASC_OR_DESC"
    description="ASC_OR_DESC_DESC">
    <option value="RAND()">RANDOM</option>
    <option value="ASC">ASC</option>
    <option value="DESC">DESC</option>
    </field>

    2. Go to this File : modules/mod_jaslideshow/helpers/helper.php

    Replace this code


    switch ($ordering) {

    case 'created':
    $orderby = 'i.created';
    break;

    case 'hits':
    $orderby = 'i.hits';
    break;
    case 'ordering':
    if (JRequest::getInt('featured') == '2')
    $orderby = 'i.featured_ordering';
    else
    $orderby = 'c.ordering, i.ordering';
    break;
    }
    $dir = $params->get('source-articles-sort_order', 'DESC');

    with


    $dir = $params->get('source-articles-sort_order', 'DESC');
    switch ($ordering) {

    case 'created':
    $orderby = 'i.created';
    break;

    case 'hits':
    $orderby = 'i.hits';
    break;

    case 'rand':
    $orderby = ' RAND() '; $dir ='';
    break;

    case 'ordering':
    if (JRequest::getInt('featured') == '2')
    $orderby = 'i.featured_ordering';
    else
    $orderby = 'c.ordering, i.ordering';
    break;
    }

    next

    Replace this Code


    function getArticles($params)
    {
    $this->setOrder($params->get('source-articles-sort_order_field', 'created'), $params->get('source-articles-sort_order', 'DESC'));

    $this->setLimit($params->get('source-articles-max_items', 5));
    $rows = $this->fetchListArticles($params);
    return $rows;
    }

    With


    function getArticles($params)
    {

    if($params->get('source-articles-sort_order', 'DESC') == 'RAND()'){

    $this->setOrder1($params->get('source-articles-sort_order', 'DESC'), '');

    }else{
    $this->setOrder($params->get('source-articles-sort_order_field', 'created'), $params->get('source-articles-sort_order', 'DESC'));
    }

    $this->setLimit($params->get('source-articles-max_items', 5));
    $rows = $this->fetchListArticles($params);
    return $rows;
    }

    Add this code after this function getArticles($params)


    function setOrder1($order, $mode)
    {
    $this->order = $order;
    $this->mode = $mode;
    return $this;
    }

    This is the way to achieve random sildeshow. If there is any issues on this report me, will try to customize that for you.

    mykenzy00 Friend
    #525893

    Chavan,

    Thanks works greats!!!!!!!!!!!!

    Thanks,
    Bryan

    mykenzy00 Friend
    #525895

    I do have 2 issue with slideshow, not related to above issue.

    1. Only when a Vimeo video is loaded on top (large screen) the site will crash on IE but not on every page return.

    2. The thumbnails when clicked (using any browser) shows a blank screen. Until you use the right or left arrows.

    Thanks,
    Bryan

    chavan Friend
    #525982

    can you please tell me what version of IE you tried checking it.

    mykenzy00 Friend
    #526075

    Chavan,

    IE 11, sorry I forgot that.

    Thanks,
    Bryan

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

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

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