News:

Wondering if this will always be free?  See why free is better.

Main Menu

Like Posts

Started by vbgamer45, June 29, 2013, 09:29:03 AM

Previous topic - Next topic

jsx

@vbgamer45

I have uploaded the importlikes.php file to the server and after loading this information appears:

Database error
Try again. If you return to this message, report the error to the administrator.

Please help.

vbgamer45

Check your forums error log. Or might be easier just to run those SQL queries directly on your db
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

jsx

These are the errors:

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '', '0')' at line 4
File: /home/xxxxx/importlikes.php
Line: 26

$smcFunc['db_query']('', "INSERT IGNORE INTO {db_prefix}user_likes
    (id_member, content_type, content_id, like_time)
SELECT id_member_gave, 'msg', id_msg, liked_timestamp
    FROM {db_prefix}like_post;', '0')");



What do you think about it?

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

jsx

Quote from: shawnb61 on February 09, 2022, 11:37:39 PMThe first thing to do is to edit it & change the prefix accordingly.  I.e., if your tables don't start with smf_, then change those.

Do you use phpMyAdmin?  If so, pull up your database in phpMyAdmin, open up the SQL tab, then copy & paste this in there, & execute it.

(You may get a bunch of 'Duplicate Entry' warnings.  It's safe to ignore those.)

I quoted shawnb61 post as if someone was looking for a way to move likes to the likes system in 2.1 it immediately has it here, no need to search.

vbgamer45 looks like the likes have moved correctly:



Inserted records: 19678.

What does that mean?

Warning: #1062 Repeated occurrence '37770-msg-317' for key 'PRIMARY'

Records modified: 9589

Doug Heffernan

#1245
Quote from: jsx on September 05, 2022, 12:53:13 PMWhat does that mean?

Warning: #1062 Repeated occurrence '37770-msg-317' for key 'PRIMARY'

That error means duplicate entry. You are trying to insert two rows with the same primary key. i.e. a row inserts a value which already exists in the primary key field.


jsx

@Doug Heffernan

Thanks for the explanation, but it looks like the post likes have moved. I use your mod "Posts I liked" and I see the posts I liked, but in the notifications I don't have the likes I received.

@shawnb61

So the question I have is, does this script also transfer the likes that the user has received, or does it only transfer the likes that the user has given out?

jsx

@shawnb61

I repeat my question. Does your script moves the likes that the user got? I used your script and the likes have moved, via "Posts I liked" mod I can see the posts I liked. So those posts that I liked when I had the forum on 2.0.19 moved to the 2.1 forum, and in this mod I also see new posts that I liked on the 2.1 forum. But I don't see in Notifications my old posts that have been liked by others. So I am asking if your script also moved those likes? If the script has also moved these posts, they must be in the database.

@vbgamer45 maybe you know if this script moves all the likes from your modification?

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

jsx

Thanks for your message. So, if those likes don't displayed in Notifications it is needed a mod similar to "Posts I liked" something like: The likes I received?

@rjen

Aren't the likes showing in the individual messages? Notifications are only intended to notify the user at the time the new like is added.

Why would you want to notify them again? They were already notified in forum prior to upgrading...
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

jsx

Quote from: @rjen on September 09, 2022, 02:38:27 PMAren't the likes showing in the individual messages?

Are displayed.

Quote from: @rjen on September 09, 2022, 02:38:27 PMWhy would you want to notify them again?

I do not want to notify users about likes again, I want to see a list of likes my posts by other users. So I want to see my posts received likes.

@rjen

Quote from: jsx on September 09, 2022, 03:12:21 PM
Quote from: @rjen on September 09, 2022, 02:38:27 PMWhy would you want to notify them again?

I do not want to notify users about likes again, I want to see a list of likes my posts by other users. So I want to see my posts received likes.

I guess you're out of luck then: I am pretty sure the the notification system is not designed to be a permanent record of received likes...
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

shawnb61

Top likes are on the stats page.

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

jsx

Quote from: @rjen on September 09, 2022, 03:56:42 PMI guess you're out of luck then: I am pretty sure the the notification system is not designed to be a permanent record of received likes...

I understand that, then a modification is needed, such as "The likes I received", which will display all the likes that the user has received. I hope some good guy (programmer) will create such a modification. I think any user who has used this script wants to be able to access a list of their own posts that have been liked by users.

I have in mind such a list:


Doug Heffernan

Quote from: jsx on September 10, 2022, 07:45:27 AM
Quote from: @rjen on September 09, 2022, 03:56:42 PMI guess you're out of luck then: I am pretty sure the the notification system is not designed to be a permanent record of received likes...

I understand that, then a modification is needed, such as "The likes I received", which will display all the likes that the user has received. I hope some good guy (programmer) will create such a modification. I think any user who has used this script wants to be able to access a list of their own posts that have been liked by users.

I have in mind such a list:



You can request such a mod at the Mod Requests board.

https://www.simplemachines.org/community/index.php?board=79.0

a10

2.0.19 > 2.1.2, the sql import query worked fine, thanks!

But  :(  at least for the kind of forum I manage, very sad to see the 'Total likes' pr member gone. Really impossible to get that back? (if needed with a $$$ mod).
2.0.19, php 8.0.23, MariaDB 10.5.15. Mods: Contact Page, Like Posts, Responsive Curve, Search Focus Dropdown, Add Join Date to Post.

Advertisement: