Example #1
0
function _rm_page_month($page)
{
    $arr_month = array('01' => 'Styczeń', '02' => 'Luty', '03' => 'Marzec', '04' => 'Kwiecień', '05' => 'Maj', '06' => 'Czerwiec', '07' => 'Lipiec', '08' => 'Sierpień', '09' => 'Wrzesień', '10' => 'Październik', '11' => 'Listopad', '12' => 'Grudzień');
    $year = substr($page, 0, 2);
    $month = substr($page, 2, 2);
    $ereg = '[0-9]{6}_[0-9]{5}\\.';
    $raws = array();
    foreach (rmconf('rawdir') as $udir => $dir) {
        if (!is_dir($dir)) {
            continue;
        }
        $raws = array_merge($raws, rawman_readdir(sprintf('%s20%02d_%02d/', $dir, $year, $month), $ereg));
    }
    echo rawman_html('month', array('skins' => RM_WEB . '/skins', 'imgdir' => RM_WEB . '/index.php/image', 'content' => rawman_listmonth($raws), 'header' => $arr_month[$month] . ' 20' . $year, 'footer' => RetIf(!IsEmpty($_SESSION['bookmark']), sprintf('&raquo; <a href="' . RM_WEB . '/index.php/bookmark/all">%s</a> (%d) &laquo; ', 'Wyświetl ulubione', count($_SESSION['bookmark'])))));
}
Example #2
0
function _rm_page_main()
{
    $content = '';
    $months = array();
    foreach (rmconf('rawdir') as $udir => $dir) {
        if (!is_dir($dir)) {
            continue;
        }
        $months = array_merge($months, rawman_readdir($dir, '[0-9]{4}_[0-9]{2}'));
    }
    sort($months);
    $years = array();
    foreach ($months as $month) {
        if (preg_match('/\\d{2}(\\d{2})_(\\d{2})/', $month, $m)) {
            $years[$m[1]][] = $m[2];
        }
    }
    $content = '<table border="0">';
    foreach ($years as $year => $yd) {
        $content .= '<tr><td colspan="4" class="year">20' . $year . "</td></tr>\n";
        for ($m = 1; $m <= 12; $m++) {
            if ($m % 3 == 1) {
                $content .= '<tr><td width="50"></td>';
            }
            $content .= '<td>';
            $month = sprintf('%02d', $m);
            if (in_array($month, $yd)) {
                $link = sprintf('%02d%02d', $year, $month);
                $content .= '<div>' . '<a href="' . RM_WEB . '/index.php/month/all/' . $link . '"> ' . '<img src="' . RM_WEB . '/index.php/stack/all/' . $link . '" border="0" />' . '<br clear="all" />' . $month . '</a>' . "</div>\n";
            }
            $content .= '</td>';
            if ($m % 3 == 0) {
                $content .= "</tr>\n";
            }
        }
    }
    $content .= '</table>';
    echo rawman_html('main', array('skins' => RM_WEB . '/skins', 'content' => $content, 'footer' => RetIf(!IsEmpty($_SESSION['bookmark']), sprintf('&raquo; <a href="' . RM_WEB . '/index.php/bookmark/all">%s</a> (%d) &laquo; ', 'Wyświetl ulubione', count($_SESSION['bookmark'])))));
}
Example #3
0
function rawman_infobox($pic)
{
    $dir = rawman_getpicdir($pic);
    $par = rawman_mkdir(array($dir, 'param')) . $pic . '.txt';
    $img = rawman_mkdir(array($dir, 'image', 'orig')) . $pic . '.jpg';
    $opt = rawman_convparams($par, array('rating' => 0, 'coloring' => 'none'));
    echo '&raquo; <a onclick="rmSendReq(\'' . rmconf('elem-dir') . '/box\')">Edytuj zdjęcie</a> &laquo;' . '<br />' . (isset($_SESSION['bookmark'][$pic]) ? sprintf('&raquo; <a onclick="rmSendReq(\'' . rmconf('elem-dir') . '/del\')">Jest w ulubionych (%d) - Usuń</a> &laquo;', count($_SESSION['bookmark'])) : '&raquo; <a onclick="rmSendReq(\'' . rmconf('elem-dir') . '/add\')">Dodaj do ulubionych</a> &laquo;') . RetIf(!is_file($img), '<br />' . '&raquo; <a onclick="rmSendReq(\'' . rmconf('elem-dir') . '/gen\')">Wygeneruj JPG</a> &laquo;') . '<br /><br />' . rawman_coloring($opt['coloring'], true) . '<br />' . rawman_rating($opt['rating'], true) . '<br />' . join('<br />', rawman_readexif($pic));
}
Example #4
0
function CreateRadioField($name, $options = '', $hash = 1, $maxitem = 0)
{
    global $form;
    $content = '';
    $temp = '<input type="radio" name="form[%s]" value="%s" %s /> %s';
    if (is_array($options) && count($options)) {
        $numitem = 0;
        foreach ($options as $key => $label) {
            $value = $hash ? $key : $label;
            $content .= sprintf($temp, $name, $value, RetIf(FldIsEq($name, $value), 'checked="checked"'), $label);
            $numitem++;
            if ($maxitem && $numitem >= $maxitem) {
                $content .= "<br />\n";
                $numitem = 0;
            }
        }
    }
    return $content;
}