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

blokey

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

Arantor

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.

SoLoGHoST

I have a plan on fixing this and will be implemented in the next version.

Cheers :)

Vyache

Under Display.php in sources,

$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,

' . (!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:

$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~

Arantor

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...

Vyache

Quote from: The Grinch 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...

What should I do?

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

Arantor

So, are you trying to install this mod?

Vyache

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~

jasonwatkins

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 :)

Vyache

Quote from: jasonwatkins 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 :)

What SMF are you using ?

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

jasonwatkins

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.

SoLoGHoST

#91
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.

SoLoGHoST

Quote from: Vyache 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?

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:
' . (!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 :)

Vyache

Thought so,

Thank you very much,

Happy Holidays!

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

sattninja

#94
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  ??? ???
Running Rc4

SoLoGHoST

#95
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:
$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:
$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 :)

sattninja

i am confused i have to add this to the mod itself or where?
Running Rc4

SoLoGHoST

#97
Ok, open up WelcomeTopic2.php in your Sources folder.

FIND:$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:$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 :)

sattninja

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

SoLoGHoST

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 :)

Advertisement: