/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */
function smarty_modifier_preview($node_content)
{
    if (!empty($_POST['no_html'])) {
        $node_content = htmlspecialchars($node_content);
    }
    require INCLUDE_DIR . 'htmlparse.inc';
    global $htmlparse;
    htmlparser::htmlparse($node_content);
    if (!empty($htmlparse)) {
        $error = $htmlparse;
        echo "<span class='most_important'> {$error} </span>";
        return false;
    }
    $node_content = EregI_Replace("((( )|(\n)|(^))+)(http://|ftp://|https://)([[:alnum:]][^,[:space:]]*)", "\\2<a target='_blank'href=\"\\6\\7\">\\6\\7</a>", $node_content);
    $node_content = strip_tags($node_content, '<a><b><i><u><img><br><p><font>');
    $node_content = str_replace("\n", "<br>", $node_content);
    return $node_content;
}
示例#2
0
		$info .= $text_nick." : ".$row['nick']."<BR>";
		$info .= $text_host." : ".$row['host']."<BR>";
		$info .= $text_share_size." : ".Number_Format($row['share_size'])." (".RoundShare($row['share_size']).")<BR>";
		$info .= $text_email." : ".$row['email']."<BR>";
		$info .= $text_range_fr." : ".Get_IP_From_Range($row['range_fr'])."<BR>";
		$info .= $text_range_to." : ".Get_IP_From_Range($row['range_to'])."<BR>";
		$info .= $text_date_start." : ".Date($VA_setup['timedate_format'], $row['date_start'])."<BR>";
		IF($row['date_limit'] > 0)
			{$info .= $text_date_limit." : ".Date($VA_setup['timedate_format'], $row['date_limit'])."<BR>";}
		ELSE
			{$info .= $text_date_limit." : ".$text_permanent."<BR>";}
		$info .= $text_date_unban." : ".Date($VA_setup['timedate_format'], $row['date_unban'])."<BR>";
		$info .= $text_ban_op." : ".$row['nick_op']."<BR>";
		$info .= $text_unban_op." : ".$row['unban_op']."<BR>";
		$info .= $text_ban_reason." :<BR>".EregI_Replace("(\r)?\n", "<BR>", $row['reason'])."<BR>";
		$info .= $text_unban_reason." :<BR>".EregI_Replace("(\r)?\n", "<BR>", $row['unban_reason']);
		$info = htmlspecialchars($info);
?>
		<TR onmouseover="JavaScript: return escape('<?Print AddSlashes($info);?>');">
			<TD class="bg_light"><IMG src="img/info.gif" title="<?Print $info;?>" widht=16 height=16></TD>
			<?IF($VA_setup['unbanlist_ban_type']){?><TD align="right" class="bg_light"><?	Print $row['ban_type'];?></TD><?}?>
			<?IF($VA_setup['unbanlist_ip']){?><TD class="bg_light"><?Print $row['ip']?></TD><?}?>
			<?IF($VA_setup['unbanlist_nick']){?><TD class="bg_light"><?Print $row['nick'];?></TD><?}?>
			<?IF($VA_setup['unbanlist_host']){?><TD class="bg_light"><?Print $row['host'];?></TD><?}?>
			<?IF($VA_setup['unbanlist_share_size']){?><TD class="bg_light"><?Print RoundShare($row['share_size']);?></TD><?}?>
			<?IF($VA_setup['unbanlist_email']){?><TD class="bg_light"><?Print $row['email'];?></TD><?}?>
			<?IF($VA_setup['unbanlist_range_fr']){?><TD align="right" class="bg_light"><?	Print Get_IP_From_Range($row['range_fr']);?></TD><?}?>
			<?IF($VA_setup['unbanlist_range_to']){?><TD align="right" class="bg_light"><?	Print Get_IP_From_Range($row['range_to']);?></TD><?}?>
			<?IF($VA_setup['unbanlist_date_start']){?><TD class="bg_light"><?Print Date($VA_setup['timedate_format'], $row['date_start']);?></TD><?}?>
			<?IF($VA_setup['unbanlist_date_limit']){?><TD class="bg_light"><?IF($row['date_limit'] > 0){Print Date($VA_setup['timedate_format'], $row['date_limit']);}ELSE{Print $text_permanent;}?></TD><?}?>
			<?IF($VA_setup['unbanlist_date_unban']){?><TD class="bg_light"><?Print Date($VA_setup['timedate_format'], $row['date_unban']);?></TD><?}?>
                $text = Trim($text);
                // trim spaces on start and end
                $text = HTMLSpecialChars($text);
                // extract unsecure characters
                $text = Str_Replace("\r\n", " <BR> ", $text);
                // relpace ends whit tag <BR>
                $text = WordWrap($text, 90, "\n", 1);
                // break long words
                // crete anchors
                $text = EregI_Replace("(http://[^ ]+\\.[^ ]+)", " <a href=\\1>\\1</a>", $text);
                $text = EregI_Replace("[^/](www\\.[^ ]+\\.[^ ]+)", " <a href=http://\\1>\\1</a>", $text);
                // povolí tyto tagy - <b> <u> <i>, možnost pøidat další
                $tag = array("b", "u", "i");
                for ($y = 0; $y < Count($tag); $y++) {
                    $text = EregI_Replace("<" . $tag[$y] . ">", "<" . $tag[$y] . ">", $text);
                    $text = EregI_Replace("</" . $tag[$y] . ">", "</" . $tag[$y] . ">", $text);
                }
                $time = time();
                // timestamp
                $platnost = Date("Y-m-d", Time() + $platn * 24 * 3600);
                //validity
                $sql = mysql_query("SELECT * FROM uniletim_subsections WHERE sub_id = '{$pri}' AND ul_group = '{$sess['4']}'");
                $row = mysql_fetch_row($sql);
                $rub = $row[2];
                mysql_query("insert into uniletim_announces values (null, '{$a_id}', '', '{$pri}', '{$time}', '{$platnost}', '{$rub}', '{$text}', '{$cena}', '{$dp}', '', '{$sess['4']}')");
                $result = _ANNO_INSERTED;
            }
        }
    }
}
// edit announce
示例#4
0
FUNCTION PrintOrderBy($colum) {
	GLOBAL $_GET;

	IF(!EregI("^".$colum, $_GET['orderby'])) {
		$sec_order = EregI_Replace(",.{1,100}$", "", $_GET['orderby']);
		$sec_order = ",%20".$sec_order;
		}
	
	IF(EregI("^".$colum." ASC", $_GET['orderby']))
		{?>&nbsp;<A href="index.php?<?Print Change_URL_Query("orderby", $colum."%20ASC".$sec_order, "page", "");?>"><IMG src="img/asca.gif" width=8 height=7></A><?}
	ELSEIF(EregI(", ".$colum." ASC$", $_GET['orderby']))
		{?>&nbsp;<A href="index.php?<?Print Change_URL_Query("orderby", $colum."%20ASC".$sec_order, "page", "");?>"><IMG src="img/ascp.gif" width=8 height=7></A><?}
	ELSE
		{?>&nbsp;<A href="index.php?<?Print Change_URL_Query("orderby", $colum."%20ASC".$sec_order, "page", "");?>"><IMG src="img/asc.gif" width=8 height=7></A><?}

	IF(EregI("^".$colum." DESC", $_GET['orderby']))
		{?><A href="index.php?<?Print Change_URL_Query("orderby", $colum."%20DESC".$sec_order, "page", "");?>"><IMG src="img/desca.gif" width=8 height=7></A><?}
	ELSEIF(EregI(", ".$colum." DESC$", $_GET['orderby']))
		{?><A href="index.php?<?Print Change_URL_Query("orderby", $colum."%20DESC".$sec_order, "page", "");?>"><IMG src="img/descp.gif" width=8 height=7></A><?}
	ELSE
		{?><A href="index.php?<?Print Change_URL_Query("orderby", $colum."%20DESC".$sec_order, "page", "");?>"><IMG src="img/desc.gif" width=8 height=7></A><?}
	RETURN;
	}