HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Search
-
Re: Noindex based on min word count?
I assume you want to filter on the number of words in the discussion and comments bodies. public function discussionController_render_before($sender) { $threshold = C('AutoNoIndex.Threshold', 100); $wordCount = str_word_count($sender->Discussion->Body); if($wordCount >= $threshold) { return; } $comments =… -
Re: Noindex based on min word count?
Normally simple things like that either work or they don't. Is it possible that "this little hack/plugin is no longer working consistently" is based on a misunderstanding on what the plugin should do/can do? hgtonight adviced you to "passing the bodies through the format class like @x00 did". The difference of counting the… -
Re: Noindex based on min word count?
Huh, thought I had responded to this. You need to check and make sure the discussion object exists. Replace line 3 with: $discussion = val('Discussion', $sender, false);if($discussion === false) { return;}$wordCount = str_word_count($discussion->Body); You could also improve this by passing the bodies through the format… -
Re: Noindex based on min word count?
Please can aonyone figure out why @hgtonight 'noindex' code is causing discussion controller errors on most of the forum functions? Deleting, favouriting etc. Reminder of @hgtonight 's code: public function discussionController_render_before($sender) { $threshold = C('AutoNoIndex.Threshold', 100); $wordCount =… -
Re: Noindex based on min word count?
Again you will need to encourage your users to make make better topics, there are a number of ways to do that from interface to behavioural incentives. If you want to add noindex conditionally in a theme hooks file you can add this hook public function DiscussionController_Render_Before($Sender){ if… -
Re: Noindex based on min word count?
$PluginInfo['TestingGround'] = array( // You put whatever you want to call your plugin folder as the key 'Name' => 'Testing Ground', // User friendly name, this is what will show up on the garden plugins page 'Description' => 'A skeleton plugin that adds its resources to every page, creates a settings page, and creates a…
6 results