|
|
|
|
#1 |
|
V.I.P
![]() Grupa: V.I.P
Dołączył: Jan 2006
Posty: 2,036
Piwa Postawione: 0
Piwa Otrzymane: 16
Punkty Reputacji: 0
Siła Reputacji: 5
|
Bitbucket.php (wersja imageshack)
Upload avatarów, które odrazy wrzucają się na imageshack.us
Utwórz dowolny plik php i daj do niego treść: Kod:
<?
require "include/bittorrent.php";
dbconn();
loggedinorreturn();
// Configuratie
$serverpath = "imagebucket/";
$urltoimages = "http://www.imtorrents.com/imagebucket";
$maxsize = 256 * 1024;
// Configuratie Eind
stdhead("Upload avatarów");
print("<h2>ImageShack Upload</h2>");
$mode = $_GET['mode'];
if ($mode == "") { $mode = "form"; }
if ($mode == "form") {
/*
echo '<iframe src="http://imageshack.us/iframe.php?txtcolor=111111&type=blank" scrolling="no" frameborder="0" width="280" height="70"> You must have an iframe-compatable browser to view the ImageShack.us upload form.</iframe>';
*/
?>
<form action="http://imageshack.us/index.php" method="post" enctype="multipart/form-data" target="_blank">
<center>
<table border=1 cellspacing=0 cellpadding=5>
<tr><td class=rowhead>Wyslij plik!</td>
<td><input type="hidden" name="MAX_FILE_SIZE" value="1048576">
<input type="hidden" name="aff" value="">
<input type="hidden" name="type" value="blank">
<input type="file" class="textfield" name="fileupload" size="60"></td></tr>
<tr><td colspan=2 align=center><input type="submit" value="Wyslij"></td></tr>
</table>
</form>
<table class=main width=410 border=0 cellspacing=0 cellpadding=0><tr><td class=embedded>
<
</td></tr></table>
<?
}
if ($mode == "upload") {
$file = $_FILES['file']['name'];
// Als je een eigen extensie wilt toelaten, voeg deze hier toe, vergeet niet om OOK een hoofdletter extensie toe te voegen.
$allowedfiles[] = "gif";
$allowedfiles[] = "jpg";
$allowedfiles[] = "jpeg";
$allowedfiles[] = "png";
$allowedfiles[] = "GIF";
$allowedfiles[] = "JPG";
$allowedfiles[] = "JPEG";
$allowedfiles[] = "PNG";
if($_FILES['file']['size'] > $maxsize)
{
print "Rozmiar pliku jest za duzy. Zredukuj rozmiar pliku, i spróbuj ponownie.";
}
else {
$path = "$serverpath/$file";
foreach($allowedfiles as $allowedfile) {
if ($done <> "yes") {
if (file_exists($path)) {
echo "Wysylanie nie powiodlo sie, poniewaz jest taki sam plik na serwerze.";
exit;
}
}
if (substr($file, -3) == $allowedfile) {
move_uploaded_file($_FILES['file']['tmp_name'], "$path");
$done = "yes";
echo "
<a href=/bitbucket.php>Wyslij inny plik</a></p>";
echo "
Sukces! Zostaniesz przeniesiony do pliku!</p>";
echo "
$urltoimages/$file</p>";
echo "
[img]$urltoimages/$file[/img]";
$name = sqlesc($file);
$added = sqlesc(get_date_time());
mysql_query("INSERT INTO bitbucket (owner, name, added) VALUES ($CURUSER[id], $name, $added)") or sqlerr(__FILE__, __LINE__);
}
}
if ($done <> "yes") { print "
Blad: Twoj obrazek nie zostal wrzucony. Rozszerzenie nie jest przyjmowane. Sprobuj ponownie.</p>"; }
}
}
//end_main_frame();
stdfoot();
?>
|
|
|
|
|
|
#2 |
|
User
![]() Grupa: Użytkownik
Dołączył: May 2008
Posty: 34
Piwa Postawione: 0
Piwa Otrzymane: 0
Punkty Reputacji: 0
Siła Reputacji: 1
|
Nie działa.Wyskakuje to Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/man/public_html/wrzuc.php on line 153
|
|
|
|
|
|
#3 |
|
Xtreme User
![]() |
w 153 lini jest [img]$urltoimages/$file[/img]";
A powinno byc troche inaczej. Masz poprawiłem to: Kod:
<?
require "include/bittorrent.php";
dbconn();
loggedinorreturn();
// Configuratie
$serverpath = "imagebucket/";
$urltoimages = "http://www.imtorrents.com/imagebucket";
$maxsize = 256 * 1024;
// Configuratie Eind
stdhead("Upload avatarów");
print("<h2>ImageShack Upload</h2>");
$mode = $_GET['mode'];
if ($mode == "") { $mode = "form"; }
if ($mode == "form") {
/*
echo '<iframe src="http://imageshack.us/iframe.php?txtcolor=111111&type=blank" scrolling="no" frameborder="0" width="280" height="70"> You must have an iframe-compatable browser to view the ImageShack.us upload form.</iframe>';
*/
?>
<form action="http://imageshack.us/index.php" method="post" enctype="multipart/form-data" target="_blank">
<center>
<table border=1 cellspacing=0 cellpadding=5>
<tr><td class=rowhead>Wyslij plik!</td>
<td><input type="hidden" name="MAX_FILE_SIZE" value="1048576">
<input type="hidden" name="aff" value="">
<input type="hidden" name="type" value="blank">
<input type="file" class="textfield" name="fileupload" size="60"></td></tr>
<tr><td colspan=2 align=center><input type="submit" value="Wyslij"></td></tr>
</table>
</form>
<table class=main width=410 border=0 cellspacing=0 cellpadding=0><tr><td class=embedded>
<
</td></tr></table>
<?
}
if ($mode == "upload") {
$file = $_FILES['file']['name'];
// Als je een eigen extensie wilt toelaten, voeg deze hier toe, vergeet niet om OOK een hoofdletter extensie toe te voegen.
$allowedfiles[] = "gif";
$allowedfiles[] = "jpg";
$allowedfiles[] = "jpeg";
$allowedfiles[] = "png";
$allowedfiles[] = "GIF";
$allowedfiles[] = "JPG";
$allowedfiles[] = "JPEG";
$allowedfiles[] = "PNG";
if($_FILES['file']['size'] > $maxsize)
{
print "Rozmiar pliku jest za duzy. Zredukuj rozmiar pliku, i spróbuj ponownie.";
}
else {
$path = "$serverpath/$file";
foreach($allowedfiles as $allowedfile) {
if ($done <> "yes") {
if (file_exists($path)) {
echo "Wysylanie nie powiodlo sie, poniewaz jest taki sam plik na serwerze.";
exit;
}
}
if (substr($file, -3) == $allowedfile) {
move_uploaded_file($_FILES['file']['tmp_name'], "$path");
$done = "yes";
echo "
<a href=/bitbucket.php>Wyslij inny plik</a></p>";
echo "
Sukces! Zostaniesz przeniesiony do pliku!</p>";
echo "
$urltoimages/$file</p>";
echo "[img]$urltoimages/$file[/img]";
$name = sqlesc($file);
$added = sqlesc(get_date_time());
mysql_query("INSERT INTO bitbucket (owner, name, added) VALUES ($CURUSER[id], $name, $added)") or sqlerr(__FILE__, __LINE__);
}
}
if ($done <> "yes") { print "
Blad: Twoj obrazek nie zostal wrzucony. Rozszerzenie nie jest przyjmowane. Sprobuj ponownie.</p>"; }
}
}
//end_main_frame();
stdfoot();
?>
__________________
![]() |
|
|
|
![]() |
| Narzędzia wątku | |
| Wygląd | |
|
|
Podobne wątki
|
||||
| Wątek | Autor wątku | Forum | Odpowiedzi | Ostatni Post |
| torrentstrike wersja 0.41 Download | rozpusta | Ogólna dyskusja i Pomoc | 1 | 04-06-07 20:21 |
| [Pytanie] Adobe photoshop wersja 30 dniowa | tiszert | Grafika, Webdesign & Fotografie | 3 | 07-03-07 10:16 |
| Nowy bitbucket-upload | HERKULES | Mody 100% działające | 0 | 14-02-07 20:28 |
| [Info] Kolejna wersja Exploera | mareski | Aplikacje | 2 | 31-01-07 23:41 |
| Nowy na TM? | Potrzebna Pomoc? |