ProBlog

A powerful October CMS Blog plugin. Boost your SEO with robust blogging tools by Radiantweb.

Back to ProBlog Support

imunisasi
imunisasi

Embed Code seems not working, i used slug like this : :filter?/:slug?/
and i add Embed Code forum with : :slug , :slug? , :filter?/:slug?/ , forum/topic/:slug
all of them give same result, comment to all post

thanks

Last updated

imunisasi
imunisasi

rainlab.forum record ID parameter :slug? will be save as :slug?
this is dirty way how to keep using rainlab.forum for comment :

open rainlab/forum/components/EmbedTopic.php
go to line 80

if ($topic = TopicModel::forEmbed($channel, $code)->first()) {
            $properties['slug'] = $slug;
        }

change into :

if ($topic = TopicModel::forEmbed($channel, $lolslug)->first()) {
            $properties['slug'] = $lolslug;
        }

go to line 89

$this->controller->bindEvent('page.end', function() use ($component, $channel, $code)

change into

$this->controller->bindEvent('page.end', function() use ($component, $channel, $code, $lolslug)

go to line 91

$topic = TopicModel::createForEmbed($code, $channel, $this->page->title);

change into

$topic = TopicModel::createForEmbed($code, $channel, $this->page->title, $lolslug);

in line 58 under public function init() {
add

$urlarray = explode('/',Request::url());
$lolslug = $urlarray[(count($urlarray) - 1)];

add this on top under "use Exception;"

use Request;

open rainlab/forum/models/Topic.php
go to line 126

public static function createForEmbed($code, $channel, $subject = null)

change into

public static function createForEmbed($code, $channel, $subject = null, $lolslug = null)

go to line 132

$topic->embed_code = $code;

change into go to line 132

$topic->embed_code = $lolslug;

this one alternative for commenting use rainlab forum if u had better way to approach this, please let me know

Last updated

laics19845002
laics19845002

I encountered this error after applying your code:

Class 'RainLab\Forum\Components\Request' not found

ChadStrat
ChadStrat

I really really love that users in this community make an effort to problem solve and learn and code. Great post. Thanks for sharing!

imunisasi
imunisasi

laics19845002 said:

I encountered this error after applying your code:

Class 'RainLab\Forum\Components\Request' not found

sry just comeback from long holiday, did u add " use Request; " ?

ChadStrat said:

I really really love that users in this community make an effort to problem solve and learn and code. Great post. Thanks for sharing!

thanks Chad, i'm in love with your plugin too much :D

laics19845002
laics19845002

I have followed the instruction.

Now the error i encounter is "You cannot edit posts or make replies." when i add comment.

1-6 of 6