Info
- 5 posts
- 3 voices
- Started 5 years ago by ear1grey
- Latest reply from Michael Adams (mdawaffe)
How to read bb_topicmeta?
-
- Posted 5 years ago #
I'm writing a plugin and looking for a way to read the bb_topicmeta table without resorting to cranking out SQL. I can find the
bb_update_metamethod but no matchingbb_get_meta.Is there an obvious other metadata retrieval method or is this one for trac?
-
- Posted 5 years ago #
Unlike WP, topic meta is accessed throught the topic object.
update_topicmeta( 5, 'my_meta', 'yay' );
$topic = get_topic( 5 );
echo $topic->my_meta; // outputs: yay -
- Posted 5 years ago #
Unlike WP, topic meta is accessed throught the topic object.
update_topicmeta( 5, 'my_meta', 'yay' );
$topic = get_topic( 5 );
echo $topic->my_meta; // outputs: yayUm. What? I see this isn't going to be a fun forum system to customise if you're not a PHP programmer. I have NO IDEA what the above means. (I dont mean that as a slam, just a declaration that I'm in over my head at this point.)
-
- Posted 5 years ago #
Thx Mike; perfick.
@nola: the short version is that if you already have the topic (which I do because I'm using this in the topic.php template), then instread of saying:
echo bb_get_topicmeta($topic->ID, "mykey");whichis what I was expecting, there is the somewhat easierecho $topic->my_key; -
- Posted 5 years ago #
nolageek, That information will mostly be useful to plugin authors. You probably won't need to know that in order to customize your site.
I hope not, anyway :)
-
You must log in to post.