Ejemplo n.º 1
0
 public function columnUrl()
 {
     $intColumnId = intval($this->input['column_id']);
     if (!$intColumnId) {
         $this->errorOutput('NO COLUMN_ID');
     }
     $sql = "SELECT col.id,col.special_id,col.column_name,col.outlink,spe.column_url\n                FROM " . DB_PREFIX . "special_columns col \n                LEFT JOIN " . DB_PREFIX . "special spe\n                    ON col.special_id = spe.id \n                WHERE 1 AND col.id = " . $intColumnId;
     $arColumnInfo = $this->db->query_first($sql);
     if (!empty($arColumnInfo)) {
         if (!$arColumnInfo['outlink']) {
             $arColumnInfo['column_url'] = $arColumnInfo['column_url'] ? unserialize($arColumnInfo['column_url']) : array();
             $intContentId = array_pop($arColumnInfo['column_url']);
             if (!class_exists('publishcontent')) {
                 include ROOT_PATH . 'lib/class/publishcontent.class.php';
             }
             $objPublishContent = new publishcontent();
             $arSpecialInfo = $objPublishContent->get_content_by_rid($intContentId);
             $arColumnInfo['column_url'] = $arSpecialInfo['content_url'];
             $arColumnInfo['column_url'] = explode('/', $arColumnInfo['column_url']);
             array_pop($arColumnInfo['column_url']);
             $arColumnInfo['column_url'] = implode('/', $arColumnInfo['column_url']);
             $arColumnInfo['column_url'] = $arColumnInfo['column_url'] ? rtrim($arColumnInfo['column_url'], '/') . '/' . $arColumnInfo['id'] . '_list.html' : '';
             if (!$arColumnInfo['column_url']) {
                 $arColumnInfo['column_url'] = COLURL . $arColumnInfo['id'];
             }
         } else {
             $arColumnInfo['column_url'] = $arColumnInfo['outlink'];
         }
     }
     $this->addItem($arColumnInfo['column_url']);
     $this->output();
 }
Ejemplo n.º 2
0
 public function get_published_content_byid($id)
 {
     include_once ROOT_PATH . 'lib/class/publishcontent.class.php';
     $publish_server = new publishcontent();
     return $publish_server->get_content_by_rid($id);
 }