I successfully created the plugin after adding another prefix for cms_node.
This will be the correct codes which I used:
PHP Code:
$record = vB::$vbulletin->db->query_first("SELECT a.threadid
FROM " . TABLE_PREFIX . "cms_article AS a
JOIN " . TABLE_PREFIX . "cms_node ON(" . TABLE_PREFIX . "cms_node.contentid = a.contentid)
WHERE nodeid = " . $this->getNodeId());
$view->threadid = $record['threadid'];
In case someone else want to know, I used threadid in templates in this format: {vb:raw threadid}
I truly appreciate your help Lynne.
regards,