Wiki source for CodeSnippets
%%(php;1)
$item = zmienna przekazywana w action {{komornik item="$item"}}
$new_table = "CREATE TABLE komornik_opinie (
id int(10) unsigned NOT NULL auto_increment,
komornik varchar(75) NOT NULL,
ocena smallint(6) NOT NULL DEFAULT '0',
opinia text NOT NULL,
username varchar(75) NOT NULL,
,\n `area` varchar(10) collate utf8_bin NOT NULL,\n `pagename` varchar(50) collate utf8_bin NOT NULL,\n `username` varchar(75) collate utf8_bin NOT NULL,\n `latest` enum('Y','N') collate utf8_bin NOT NULL default 'N',\n PRIMARY KEY (`id`)\n) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_bin";
// oceny komorników
if ($komornik_access) {
// if POST, then DB-operations
if ($komornik_mode == "add_opinion") {
$rsstr = "INSERT INTO komornik_opinie (komornik, ocena, opinia) VALUES ('".$item."', ".$_POST["ocena"].",'".$_POST["opinia"]."');";
//wykonaj operacje na bazie
}
// show form - on access only
}
// for all - show results:
$rssstr = "SELECT * FROM komornik_opinie WHERE ";
// w pliku /formatters/wikka.php od linijki ok. 452
//$text = preg_replace("/(art(\.?)|(§)) (.*? [A-Za-z0-9]*)/i", "{{pu przepis=\"$4\"}}", $text);
$text = preg_replace("/((art\.?)|(§)) (.*?) ([A-Za-z0-9]*)/i", "<b><a href=\"javascript:myOpen('norm=$4&skrot=$5', 'przepis_$4_$5');\">$1 $4 $5</a></b>", $text);
//<b><a href="javascript:myOpen('norm=535&skrot=KC', 'przepis_3');">art. 535 KC</a></b>
//{{pu przepis="353 KC"}}
%%
$item = zmienna przekazywana w action {{komornik item="$item"}}
$new_table = "CREATE TABLE komornik_opinie (
id int(10) unsigned NOT NULL auto_increment,
komornik varchar(75) NOT NULL,
ocena smallint(6) NOT NULL DEFAULT '0',
opinia text NOT NULL,
username varchar(75) NOT NULL,
,\n `area` varchar(10) collate utf8_bin NOT NULL,\n `pagename` varchar(50) collate utf8_bin NOT NULL,\n `username` varchar(75) collate utf8_bin NOT NULL,\n `latest` enum('Y','N') collate utf8_bin NOT NULL default 'N',\n PRIMARY KEY (`id`)\n) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_bin";
// oceny komorników
if ($komornik_access) {
// if POST, then DB-operations
if ($komornik_mode == "add_opinion") {
$rsstr = "INSERT INTO komornik_opinie (komornik, ocena, opinia) VALUES ('".$item."', ".$_POST["ocena"].",'".$_POST["opinia"]."');";
//wykonaj operacje na bazie
}
// show form - on access only
}
// for all - show results:
$rssstr = "SELECT * FROM komornik_opinie WHERE ";
// w pliku /formatters/wikka.php od linijki ok. 452
//$text = preg_replace("/(art(\.?)|(§)) (.*? [A-Za-z0-9]*)/i", "{{pu przepis=\"$4\"}}", $text);
$text = preg_replace("/((art\.?)|(§)) (.*?) ([A-Za-z0-9]*)/i", "<b><a href=\"javascript:myOpen('norm=$4&skrot=$5', 'przepis_$4_$5');\">$1 $4 $5</a></b>", $text);
//<b><a href="javascript:myOpen('norm=535&skrot=KC', 'przepis_3');">art. 535 KC</a></b>
//{{pu przepis="353 KC"}}
%%