News:

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

Main Menu

Who Quoted Me

Started by vbgamer45, February 04, 2019, 05:06:19 PM

Previous topic - Next topic

vbgamer45

Link to the mod

For SMF 2.0.x
Shows the user a list of people that have quoted them.
Has built in option to rebuild quote history for all old posts


Install Information:
Install via the SMF's Package Manager via upload package.

License: BSD License
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

live627

What's the license?  I want to add this to my site but with a slightly different implementation.

vbgamer45

You can treat it as BSD/same as SMF.
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

live627

oh okay.

I see a few problems (haven't tested)
  • The hooks must go into the code tag. The database tag only executes on uninstall if the checkmark is checked. See SimpleDesk  for a godo example.
  • Admin area, try manually writing an unknown subaaction in the url; may get an undefined index
  • The regex to get the quoted author assumes all parameters are present when they're all really optional. Just search for the author.

vbgamer45

Fixed the first two.

Regex have to think about. Was just handling the quote button on posts when quoting someone.
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

-Rock Lee-

Very good @vbgamer45 great work!!!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Arantor

Interesting, why not use the approach that 2.1 does where it looks for a quite with a message id?
Holder of controversial views, all of which my own.

vbgamer45

didn't look at it. It looks like they do it differently

protected static function getQuotedMembers($msgOptions, $posterOptions)
{
global $smcFunc;

$blocks = preg_split('/(\[quote.*?\]|\[\/quote\])/i', $msgOptions['body'], -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);

$quote_level = 0;
$message = '';

foreach ($blocks as $block)
{
if (preg_match('/\[quote(.*)?\]/i', $block, $matches))
{
if ($quote_level == 0)
$message .= '[quote' . $matches[1] . ']';
$quote_level++;
}
elseif (preg_match('/\[\/quote\]/i', $block))
{
if ($quote_level <= 1)
$message .= '[/quote]';
if ($quote_level >= 1)
{
$quote_level--;
$message .= "\n";
}
}
elseif ($quote_level <= 1)
$message .= $block;
}

preg_match_all('/\[quote.*?link=msg=([0-9]+).*?\]/i', $message, $matches);

$id_msgs = $matches[1];
foreach ($id_msgs as $k => $id_msg)
$id_msgs[$k] = (int) $id_msg;

if (empty($id_msgs))
return array();

// Get the messages
$request = $smcFunc['db_query']('', '
SELECT m.id_member, mem.email_address, mem.lngfile, mem.real_name
FROM {db_prefix}messages AS m
INNER JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
WHERE id_msg IN ({array_int:msgs})
LIMIT {int:count}',
array(
'msgs' => array_unique($id_msgs),
'count' => count(array_unique($id_msgs)),
)
);

$members = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
{
if ($posterOptions['id'] == $row['id_member'])
continue;

$members[$row['id_member']] = $row;
}

return $members;
}
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

live627

Quote from: Arantor on February 05, 2019, 02:47:42 AM
Interesting, why not use the approach that 2.1 does where it looks for a quite with a message id?
because some quotes use only author, such as a quote from a pm.

vbgamer45

I will say this mod just handles quotes from messages in posts does not handle pm's or in other areas.
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

live627

Of course. Some people actually do post a pm in public; rare, but it happens.

Arantor

Quote from: live627 on February 05, 2019, 04:27:35 PM
Quote from: Arantor on February 05, 2019, 02:47:42 AM
Interesting, why not use the approach that 2.1 does where it looks for a quite with a message id?
because some quotes use only author, such as a quote from a pm.

I'd honestly suggest it would be better not to rely on that (especially as users so rarely use it that way) but I can see why you might not.
Holder of controversial views, all of which my own.

pocttopus

What is the changelog of todays update?  ???

vbgamer45

Nothing just changed the license.
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

pocttopus

Thanks. :)


Nothing here on this post... move along.  ;D

BellGab.com

Thanks for this mod. Quite useful. I went ahead and rebuilt the quote database after I installed it and with 1.3 million posts, well, let's just say that took a while, heh heh. Actually, about 30 hours to be precise.

digger


vbgamer45

Added translation to mod. Thanks for making it easier. I will to try to get better adding them to my mods.
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

aegersz

it's working for new quotes but the historical quotes don't show anything.
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

vbgamer45

You have to rebuild the old quote history in the mod's settings
go to "Click here to rebuild quote log history"
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

Advertisement: