Вход Регистрация
Файл: core/modules/smiles.php
Строк: 46
<?php

if (!defined('CMS')) { die('Access Denied!'); }

if (!
function_exists('onpage')) loadFns('pages');

$mod = !empty($_GET['m']) ? check($_GET['m']) : '';
$page = !empty($_GET['page']) ? $_GET['page'] : 1;
$onpage = !empty($config['smilelist']) ? (int) $config['smilelist'] : onpage();
$folders = ($mod == 'admsmiles') ? 'smiles2' : 'smiles';

if (
$mod == 'smiles') {

    echo 
'<div class="bl"><b>Общие смайлы</b> | <a href="' . gen_uri('admsmiles', '', UID) . '">Админские смайлы</a><br /></div>';
}
else {

    echo 
'<div class="bl"><a href="' . gen_uri('smiles', '', UID) . '">Общие смайлы</a> | <b>Админские смайлы</b><br /></div>';
}

$smiles = array();

$globsmiles = glob(ROOTPATH . '/images/' . $folders . '/*.gif');

foreach(
$globsmiles as $filename) {

    
$smiles[] = basename($filename, '.gif');
}

sort($smiles);

$total = count($smiles); 

if (
$total > 0) {

    
$output = '';

    if ( 
VERSION == 'html' ) {

        
$onpage  = 30;
        
$output .= <<<HTML
<table align="center" width="100%" class="bc">
    <tr align="center">
        <td>Смайлик</td>
        <td>&mdash;</td><td>Название</td>
        <td>Смайлик</td>
        <td>&mdash;</td><td>Название</td>
        <td>Смайлик</td>
        <td>&mdash;</td><td>Название</td>
    </tr>
    <tr align="center">
HTML;
    }

    list(
$start, $stop) = get_page();
   
    for (
$i = $start; $i < $stop; $i++) {

        
$code = str_replace('.gif', '', $smiles[$i]);
        
$n = $i+1;
        if (
$n%3 == 0 AND $i < $total AND VERSION == 'html') $output .= '</tr><tr>';
        else 
$output .= '';

        if ( 
VERSION == 'wml' ) {

            
$output .= <<<HTML
<p align='left'>
<a title='
{$code}' href="#form" onclick="javascript:tag(' :{$code}', '');">
<img src='/images/
{$folders}/{$smiles[$i]}.gif' alt='{$code}' />
</a>
&nbsp;-&nbsp;
<b>:
{$code}</b>
<br />
</p>
HTML;
        }
        elseif ( 
VERSION == 'html' ) {

            
$output .= <<<HTML
        <td align="center">
           <a title="
{$code}" href="#form" onclick="javascript:tag(' :{$code}', '');">
               <img src="/images/
{$folders}/{$smiles[$i]}.gif" alt="{$code}" />
           </a>
        </td>
        <td align="center">&nbsp;&mdash;&nbsp;</td>
        <td align="center">:
{$code}</td>
HTML;
        }
        elseif ( 
VERSION == 'xhtml' ) {

            
$output .= <<<HTML
<div class="bl">
  <a title="
{$code}" href="#form" onclick="javascript:tag(' :{$code}', '');">
    <img src="/images/
{$folders}/{$smiles[$i]}.gif" alt="{$code}" />
  </a>
  &nbsp;-&nbsp;
  <strong>:
{$code}</strong><br />
</div>
HTML;
        }
    }
    if ( 
VERSION == 'html' ) {

        
$output .= <<<HTML

    </tr>
</table>
HTML;
    }
    echo 
$output;
    echo 
show_pages(gen_uri($mod, '', UID));
    if (
$mod == 'smiles') echo '<div class="bl">Данные смайлы доступны всем авторизованным участникам сайта<br />';
    else echo 
'<div class="bl">Данные смайлы доступны только админам и модерам<br /><br />';
    echo 
'Всего cмайлов: <b>' . $total . '</b><br /></div>';
}
else {
    
show_error('В данной категории смайлов нет!');
}

?>
Онлайн: 0
Реклама