public function display($pid) { if (!isset($this->optObj)) { if (!$this->loadProfileOptions()) { return ''; } } erpPROPaths::requireOnce(erpPROPaths::$erpPROTheme); if (!is_int($pid) || erpPROTheme::areOthersSuppressed()) { $this->setSuppressOthers(); return ''; } erpPROPaths::requireOnce(erpPROPaths::$VPluginThemeFactory); erpPROPaths::requireOnce(erpPROPaths::$erpProRelated); $relatedObj = erpProRelated::get_instance($this->optObj); $result = $relatedObj->getRelated($pid); $ratings = $relatedObj->getRatingsFromRelDataObj(); if (empty($result) || empty($result->posts)) { return ''; } VPluginThemeFactory::registerThemeInPathRecursive(erpPROPaths::getAbsPath(erpPROPaths::$scThemesFolder), $this->optObj->getDsplLayout()); $theme = VPluginThemeFactory::getThemeByName($this->optObj->getDsplLayout(), 'shortcode'); if (!$theme) { return ''; } $theme->setOptions($this->optObj->getOptions()); $theme->formPostData($result, $this->optObj, $ratings); $relContent = $theme->render(); $this->setSuppressOthers(); return $relContent; }