Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: nadeem34 on November 11, 2018, 08:55:46 AM

Title: Error in installation of anti spam links mod
Post by: nadeem34 on November 11, 2018, 08:55:46 AM
Hi
I want to install anti-spam link mod (http://custom.simplemachines.org/mods/index.php?mod=2404) but I got an error during installation. It wants to replace this code in ./Sources/Display.php
// Run BBC interpreter on the message.
$message['body'] = parse_bbc($message['body'], $message['smileys_enabled'], $message['id_msg']);

replace with this code
// Start of Anti-Spam-Links mod

$posts = $memberContext[$message['id_member']]['is_guest'] ? 0 : $memberContext[$message['id_member']]['posts'];

// End of Anti-Spam-Links mod

// Run BBC interpreter on the message.
$message['body'] = parse_bbc($message['body'], $message['smileys_enabled'], $message['id_msg'], NULL, (int) $message['id_member'], $posts);


But the problem is in my ./Sources/Display.php it can't find the exact code to replace with. in My ./Sources/Display.php i have this code available which is a little bit different from the code it wants to replace with.
// Run BBC interpreter on the message.
$message['body'] = '<!-- google_ad_section_start -->' . parse_bbc(parse_acronyms($message['body']), $message['smileys_enabled'], $message['id_msg']) . '<!-- google_ad_section_end -->';


Can anyone help how to change it manually the above codes
Title: Re: Error in installation of anti spam links mod
Post by: Bigguy on November 11, 2018, 09:06:33 AM
It doesn't really replace it though. If you add this above that code you found it should work:
// Start of Anti-Spam-Links mod

$posts = $memberContext[$message['id_member']]['is_guest'] ? 0 : $memberContext[$message['id_member']]['posts'];

// End of Anti-Spam-Links mod
Title: Re: Error in installation of anti spam links mod
Post by: Shambles on November 11, 2018, 09:14:14 AM
Manual Installation of Mods (https://wiki.simplemachines.org/smf/Manual_installation_of_mods)

For any issues related to the mod, try posting in the topic created to support it :)

https://www.simplemachines.org/community/index.php?topic=364169.0

Title: Re: Error in installation of anti spam links mod
Post by: nadeem34 on November 11, 2018, 09:38:57 AM
Quote from: Bigguy on November 11, 2018, 09:06:33 AM
It doesn't really replace it though. If you add this above that code you found it should work:
// Start of Anti-Spam-Links mod

$posts = $memberContext[$message['id_member']]['is_guest'] ? 0 : $memberContext[$message['id_member']]['posts'];

// End of Anti-Spam-Links mod


The mod is installed successfully but it does not work.
Title: Re: Error in installation of anti spam links mod
Post by: Bigguy on November 11, 2018, 09:41:39 AM
I have to go to work but you should ask the mod author for support really as Sh@mbles suggested. If it installed successfully you should be able to use it.
Title: Re: Error in installation of anti spam links mod
Post by: Kindred on November 11, 2018, 06:53:45 PM
As noted, support for specific mods should be requested in the support topic dedicated to supporting that specific mod.

Also, your question was answered directly in that thread along with the exact code edit.