News:

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

Main Menu

SMF Likes Lite

Started by Nibogo, June 08, 2011, 05:35:20 PM

Previous topic - Next topic

Rain Forest

Quote from: hcfwesker on October 22, 2012, 10:12:49 AM
Quote from: 4Three on October 22, 2012, 10:09:34 AM
Ok, thanks!

Hmm, Can u provide me a link?

http://simpleportal.net/index.php?topic=11918.msg60566#msg60566

You probably won't like what you see lol.

Since you're not allowed to share it public because you don't have the permission yet, can you PM me the custom php block instead?

Arantor

Um, why would he be able to share it privately if he can't share it publicly?

In all honesty, though, the data structure that is related is publicly visible (since the likes lite mod is publicly visible). Personally I'd see no need to ask for permission (even if it were one of my works that were being integrated with) for integrating with that. Integrating with the paid mod is a different kettle of fish, though (and should be constrained to the private board where paying customers can see it)

Rain Forest

Quote from: Arantor on October 22, 2012, 10:22:58 AM
Um, why would he be able to share it privately if he can't share it publicly?

Um, because it's possible to PM people?

Arantor

You're missing the point. If he can't post it publicly because he's waiting for permission, he won't be able to share it privately either without waiting for the same permission...

hcfwesker

#64
As posted from the SP support site post.

I will share the edits.  But first, I need to ask NIBOGO's permission to share the edit, out of respect.  And ask him if it would even be compatible with Likes Lite version of the MOD.

If it were any other MOD I wouldn't mind.  But this is a free version to a Paid MOD.  And I know NIBOGO doesn't handle much support for free versions to his paid MOds.  That i respect, and will continue to do so ;)

Though if you ever decide to upgrade to Likes PRO, I've posted the edits there in the customer board, already, while awaiting a response.

Arantor

I got that fact ;) Just saying that as the free mod is freely visible, it would not be much of a stepping-on-toes to write something that happened to look in the same place for data. It's great that you're asking for permission, I'm just saying that it's probably a step above and beyond the call of duty ;)

hcfwesker

I wasn't directing the post at you.  sorry if it seemed that way.  Just continuing from what you were saying 2 posts above, the 2 new posts came while i was typing. 

And, yeah, I'm sure I'm jumping through unnecessary hoops :D  Just wanna play it cool.

hcfwesker

Quote from: 4Three on October 04, 2012, 03:50:29 PM
What to do to make this a 'block' at portal with top 5 most 'liked' persons..

Here ya go.

Here are the 3 simple edits for this.

Sources/PortalBlocks.php

Find
'casino' => $txt['sp_topStatsMember_Casino'],

Add AFTER
'likes' => $txt['Likes'],

Find
'casino' => array(
'name' => 'Casino Cash',
'mod_id' => 1641,
'field' => 'mem.cash',
'order' => 'mem.cash',
'output_text' => '%cash%',
'enabled' => file_exists($sourcedir . 'casino/Casino.php'),
'error_msg' => $txt['sp_sashop_no_exist'],
),


Add AFTER
'likes' => array(
'name' => 'Likes',
'field' => 'mem.liked',
'order' => 'mem.liked',
'output_text' => '%liked% ' . $txt['Likes'],
'enabled' => file_exists($sourcedir . '/Likes.php'),
'error_msg' => $txt['sp_likes_no_exist'],
),


/languages/SPortal.english.php

Add Before the ?>  at the bottom of the file
$txt['Likes'] = 'Likes';
$txt['sp_likes_no_exist'] = 'Likes Pro MOD not found';



How To Create the Block

Now after you made the edits, when making a "New Block"  use the Block Option "Top Member Stats".  You'll now see the option to select Likes at the bottom of the drop down list of options.  Select the number of Top Liked members you'd like displayed (5), and rename the Block Title.

Enjoy!

Rain Forest

Thank you! :)

EDIT:

Now my error log get's full or:

website../forum/index.php?action=admin;area=portalblocks;sa=edit
Apply Filter: Only show the errors with the same message
8: A non well formed numeric value encountered
Apply Filter: Only show the errors from this file
File: /var/www/vhosts/website../httpdocs/forum/Sources/Subs.php
Line: 742

hcfwesker

Working on a custom php block for this.  Just having an issue with showing all avatars

hcfwesker

PHP Custom block.   Thanx to Underdog for solving the avatar display issue.  http://simpleportal.net/index.php?topic=11918.msg60585#msg60585

with that you can reverse the file edits from the previous post, and just use that.

Rain Forest

Thanks! But now I don't have the borders anymore around the avatars..

width="40" style="border: 1px solid #D8D8D8; padding: 5px; background: white;" />

EDIT:

I got it now. With 2px for border around the avatar it should be something like this:

global $smcFunc, $scripturl, $context, $txt, $boardurl;

$result = $smcFunc['db_query']('', '
   SELECT mem.real_name, mem.avatar, mem.liked, mem.member_name, mem.id_member, att.id_attach, att.filename
   FROM {db_prefix}members AS mem
   LEFT JOIN {db_prefix}attachments AS att ON (att.id_member = mem.id_member)
   ORDER BY liked DESC
   LIMIT 5');
while ($row = $smcFunc['db_fetch_assoc']($result))
{

if (!$row['avatar'] && !$row['filename'])
$avatar = $boardurl . '/avatars/noavatar.gif';
elseif (!$row['avatar'])
$avatar = $scripturl . '?action=dlattach;attach='.$row['id_attach'].';type=avatar';
elseif (substr($row['avatar'], 0, 4) != 'http')
$avatar = $boardurl .'/avatars/' . $row['avatar'];
else
$avatar = $row['avatar'];

echo'
<table width="100%">
<tr>
<td width="50"><img src="'.$avatar.'" width="40" style="border: 2px solid #D8D8D8; padding: 5px; background: white;"" /></td>
<td><a href="'.$scripturl.'?action=profile;u='.$row['id_member'].'" />'.$row['real_name'].'</a><br />  '.$row['liked'].'  '.$txt['Likes'].' </td>
</tr>
</table>';
}
$smcFunc['db_free_result']($result);


EDIT #2:
How is this custom mod compatible with the member color link?

jack001

please update it for smf v2.0.x..

when i am trying to install it, it is showing the following error:

'The package you are trying to download or install is either corrupt or not compatible with this version of SMF.'


https://www.edufor.xyz Edutainment forum - Education with Entertainment!

wildcat180

Quote from: jack001 on December 08, 2012, 01:11:21 AM
please update it for smf v2.0.x..

when i am trying to install it, it is showing the following error:

'The package you are trying to download or install is either corrupt or not compatible with this version of SMF.'

I have the same problem for 2.0.3.


mamadmankan

Quote
Install Mod

Please remember to always make regular backups of your sources and database before installing mods, especially beta versions.



Installations actions for "SMFPacks Likes Lite Mod"

The package you are trying to download or install is either corrupt or not compatible with this version of SMF.

i get this problem

can someone please help me ??

hcfwesker

Quote from: mamadmankan on January 09, 2013, 02:01:14 AM
Quote
Install Mod

Please remember to always make regular backups of your sources and database before installing mods, especially beta versions.



Installations actions for "SMFPacks Likes Lite Mod"

The package you are trying to download or install is either corrupt or not compatible with this version of SMF.

i get this problem

can someone please help me ??

Quote from: hcfwesker on January 07, 2013, 07:46:13 PM
oh lord ...

How can I install a mod that doesn't work in my SMF version

^^ Click The Link!


Skaty

is there a way to transfer thankyoupost mod numbers to this ? i do not want to lose all points.


TheRealityBuzz

Its not working for me either.

Advertisement: