示例#1
0
function prepare_tags($tags_row)
{
    $_tags = hilite(nl2br(stripslashes($tags_row)));
    $_tags_array = explode(',', $_tags);
    foreach ($_tags_array as $key => $value) {
        $_tags_array[$key] = "<li><a href='?cs=" . trim($_tags_array[$key]) . "'>" . trim($_tags_array[$key]) . "</a></li>";
    }
    $_tags_imploded = implode(" ", $_tags_array);
    $_tags = $_tags_imploded;
    return '<ul>' . $_tags . '</ul>';
}
示例#2
0
        $linklist['head_menu'][] = $row;
        $parents[] = $row['link_id'];
    } else {
        $pid = $row['link_parent'];
        $linklist['sub_' . $pid][] = $row;
    }
}
// Loops thru parents.--------->
global $tp;
$sepBr = 1;
$sepCount = count($linklist['head_menu']);
foreach ($linklist['head_menu'] as $lk) {
    $lk['link_url'] = $tp->replaceConstants($lk['link_url'], TRUE);
    $main_linkid = $lk['link_id'];
    //if (hilite($lk['link_url'],TRUE)) { echo $lk['link_name']; }
    if (hilite($lk['link_url'], TRUE)) {
        $hilite_style = " id='active'";
    } else {
        $hilite_style = "";
    }
    if (isset($linklist['sub_' . $main_linkid])) {
        // Has Children.
        $text .= "\n\t\t\t<li" . $hilite_style . " class='sub'>" . adnav_cat($lk['link_name'], e_SELF . '?' . e_QUERY . '#', $main_linkid) . "";
        $text .= "\n\t\t\t\t<ul class='sub'>" . render_sub($linklist, $main_linkid) . "\n\t\t\t\t</ul>\n\t\t\t</li>";
    } else {
        // Display Parent only.
        $text .= "\n\t\t\t<li" . $hilite_style . ">" . adnav_cat($lk['link_name'], $lk['link_url'], FALSE, $lk['link_open']) . "</li>";
    }
    if (defined('FS_LINK_SEPARATOR')) {
        if ($sepBr < $sepCount) {
            $text .= "\n\t\t\t<li class='fs-linkSep'>" . FS_LINK_SEPARATOR . "</li>";
function product_display_paginated($search_sql = '', $offset, $items_on_page)
{
    global $wpdb, $colorfilter, $totalitems, $siteurl, $sword;
    $siteurl = get_option('siteurl');
    $javascript_functions = '';
    $product_list = $GLOBALS['wpdb']->get_results($search_sql, ARRAY_A);
    //$totalitems =  count($product_list);
    if ($product_list != null) {
        $preview_mode = 1;
        // display as popup window
        //          $preview_mode=0; // display as Lightbox slideshow
        $output = "<div id='items' class='items'>";
        $counter = 0;
        foreach ($product_list as $product) {
            if ($product['image'] != null and $counter < $items_on_page) {
                $imagedir = ABSPATH . "wp-content/plugins/wp-shopping-cart/product_images/";
                $image_size = @getimagesize($imagedir . $product['image']);
                $image_link = "index.php?productid=" . $product['id'] . "&width=" . $image_size[0] . "&height=" . $image_size[1] . "";
                // thumbs output
                $output .= "<div id='item" . $counter . "' class='item'>";
                // start item
                //$vstavka = "jQuery('#bigpic').html('<img src=\'".$siteurl."/wp-content/plugins/wp-shopping-cart/product_images/".$product['image']."\'>');";
                $vstavka = "jQuery('#bigpic').html('<img src=http://sl.cartoonbank.ru/" . $product['image'] . ">');";
                // here we prepare data for the BIGPIC preview
                if (stristr($product['image'], 'jpg') != FALSE) {
                    $_file_format = 'jpg';
                }
                if (stristr($product['image'], 'gif') != FALSE) {
                    $_file_format = 'gif';
                }
                if (stristr($product['image'], 'png') != FALSE) {
                    $_file_format = 'png';
                }
                $_number = $product['id'];
                $_description = htmlspecialchars_decode(nl2br(hilite(htmlspecialchars(stripslashes($product['description']), ENT_QUOTES))));
                $_size_warning = '';
                if (isset($product['brandid'])) {
                    $_brandid = $product['brandid'];
                } else {
                    $_brandid = '';
                }
                if (isset($product['category_id'])) {
                    $_category_id = $product['category_id'];
                } else {
                    $_category_id = '';
                }
                $_author = "<a href=\\'" . $siteurl . "/?page_id=29&brand=" . $_brandid . "\\'>" . $product['brand'] . "</a>";
                //$product['brand'];
                //$_name = hilite(nl2br(htmlspecialchars(stripslashes($product['name']),ENT_QUOTES)));
                $_name = nl2br(stripslashes($product['name']));
                $_avatarurl = "";
                //"<a href=\"".get_option('siteurl')."/?page_id=29&brand=$_brandid\"><img src=".$product['avatarurl']." width=32 height=32 align=top border=0></a>";
                $_category = "<a href=\\'" . get_option('product_list_url') . "&category=" . $_category_id . "\\'>" . $product['kategoria'] . "</a>";
                //$options .= "<a href='".get_option('product_list_url')."/&category=".$option['id']."'>".stripslashes($option['name'])."</a><br />";
                $product['additional_description'] = stripslashes($product['additional_description']);
                $product['additional_description'] = htmlspecialchars($product['additional_description'], ENT_QUOTES);
                $_tags = hilite(nl2br($product['additional_description']));
                if (isset($product['sold'])) {
                    $psold = $product['sold'];
                } else {
                    $psold = 0;
                }
                if ($psold == 0) {
                    $_sold = "";
                } else {
                    $_sold = "<h2><b>Продажи:</b> <span class=\\'sold\\'>" . $psold . "</span></h2><br />";
                }
                //$_tags = hilite(nl2br(htmlspecialchars(stripslashes($product['additional_description']))));
                //$_tags = hilite($product[0]['additional_description']);
                $_bigpicimgalt = addslashes($_name . ", " . $product['brand']);
                $_bigpicimgtitle = addslashes($_name . " в категории " . $product['kategoria'] . ", " . $product['brand']);
                //."". ".$_description.". ".$_tags);
                $_tags_array = explode(',', $_tags);
                //$i=0;
                foreach ($_tags_array as $key => $value) {
                    $_tags_array[$key] = "<li><a href=\\'" . get_option('siteurl') . "/?page_id=29&cs=" . trim($_tags_array[$key]) . "\\'>" . trim($_tags_array[$key]) . "</a></li>";
                }
                $_tags_imploded = implode(" ", $_tags_array);
                $_tags = $_tags_imploded;
                $_sharethis_html = "<div id=\\'share_this\\' class=\\'lh2\\'></div>";
                $_dimensions_html = "<div id='dimensions'><img src='" . get_option('siteurl') . "/img/ldng.gif' alt='loading'></div>";
                $_dimensions_html = str_replace("\"", "\\'", $_dimensions_html);
                $_dimensions_html = str_replace("'", "\\'", $_dimensions_html);
                $_rating_html = "<div id='star_rating'><img src='" . get_option('siteurl') . "/img/ldng.gif' alt='loading'></div>";
                $_rating_html = str_replace("\"", "\\'", $_rating_html);
                $_rating_html = str_replace("'", "\\'", $_rating_html);
                if (current_user_can('manage_options')) {
                    $_edid = "";
                    //$_edid = " <a href=".get_option('siteurl')."/wp-admin/admin.php?page=wp-shopping-cart/display-items.php&edid=".$_number."  target=_blank><img border=0 src=".get_option('siteurl')."/img/edit.jpg title=\'открыть редактор\'></a> <a href=".get_option('siteurl')."/wp-admin/admin.php?page=wp-shopping-cart/display-items.php&updateimage=".$_number." target=_blank><img border=0 src=".get_option('siteurl')."/img/reload.gif title=\'обновить водяной знак\'></a> <a href=".get_option('siteurl')."/ales/wordassociations/words.php?id=".$_number." target=_blank><img border=0 src=".get_option('siteurl')."/img/tags.gif title=\'добавить тэгов\'></a>";
                } else {
                    $_edid = "";
                }
                $current_user = wp_get_current_user();
                //    $_SESSION['id']= $current_user->ID;
                //    setcookie('uid', $_SESSION['id']);
                //pokazh($_COOKIE,"cookie");
                //pokazh ($_SESSION,"session");
                //pokazh ($current_user);
                ///pokazh($_SERVER);
                if (is_user_logged_in()) {
                    $logged = true;
                    //" залогинен ";
                    $klop = "";
                    //"_";
                } else {
                    $logged = false;
                    //" не залогинен ";
                    $klop = "";
                    //"|";
                }
                if ($logged) {
                    //$_bigpicstrip = "<div style=\'float:left;\'><b>Название: </b><h1>" .$_name."</h1>&nbsp;$klop<span id=\'thumb\' onclick=\'fave_it();\'>$klop<img src=\'".$siteurl."/img/thumbupp.jpg\' border=0 title=\'добавить в любимое\'></span></div> "."<div>№&nbsp;<a id=\'cuid\' title=\'".$product['kategoria'].", ".$_name.", ".$product['brand']."\' href=\'".get_option('siteurl')."/?page_id=29&cartoonid=".$_number."\'>".$_number."</a>&nbsp;<b>".$_author."</a></b></div>";
                    $_bigpicstrip = "<div class=\\'fll\\'><b>Название: </b><h3>" . $_name . "</h3>&nbsp;{$klop}</div> " . "<div>№&nbsp;<a id=\\'cuid\\' title=\\'" . $product['kategoria'] . ", " . $_name . ", " . $product['brand'] . "\\' href=\\'" . get_option('siteurl') . "/?page_id=29&cartoonid=" . $_number . "\\'>" . $_number . "</a>&nbsp;<b>" . $_author . "</a></b></div>";
                } else {
                    $_bigpicstrip = "<div class=\\'fll\\'><b>Название: </b><h3>" . $_name . "</h3> {$klop}</div> " . "<div>№&nbsp;<a id=\\'cuid\\' title=\\'" . $product['kategoria'] . ", " . $_name . ", " . $product['brand'] . "\\' href=\\'" . get_option('siteurl') . "/?page_id=29&cartoonid=" . $_number . "\\'>" . $_number . "</a>&nbsp;<b>" . $_author . "</a></b></div>";
                }
                $_bigpictext = "<h2><b>Категория: </b>" . $_category . "</h2><h2><b>Описание: </b></h2> " . $_description . "<br /><h2><b>Тэги: </b></h2><ul>" . $_tags . "</ul><h2><b>Ссылка:</b></h2><a title=\\'" . $product['kategoria'] . ", " . $_name . ", " . $product['brand'] . "\\' href=\\'" . get_option('siteurl') . "/?page_id=29&cartoonid=" . $_number . "\\'> №&nbsp;" . $_number . "</a><br /><b>Размер:</b><br />" . $_dimensions_html . $_sold . "<b>Оценка:</b><br />" . $_rating_html . $_sharethis_html . $_edid;
                $_bigpictext .= '<br><a title="Заказать печать у нашего партнера" class="btn-s btn-blue" target=_blank href="http://www.artwall.ru/products/upload?url=http://sl.cartoonbank.ru/' . $product['image'] . '">Печатать в раме</a><br>';
                $_bigpic = "<img src=http://sl.cartoonbank.ru/" . rawurlencode($product['image']) . " border=0 alt=\\'" . $_bigpicimgalt . "\\' title=\\'" . $_bigpicimgtitle . "\\' />";
                if ($product['l1_price'] == '0') {
                    $l1_disabled = 'disabled=true';
                } else {
                    $l1_disabled = '';
                }
                if ($product['l2_price'] == '0') {
                    $l2_disabled = 'disabled=true';
                } else {
                    $l2_disabled = '';
                }
                if ($product['l3_price'] == '0') {
                    $l3_disabled = 'disabled=true';
                } else {
                    $l3_disabled = '';
                }
                if ($psold == 0) {
                    $_soldd = '';
                } else {
                    $_soldd = '<div class="cntrsold" title="продажи">' . $psold . '</div>';
                }
                if (isset($product['not_for_sale']) && $product['not_for_sale'] == '1') {
                    $_bottomstriptext = "Лицензии на это изображение временно недоступны";
                } else {
                    // отключить лицензию
                    if (isset($product['l1_price']) && $product['l1_price'] != 0) {
                        $l1_price_text = "<td class=\\'vamtar\\'><b>" . round($product['l1_price']) . "&nbsp;руб.</b></td>";
                    } else {
                        $l1_price_text = "<td class=\\'vamtar\\'>не доступна</td>";
                    }
                    if (isset($product['l2_price']) && $product['l2_price'] != 0) {
                        $l2_price_text = "<td class=\\'vamtar\\'><b>" . round($product['l2_price']) . "&nbsp;руб.</b></td>";
                    } else {
                        $l2_price_text = "<td class=\\'vamtar\\'>не доступна</td>";
                    }
                    if (isset($product['l3_price']) && $product['l3_price'] != 0) {
                        $l3_price_text = "<td class=\\'vamtar\\'><b>" . round($product['l3_price']) . "&nbsp;руб.</b></td>";
                    } else {
                        $l3_price_text = "<td class=\\'vamtar\\'>не доступна</td>";
                    }
                    if ($_brandid == 1 || $_brandid == 6 || $_brandid == 8) {
                        //$printdirect = "<div class=\'prdrrdr\'>.</div>";
                        $printdirect = "<div class=\\'fll\\'><a onclick=\"prdrrdr(" . $product['id'] . ");\";);\" rel=\\'nofollow\\' href=\\'#\\'><img src=\\'/img/tshirt.jpg\\' title=\\'Закажите этот рисунок на кружке, футболке или другом сувенире\\' alt=\\'t-shirt\\'></a></div><div class=\\'mrktimg\\'><a onclick=\"prdrrdr(" . $product['id'] . ");\";);\" rel=\\'nofollow\\' href=\\'#\\'>Заказать сувенир<br>с этим рисунком</a>.</div>";
                    } else {
                        $printdirect = "";
                    }
                    $_bottomstriptext = $printdirect . $_size_warning . "<div class=\\'w4fr\\'><form name=\\'licenses\\' id=\\'licenses\\' onsubmit=\\'submitform(this);return false;\\' action=\\'" . get_option('siteurl') . "/?page_id=29\\' method=\\'POST\\'><table class=\\'licenses\\'> <tr> <td class=\\'wh w8vb\\'><b>Выбор</b></td> <td class=\\'wh tal\\'><input type=\\'radio\\' name=\\'license\\' {$l1_disabled} value=\\'l1_price\\'></td> " . $l1_price_text . " <td rowspan=\\'2\\' class=\\'w20\\'>&nbsp;</td> <td class=\\'wh\\' class=\\'tal\\'><input type=\\'radio\\' name=\\'license\\' {$l2_disabled} value=\\'l2_price\\'></td> " . $l2_price_text . " <td rowspan=\\'2\\' class=\\'w20\\'>&nbsp;</td> <td class=\\'wh\\' class=\\'tal\\'><input type=\\'radio\\' name=\\'license\\' {$l3_disabled} value=\\'l3_price\\'></td> " . $l3_price_text . " <td rowspan=\\'2\\' class=\\'wh\\' class=\\'w8tarvab\\'><input id=\\'searchsubmit\\' value=\\'Купить\\' type=\\'submit\\' class=\\'btn-s\\' title=\\'Добавить рисунок в корзину заказов\\'></td> </tr> <tr> <td class=\\'wh vat\\'><b>лицензии:</b></td> <td colspan=\\'2\\' class=\\'pl6\\'><a target=\\'_blank\\' href=\\'" . get_option('siteurl') . "/?page_id=238\\' title=\\'подробнее об ограниченной лицензии\\'>ограниченная</a></td> <td colspan=\\'2\\' class=\\'pl6\\'><a target=\\'_blank\\' href=\\'" . get_option('siteurl') . "/?page_id=242\\' title=\\'подробнее о стандартной лицензии\\'>стандартная</a></td> <td colspan=\\'2\\' class=\\'pl6\\'><a target=\\'_blank\\' href=\\'" . get_option('siteurl') . "/?page_id=245\\' title=\\'подробнее об расширенной лицензии\\'>расширенная</a></td> </tr> </table><input type=\\'hidden\\' value=\\'" . $_number . "\\' name=\\'prodid\\'> </form></div>";
                }
                $_next_item = $counter + 1;
                if ($_next_item == 20) {
                    $vstavka = "jQuery('#bigpic').html('<a title=\"следующая страница > \" href=\"" . get_option('siteurl') . "/cartoon/" . $_number . "\" onclick=\"next_page();return false;\">" . $_bigpic . "</a>');";
                } else {
                    $vstavka = "jQuery('#bigpic').html('<a title=\"следующее изображение > \" href=\"" . get_option('siteurl') . "/cartoon/" . $_number . "\" onclick=\"get_item" . $_next_item . "();return false;\">" . $_bigpic . "</a>');";
                }
                $vstavka .= "jQuery('#bigpictext').html('" . $_bigpictext . "');";
                $vstavka .= "jQuery('#bigpictopstrip').html ('" . $_bigpicstrip . "');";
                //$vstavka .= "jQuery('#hone').html('<h1>Карикатура «".$_name."», ".$_author."</h1>');";
                $vstavka .= "jQuery('#bigpicbottomstrip').html ('" . $_bottomstriptext . "');";
                $output .= "<a href=\"" . get_option('siteurl') . "/cartoon/" . $_number . "\" onclick=\"get_item" . ($_next_item - 1) . "();return false;\">";
                $jq_stars = ' get_5stars(); ';
                $jq_dimensions = ' get_dimensions(); ';
                $share_this = ' get_share_this(); ';
                $add_hash_2url = ' change_url(); ';
                $get_favorite = ' get_fave(); ';
                if (isset($sword) && $sword != '') {
                    //$highlight = " highlight(\"".$sword."\"); ";
                    $highlight = " highlight(\"" . htmlentities($sword, ENT_QUOTES) . "\"); ";
                } else {
                    $highlight = "";
                }
                $javascript_functions .= " function get_item" . $counter . "() { jQuery('#pt')[0].scrollIntoView(true);" . $vstavka . $highlight . " scrpts(); } ";
                $_offset = $offset + 20;
                $javascript_functions .= ' function next_page(){window.location = "' . get_option('siteurl') . '/?' . get_url_vars() . 'offset=' . $_offset . '";    var cuid = jQuery("#cuid").html(); jQuery("#navbar").html(cuid);}';
                $fiilename = ABSPATH . '/wp-content/plugins/wp-shopping-cart/images/' . $product['image'];
                if (file_exists($fiilename)) {
                    $output .= "<img src='http://th.cartoonbank.ru/" . $product['image'] . "' title='" . $product['name'] . "' alt='" . $_bigpicimgalt . "' width='140' height='140' class='thumb' />";
                } else {
                    $output .= "<img src='http://th.cartoonbank.ru/icon-rest.gif' width='140' height='140' class='thumb' />";
                }
                $output .= "</a>";
                $output .= $_soldd . "</div>";
                // stop item
            }
            $counter = $counter + 1;
        }
        $output .= "</div>";
        $pagination = pagination($offset, $totalitems, $items_on_page);
        return "<script>get_item0();" . $javascript_functions . "</script>" . " " . $pagination . $output;
    }
    // end function output first page
}
}
echo '
		</tr>
		<tr   valign="top">';
// ************** Notes (Angaben) Lot-Mat-Ch.nr ************************
echo '
		<td bgcolor=white valign="top" width="130" class="a10">
		';
if ($edit) {
    echo ' <a href="javascript:popgetinfowin(\'lot_mat_etc\',\'' . $pn . '\',\'' . $jahr . '\',\'' . $kmonat . '\',\'' . $tag . '\',\'' . $tag . '\',\'' . $tagname . '\')">' . $LDExtraNotes . ': <img ' . createComIcon($root_path, 'clip2.gif', '0') . '  alt="' . str_replace("~tagword~", $LDExtraNotes, $LDClk2Enter) . '" ></a>';
} else {
    echo $LDExtraNotes;
}
if (is_object($lot_mat)) {
    while ($buff = $lot_mat->FetchRow()) {
        echo '<br>' . hilite(nl2br($buff['notes']));
    }
}
echo '</td>';
// ************** medication ************************
if (is_object($medis)) {
    $maxmedx = $medis->RecordCount();
} else {
    $maxmedx = 10;
}
if (!$maxmedx || $maxmedx < 10) {
    $maxmedx = 10;
}
echo '
		<td bgcolor="#ffffff" ><nobr><font size=1 face="verdana,arial" >';
if ($edit) {
示例#5
0
 }
 $toggle = !$toggle;
 $smarty->assign('sRowClass', $sRowClass);
 if (!empty($row['date'])) {
     $smarty->assign('sDate', @formatDate2Local($row['date'], $date_format));
 }
 $sTemp = '';
 if (!empty($row['notes'])) {
     $sTemp = hilite(substr($row['notes'], 0, $GLOBAL_CONFIG['notes_preview_maxlen']));
 }
 if (strlen($row['notes']) > $GLOBAL_CONFIG['notes_preview_maxlen']) {
     $sTemp = $sTemp . ' [...]';
 }
 $sTemp = $sTemp . '<br>';
 if (!empty($row['short_notes'])) {
     $sTemp = $sTemp . '[ ' . hilite($row['short_notes']) . ' ]';
 }
 $smarty->assign('sPreview', $sTemp);
 # Link to pdf generator
 $topdf = '<a href="' . $root_path . 'modules/pdfmaker/emr_generic/report.php' . URL_APPEND . '&enc=' . $row['encounter_nr'] . '&recnr=' . $row['nr'] . '&type_nr=' . $this_type['nr'] . '&LD_var=' . $this_type['LD_var'] . '" target=_blank><img ' . createComIcon($root_path, 'pdf_icon.gif', '0', '', TRUE) . '></a>';
 if (strlen($row['notes']) > $GLOBAL_CONFIG['notes_preview_maxlen']) {
     $smarty->assign('sDetails', '<a href="javascript:popNotesDetails(\'' . $row['nr'] . '\',\'' . strtr($subtitle, "' ", "+") . '\',\'' . $this_type['LD_var'] . '\')"><img ' . createComIcon($root_path, 'info3.gif', '0', '', TRUE) . '></a>');
     //'
     $smarty->assign('sMakePdf', $topdf);
 } elseif (!empty($row['notes'])) {
     $smarty->assign('sMakePdf', $topdf);
 }
 if ($row['personell_name']) {
     $smarty->assign('sAuthor', $row['personell_name']);
 }
 if (!$parent_admit) {