Exemple #1
0
</div>-->
    <?php 
    }
    ?>
    <div class="search-posts">
        <ul>
            <?php 
    $i = 0;
    foreach ($registry['search'] as $item) {
        $i++;
        $title_length = string_length($item['title']);
        if (!empty($item['title_short'])) {
            $short_length = string_length($item['title_short']);
            $short_text = $item['title_short'];
        } else {
            $short_length = string_length($item['text_short']);
            $short_text = $item['text_short'];
        }
        $content_length = $title_length + $short_length;
        $short_length = 135 - $title_length;
        $this['slide'] = get_serialize($item['slide']);
        ?>
            <li data-last_id="<?php 
        echo $item['id'];
        ?>
">
                <a href="http://<?php 
        echo $_SERVER['SERVER_NAME'];
        ?>
/<?php 
        echo $item['cat_chpu'];
Exemple #2
0
<?php

defined('_JEXEC') or die('Restricted access');
$title_length = string_length($registry['main-article'][0]['title']);
if (!empty($registry['main-article'][0]['text_short'])) {
    $short_length = string_length($registry['main-article'][0]['text_short']);
    $short_text = $registry['main-article'][0]['text_short'];
} else {
    $short_length = string_length($registry['main-article'][0]['title_short']);
    $short_text = $registry['main-article'][0]['title_short'];
}
$content_length = $title_length + $short_length;
$short_length = 115 - $title_length;
$color = unserialize($registry['main-article'][0]['color']);
$slide = unserialize($registry['main-article'][0]['slide']);
?>
<div class="main-article" style="border:3px solid <?php 
echo $color['frame'];
?>
;">
    <ul>
        <li  style="border:17px solid <?php 
echo $color['frame'];
?>
">
            <div class="main-image">
                <a href="http://<?php 
echo $_SERVER['SERVER_NAME'];
?>
/<?php 
echo $registry['main-article'][0]['cat_chpu'];
Exemple #3
0
/">0</div></td>
                    </tr>
                </table>
             </div>
        </li>
        <li>
            <?php 
foreach ($registry['three-short-article'] as $item) {
    ?>
                <?php 
    $title_length = string_length($item['title']);
    if (!empty($item['text_short'])) {
        $short_length = string_length($item['text_short']);
        $short_text = $item['text_short'];
    } else {
        $short_length = string_length($item['title_short']);
        $short_text = $item['title_short'];
    }
    $content_length = $title_length + $short_length;
    $short_length = 130 - $title_length + 25;
    ?>
            <div class="three-short-img">
                <a href="http://<?php 
    echo $_SERVER['SERVER_NAME'];
    ?>
/<?php 
    echo $item['cat_chpu'];
    ?>
/"><h3><?php 
    echo $item['name'];
    ?>
function formatString($pString, $pControl)
{
    return string_length($pString, $pControl->font_size, $pControl->font_name, $pControl->width);
}
Exemple #5
0
    function load_search($args = array())
    {
        $output = '';
        $value = $args['txt'];
        $num = intval($args['num']);
        $last_id = intval($args['last_id']);
        $time = time();
        if ($value == "archive") {
            $sql_search = "";
            $sql_count = "";
        } else {
            $sql_search = '(osr_news.title LIKE "%' . $value . '%" or osr_news.text LIKE "%' . $value . '%") and ';
            $sql_count = "({$this->p}news.title LIKE '%{$value}%' or {$this->p}news.text LIKE '%{$value}%') and";
        }
        $last = $this->DB->getOne("SELECT {$this->p}news.id FROM {$this->p}news WHERE {$sql_count} {$this->p}news.moderate=1 and {$this->p}news.date <= {$time} order by {$this->p}news.date ASC");
        if ($last == $last_id) {
            $output .= "" . $last_id . "";
        } else {
            $registry['search'] = $this->DB->getAll('SELECT osr_news.*,osr_users.realname,osr_category.name,osr_category.cat_chpu,osr_category.id as cat_id FROM osr_news
                                         LEFT JOIN osr_category ON osr_category.id = osr_news.cat
                                         LEFT JOIN osr_users ON osr_users.id = osr_news.user
                                         WHERE ' . $sql_search . ' osr_news.moderate=1 and osr_news.date <= ' . $time . ' order by osr_news.date DESC LIMIT ' . $num . ',21');
            if ($registry['search'][0]['id'] > 0) {
                foreach ($registry['search'] as $item) {
                    $reg['slide'] = get_serialize($item['slide']);
                    if (count($reg['slide']['img']) > 1) {
                        $style = "background-image:url('/theme/funtime/images/main_icon.png');background-repeat:no-repeat;background-size:30px 30px;background-position:right 10px center;padding:10px 50px 7px 10px;";
                    } else {
                        $style = "padding:10px 10px 7px 10px;";
                    }
                    $title_length = string_length($item['title']);
                    if (!empty($item['title_short'])) {
                        $short_length = string_length($item['title_short']);
                        $short_text = $item['title_short'];
                    } else {
                        $short_length = string_length($item['text_short']);
                        $short_text = $item['text_short'];
                    }
                    $content_length = $title_length + $short_length;
                    $short_length = 135 - $title_length;
                    $output .= '<li data-last_id="' . $item['id'] . '">
<a href="http://' . $_SERVER['SERVER_NAME'] . '/' . $item['cat_chpu'] . '/"><h3 style="' . $style . '">' . $item['name'] . '</h3></a>
<a href="http://' . $_SERVER['SERVER_NAME'] . '/' . $item['cat_chpu'] . '/' . $item['chpu'] . '/"><img src="' . substr($item['thumbs'], 2) . '" width="363" title="' . $item['title'] . '" height="225"/></a>
<br><br>
<div class="search-post-title"><a href="http://' . $_SERVER['SERVER_NAME'] . '/' . $item['cat_chpu'] . '/' . $item['chpu'] . '/">' . title_filter($item['title'], 60) . '</a></div>
<div class="search-post-short">' . title_filter($short_text, $short_length) . '</div>
<table class="time-like-short">
    <tr>
        <td>' . gedate('l H:i', $item['date']) . ' | ' . gedate('d.m.Y', $item['date']) . '</td>
             <td valign="center">
                            <span>ავტორი:</span> ' . $item['realname'] . '
                        </td>
                    </tr>
                    <tr>
                        <td><div class="fb-like" data-href="http://' . $_SERVER['SERVER_NAME'] . '/' . $item['cat_chpu'] . '/' . $item['chpu'] . '/" data-width="80" data-layout="button_count" data-action="like" data-show-faces="false" data-share="false"></div> <div class="fb-share-button" data-href="http://' . $_SERVER['SERVER_NAME'] . '/' . $item['cat_chpu'] . '/' . $item['chpu'] . '/" data-layout="button_count"></div></td>
                        <td></td>
                    </tr>
</table>
</li>';
                }
            } else {
                $output .= '0';
            }
        }
        die($output);
    }