Upload billede script til phpnuke 7.7
HejJeg er lidt ny til phpnuke.
Ville høre om der er nogen der ved hvordan koden til index.php ser ud, og hvor den skal indsættes hvis man gerne vil give sine medlemmer mulighed for at uploade et billede sammen med tilføjelsen af et link i Weblinks.
Det uploaded billede skal kunne ses sammen med link beskrivelsen.
index.php til weblinks ser sådan ud:
include("footer.php");
}
function Add($title, $url, $auth_name, $cat, $description, $email,$postal) {
global $prefix, $db, $user;
$result = $db->sql_query("SELECT url from ".$prefix."_links_links where url='$url'");
$numrows = $db->sql_numrows($result);
if ($numrows>0) {
include("header.php");
menu(1);
echo "<br>";
OpenTable();
echo "<center><b>"._LINKALREADYEXT."</b><br><br>"
.""._GOBACK."";
CloseTable();
include("footer.php");
} else {
if(is_user($user)) {
$user2 = base64_decode($user);
$user2 = addslashes($user2);
$cookie = explode(":", $user2);
cookiedecode($user);
$submitter = $cookie[1];
}
// Check if Title exist
if ($title=="") {
include("header.php");
menu(1);
echo "<br>";
OpenTable();
echo "<center><b>"._LINKNOTITLE."</b><br><br>"
.""._GOBACK."";
CloseTable();
include("footer.php");
}
// Check if URL exist
if ($url=="") {
include("header.php");
menu(1);
echo "<br>";
OpenTable();
echo "<center><b>"._LINKNOURL."</b><br><br>"
.""._GOBACK."";
CloseTable();
include("footer.php");
}
// Check if Description exist
if ($description=="") {
include("header.php");
menu(1);
echo "<br>";
OpenTable();
echo "<center><b>"._LINKNODESC."</b><br><br>"
.""._GOBACK."";
CloseTable();
include("footer.php");
}
$cat = explode("-", $cat);
if ($cat[1]=="") {
$cat[1] = 0;
}
$title = stripslashes(check_html($title, "nohtml"));
$url = stripslashes($url);
$description = stripslashes($description);
$auth_name = stripslashes($auth_name);
$email = stripslashes($email);
$cat[0] = intval($cat[0]);
$cat[1] = intval($cat[1]);
$num_new = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_links_newlink WHERE title='$title' OR url='$url' OR description='$description'"));
if ($num_new == 0) {
$db->sql_query("insert into ".$prefix."_links_newlink values (NULL, '$cat[0]', '$cat[1]', '$title', '$url', '$description', '$auth_name', '$email','$postal','$submitter')");
}
include("header.php");
menu(1);
echo "<br>";
OpenTable();
echo "<center><b>"._LINKRECEIVED."</b><br>";
if ($email != "") {
echo _EMAILWHENADD;
} else {
echo _CHECKFORIT;
}
CloseTable();
include("footer.php");
}
}
Mvh.
Sammy