Reply New Topic
2009/1/2 18:28:19
#1
Offline
Just popping in

Integrating a new system of rating by stars for WFDownloads (ajaxstarrater_v122)

Hello and best wishes for happiness for the year 2009 a whole community, the team and SmartFactory ImpressCMS and of course all those who read this message!

So I'd like to integrate a new system of rating by stars, the graft module meets wfdownload very good job but I need a more sophisticated system, I have already dipped a bit on the code but in vain.

Some info:

Environment: XOOPS 2.3.2, WFDownloads 3.1

The script in question: ajaxstarrater_v122

Where the mainstream? :

On the details of a download wfdownload eg modules / WFDownloads / singlefile.php? Cid = 1 & lid = 4302

Thank you to the good souls who will help me.

A later

(Excuse me for translation googlienne)


2009/1/2 21:28:48
#2
Offline
Home away from home

Re: Integrating a new system of rating by stars for WFDownloads (ajaxstarrater_v122)

Perhaps the same code found in imLinks could be used here

_________________
Christian Web Resources
Facebook

2009/1/2 23:22:17
#3
Offline
Home away from home

Re: Integrating a new system of rating by stars for WFDownloads (ajaxstarrater_v122)

This is the same source / rating system used with imLinks, see About page.

_________________
McDonalds Store

2009/1/3 2:11:09
#4
Offline
Home away from home

Re: Integrating a new system of rating by stars for WFDownloads (ajaxstarrater_v122)

Only bad thing is that the script is no longer supported...

_________________
McDonalds Store

2009/1/4 2:29:14
#5
Offline
Just popping in

Re: Integrating a new system of rating by stars for WFDownloads (ajaxstarrater_v122)

McDonald Hello, you do good work for imLinks! But I did not really happen, you could look for me? I would simply like to integrate this system of notation for the module wfdownload, if there is a lot of work, I might even pay you in private, that tell you?

(Excuse me for my English)


2009/1/4 8:43:34
#6
Offline
Home away from home

Re: Integrating a new system of rating by stars for WFDownloads (ajaxstarrater_v122)

Will have a look next week.

_________________
McDonalds Store

2009/1/4 9:49:24
#7
Offline
Home away from home

Re: Integrating a new system of rating by stars for WFDownloads (ajaxstarrater_v122)

if you could sort that rating system out Mcdonald, it'd be great, if you need help, just ask.. i'll try and get the remaining bugs (that i know of) fixed at the same time, and then release 3.2 final.

_________________
Live as if you were to die tomorrow, Learn as if you were to live forever

The beauty of a living thing is not the atoms that go into it, but the way those atoms are put together!

2009/1/4 10:20:54
#8
Offline
Just popping in

Re: Integrating a new system of rating by stars for WFDownloads (ajaxstarrater_v122)

Quote:

by McDonald on 2009/1/4 16:43:34

Will have a look next week.



thank you, I expect next week

Quote:

by Vaughan on 2009/1/4 17:49:24

if you could sort that rating system out Mcdonald, it'd be great, if you need help, just ask.. i'll try and get the remaining bugs (that i know of) fixed at the same time, and then release 3.2 final.



Thank you, although I accept your help, you can give me your version 3.2, I also watch the bugs. Thank you


2009/1/4 12:39:34
#9
Offline
Home away from home

Re: Integrating a new system of rating by stars for WFDownloads (ajaxstarrater_v122)

In imLinks the rating system is incompatible with the rating system of WF-Links.
Adding this to WF-Downloads the way I've done with imLinks would mean a new rating system and losing the old original votes. Maybe we can add an option to WF-Downloads preferences what rating system should be used: the current rating system (default) or the AJAX rating system.

The AJAX rating in imLinks consist of the following files:
_drawrating.php
db.php
rpc.php
js/behavior.js
js/rating.php
images/icon/starrating.gif

This part in style.css
/* styles for the unit rater
---------------------------------------------------------
ryan masuga, masugadesign.com
ryan@masugadesign.com
Licensed under a Creative Commons Attribution 3.0 License.
http://creativecommons.org/licenses/by/3.0/
See readme.txt for full credit details.
--------------------------------------------------------- */

#container {
width: 50%;
border: 1px solid #CCC;
padding: 20px;
}

.ratingblock {
}

.loading {
height: 30px;
background: url(images/icon/working.gif) 50% 50% no-repeat;
}

.unit-rating { /* the UL */
list-style:none;
margin: 0px;
padding:0px;
height: 30px;
position: relative;
background: url(images/icon/starrating.gif) top left repeat-x;
}

.unit-rating div {
text-indent: -90000px;
padding:0px;
margin:0px;
float: left;
}

.unit-rating div a {
outline: none;
display:block;
width:30px;
height: 30px;
text-decoration: none;
text-indent: -9000px;
z-index: 20;
position: absolute;
padding: 0px;
}

.unit-rating div a:hover{
background: url(images/icon/starrating.gif) left center;
z-index: 2;
left: 0px;
}

.unit-rating a.r1-unit{left: 0px;}
.unit-rating a.r1-unit:hover{width:30px;}
.unit-rating a.r2-unit{left:30px;}
.unit-rating a.r2-unit:hover{width: 60px;}
.unit-rating a.r3-unit{left: 60px;}
.unit-rating a.r3-unit:hover{width: 90px;}
.unit-rating a.r4-unit{left: 90px;}
.unit-rating a.r4-unit:hover{width: 120px;}
.unit-rating a.r5-unit{left: 120px;}
.unit-rating a.r5-unit:hover{width: 150px;}
.unit-rating a.r6-unit{left: 150px;}
.unit-rating a.r6-unit:hover{width: 180px;}
.unit-rating a.r7-unit{left: 180px;}
.unit-rating a.r7-unit:hover{width: 210px;}
.unit-rating a.r8-unit{left: 210px;}
.unit-rating a.r8-unit:hover{width: 240px;}
.unit-rating a.r9-unit{left: 240px;}
.unit-rating a.r9-unit:hover{width: 270px;}
.unit-rating a.r10-unit{left: 270px;}
.unit-rating a.r10-unit:hover{width: 300px;}

.unit-rating div.current-rating {
background: url(images/icon/starrating.gif) left bottom;
position: absolute;
height: 30px;
display: block;
text-indent: -9000px;
z-index: 1;
}

.voted {}
.thanks {color:#36AA3D;}
.static {}


And this part in include/linkload.php:
include_once ICMS_ROOT_PATH . '/modules/' . $mydirname . '/_drawrating.php';
$link['ratingbar'] = rating_bar( $link_arr['lid'], '5', $cid );


The rating is stored in a new table:
CREATE TABLE imlinks_ratings (
id int(11) NOT NULL,
total_votes int(11) NOT NULL default '0',
total_value int(11) NOT NULL default '0',
used_ips longtext,
PRIMARY KEY (id)
) TYPE=MyISAM;

_________________
McDonalds Store

2009/1/5 10:36:53
#10
Offline
Just popping in

Re: Integrating a new system of rating by stars for WFDownloads (ajaxstarrater_v122)

Thank you McDonald, of course, I would totally change the system. old system is obsolete.
you want to do for me?
I tried myself amended by copying on imlinks, but I can not. Sorry
thank you


2009/1/7 15:50:21
#11
Offline
Home away from home

Re: Integrating a new system of rating by stars for WFDownloads (ajaxstarrater_v122)

It's almost finished.
Need to do some more testing and applying the rating permission.

_________________
McDonalds Store

2009/1/8 10:31:49
#12
Offline
Just popping in

Re: Integrating a new system of rating by stars for WFDownloads (ajaxstarrater_v122)

Thank you very much, let me help you, what can I do? waiting impatiently thank you again


2009/1/8 11:27:37
#13
Offline
Home away from home

Re: Integrating a new system of rating by stars for WFDownloads (ajaxstarrater_v122)

http://impresscms.svn.sourceforge.net/viewvc/impresscms/modules/smartdownload/branches/ajax_star_rating/wfdownloads.tar.gz?view=tar

You have to do a clean install or add the sql table wfdownloads_ratings manually to your database.

_________________
McDonalds Store

2009/1/9 10:09:48
#14
Offline
Just popping in

Re: Integrating a new system of rating by stars for WFDownloads (ajaxstarrater_v122)

McDonald thank you very much! I will try and give you any bugs.
thank you for responding so quickly to my request


2009/1/18 7:41:00
#15
Offline
Home away from home

Re: Integrating a new system of rating by stars for WFDownloads (ajaxstarrater_v122)

Hello upload,

How is the new AJAX star rating system with WF-Downloads doing?
Is it working as you wished?

Any feedback is welcome!

_________________
McDonalds Store

2009/4/2 9:47:54
#16
Offline
Webmaster

Re: Integrating a new system of rating by stars for WFDownloads (ajaxstarrater_v122)

I installed the WF-Downloads 3.2 from SVN and everything works, unless when I want to look at a category of downloads. Then I get the error:

Quote:

Fatal error: Cannot redeclare rating_bar() (previously declared in /home/fiammybe/difdts.nebulagame.com/beta2/modules/wfdownloads/_drawrating.php:15) in /home/fiammybe/difdts.nebulagame.com/beta2/modules/wfdownloads/_drawrating.php on line 95



It must be a typo or something, because the error only produces itself when I want to look at a listing of the files. When I look at the file itself (by clicking on it in the admin section where the last uploaded files are listed), it works ok.

any ideas?

_________________

Me on Ohloh


2009/4/2 9:54:50
#17
Offline
Home away from home

Re: Integrating a new system of rating by stars for WFDownloads (ajaxstarrater_v122)

_drawrating.php?

shouldn't it be looking at ratefile.php?


2009/4/2 10:07:51
#18
Offline
Webmaster

Re: Integrating a new system of rating by stars for WFDownloads (ajaxstarrater_v122)

the file _drawrating.php is there. I'm not acquainted enough with icms to understand what's meant by redeclare in php.

I'll have a look again at that part, maybe I missed something.

_________________

Me on Ohloh


2009/4/2 10:37:20
#19
Offline
Home away from home

Re: Integrating a new system of rating by stars for WFDownloads (ajaxstarrater_v122)

it worked for me, though i didn't do multiple uploads.. so i could have missed that easily.

the ajax star rating though will NOT be in the final version as there's still work to do on it. ie, remove the old rating system as the links are still there to rate with the old rating system (ratefile.php), and also need to log the usernames of who rated and IP's etc for the new ajax system.

also in admin, there's no way that i can see where you can view a log of who's rated each download etc, for the ajax rating, you can only see the logs of the old rating system. I don't have time to do all that, and with it already being an RC2 release, i'm hesitant to add more features to it at this stage as there's already been some added during RC.

I just need to get the new templates when they are ready, and then people can test the release, and it can goto 3.2 Final then.

3.2 Final will be the last WF-Downloads from smartfactory, and will be the last downloads module compatible with both xoops & icms.

our next downloads module is to be written from scratch using the IPF, and will be for icms only. the ajax system will of course most likely be added to it :)


@fiammybe, the error isn't a icms specifc error message, it's a standard PHP error message. what redeclare means is that something is trying to declare a class or include a file etc that has already been included so it's trying to call the same thing twice.

without looking at it, i'd say it's probably some include() or require() that needs changing to include_once or require_once etc.

that's the likely candidate anyway.

_________________
Live as if you were to die tomorrow, Learn as if you were to live forever

The beauty of a living thing is not the atoms that go into it, but the way those atoms are put together!

2009/4/2 10:52:46
#20
Offline
Home away from home

Re: Integrating a new system of rating by stars for WFDownloads (ajaxstarrater_v122)

@fiammybe,

Open the file viewcat.php and replace
if ($total_numrows > 0)
{
foreach (array_keys($downloads) as $i) {
include XOOPS_ROOT_PATH.'/modules/wfdownloads/_drawrating.php';


with
include XOOPS_ROOT_PATH.'/modules/wfdownloads/_drawrating.php';
if ($total_numrows > 0)
{
foreach (array_keys($downloads) as $i) {

_________________
McDonalds Store

Reply New Topic extras
 Previous Topic   Next Topic
You can view topic.
You can start a new topic.
You can reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You can post without approval.