Advertisement:

Author Topic: Post Ratings  (Read 125221 times)

Offline blokey

  • Jr. Member
  • **
  • Posts: 143
  • Gender: Male
Re: Post Ratings
« Reply #80 on: December 20, 2009, 02:30:57 PM »
sure same thing,,, just found a prob with curve,,,,,,,,,, my prob not curves,,, anyway signed on as guest and it does not afffect it,,, see pic
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

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,399
    • StoryBB/StoryBB on GitHub
Re: Post Ratings
« Reply #81 on: December 20, 2009, 03:10:33 PM »
The reason is that the right hand area - where the ratings bar is - will not appear until all the left hand profile side is done, and with all that stuff in your profile area, it pushes it all down.

Not sure how best to fix it though.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline SoLoGHoST

  • SMF Hero
  • ******
  • Posts: 1,796
  • Gender: Male
  • Real coders do not need to comment their code!
    • Dream Portal
Re: Post Ratings
« Reply #82 on: December 20, 2009, 07:27:27 PM »
I have a plan on fixing this and will be implemented in the next version.

Cheers :)

Offline Vyache

  • Jr. Member
  • **
  • Posts: 164
  • Gender: Male
  • "If You Give A Mouse A Cookie?"
    • Swim Strong Network
Re: Post Ratings | Error
« Reply #83 on: December 23, 2009, 10:49:17 AM »
Under Display.php in sources,

Code: [Select]
$messages_request = $smcFunc['db_query']('', ' SELECT id_msg, icon, subject, poster_time, poster_ip, id_member, modified_time, modified_name, body, smileys_enabled, poster_name, poster_email, approved,
Code: [Select]
' . (!empty($modSettings['post_ratings_enable']) ? ' ratings_enabled, rating, IFNULL(total_ratings, 0) as total_ratings, id_last_rating, ' : '') . '
I had to insert that line manually because I have in my array:

Code: [Select]
$messages_request = $smcFunc['db_query']('', '
SELECT
m.id_msg, m.icon, m.subject, m.poster_time, m.poster_ip, m.id_member, m.modified_time, m.modified_name, m.body, m.edit_reason,
m.smileys_enabled, m.poster_name, m.poster_email, m.approved,

Where are the "m"s coming from?

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

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,399
    • StoryBB/StoryBB on GitHub
Re: Post Ratings
« Reply #84 on: December 23, 2009, 10:50:44 AM »
The m refers to the messages table, you should see further in that query a reference to {db_prefix}messages AS m.

It would seem you have a mod that already interferes in that query though...
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Vyache

  • Jr. Member
  • **
  • Posts: 164
  • Gender: Male
  • "If You Give A Mouse A Cookie?"
    • Swim Strong Network
Re: Post Ratings
« Reply #85 on: December 23, 2009, 10:52:25 AM »
The m refers to the messages table, you should see further in that query a reference to {db_prefix}messages AS m.

It would seem you have a mod that already interferes in that query though...

What should I do?

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

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,399
    • StoryBB/StoryBB on GitHub
Re: Post Ratings
« Reply #86 on: December 23, 2009, 10:58:48 AM »
So, are you trying to install this mod?
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Vyache

  • Jr. Member
  • **
  • Posts: 164
  • Gender: Male
  • "If You Give A Mouse A Cookie?"
    • Swim Strong Network
Re: Post Ratings
« Reply #87 on: December 23, 2009, 11:02:06 AM »
Yes,

I installed it, but I added that line in my previous post. Will it work that way or I need more modification?

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

Offline jasonwatkins

  • Jr. Member
  • **
  • Posts: 101
Re: Post Ratings
« Reply #88 on: December 23, 2009, 11:09:24 AM »
hi,

am i completely missing it or is there no uninstall feature ?

i tried this on my forum and it didn't seem to initially work properly, so i looked for an uninstall option and it wasn't available ..

i removed the package from the list but it's still there and a lot of posts still have the option to rate them.

any help much appreciated :)

Offline Vyache

  • Jr. Member
  • **
  • Posts: 164
  • Gender: Male
  • "If You Give A Mouse A Cookie?"
    • Swim Strong Network
Re: Post Ratings
« Reply #89 on: December 23, 2009, 11:13:58 AM »
hi,

am i completely missing it or is there no uninstall feature ?

i tried this on my forum and it didn't seem to initially work properly, so i looked for an uninstall option and it wasn't available ..

i removed the package from the list but it's still there and a lot of posts still have the option to rate them.

any help much appreciated :)

What SMF are you using ?

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

Offline jasonwatkins

  • Jr. Member
  • **
  • Posts: 101
Re: Post Ratings
« Reply #90 on: December 23, 2009, 11:51:39 AM »
i'm using RC2 .. sorry, should have said that.  The users of my forum aren't keen on the mod anyway - it's nothing to do with the mod itself, they just voted against it.

Offline SoLoGHoST

  • SMF Hero
  • ******
  • Posts: 1,796
  • Gender: Male
  • Real coders do not need to comment their code!
    • Dream Portal
Re: Post Ratings
« Reply #91 on: December 23, 2009, 01:34:14 PM »
You are able to uninstall this mod.  I have already tested this and uninstalls just fine.  There is an additional option now when uninstalling that allows you to also uninstall the database changes, option says:  Remove all data associated with this modification. [ Details ]  Perhaps you forgot to place a checkmark in this option before uninstalling.  Though, in any case, it should've uninstalled the feature from within your posts.
« Last Edit: December 23, 2009, 01:37:30 PM by SoLoGHoST »

Offline SoLoGHoST

  • SMF Hero
  • ******
  • Posts: 1,796
  • Gender: Male
  • Real coders do not need to comment their code!
    • Dream Portal
Re: Post Ratings
« Reply #92 on: December 23, 2009, 01:57:19 PM »
Yes,

I installed it, but I added that line in my previous post. Will it work that way or I need more modification?

Ok, in your case Vyache, you'll need to change the query so that all columns have a m. in front of it for Post Ratings additions.  So your edit for this should be this:
Code: [Select]
' . (!empty($modSettings['post_ratings_enable']) ? ' m.ratings_enabled, m.rating, IFNULL(m.total_ratings, 0) as total_ratings, m.id_last_rating, ' : '') . '
Hope this helps.
Cheers :)

Offline Vyache

  • Jr. Member
  • **
  • Posts: 164
  • Gender: Male
  • "If You Give A Mouse A Cookie?"
    • Swim Strong Network
Re: Post Ratings
« Reply #93 on: December 23, 2009, 10:20:38 PM »
Thought so,

Thank you very much,

Happy Holidays!

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

Offline sattninja

  • Sr. Member
  • ****
  • Posts: 701
    • Appfuzion.com
Re: Post Ratings
« Reply #94 on: December 24, 2009, 07:50:46 PM »
i just installed this and it works fine i had to manually put the images in the folder but anywho i have a serious problem now when i get a new member and try to approve and send email i get this error or when i send new member an activation email and they click the link to activate they get the same error


An Error Has Occurred!
The database value you're trying to insert does not exist: is_ratings

EDIT:
i have figured it out kinda !!!  if i uninstall this mod
http://custom.simplemachines.org/mods/index.php?mod=789
i get no error as soon as i reinstall the welcome topic mod the error returns also when welcome topic is installed it creates the welcome post well at least i see it in recent posts but it is nowhere in the forum there is no post really weird so for now i uninstalled the welcome topic mod as i want the post ratings one more but would be nice to have both  ??? ???
« Last Edit: December 24, 2009, 08:11:21 PM by sattninja »
Running Rc4

Offline SoLoGHoST

  • SMF Hero
  • ******
  • Posts: 1,796
  • Gender: Male
  • Real coders do not need to comment their code!
    • Dream Portal
Re: Post Ratings
« Reply #95 on: December 24, 2009, 09:06:02 PM »
Ok, here's the problem, any mod that uses the createPost and/or modifyPost functions will need to have these indexes in $topicOptions and $msgOptions and defined as either true or false.

For $topicOptions, it will need the 'ratings_mode' index defined and either set to true or false.  Here is an example:
Code: [Select]
$topicOptions['ratings_mode'] = !empty($modSettings['post_ratings_enable']);This will set this to true if post ratings is enabled, otherwise will be false.  If you don't want this topic to be rated at all, just set this to false.

For $msgOptions, it will need the 'ratings_enabled' index defined.  Example:
Code: [Select]
$msgOptions['ratings_enabled'] = !isset($_POST['nr']);This example will disallow the post from being rated if the option for it to be rated was disabled, otherwise, it will be enabled.  You can also set this to true or false, whichever you prefer.

Well, there you go.  You can open up the other mod, and just edit where it uses createPost and modifyPost (if it uses this) and add these indexes into the $topicOptions and $msgOptions just before the createPost and/or modifyPost gets called, and tada will work like a charm.  You have to decide on whether or not you want these posts/topics to be rated though.

Cheers :)
« Last Edit: December 24, 2009, 09:11:44 PM by SoLoGHoST »

Offline sattninja

  • Sr. Member
  • ****
  • Posts: 701
    • Appfuzion.com
Re: Post Ratings
« Reply #96 on: December 24, 2009, 09:11:30 PM »
i am confused i have to add this to the mod itself or where?
Running Rc4

Offline SoLoGHoST

  • SMF Hero
  • ******
  • Posts: 1,796
  • Gender: Male
  • Real coders do not need to comment their code!
    • Dream Portal
Re: Post Ratings
« Reply #97 on: December 24, 2009, 09:16:59 PM »
Ok, open up WelcomeTopic2.php in your Sources folder.

FIND:
Code: [Select]
$msgOptions = array(
'id' => 0,
'subject' => str_replace("[username]",$memberName,$row2['welcomesubject']),
'body' => str_replace("[username]",$memberName,$row2['welcomebody']),
'icon' => 'xx',
'smileys_enabled' => 1,
'attachments' => array(),
);
$topicOptions = array(
'id' => 0,
'board' => $modSettings['welcome_boardid'],
'poll' => null,
'lock_mode' => null,
'sticky_mode' => null,
'mark_as_read' => false,
);

REPLACE IT WITH:
Code: [Select]
$msgOptions = array(
'id' => 0,
'subject' => str_replace("[username]",$memberName,$row2['welcomesubject']),
'body' => str_replace("[username]",$memberName,$row2['welcomebody']),
'icon' => 'xx',
'smileys_enabled' => 1,
'ratings_enabled' => !isset($_POST['nr']),
'attachments' => array(),
);
$topicOptions = array(
'id' => 0,
'board' => $modSettings['welcome_boardid'],
'poll' => null,
'lock_mode' => null,
'sticky_mode' => null,
'ratings_mode' => 0,
'mark_as_read' => false,
);

There, now it should work perfect.  Ratings for that topic/post will be disabled also.

This applies to all mods that use createPost and/or modifyPost functions, if you have Post Ratings installed.  Simply need to add these 2 array indexes.  1 for $topicOptions, and 1 for $msgOptions.  Their are security reasons why this needs to be this way.

Cheers :)
« Last Edit: December 29, 2009, 12:25:03 AM by SoLoGHoST »

Offline sattninja

  • Sr. Member
  • ****
  • Posts: 701
    • Appfuzion.com
Re: Post Ratings
« Reply #98 on: December 24, 2009, 09:29:58 PM »
made the edits and still the same thing nothing changed i registered a new member and sent an activation email and when i clicked tha ctivation email i got the same error

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

then i went and looked and again the welcome post shows on my portal in recent posts but i click on it and there is no post there

damn very weird
Running Rc4

Offline SoLoGHoST

  • SMF Hero
  • ******
  • Posts: 1,796
  • Gender: Male
  • Real coders do not need to comment their code!
    • Dream Portal
Re: Post Ratings
« Reply #99 on: December 24, 2009, 10:25:09 PM »
Ok, try changing both values to false instead and place ratings_enabled underneath smileys_enabled and place ratings_mode underneath sticky_mode.

Let me know if that works, k?

I'm going to install it now on my test site and see if I can get it to work....

Cheers :)