Codoforum Related Descussions
On my form using CODOLOGIC forum.

I got a little plugin working using the after_topic_insert hook.

Is it possible to use that to get information on what category a post was put in, or what tags were used on it?

I got a little plugin working using the after_topic_insert hook. Is it possible to use that to get information on what category a post was put in, or what tags were used on it?

If you have the post information, it will also have the category id, so you can fetch the category information from codo_categories table

If you have the post information, it will also have the category id, so you can fetch the category information from codo_categories table

Is there a global I can call to get that information?

What about tags?

Is there a global I can call to get that information? What about tags?

I can't seem to call

$query = CODOF\Forum\Topic::getTags($id);

from a plugin, due to a non-static context.

I can't seem to execute

$query = DB::table(PREFIX.'codo_tags')->where('topic_id', $id)->get();

because $id is not passed to the function. I'm going slowly insane.

Help?

I can't seem to call ```` $query = CODOF\Forum\Topic::getTags($id); ```` from a plugin, due to a non-static context. I can't seem to execute ```` $query = DB::table(PREFIX.'codo_tags')->where('topic_id', $id)->get(); ```` because $id is not passed to the function. I'm going slowly insane. Help?

have a look at sites/default/plugins/codo_similar_topics/codo_similar_topics.php, which show similar topics , maybe it can help ?

have a look at sites/default/plugins/codo_similar_topics/codo_similar_topics.php, which show similar topics , maybe it can help ?

please, excuse my bad english! ( i'm french, and i know, it's not a good excuse ! ;) )


$query = DB::table(PREFIX.'codo_tags')->where('topic_id', $id)->get();

That is the topic id which you should get from the hook after_topic_insert

``` $query = DB::table(PREFIX.'codo_tags')->where('topic_id', $id)->get(); ``` That is the topic id which you should get from the hook after_topic_insert

Yes. I am able to verify that I have an integer value that coresponds to a topic ID in that variable, but that function does not see it. I can hard-code an id number in that statement as follows:

$query = DB::table(PREFIX.'codo_tags')->where('topic_id', 26)->get();

which works fine, but as soon as I try to make it a variable, no go.

Yes. I am able to verify that I have an integer value that coresponds to a topic ID in that variable, but that function does not see it. I can hard-code an id number in that statement as follows: ```` $query = DB::table(PREFIX.'codo_tags')->where('topic_id', 26)->get(); ```` which works fine, but as soon as I try to make it a variable, no go.

Ok, I've made some progress.

Apprently, the after_topic_insert hook in my plugin runs just before the information is added to the database, so my desire to pull tags from the post that was just made is not being fulfilled because those database values are inserted after the plugin does its thing.

Is there another hook I should be using for this? Or, is there another place I can grab the tags from?

Ok, I've made some progress. Apprently, the after_topic_insert hook in my plugin runs just before the information is added to the database, so my desire to pull tags from the post that was just made is not being fulfilled because those database values are inserted after the plugin does its thing. Is there another hook I should be using for this? Or, is there another place I can grab the tags from?

HI,

Can you try "after_post_insert" hook ?

HI, Can you try "after_post_insert" hook ?
Necessity is the mother of all inventions!

158
8
4
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft