News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Post Ratings

Started by SoLoGHoST, October 27, 2009, 11:54:09 AM

Previous topic - Next topic

SoLoGHoST

Thanks blokey, this should fix all of your problems with this mod.

On another note...
I've been wondering, how come I never ever see any of my mods on the Featured Mods Block at the Mod Site??  It's as good as the other mods listed on there.  Just a thought, as I always see the same mods on the Featured Mods section of the Mod Site.  Oh well.  Life goes on...

Bugo

Quote from: SoLoGHoST on December 27, 2009, 03:20:51 PM
Quote from: Bugo on December 27, 2009, 01:57:43 PM
Quote from: SoLoGHoST on December 27, 2009, 01:22:21 AM
Can you be a bit more specific?  I will try and see if there is something on my end here, but I don't follow periodically.  Perhaps you can pin-point any 1 of these undefined index errors on an actual step by step basis of events??  That would be much more helpful.

Thank You :)
Usually errors appear after viewing by visitors of any page of a forum. Sometimes — after viewing by usual users.
Can you give me a Line # for this undefined index error in Display.php please?  In your Error Log, it should tell you the Line # that this error happens on.  This would be most helpful.

Thank You!
Example:
8: Undefined index: total_ratings
File: /../Sources/Display.php
Line: 1413

Line 1413 in Display.php:
==>1413:
'post_rating_num' => GetPostRating('text', $message['id_msg'], $message['total_ratings'], $message['rating']),

SoLoGHoST

#142
Thanks Bugo, I have already found this and fixed this in the newest update version 1.2.

Let me know if you get any errors with Post Ratings 1.2 installed.

Note, you can just upload it via the Package Manager in the Admin, and install it, and it should update it with the new edits.

Cheers :)

mforum

Your mod is excellent !!!!! works great ,, except one conflict with smf download mod

when smf download tries to make a post in selected board , the following error occurs:

The database value you're trying to insert does not exist: is_ratings
Function: createPost

smf 2 rc2

subs-post.php
1859:  array(
1860: $topicOptions['board'], $posterOptions['id'], $posterOptions['id'], $msgOptions['id'],
1861: $msgOptions['id'], $topicOptions['lock_mode'] === null ? 0 : $topicOptions['lock_mode'], $topicOptions['sticky_mode'] === null ? 0 : $topicOptions['sticky_mode'], 0,
1862: $topicOptions['poll'] === null ? 0 : $topicOptions['poll'], $msgOptions['approved'] ? 0 : 1, $msgOptions['approved'], $topicOptions['ratings_mode'],
1863: ),
1864: array('id_topic')
==>1865: );
1866: $topicOptions['id'] = $smcFunc['db_insert_id']('{db_prefix}topics', 'id_topic');

ディン1031

So i can help her ;).

The problem here is that the value is set null if it not preset.
If this happen than the value is even not set for SMF on a int value.
So that other mods can use the function now there is simple change needed:

$topicOptions['poll'] === null ? 0 : $topicOptions['poll'], $msgOptions['approved'] ? 0 : 1, $msgOptions['approved'], $topicOptions['ratings_mode'] === null ? 0 : $topicOptions['ratings_mode'],


Code (Replace with) Select

$topicOptions['poll'] === null ? 0 : $topicOptions['poll'], $msgOptions['approved'] ? 0 : 1, $msgOptions['approved'], $topicOptions['ratings_mode'] === null ? 0 : $topicOptions['ratings_mode'],


The diffrent now is the

$topicOptions['ratings_mode'] === null ? 0 : $topicOptions['ratings_mode']

With this there will be 0 in it if the createPosts is used without preset this option (what should be happen often if other mods use the same function).

I hope this help you as creator to improve you mod a little bit ;).

Bye
DIN1031
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

mforum

Your fix worked for me  :)

Thank you !!!!!!!!!!

Vyache

#146
For some reason, after installing this mod, I've noticed I cannot switch the comment tags on the post without going through the editing process.

I added those lines of code from the above suggestion as well:
            $topicOptions['poll'] === null ? 0 : $topicOptions['poll'], $msgOptions['approved'] ? 0 : 1, $msgOptions['approved'], $topicOptions['ratings_mode'] === null ? 0 : $topicOptions['ratings_mode'],

I also get this browser error:
Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Timestamp: Tue, 29 Dec 2009 18:36:54 UTC


Message: 'responseXML.getElementsByTagName(...).0' is null or not an object
Line: 1289
Char: 3
Code: 0
URI: http://theswimstrongfoundation.org/network/Themes/default/scripts/script.js?rc2


Message: 'responseXML.getElementsByTagName(...).0' is null or not an object
Line: 1289
Char: 3
Code: 0
URI: http://theswimstrongfoundation.org/network/Themes/default/scripts/script.js?rc2


Message: 'responseXML.getElementsByTagName(...).0' is null or not an object
Line: 1289
Char: 3
Code: 0
URI: http://theswimstrongfoundation.org/network/Themes/default/scripts/script.js?rc2

1278 // Event handler for clicking on one of the icons.
1279 IconList.prototype.onItemMouseDown = function (oDiv, sNewIcon)
1280 {
1281 if (this.iCurMessageId != 0)
1282 {
1283 ajax_indicator(true);
1284 this.tmpMethod = getXMLDocument;
1285 var oXMLDoc = this.tmpMethod(smf_prepareScriptUrl(this.opt.sScriptUrl)   'action=jsmodify;topic='   this.opt.iTopicId   ';msg='   this.iCurMessageId   ';'   this.opt.sSessionVar   '='   this.opt.sSessionId   ';icon='   sNewIcon   ';xml');
1286 delete this.tmpMethod;
1287 ajax_indicator(false);
1288
1289 var oMessage = oXMLDoc.responseXML.getElementsByTagName('smf')[0].getElementsByTagName('message')[0];
1290 if (oMessage.getElementsByTagName('error').length == 0)
1291 {
1292 if (this.opt.bShowModify && oMessage.getElementsByTagName('modified').length != 0)
1293 setInnerHTML(document.getElementById('modified_'   this.iCurMessageId), oMessage.getElementsByTagName('modified')[0].childNodes[0].nodeValue);
1294 this.oClickedIcon.getElementsByTagName('img')[0].src = oDiv.getElementsByTagName('img')[0].src;
1295 }
1296 }
1297 }


var oMessage = oXMLDoc.responseXML.getElementsByTagName('smf')[0].getElementsByTagName('message')[0];


That used to work...
Edit: Actually its not from this mod... I removed this mod just to make sure. Dang where is it coming from...
What should I do?

AjaxChat - SMF 2.0 RC2 Edition Download.
mrtrc266 ~AJAX Chat Intergration FAQ's & Tips-N-Tricks~

ŦώεαЖзяŁ

Is there a way to make post ratings work with custom forms mod ?

Link Sharing Community - Share links and earn cash in the process!
APPS | GAMES | MUSIC | MOVIES | TV SHOWS | E-BOOKS

SoLoGHoST

#148
Quote from: ディン1031 on December 29, 2009, 09:52:08 AM
So i can help her ;).

The problem here is that the value is set null if it not preset.
If this happen than the value is even not set for SMF on a int value.
So that other mods can use the function now there is simple change needed:

$topicOptions['poll'] === null ? 0 : $topicOptions['poll'], $msgOptions['approved'] ? 0 : 1, $msgOptions['approved'], $topicOptions['ratings_mode'] === null ? 0 : $topicOptions['ratings_mode'],


Code (Replace with) Select

$topicOptions['poll'] === null ? 0 : $topicOptions['poll'], $msgOptions['approved'] ? 0 : 1, $msgOptions['approved'], $topicOptions['ratings_mode'] === null ? 0 : $topicOptions['ratings_mode'],


The diffrent now is the

$topicOptions['ratings_mode'] === null ? 0 : $topicOptions['ratings_mode']

With this there will be 0 in it if the createPosts is used without preset this option (what should be happen often if other mods use the same function).

I hope this help you as creator to improve you mod a little bit ;).

Bye
DIN1031
Thank You ディン1031, I will go ahead and implement this.  Cheers :)

Quote from: TweakerL on December 29, 2009, 02:07:54 PM
Is there a way to make post ratings work with custom forms mod ?

Not really sure what Custom Forms Mod does, will look into this.

Also, 1 more update coming soon for you guys that should address issue noted by:  ディン1031 as well as allow for Post Ratings to work in the RC2 Core Theme.

Cheers :)

SoLoGHoST

Ok, LAST UPDATE for this MOD, just now updated to Version 1.3 (is upgradeable):

1.3
! Fixes error is_ratings when other mods use the SMF createPost() function to create a post.  Will automatically disable ratings within that topic.
+ Added SMF 2.0 RC2 Core Theme edits so that both layouts (Header Style, and Inner Style) will now, also, work in the Core Theme of SMF 2.0 RC2 as well as the ability to rate posts.

Cheers :)

SoLoGHoST

#150
Quote from: TweakerL on December 29, 2009, 02:07:54 PM
Is there a way to make post ratings work with custom forms mod ?
Ok, Have looked at this mod some.  What do you want to do with it?  Do you want to enable ratings for this when it is used to create a post?  If so you'll need to edit the createPost() function in this mod to allow for ratings.  Just set the $topicOptions['ratings_mode'] = 1 and also set the $msgOptions['ratings_enabled'] = true and that should make it able to be rated.

EDIT:
@ ディン1031 - I have actually been thinking some about your edit and I think this would be a perfect opportunity to implement a means to allow the Admin the ability to enable/disable ratings within that post for all other mods that use the createPost() function.  So this can even be an option within the Post Ratings Settings.  Ofcourse it will be disabled by default unless the user selected to enable it for that specific mod.

Cheers :)

pointalk

Please compatible with smf1.1.11 :)

Spoogs

Quote from: pointalk on January 02, 2010, 03:01:15 AM
Please compatible with smf1.1.11 :)

Quote from: SoLoGHoST on December 19, 2009, 06:45:23 AM
If I code this for 1.1.x versions, I will be focusing on 1.1.11 specifically and can't guarantee that it will work in any other SMF 1.1.x version.  Though, honestly, I do not see a need to make this compatible for 1.1.x.

If you want a 1.1.x version of this mod and are willing to pay for it, send me a PM Please!  This goes for everyone else who reads this post and wants it made compatible with SMF 1.1.11 and are willing to pay.  Once I get about 8 people interested in paying for this mod, I'll code it, offer a 1 year commitment to updates for FREE, and than place the URL within this topic or someplace else for you all to purchase.

DO NOT POST UP ANY MESSAGE IN HERE, PERSONAL MESSAGE TO ME IS ALL I ASK!

Thank You!

blokey

Solo just noticed this

one member votes  lets say ok
another member votes lets say good

topic header still says ok

Is this due to the threshold limits?
SMF Version 2.0 RC2     Server Info Apache version 2.0.63 PHP version 5.2.9 MySQL version 5.0.81-community Architecture x86_64 Operating system Linux

SoLoGHoST

#154
Ok, this all depends on the numbers you have set for your Ratings threshold.

Please note:  The percentage scores are as follows.

Rating of 1 = 20
Rating of 2 = 40
Rating of 3 = 60
Rating of 4 = 80
Rating of 5 = 100

The percentage Thresholds are set differently.  Upon default the percentages are set at:

20, 50, 75, 90, 100 (all changeable, but the 100).

Ok, so a rating of ok = a Rating of 2 and a rating of good = a Rating of 3.

A Rating of 2 = 40 and a Rating of 3 = 60, to get the average add them together and divide these by 2 and you get 50.

So the rating score for this post = 50.  If you look at the default Threshold for this 50 = Rating of 2.  51 = a Rating of 3 however.  So if 1 more user rates this a 3 (Good) it will than go up to a Rating of 3 (Good).

Well hopefully you understand this.  Ofcourse, there is much more involved here than just those numbers.  Because, once you change the Ratings Strength from 1 to something else, the actual scores change, though the percentages (20, 40, 60, 80, and 100) remain the same.

Cheers :)

blokey

SMF Version 2.0 RC2     Server Info Apache version 2.0.63 PHP version 5.2.9 MySQL version 5.0.81-community Architecture x86_64 Operating system Linux

SoLoGHoST


hindian


I have enabled the post ratings and turned on the necessary permissions but for some reason the ratings header is not showing up. 

Someone please help...

hindian

ŦώεαЖзяŁ

I'm still kinda noob in PHP so is this the modification i would be making?

Quote// Collect all necessary parameters for the creation of the post.
            $msgOptions = array(
               'id' =>  0,
               'subject' => $subject,
               'icon' => $icon,
               'body' => $output,
               'smileys_enabled' => true,
               'ratings_enabled' => true,
            );
            
            $topicOptions = array(
               'id' => 0,
               'board' => $board,
               'mark_as_read' => true,
               'ratings_mode' => 1,
            );

Thank you very much in advance :)

Link Sharing Community - Share links and earn cash in the process!
APPS | GAMES | MUSIC | MOVIES | TV SHOWS | E-BOOKS

SoLoGHoST

#159
Quote from: TweakerL on January 05, 2010, 12:31:38 AM
I'm still kinda noob in PHP so is this the modification i would be making?

Quote// Collect all necessary parameters for the creation of the post.
            $msgOptions = array(
               'id' =>  0,
               'subject' => $subject,
               'icon' => $icon,
               'body' => $output,
               'smileys_enabled' => true,
               'ratings_enabled' => true,
            );
            
            $topicOptions = array(
               'id' => 0,
               'board' => $board,
               'mark_as_read' => true,
               'ratings_mode' => 1,
            );

Thank you very much in advance :)

That is correct! :)  That will enable post ratings by default, for that topic and post, within that Mod.  Though, to have it disabled by default, you don't need to do anything if you have the latest Post Ratings version installed.

Quote from: hindian on January 04, 2010, 11:15:43 PM

I have enabled the post ratings and turned on the necessary permissions but for some reason the ratings header is not showing up. 

Someone please help...

hindian

Does it show when you change the Layout Style to Inner Style?  Please note:  It is automatically on Inner Style by default, you have to change it to Header Style in Post Ratings Settings to see the Header Style.  Did you do this?

Advertisement: