Exemplo n.º 1
0
function f_banners(&$text)
{
    $phrase = 'БАННЕР';
    if (mb_strpos($text, $phrase) === false) {
        return true;
    }
    if (!cmsCore::getInstance()->isComponentEnable('banners')) {
        return true;
    }
    $regex = '/{(' . $phrase . '=)\\s*(.*?)}/i';
    $matches = array();
    preg_match_all($regex, $text, $matches, PREG_SET_ORDER);
    if (!$matches) {
        return true;
    }
    cmsCore::loadModel('banners');
    foreach ($matches as $elm) {
        $elm[0] = str_replace('{', '', $elm[0]);
        $elm[0] = str_replace('}', '', $elm[0]);
        mb_parse_str($elm[0], $args);
        $position = @$args[$phrase];
        if ($position) {
            $output = cms_model_banners::getBannerHTML($position);
        } else {
            $output = '';
        }
        $text = str_replace('{' . $phrase . '=' . $position . '}', $output, $text);
    }
    return true;
}
Exemplo n.º 2
0
function banners()
{
    $inCore = cmsCore::getInstance();
    $model = new cms_model_banners();
    $do = $inCore->do;
    $banner_id = cmsCore::request('id', 'int', 0);
    //======================================================================================================================//
    if ($do == 'view') {
        $banner = $model->getBanner($banner_id);
        if (!$banner || !$banner['published']) {
            cmsCore::error404();
        }
        $model->clickBanner($banner_id);
        cmsCore::redirect($banner['link']);
    }
}
Exemplo n.º 3
0
        $mod = cms_model_banners::getBanner($item_id);
        if (!$mod) {
            cmsCore::error404();
        }
        echo '<h3>' . $mod['title'] . ' ' . $ostatok . '</h3>';
        cpAddPathway($mod['title']);
    }
    ?>
    <?php 
    if ($opt == 'edit') {
        ?>
        <table width="625" border="0" cellspacing="5" class="proptable">
              <tr>
                <td align="center">
                    <?php 
        echo cms_model_banners::getBannerById($item_id);
        ?>
                </td>
             </tr>
        </table>
    <?php 
    }
    ?>

    <form action="index.php?view=components&amp;do=config&amp;id=<?php 
    echo $id;
    ?>
" method="post" enctype="multipart/form-data" name="addform" id="addform">
    <input type="hidden" name="csrf_token" value="<?php 
    echo cmsUser::getCsrfToken();
    ?>
Exemplo n.º 4
0
Arquivo: cp.php Projeto: deltas1/icms1
function insertPanel()
{
    global $_LANG;
    $p_html = cmsCore::callEvent('REPLACE_PANEL', array('html' => ''));
    if ($p_html['html']) {
        return $p_html['html'];
    }
    $inCore = cmsCore::getInstance();
    $submit_btn = '<input type="button" value="' . $_LANG['AD_INSERT'] . '" style="width:100px" onClick="insertTag(document.addform.ins.options[document.addform.ins.selectedIndex].value)">';
    echo '<table width="100%" border="0" cellspacing="0" cellpadding="8" class="proptable"><tr><td>';
    echo '<table width="100%" border="0" cellspacing="0" cellpadding="2">';
    echo '<tr>';
    echo '<td width="120">';
    echo '<strong>' . $_LANG['AD_INSERT'] . ':</strong> ';
    echo '</td>';
    echo '<td width="">';
    echo '<select name="ins" id="ins" style="width:99%" onChange="showIns()">
					<option value="frm" selected="selected">' . $_LANG['AD_FORM'] . '</option>
					<option value="include">' . $_LANG['FILE'] . '</option>
					<option value="filelink">' . $_LANG['AD_LINK_DOWNLOAD_FILE'] . '</option>';
    if ($inCore->isComponentInstalled('banners')) {
        echo '<option value="banpos">' . $_LANG['AD_BANNER_POSITION'] . '</option>';
    }
    echo '<option value="pagebreak">-- ' . $_LANG['AD_PAGEBREAK'] . ' --</option>
					<option value="pagetitle">-- ' . $_LANG['AD_PAGETITLE'] . ' --</option>
				  </select>';
    echo '</td>';
    echo '<td width="100">&nbsp;</td>';
    echo '</tr>';
    echo '<tr id="frm">';
    echo '<td width="120">
                    <strong>' . $_LANG['AD_FORM'] . ':</strong>
              </td>';
    echo '<td>
                    <select name="fm" style="width:99%">' . $inCore->getListItems('cms_forms') . '</select>
              </td>';
    echo '<td width="100">' . $submit_btn . '</td>';
    echo '</tr>';
    echo '<tr id="include">';
    echo '<td width="120">
                    <strong>' . $_LANG['FILE'] . ':</strong>
              </td>';
    echo '<td>
                    /includes/myphp/<input name="i" type="text" value="myscript.php" />
              </td>';
    echo '<td width="100">' . $submit_btn . '</td>';
    echo '</tr>';
    echo '<tr id="filelink">';
    echo '<td width="120">
                    <strong>' . $_LANG['FILE'] . ':</strong>
              </td>';
    echo '<td>
                    <input name="fl" type="text" value="/files/myfile.rar" />
              </td>';
    echo '<td width="100">' . $submit_btn . '</td>';
    echo '</tr>';
    if ($inCore->isComponentInstalled('banners')) {
        $inCore->loadModel('banners');
        echo '<tr id="banpos">';
        echo '<td width="120">
                        <strong>' . $_LANG['AD_POSITION'] . ':</strong>
                  </td>';
        echo '<td>
                        <select name="ban" style="width:99%">' . cms_model_banners::getBannersListHTML() . '</select>
                  </td>';
        echo '<td width="100">' . $submit_btn . '</td>';
        echo '</tr>';
    }
    echo '<tr id="pagebreak">';
    echo '<td width="120">
                    <strong>' . $_LANG['TAG'] . ':</strong>
              </td>';
    echo '<td>
                    {pagebreak}
              </td>';
    echo '<td width="100">' . $submit_btn . '</td>';
    echo '</tr>';
    echo '<tr id="pagetitle">';
    echo '<td width="120">
                    <strong>' . $_LANG['AD_TITLE'] . ':</strong>
              </td>';
    echo '<td>
                    <input type="text" name="ptitle" style="width:99%" />
              </td>';
    echo '<td width="100">' . $submit_btn . '</td>';
    echo '</tr>';
    echo '</table>';
    echo '</td></tr></table>';
    echo '<script type="text/javascript">showIns();</script>';
}
Exemplo n.º 5
0
function insertPanel() {
    global $_LANG;
    $p_html = cmsCore::callEvent('REPLACE_PANEL', array('html' => ''));

    if ($p_html['html']) { return $p_html['html']; }

    $inCore=cmsCore::getInstance();

    $submit_btn = '<input type="button" class="btn btn-default" style="width:100px" value="'. $_LANG['AD_INSERT'] .'" onClick="insertTag(document.addform.ins.options[document.addform.ins.selectedIndex].value)">';

echo '<table border="0" class="table" style="margin:0;"><tr><td style="border:0;">';
	echo '<table border="0" class="table" style="margin:0;">';
	echo '<tr>';
		echo '<td width="120">';
			echo '<label>'. $_LANG['AD_INSERT'] .':</label> ';
		echo '</td>';
		echo '<td width="">';
			echo '<select id="ins" style="width:99%" class="form-control" name="ins" onChange="showIns()">
					<option value="frm" selected="selected">'.$_LANG['AD_FORM'].'</option>
					<option value="include">'.$_LANG['FILE'].'</option>
					<option value="filelink">'.$_LANG['AD_LINK_DOWNLOAD_FILE'].'</option>';
                    if ($inCore->isComponentInstalled('banners')) {
                        echo '<option value="banpos">'. $_LANG['AD_BANNER_POSITION'] .'</option>';
                    }
		    echo   '<option value="pagebreak">-- '. $_LANG['AD_PAGEBREAK'] .' --</option>
					<option value="pagetitle">-- '. $_LANG['AD_PAGETITLE'] .' --</option>
				  </select>';
		echo '</td>';
        echo '<td width="100">&nbsp;</td>';
	echo '</tr>';
	echo '<tr id="frm">';
		echo '<td width="120">
                    <label>'. $_LANG['AD_FORM'] .':</label>
              </td>';
        echo '<td>
                    <select class="form-control" style="width:99%" name="fm">'. $inCore->getListItems('cms_forms') .'</select>
              </td>';
        echo '<td width="100">'. $submit_btn .'</td>';
    echo '</tr>';
	echo '<tr id="include">';
		echo '<td width="120">
                    <label>'. $_LANG['FILE'] .':</label>
              </td>';
        echo '<td style="vertical-align: middle;">
                    /includes/myphp/<input type="text" class="form-control" style="width:300px;display:inline-block;" name="i" value="myscript.php" />
              </td>';
        echo '<td width="100">'. $submit_btn .'</td>';
    echo '</tr>';
	echo '<tr id="filelink">';
		echo '<td width="120">
                    <label>'. $_LANG['FILE'] .':</label>
              </td>';
        echo '<td>
                    <input type="text" class="form-control" name="fl" value="/files/myfile.rar" />
              </td>';
        echo '<td width="100">'. $submit_btn .'</td>';
    echo '</tr>';
    if ($inCore->isComponentInstalled('banners')){
        $inCore->loadModel('banners');
        echo '<tr id="banpos">';
            echo '<td width="120">
                        <label>'. $_LANG['AD_POSITION'] .':</label>
                  </td>';
            echo '<td>
                        <select class="form-control" style="width:99%" name="ban">'. cms_model_banners::getBannersListHTML() .'</select>
                  </td>';
            echo '<td width="100">'. $submit_btn .'</td>';
        echo '</tr>';
    }
	echo '<tr id="pagebreak">';
		echo '<td width="120">
                    <label>'. $_LANG['TAG'] .':</label>
              </td>';
        echo '<td>
                    {pagebreak}
              </td>';
        echo '<td width="100">'. $submit_btn .'</td>';
    echo '</tr>';
	echo '<tr id="pagetitle">';
		echo '<td width="120">
                    <label>'. $_LANG['AD_TITLE'] .':</label>
              </td>';
        echo '<td>
                    <input type="text" class="form-control" style="width:99%" name="ptitle" />
              </td>';
        echo '<td width="100">'. $submit_btn .'</td>';
    echo '</tr>';


	echo '</table>';

   echo '</td></tr></table>';

   echo '<script type="text/javascript">showIns();</script>';

}
Exemplo n.º 6
0
function insertPanel()
{
    global $_LANG;
    $p_html = cmsCore::callEvent('REPLACE_PANEL', array('html' => ''));
    if ($p_html['html']) {
        return $p_html['html'];
    }
    $inCore = cmsCore::getInstance();
    if ($inCore->isComponentInstalled('banners')) {
        $inCore->loadModel('banners');
    }
    $tpl = cmsCore::c('page')->initTemplate('special', 'panel')->assign('bannersInstalled', $inCore->isComponentInstalled('banners'))->assign('forms_options', $inCore->getListItems('cms_forms'));
    if ($inCore->isComponentInstalled('banners')) {
        $tpl->assign('banners_options', cms_model_banners::getBannersListHTML());
    }
    $tpl->display();
}
Exemplo n.º 7
0
        if (isset($_REQUEST['multiple'])) {
            if (isset($_REQUEST['item'])) {
                $_SESSION['editlist'] = cmsCore::request('item', 'array_int', array());
            } else {
                cmsCore::addSessionMessage($_LANG['AD_NO_SELECT_OBJECTS'], 'error');
                cmsCore::redirectBack();
            }
        }
        $ostatok = '';
        if (isset($_SESSION['editlist'])) {
            $item_id = array_shift($_SESSION['editlist']);
            if (sizeof($_SESSION['editlist']) == 0) {
                unset($_SESSION['editlist']);
            } else {
                $ostatok = '(' . $_LANG['AD_NEXT_IN'] . sizeof($_SESSION['editlist']) . ')';
            }
        } else {
            $item_id = cmsCore::request('item_id', 'int', 0);
        }
        $mod = cms_model_banners::getBanner($item_id);
        if (!$mod) {
            cmsCore::error404();
        }
        cpAddPathway($mod['title']);
    }
    $tpl = cmsCore::c('page')->initTemplate('components', 'banners_add')->assign('id', $id)->assign('opt', $opt)->assign('mod', $mod);
    if ($opt == 'edit') {
        $tpl->assign('banner_html', cms_model_banners::getBannerById($item_id));
    }
    $tpl->display();
}