21
brutalicuss
Re: Rating system in publisher module

Everything working just perfect!

The only thing you must change:

in xoops_version.php
this line: _MI_PUBLISHER_ORDERBY_HITS => 'hits',
must be: _MI_PUBLISHER_ORDERBY_HITS => 'counter',

thats all

10x again Mamba, now its much better, im sure that the users will like it :))


ps: If you want you can change block name from "recent item list" to some other like "sorting item list" in exmp



22
brutalicuss
Re: Rating system in publisher module

Its fantastic :)

My project is still on localhost and I testing in old (my) publisher version and the new (master) both, and working fine. But I have also changes in .html (visualization)
Of course, I will test the new one also. First on localhost and than on web, and and will post here soon :)

10x Mamba :)



23
brutalicuss
Re: Images width

tray in .css
img {max-width: 100%;height: auto;width: auto \9;}
if not, set for your content
.item img {max-width: 500px;height: auto;width: auto \9;}



24
brutalicuss
Re: Rating system in publisher module

ops :)

for
xoops_version.php

replace
$modversion['config'][] = array(
    
'name'        => 'format_order_by',
    
'title'       => '_MI_PUBLISHER_ORDERBY',
    
'description' => '_MI_PUBLISHER_ORDERBYDSC',
    
'formtype'    => 'select',
    
'valuetype'   => 'text',
    
'options'     => array(
        
_MI_PUBLISHER_ORDERBY_TITLE  => 'title',
        
_MI_PUBLISHER_ORDERBY_DATE   => 'date',
        
_MI_PUBLISHER_ORDERBY_WEIGHT => 'weight'),
    
'default'     => 'date',
    
'category'    => 'format'
);


with
$modversion['config'][] = array(
    
'name'        => 'format_order_by',
    
'title'       => '_MI_PUBLISHER_ORDERBY',
    
'description' => '_MI_PUBLISHER_ORDERBYDSC',
    
'formtype'    => 'select',
    
'valuetype'   => 'text',
    
'options'     => array(
        
_MI_PUBLISHER_ORDERBY_TITLE  => 'title',
        
_MI_PUBLISHER_ORDERBY_DATE   => 'date',
        
_MI_PUBLISHER_ORDERBY_RATING => 'rating',
        
_MI_PUBLISHER_ORDERBY_VOTES  => 'votes',
        
_MI_PUBLISHER_ORDERBY_COMMENTS  => 'comments',
        
_MI_PUBLISHER_ORDERBY_WEIGHT => 'weight'),
    
'default'     => 'date',
    
'category'    => 'format'
);



for older ver of publisher
include/functions.php

this:
function publisherGetOrderBy($sort)
must be:
function publisher_GetOrderBy($sort)



25
brutalicuss
Re: Rating system in publisher module

lol I did it

But this is not professional work and I think shouldnt use in official ver.
This is only for who wants to have all sorting option like me.

language/english/modinfo.php
add bellow:
define("_MI_PUBLISHER_ORDERBY_RATING","Rating DESC");
define("_MI_PUBLISHER_ORDERBY_VOTES","Votes DESC");
define("_MI_PUBLISHER_ORDERBY_COMMENTS","COMMENTS DESC");


xoops_version.php

replace:
$modversion['config'][$i]['options'] = array(_MI_PUBLISHER_PUBLISHED => _PUBLISHER_STATUS_PUBLISHED,
                                             
_MI_PUBLISHER_OFFLINE => _PUBLISHER_STATUS_OFFLINE,
                                             
_MI_PUBLISHER_SUBMITTED => _PUBLISHER_STATUS_SUBMITTED,
                                             
_MI_PUBLISHER_REJECTED => _PUBLISHER_STATUS_REJECTED);


with:
$modversion['config'][] = array(
    
'name'        => 'format_order_by',
    
'title'       => '_MI_PUBLISHER_ORDERBY',
    
'description' => '_MI_PUBLISHER_ORDERBYDSC',
    
'formtype'    => 'select',
    
'valuetype'   => 'text',
    
'options'     => array(
        
_MI_PUBLISHER_ORDERBY_TITLE  => 'title',
        
_MI_PUBLISHER_ORDERBY_DATE   => 'date',
        
_MI_PUBLISHER_ORDERBY_RATING => 'rating',
        
_MI_PUBLISHER_ORDERBY_VOTES  => 'votes',
        
_MI_PUBLISHER_ORDERBY_COMMENTS  => 'comments',
        
_MI_PUBLISHER_ORDERBY_WEIGHT => 'weight'),
    
'default'     => 'date',
    
'category'    => 'format'
);



item.php

replace:
switch ($publisher->getConfig('format_order_by')) {
    case 
'title' :
        
$sort 'title';
        
$order 'ASC';
        break;

    case 
'date' :
        
$sort 'datesub';
        
$order 'DESC';
        break;

    default :
        
$sort 'weight';
        
$order 'ASC';
        break;
}


with:
switch ($publisher->getConfig('format_order_by')) {
    case 
'title':
        
$sort  'title';
        
$order 'ASC';
        break;

    case 
'date':
        
$sort  'datesub';
        
$order 'DESC';
        break;

    case 
'rating' :
        
$sort 'rating';
        
$order 'DESC';
        break;
        
    case 
'votes' :
        
$sort 'votes';
        
$order 'DESC';
        break;
        
    case 
'comments' :
        
$sort 'comments';
        
$order 'DESC';
        break;

    default :
        
$sort  'weight';
        
$order 'ASC';
        break;
}




index.php

replace:
switch ($publisher->getConfig('format_order_by')) {
        case 
'title' :
            
$sort 'title';
            
$order 'ASC';
            break;

        case 
'date' :
            
$sort 'datesub';
            
$order 'DESC';
            break;

        default :
            
$sort 'weight';
            
$order 'ASC';
            break;
    }


with:
switch ($publisher->getConfig('format_order_by')) {
        case 
'title':
            
$sort  'title';
            
$order 'ASC';
            break;

        case 
'date':
            
$sort  'datesub';
            
$order 'DESC';
            break;

        case 
'rating' :
            
$sort 'rating';
            
$order 'DESC';
            break;
            
        case 
'votes' :
            
$sort 'votes';
            
$order 'DESC';
            break;
            
        case 
'comments' :
            
$sort 'comments';
            
$order 'DESC';
            break;
        default:
            
$sort  'weight';
            
$order 'ASC';
            break;
    }



category.php

replace:
switch ($publisher->getConfig('format_order_by')) {
    case 
'title' :
        
$sort 'title';
        
$order 'ASC';
        break;

    case 
'date' :
        
$sort 'datesub';
        
$order 'DESC';
        break;

    default :
        
$sort 'weight';
        
$order 'ASC';
        break;
}


with:
switch ($publisher->getConfig('format_order_by')) {
    case 
'title' :
        
$sort  'title';
        
$order 'ASC';
        break;

    case 
'date' :
        
$sort  'datesub';
        
$order 'DESC';
        break;

    case 
'rating' :
        
$sort 'rating';
        
$order 'DESC';
        break;

    case 
'votes' :
        
$sort 'votes';
        
$order 'DESC';
        break;
            case 
'comments' :
        
$sort 'comments';
        
$order 'DESC';
        break;

    default:
        
$sort  'weight';
        
$order 'ASC';
        break;
}



BLOCKS
blocks/item_new.php

replace:
$item['title'] = $itemsObj[$i]->title();

            if (
$sort == "datesub") {
                
$item['new'] = $itemsObj[$i]->datesub();
            } elseif (
$sort == "counter") {
                
$item['new'] = $itemsObj[$i]->counter();
            } elseif (
$sort == "weight") {
                
$item['new'] = $itemsObj[$i]->weight();
            }

            
$block['newitems'][] = $item;



with:
$item['title'] = $itemsObj[$i]->title();

            if (
$sort == "datesub") {
                
$item['new'] = $itemsObj[$i]->datesub();
            } elseif (
$sort == "counter") {
                
$item['new'] = $itemsObj[$i]->counter();
            } elseif (
$sort == "weight") {
                
$item['new'] = $itemsObj[$i]->weight();
                } elseif (
$sort == "rating") {
                
$item['new'] = $itemsObj[$i]->rating();
                } elseif (
$sort == "votes") {
                
$item['new'] = $itemsObj[$i]->votes();
                }
                elseif (
$sort == "comments") {
                
$item['new'] = $itemsObj[$i]->comments();
                }
            
            
$block['newitems'][] = $item;



replace:
$orderEle->addOptionArray(array(
                                  
'datesub' => _MB_PUBLISHER_DATE,
                                  
'counter' => _MB_PUBLISHER_HITS,
                                  
'weight'  => _MB_PUBLISHER_WEIGHT,
                              ));


with:
$orderEle->addOptionArray(array(
                                  
'datesub' => _MB_PUBLISHER_DATE,
                                  
'counter' => _MB_PUBLISHER_HITS,
                                  
'weight'  => _MB_PUBLISHER_WEIGHT,
                                  
'rating'  => _MI_PUBLISHER_ORDERBY_RATING,
                                  
'votes'   => _MI_PUBLISHER_ORDERBY_VOTES,
                                  
'comments'   => _MI_PUBLISHER_ORDERBY_COMMENTS,
                              ));


include/functions.php

replace:
function publisherGetOrderBy($sort)
{
    if (
$sort == "datesub") {
        return 
"DESC";
    } elseif (
$sort == "counter") {
        return 
"DESC";
    } elseif (
$sort == "weight") {
        return 
"ASC";
    }

    return 
null;
}


with:
function publisherGetOrderBy($sort)
{
    if (
$sort == "datesub") {
        return 
"DESC";
    } elseif (
$sort == "counter") {
        return 
"DESC";
    } elseif (
$sort == "weight") {
        return 
"ASC";
    }
    elseif (
$sort == "votes") {
        return 
"DESC";
    }
    elseif (
$sort == "rating") {
        return 
"DESC";
    }
        elseif (
$sort == "comments") {
        return 
"DESC";
    }

    return 
null;
}



Thas all!
Working well for both: starting page and block "recent items list"
If you want to have more than one option in this block, just clone it
If you want to have these sortings on whole or many pages, just use cloned block in dummy module

10x Mamba, It would not happen without you



26
brutalicuss
Re: Rating system in publisher module

Quote:

If the users want to vote for it, then they rate it, and based on the rating, the highest rated articles will come up first.


Thats I mean Mamba, users will define which article is important, and if we havent rating sort system this will be impossible, isnt it
But we must have other sorting option also, like time, hits and etc. I think it is normal for any publisher site. Just option: "show most rated", "show most visited" "votes", "comments"..etc These are just features. Good features!

As for "ASC" to "DESC" sorting I tried everything :) Something buggy, and I really cant, because im not programmer

In this context, I tried to set your fix to sort by ASC not DESC and nothing happens - order still was by DESC. You shouldnt upload this before closely testing I think



27
brutalicuss
Re: Rating system in publisher module

Yes, you are right in principle - if we using publisher module for news, but if we makes article directory (in example) I think it is necessary, because you know some articles are important for the users months even years. In that case we really need of all sorting option.

Your example with extgallery and wt-download is very good, the same we have in weblinks also. Weblinks has all possible sorting option, not only in blocks (my favorite module ever)

Im already done new sorting in publisher blocks (its easy) based of your examples, BUT the sorting is not correct :) from 0 to 5, not 5 to 0. But im not programmer, just testing :)



28
brutalicuss
Re: Rating system in publisher module

Yes, you are just great Mamba :))

I was adding the new lines in my files. Thats the fault !
Now, in new installation its working. And we can choose sort type of the list.

But I have still trouble (maybe personal) because I want to have more than one option for sorting, at the same time. There must be all sorting option. Now im trying to editing blocks php files to achieve this wishes :) Because after that I can clone the block and will have all sorting option :)

But if you plan to upload new publisher version and if you want this module to be just perfect, you should thinking about this option in "recent block" or some similar. Will be great to sort by all features - date/hits/rating/weight, even comments count.




29
brutalicuss
Re: Rating system in publisher module

Hi Mamba! Thank you very much! Im really glad that you want to improve publisher module.

But I have still trouble with the sorting

I mean that I need to sort items by many orders like time/votes/hits/comments in recent/latest list or some other way like publisher blocks - "recent publisher items" or any other possible way

I tried with the new correction in index.php/category.php to sort items by rating/votes but its seems to not working. Still sorting only by the time.

For hits and weight we have option in one publisher block, but for new features rating and votes (guess that is comments) we havent because these new functions are not included

Maybe I dont know how to use your editing or doing something wrong, and I will be thankful if you have time to explain me



30
brutalicuss
Rating system in publisher module

Hi again

Is it possible to sort items by rating?
We have option to sort by hits and time, but not by rating
There is beautiful rating system in single item, but we cant use it for items sorting

Is it possible, or this module has such option, but im blind again




TopTop
« 1 2 (3) 4 5 6 ... 10 »



Login

Who's Online

37 user(s) are online (26 user(s) are browsing Support Forums)


Members: 0


Guests: 37


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Sep 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits