Code:
<? include("../function/db.php");?>
<?
if($_SESSION['entry_admin']!=1){redirect("../auth/");}
include("../function/upload.php");
$swait=false;
$afiles=array();
$dir = opendir ($_SERVER["DOCUMENT_ROOT"].site_root.photopreupload);
while ($file = readdir ($dir))
{
if($file <> "." && $file <> "..")
{
if (preg_match("/.jpg$|.jpeg$/i",$file))
{
$afiles[count($afiles)]=$file;
}
}
}
closedir ($dir);
sort ($afiles);
reset ($afiles);
for($j=0;$j<count($afiles);$j++)
{
if(isset($_POST["f".$j]))
{
$photo="";
if($_POST["file".$j]!="")
{
$ttl=explode(".",$_POST["file".$j]);
$title=str_replace("_","",$ttl[0]);
$pub_vars=array();
$pub_vars["category"]=(int)$_POST["category"];
$pub_vars["title"]=$title;
$pub_vars["description"]="";
$pub_vars["keywords"]="";
$pub_vars["userid"]=0;
$pub_vars["published"]=1;
$pub_vars["viewed"]=0;
$pub_vars["data"]=mktime(date("H"),date("i"),date("s"),date("m"),date("d"),date("Y"));
$pub_vars["author"]=result($_POST["author"]);
$pub_vars["content_type"]=$site_content_type;
$pub_vars["downloaded"]=0;
$pub_vars["model"]=0;
$pub_vars["examination"]=0;
$pub_vars["server1"]=$site_server_activ;
$pub_vars["free"]=0;
$pub_vars["category2"]=(int)$_POST["category2"];
$pub_vars["category3"]=(int)$_POST["category3"];
//Add a new photo to the database
$id=publication_photo_add();
$folder=$id;
$photo=site_root.photopreupload.$_POST["file".$j];
//create thumbs and watermark
if($photo!="" and preg_match("/.jpg$|.jpeg$/i",$photo) and !file_exists($_SERVER["DOCUMENT_ROOT"].site_root.$site_servers[$site_server_activ]."/".$folder."/thumb1.jpg"))
{
photo_resize($_SERVER["DOCUMENT_ROOT"].$photo,$_SERVER["DOCUMENT_ROOT"].site_root.$site_servers[$site_server_activ]."/".$folder."/thumb1.jpg",1);
photo_resize($_SERVER["DOCUMENT_ROOT"].$photo,$_SERVER["DOCUMENT_ROOT"].site_root.$site_servers[$site_server_activ]."/".$folder."/thumb2.jpg",2);
publication_watermark_add($id,$_SERVER["DOCUMENT_ROOT"].site_root.$site_servers[$site_server_activ]."/".$folder."/thumb2.jpg");
}
//IPTC support
if($photo!="")
{
publication_iptc_add($id,$_SERVER["DOCUMENT_ROOT"].$photo);
}
//create different dimensions
if($photo!="")
{
copy($_SERVER["DOCUMENT_ROOT"].$photo,$_SERVER["DOCUMENT_ROOT"].site_root.$site_servers[$site_server_activ]."/".$folder."/".$_POST["file".$j]);
$file=$_POST["file".$j];
publication_photo_sizes_add($id,$file,false);
}
//Prints
if($site_prints)
{
publication_prints_add($id,false);
}
}
if(isset($_POST["remove"]))
{
@unlink($_SERVER["DOCUMENT_ROOT"].$photo);
}
}
}
//go back
redirect_file("../catalog/index.php?category_id=".(int)$_POST["category"],true);
?>
<? include("../function/db.php");?>
<?
if($_SESSION['entry_admin']!=1){redirect("../auth/");}
include("../function/upload.php");
$swait=false;
$afiles=array();
$dir = opendir ($_SERVER["DOCUMENT_ROOT"].site_root.photopreupload);
while ($file = readdir ($dir))
{
if($file <> "." && $file <> "..")
{
if (preg_match("/.jpg$|.jpeg$/i",$file))
{
$afiles[count($afiles)]=$file;
}
}
}
closedir ($dir);
sort ($afiles);
reset ($afiles);
for($j=0;$j<count($afiles);$j++)
{
if(isset($_POST["f".$j]))
{
$photo="";
if($_POST["file".$j]!="")
{
$ttl=explode(".",$_POST["file".$j]);
$title=str_replace("_","",$ttl[0]);
$pub_vars=array();
$pub_vars["category"]=(int)$_POST["category"];
$pub_vars["title"]=$title;
$pub_vars["description"]="";
$pub_vars["keywords"]="";
$pub_vars["userid"]=0;
$pub_vars["published"]=1;
$pub_vars["viewed"]=0;
$pub_vars["data"]=mktime(date("H"),date("i"),date("s"),date("m"),date("d"),date("Y"));
$pub_vars["author"]=result($_POST["author"]);
$pub_vars["content_type"]=$site_content_type;
$pub_vars["downloaded"]=0;
$pub_vars["model"]=0;
$pub_vars["examination"]=0;
$pub_vars["server1"]=$site_server_activ;
$pub_vars["free"]=0;
$pub_vars["category2"]=(int)$_POST["category2"];
$pub_vars["category3"]=(int)$_POST["category3"];
//Add a new photo to the database
$id=publication_photo_add();
$folder=$id;
$photo=site_root.photopreupload.$_POST["file".$j];
//create thumbs and watermark
if($photo!="" and preg_match("/.jpg$|.jpeg$/i",$photo) and !file_exists($_SERVER["DOCUMENT_ROOT"].site_root.$site_servers[$site_server_activ]."/".$folder."/thumb1.jpg"))
{
photo_resize($_SERVER["DOCUMENT_ROOT"].$photo,$_SERVER["DOCUMENT_ROOT"].site_root.$site_servers[$site_server_activ]."/".$folder."/thumb1.jpg",1);
photo_resize($_SERVER["DOCUMENT_ROOT"].$photo,$_SERVER["DOCUMENT_ROOT"].site_root.$site_servers[$site_server_activ]."/".$folder."/thumb2.jpg",2);
publication_watermark_add($id,$_SERVER["DOCUMENT_ROOT"].site_root.$site_servers[$site_server_activ]."/".$folder."/thumb2.jpg");
}
//IPTC support
if($photo!="")
{
publication_iptc_add($id,$_SERVER["DOCUMENT_ROOT"].$photo);
}
//create different dimensions
if($photo!="")
{
copy($_SERVER["DOCUMENT_ROOT"].$photo,$_SERVER["DOCUMENT_ROOT"].site_root.$site_servers[$site_server_activ]."/".$folder."/".$_POST["file".$j]);
$file=$_POST["file".$j];
publication_photo_sizes_add($id,$file,false);
}
//Prints
if($site_prints)
{
publication_prints_add($id,false);
}
}
if(isset($_POST["remove"]))
{
@unlink($_SERVER["DOCUMENT_ROOT"].$photo);
}
}
}
//go back
redirect_file("../catalog/index.php?category_id=".(int)$_POST["category"],true);
?>
unapred zahvalan
"Ja sam vašar. Eto šta!
Ja sam tristo čuda.
Muzika sam. Gužva. Smeh.
Vrteška. I luda."
Ja sam tristo čuda.
Muzika sam. Gužva. Smeh.
Vrteška. I luda."