Beispiel #1
0
/**
 * get_page_similar_page_links
 * @param integer $intNumber
 * @return string $strHtmlOutput
 * @author Thomas Schedler <*****@*****.**>
 * @version 1.0
 */
function get_page_similar_page_links($intNumber = 5)
{
    $strHtmlOutput = '';
    $core = getCoreObject();
    $objPage = getPageObject();
    $strQuery = '';
    $objPageTags = $objPage->getTagsValues('page_tags');
    if (count($objPageTags) > 0) {
        foreach ($objPageTags as $objTag) {
            $strQuery .= 'page_tags:"' . $objTag->title . '" OR ';
        }
    }
    $objPageCategories = $objPage->getCategoriesValues('category');
    if (count($objPageCategories) > 0) {
        foreach ($objPageCategories as $objCategory) {
            $strQuery .= 'category:"' . $objCategory->title . '" OR ';
        }
    }
    $strQuery = rtrim($strQuery, ' OR ');
    if ($strQuery != '' && count(scandir(GLOBAL_ROOT_PATH . $core->sysConfig->path->search_index->page)) > 2) {
        Zend_Search_Lucene::setResultSetLimit($intNumber);
        $objIndex = Zend_Search_Lucene::open(GLOBAL_ROOT_PATH . $core->sysConfig->path->search_index->page);
        $objHits = $objIndex->find($strQuery);
        if (count($objHits) > 0) {
            $strHtmlOutput .= '
                <div class="divLinks">
                  <h3>&Auml;hnliche Beitr&auml;ge</h3>';
            $counter = 1;
            foreach ($objHits as $objHit) {
                if ($objHit->key != $objPage->getPageId()) {
                    $objDoc = $objHit->getDocument();
                    $arrDocFields = $objDoc->getFieldNames();
                    if (array_search('url', $arrDocFields) && array_search('title', $arrDocFields) && array_search('date', $arrDocFields)) {
                        $strHtmlOutput .= '
                    <div class="divLinkItem">
                      <a href="' . $objHit->url . '">' . htmlentities($objHit->title, ENT_COMPAT, $core->sysConfig->encoding->default) . '</a><br/>
                      <span>Erstellt am</span> <span class="black">' . $objHit->date . '</span><!-- <span>unter</span> <span class="black">Sportservice News</span> -->
                    </div>';
                    }
                }
            }
            $strHtmlOutput .= '
                  <div class="clear"></div>
                </div>';
        }
    }
    echo $strHtmlOutput;
}
Beispiel #2
0
/**
 * get_blog_text_blocks
 * @return boolean
 * @author Florian Mathis <*****@*****.**>
 * @version 1.0
 */
function get_blog_text_blocks($strImageFolder = '', $blnZoom = true, $blnUseLightbox = true, $strImageFolderZoom = '', $strContainerClass = 'divTextBlock', $strImageContainerClass = 'divImgLeft')
{
    $objCore = getCoreObject();
    $objWidget = getWidgetObject();
    $strHtmlOutput = '';
    $arrMultiplyFields = $objWidget->loadMultiplyFields();
    foreach ($arrMultiplyFields as $field) {
        $strBlockTitle = htmlentities($field['block_title'], ENT_COMPAT, getCoreObject()->sysConfig->encoding->default);
        $strHtmlOutput .= '<div class="' . $strContainerClass . '">';
        $strHtmlOutput .= '  <h2>' . $strBlockTitle . '</h2>';
        $objFiles = $objWidget->loadMultiplyFieldFiles($field['id']);
        if ($objFiles != '' && count($objFiles) > 0) {
            $strHtmlOutput .= '<div class="' . $strImageContainerClass . '">';
            foreach ($objFiles as $objFile) {
                $objFile = $objWidget->getFileFieldValueById($objFile['idFiles']);
                $strHtmlOutput .= '<img src="' . $objCore->sysConfig->media->paths->imgbase . $strImageFolder . '/' . $objFile[0]->filename . '" alt="' . $objFile[0]->title . '" title="' . $objFile[0]->title . '"/><br/>';
            }
            $strHtmlOutput .= '</div>';
        }
        $strHtmlOutput .= $field['block_description'];
        $strHtmlOutput .= '<div class="clear"></div>';
        $strHtmlOutput .= '</div>';
    }
    echo $strHtmlOutput;
}
Beispiel #3
0
/**
 * get_static_component_domain
 * @author Cornelius Hansjakob <*****@*****.**>
 * @version 1.0
 */
function get_static_component_domain()
{
    echo getCoreObject()->config->domains->static->components;
}