Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Security - PHP Nuke
Author Message
butterfly
Hangin' Around



Joined: Jun 27, 2005
Posts: 34
Location: England

PostPosted: Sun Jul 03, 2005 8:54 am Reply with quote

can a good php coder add a
Code:
 [img][/img] 
to the finshed upload bit of this script, it currently has just a http link but i need bb img code for my users.

Code:


<?php

/*
Image Host Version 1.01
Created by Nova
Website: http://www.robscorner.com
Email: [ Only registered users can see links on this board! Get registered or login! ]
*/

if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
    die ("You can't access this file directly...");
}

require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
$path = "modules/$module_name/images/sigs/";
$max_size = 524288;

function upload() {
global $module_name;
include("header.php");
if (file_exists("modules/$module_name/copyright.php")) {
Opentable();
echo"<FORM ENCTYPE=\"multipart/form-data\" ACTION=\"modules.php?name=$module_name&func=finished\" METHOD=\"POST\">"
  . "  <p align=\"center\">&nbsp;</p>"
  . "  <p align=\"center\"><img src=\"modules/$module_name/images/logo.gif\"></p>"
  . "  <p align=\"center\">Just Browse For Your File, Then Click Upload. The Link For The Image Will Come Up After The Upload.</p>"
  . "  <p align=\"center\">Use The Link Shown To Link To The Image </p>"
  . "  <p align=\"center\">The file:"
  . "    <INPUT TYPE=\"file\" NAME=\"userfile\">"
  . "    <INPUT TYPE=\"submit\" VALUE=\"Upload\">"
  . "    </p>"
  . "</FORM>";
CloseTable();
include("footer.php");
    } else {
    echo "<br>";
    OpenTable();
    echo "<br><center><b>You did not upload the copyright.php file!<br><br>Upload it and this message will go away.<br><br>Give some credit to the creators of this module.</b> </center><br>";
    CloseTable();
    include("footer.php");
    die();
    }
}

function finished() {
global $path, $max_size,$HTTP_POST_FILES, $module_name, $nukeurl;

include("header.php");
if (file_exists("modules/$module_name/copyright.php")) {
Opentable();
echo "  <p align=\"center\"><img src=\"modules/$module_name/images/logo.gif\"></p>";
echo"<hr>";
if (!isset($HTTP_POST_FILES['userfile'])) exit;
if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'])) {

if ($HTTP_POST_FILES['userfile']['size']>$max_size) { echo "The file is too big<br>\n"; exit; }
if (($HTTP_POST_FILES['userfile']['type']=="image/gif") || ($HTTP_POST_FILES['userfile']['type']=="image/pjpeg") || ($HTTP_POST_FILES['userfile']['type']=="image/jpeg") || ($HTTP_POST_FILES['userfile']['type']=="image/swf")) {

if (file_exists($path . $HTTP_POST_FILES['userfile']['name'])) { echo "The file already exists<br>\n"; exit; }

$res = copy($HTTP_POST_FILES['userfile']['tmp_name'], $path .
$HTTP_POST_FILES['userfile']['name']);
if (!$res) { echo "Upload failed!<br>\n"; exit; } else { echo "Upload sucessful<br>\n"; }
echo"<br>";
echo"<table width=\"100%\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"
  . "  <tr>"
  . "    <td width=\"20%\">File Name: </td>"
  . "    <td width=\"80%\">".$HTTP_POST_FILES['userfile']['name']."</td>"
  . "  </tr>"
  . "  <tr>"
  . "    <td width=\"20%\">File Size: </td>"
  . "    <td width=\"80%\">".$HTTP_POST_FILES['userfile']['size']." bytes</td>"
  . "  </tr>"
  . "  <tr>"
  . "    <td width=\"20%\">File Type: </td>"
  . "    <td width=\"80%\">".$HTTP_POST_FILES['userfile']['type']."</td>"
  . "  </tr>"
  . "  <tr>"
  . "    <td width=\"20%\">File Preview: </td>"
  . "    <td width=\"80%\"><img src=\"$nukeurl/modules/$module_name/images/sigs/".$HTTP_POST_FILES['userfile']['name']."\"></td>"
  . "  </tr>"
  . "  <tr>"
  . "    <td width=\"20%\">File Link: </td>"
  . "    <td width=\"80%\">$nukeurl/modules/$module_name/images/sigs/".$HTTP_POST_FILES['userfile']['name']."</td>"
  . "  </tr>"
  . "</table>";
} else { echo "Wrong file type<br>\n"; exit; }  }

CloseTable();
include("footer.php");
    } else {
    echo "<br>";
    OpenTable();
    echo "<br><center><b>You did not upload the copyright.php file!<br><br>Upload it and this message will go away.<br><br>Give some credit to the creators of this module.</b> </center><br>";
    CloseTable();
    include("footer.php");
    die();
    }
}
switch($func) {

    default:
    upload();
    break;

    case "finished":
    finished();
    break;
    }
?>
 
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Sun Jul 03, 2005 11:51 am Reply with quote

I'm not understanding what you need. That script produces HTML, not bbcode. bbcode is only used in the Forum. What exactly is it you need and what link are you referring to?
 
View user's profile Send private message
butterfly







PostPosted: Sun Jul 03, 2005 12:25 pm Reply with quote

ok u see that scritp? it displays a http code for u to use i want it to display it with forum img tags either side of it for easy copy paste, i had a go and i just messed it up Sad
 
Raven







PostPosted: Sun Jul 03, 2005 1:23 pm Reply with quote

What is the line of code, from the script, that you want the bbcode added to?
 
butterfly







PostPosted: Sun Jul 03, 2005 3:19 pm Reply with quote

If i had to guess which one it would go in, id say this line:

Code:
"  <tr>" 

  . "    <td width=\"20%\">File Link: </td>"
  . "    <td width=\"80%\">$nukeurl/modules/$module_name/images/sigs/".$HTTP_POST_FILES['userfile']['name']."</td>"
  . "  </tr>"
 
butterfly







PostPosted: Sun Jul 03, 2005 8:12 pm Reply with quote

still cant seem to do it myself anyone got idears?
 
butterfly







PostPosted: Mon Jul 04, 2005 10:53 am Reply with quote

Finshed this project!
thanks for trying raven your input is always welcomed Smile
 
Raven







PostPosted: Mon Jul 04, 2005 10:54 am Reply with quote

Sorry I was not able to get back to this. It was on my list but the list is VERY long. Congratulations on completing your project!
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Security - PHP Nuke

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©