Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][HTML]Problem ze skryptem php, Jak sprawić aby skrypt komentarzy pojawił się w oknie przeglądarki?
-Gośc01-
post
Post #1





Goście







///////////////////////////////////////////////////////////////////////////////
// talkback v1.12 //
// created by James Maglo //
// Download: http://php.umbagu.net/files/talkback.zip //
// Support: http://php.umbagu.net/support //
// //
///////////////////////////////////////////////////////////////////////////////


$address = "http://php.umbagu.net/scripts/php/"; //Full URL to where the talkback.php script is installed
$file = "comment.dat"; //name of the file where data will be stored. the default comment.dat value is recommended
$path = "/usr/home/u/m/umbagu/public_html/scripts/php/";// Finally, the full path to the script directory
$img = "1"; // 1 - user can post images 0 - images are disabled
$title_colour = "#0066AA"; //background colour of the part where user's name is displayed
$message_colour = "#CECEFF"; //background colour of the message displayed

// CHMOD THE DIRECTORY WHICH YOU SPECIFIED IN $address TO 0777!!!
//THATS ALL YOU NEED TO EDIT, PLEASE STOP NOW. TO USE THE SCRIPT, USE include("path/to/script/talkback.php");
$version = "1.1";
$maxlen = 30;
$route = "true";
if($img){
$imgnfo = "enabled. \\n\\n[img=http://imageaddress.com/image.jpg][/img]";
}
else{
$imgnfo = "disabled";
}

function reWriteDataInFile($fileData,$fileName = "talkback.tb")
{
if(!file_exists($fileName))
{
@$createFile = fopen($fileName, "w") or die ("Can't create file ".$fileName."");
fwrite ($createFile,"",0);
@chmod($fileName, 0666);
fclose($createFile);
}
@$openFile = fopen($fileName,"w+") or die ("Access is denied. Set permission to ".$fileName." by command in console \"chmod 666 ".$fileName."\"");
if ($openFile && flock($openFile,LOCK_EX)) {
@fwrite($openFile,$fileData);
}
fclose($openFile);
}

function createFile($fileName)
{
if(!file_exists($fileName))
{
@$createFile = fopen($fileName, "w") or die ("Can't create file ".$fileName."");
fwrite ($createFile,"",0);
@chmod($fileName, 0666);
fclose($createFile);
}
}

function convertLink($content)
{
global $constant;
$content = preg_replace('/(http|ftp|news|https)(:\/\/)([^<> ])+/i', "<a href='\\' class='messagelink'>\</a>", $content);
$content = preg_replace('/([\w-?&;#~=\.\/]+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?))/i', "<a href='mailto:\\1'>\\1</a>", $content);
return $content;
}

function divideWord($content,$maxWordLength = "30")
{
return wordwrap($content, $maxWordLength, " ", 1);
}


$back = "$HTTP_REFERER";
$time = date("d M, Y - H:i");
//############
//start of the script for adding
//############
if($action){
if($name){
if($comment){

$id = date("dMYHis");

if (file_exists("${file}"))
include("${file}");
else
createFile("${file}");

$comment = ereg_replace("[ ]{2,}", " ", $comment);
$comment = convertLink($comment);
$comment = str_replace("\"", "&quot;", $comment);
$comment = str_replace("\n", " <br/>", $comment);
$comment = str_replace("\$", " $", $comment);
$comment = strip_tags($comment, '');
if($img){
$comment = str_replace("[img=", "<img src='", $comment);
$comment = str_replace("][/img]", "'>", $comment);
}
$comment = trim($comment);
$comment = stripslashes($comment);


$cnt = 0;
$addContent = "<?php\n";

$addContent .= "\t\$content[0]['page'] = \"".$page."\";\n";
$addContent .= "\t\$content[0]['delete'] = \"".$id."\";\n";
$addContent .= "\t\$content[0]['name'] = \"".$name."\";\n";
$addContent .= "\t\$content[0]['comment'] = \"".$comment."\";\n";
$addContent .= "\t\$content[0]['time'] = \"".$time."\";\n";



$contentCnt = sizeof($content);
if ($contentCnt != 0)
$addContent .= "\n";
for($i = 0; $i < $contentCnt; $i++)
{
$cnt++;
while(list($key, $value) = each($content[$i]))
{
$addContent .= "\t\$content[".$cnt."]['".$key."'] = \"".$value."\";\n";
}
if ($i != $contentCnt-1)
$addContent .= "\n";
}
$addContent .= "?>";
reWriteDataInFile ($addContent, "$file");





}}
header ("location: $back");
exit;}
//#############
//end of script for adding
//#############
//show the entry form if nothing has been added
//#############
$page = "${HTTP_HOST}${PHP_SELF}";
if (file_exists("${path}${file}"))
include("${path}${file}");

print<<<END
<p><b><font size="3" face="Verdana, Arial, Helvetica, sans-serif">Talkback</font></b><br><font size="1" face="verdana">the smart way to voice your opinion</font></p>
<form action="${address}talkback.php" name="f" method="post">
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="64">
<div align="right"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2">name:</font></b></div>
</td>
<td width="436"><b><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><font color="#000000">
<input type="text" maxlength="40" name="name" style="width: 300;font-size: 7pt; font-family: Arial; background-color: #FFFFFF; color: black; border: 1 solid #000000" size="10">
</font></font></b></td>
</tr>
<tr>
<td width="64" valign="top"> <script language="Javascript">
function help(){
alert("INFORMATION\\n\\n Images are $imgnfo\\n\\n talkback - http://php.umbagu.net");
}
</script>
<div align="right"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2">comment:</font></b></div><div align="center"><font face="verdana" size="1"> <a href="java script:help()"><font color="blue">help</font></a></font></div>
</td>
<td width="436"><b><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><font color="#000000">
<textarea name="comment" style="width: 300;font-size: 7pt; font-family: Arial; background-color: #FFFFFF; color: black; border: 1 solid #000000" cols="10" rows="4"></textarea>
</font></font></b></td>
</tr>
<tr>
<td width="64">
<div align="right"><font face="Verdana, Arial, Helvetica, sans-serif"><font face="Verdana, Arial, Helvetica, sans-serif"><font size="2"><font size="2"><b></b></font></font></font></font></div>
</td>
<td width="436"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2">
<input type="submit" name="Submit" value="Submit" style="width: 300;font-size: 7pt;" ><input type="hidden" name="action" value="yeah_baby"><input type="hidden" name="page" value="$page">
</font></b></td>
</tr>
</table>
</form>

END;



?>
</font></font><br>
<table width="500" border="0" cellspacing="0" cellpadding="0">
<?
$now = "${HTTP_HOST}${PHP_SELF}";


$currentContent = $content;
for ($i = 0; $i < sizeof($currentContent); $i++)
{
$try = $currentContent[$i]['page'];
$message = $currentContent[$i]['comment'];
$message = str_replace("java script:", "[talkback JS filter]", $message);
if($try == $now){
?>
<tr>
<td bgcolor="<?echo $title_colour;?>"><font face="Verdana, Arial, Helvetica, sans-serif"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><font color='navy'><font color='black'>
<font size="2" color="#FFFFFF"> <b>
<?=$currentContent[$i]['name']?>
</b></font></font></font></font><b><font size="2" color="#FFFFFF">commented
at </font></b></font><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#FFFFFF">
<?=$currentContent[$i]['time']?>
</font></b><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><font color='navy'><font color='black'>
</font></font></font></td>
</tr>
<tr>
<td bgcolor="<?echo $message_colour;?>"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><font color='navy'><font color='black'>
&nbsp;<?=$message?>&nbsp;
</font></font></font></td>
</tr><?}}?>
</table>
<p align="center"><font face="Verdana, Arial, Helvetica, sans-serif" color="blue" size="1">
<a href="http://php.umbagu.net">&copy; James Maglo - umbagu </a>
</font></p>[/code]
Pytanie pierwsze
Co muszę zrobić aby ten skrypt pojawił się w oknie przęglądarki?
Owszem,jest instrukcja,ale po angielsku. Jak wkleję ją w tłumacza wychodzi masło maślane.
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
conel
post
Post #2





Grupa: Zarejestrowani
Postów: 28
Pomógł: 5
Dołączył: 26.08.2008
Skąd: Poznań

Ostrzeżenie: (0%)
-----


A może byś tak przestał się pienić i wykazał chociaż najmniejszą próbę rozwiązania SWOJEGO problemu, co?

Wpadasz sobie na forum, wrzucasz jak leci cały skrypt, nie używając nawet odpowiednich znaczników przez co kod staje się całkowicie nieczytelny. Do tego nie chce się Tobie przeczytać komentarzy do skryptu, którego próbujesz użyć. Tutaj nie chodzi o to, że nie umiesz, bo to bzdura. Żyjemy w 21 wieku, gdzie w szkołach angielski jest już obowiązkowym przedmiotem w gimnazjum (może nawet wcześniej). Jakby tego wszystkiego było mało, to jeszcze toczysz pianę o to czy ktoś Ci pomoże. Wybacz człowieku, ale tutaj, jak i na innych forach, nikt nie ma obowiązku Tobie pomagać. To tylko i wyłącznie dobra wola, ale skoro Ty nie potrafisz tego docenić, to trudno spodziewać się jakiejkolwiek pomocy.

http://domena.pl/skrypt/ - URL prowadzący do skryptu.
/skrypt (lub /public_html/skrypt/, lub 150 innych sposobów) - tak to wygląda z FTP.

$address = "http://php.umbagu.net/scripts/php/"; - http://domena.pl/skrypt/
$file = "comment.dat"; - chmod 777 na plik "comment.dat". Jeśli nie istnieje należy go stworzyć i dać mu chmod 777.
$path = "/usr/home/u/m/umbagu/public_html/scripts/php/"; - ścieżka bezwzględna na serwerze prowadząca do skryptu. Nie, to nie jest tak jak wygląda z FTP. Jak uzyskać bezwzględna ścieżkę do swojego katalogu? Manual.

Musi działać.

Ten post edytował conel 1.09.2008, 14:51:16
Go to the top of the page
+Quote Post

Posty w temacie
- Gośc01   [PHP][HTML]Problem ze skryptem php   28.08.2008, 14:22:40
- - Gość   KodThank you for downloading talkback v1.12 from h...   28.08.2008, 14:24:22
- - f1xer   Tłumaczenie: Instalacja 1. Zanim wgrasz pli...   28.08.2008, 14:31:42
- - gość 01   Kod$address = "http://www.piesna6....   28.08.2008, 17:29:59
- - f1xer   $adress = "http://www.piesna6.webpark.p...   28.08.2008, 20:20:47
- - Gosc01   Nic z tego,ale pytanie: Jak podaje ścieżkę dostępu...   30.08.2008, 13:00:08
- - dh   RE: [PHP][HTML]Problem ze skryptem php   30.08.2008, 17:06:00
- - Gosc01   CO JEST NIE TAK   31.08.2008, 12:19:01
- - Gosc01   CZY KTOŚ DO CHOLERY MI W KOŃCU ODPOWIE?   1.09.2008, 13:36:25
- - conel   A może byś tak przestał się pienić i wykazał choci...   1.09.2008, 14:46:47


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 8.10.2025 - 14:49