Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Need Help In video Section

max_file_size

  • Please log in to reply
No replies to this topic

#1 Mastspace

Mastspace

    CC Lurker

  • Just Joined
  • Pip
  • 8 posts

Posted 17 June 2010 - 01:31 AM

Hi Dears
I Need Help on my website to add youtube link option that i can add the link to the website video gallery. i paste the video section code and hope someone can help me with thanks in Advance.

<?php
$area = "login";
include("./_include/core/main_start.php");

payment_check('videogallery_upload');
if (isset($g['options']['videogallery']) and $g['options']['videogallery'] == "N") redirect('home.php');
$adsense = false;
class CPhotoEdit extends CHtmlBlock
{
function parseBlock(&$html)
{
global $l;
global $g;
global $g_user;

//if (empty($_POST['title'])||empty($_POST['description'])||empty($_POST['tags'])||empty($_POST['runtime']))
if (isset($_GET['end'])) {
if (get_session("upload_video_sql") != '') {
DB::execute(get_session("upload_video_sql"));
set_session("upload_video_sql", '');
}
redirect('videogallery_myvideo_view.php');
}
elseif (empty($_POST['title'])||empty($_POST['description'])||empty($_POST['tags']))
{
$result_channels=DB::query("SELECT id, name FROM videogallery_channels ORDER BY name");
$num_channels=DB::num_rows();
$channels="<table width=100% border=0 align=center cellpadding=0 cellspacing=0><tr>";
$logic=0;
while ($row_channels=DB::fetch_row())
{
if (isset($l['all'][to_php_alfabet($row_channels['name'])])) {
$name = $l['all'][to_php_alfabet($row_channels['name'])];
} else {
$name = $row_channels['name'];
}
$channels.="<td><input type=checkbox name=channel_".$row_channels['id']."> " . $name . "</td>";
$logic++;
if ($logic==2)
{
$channels.="</tr><tr>";
$logic=0;
}
}
$channels.="</tr></table>";
$html->setvar("channels", $channels);
$html->setvar("num_cat", $num_channels);
$html->setvar("title", "UPLOAD VIDEO");
$html->parse("upload_1", true);
}
//elseif (!empty($_POST['title'])&&!empty($_POST['description'])&&!empty($_POST['tags'])&&!empty($_POST['runtime']))
elseif (!empty($_POST['title'])&&!empty($_POST['description'])&&!empty($_POST['tags']))
{
$result_channels=DB::query("SELECT id, name FROM videogallery_channels ORDER BY name");
$num_channels=DB::num_rows();
$channels="<table width=100% border=0 align=center cellpadding=0 cellspacing=0><tr>";
$logic=0;
$error=0;
$sel_channels="";
while ($row_channels=DB::fetch_row())
{
if (!empty($_POST['channel_'.$row_channels['id'].'']) && $_POST['channel_'.$row_channels['id'].'']=='on')
{
$error++;
$sel_channels.=$row_channels['name'].", ";
}

if (isset($l['all'][to_php_alfabet($row_channels['name'])])) {
$name = $l['all'][to_php_alfabet($row_channels['name'])];
} else {
$name = $row_channels['name'];
}
$channels.="<td><input type=checkbox name=channel_".$row_channels['id']."> " . $name . "</td>";$logic++;
if ($logic==2)
{
$channels.="</tr><tr>";
$logic=0;
}
}
$channels.="</tr></table>";

if ($error==0)
{
$html->setvar("channels", $channels);
$html->setvar("num_cat", $num_channels);
$html->parse("error", true);
}
else
{
/* $result=DB::execute("INSERT INTO videogallery_video (title, user_id, featured, channels, tags, runtime, brodcast, embed_html, video_date, status, featured_r) VALUES
(".to_sql($_POST['title']).", '".$g_user['user_id']."', 'NO', ".to_sql($sel_channels).", ".to_sql($_POST['tags']).", ".to_sql($_POST['runtime']).", ".to_sql($_POST['visible']).", ".to_sql($_POST['description']).", '".date('Y-m-d')."', 'INACTIVE', 'NO')");*/
$tmpfname = rand(100000, 999999);
while (file_exists($g['path']['dir_files'] . "video/" . $tmpfname . ".dat")) $tmpfname = rand(100000, 999999);
set_session("upload_video_sql",
"INSERT INTO videogallery_video
(title, user_id, featured, channels, tags, runtime, brodcast, embed_html, video_date, status, featured_r, video_image, video)
VALUES
(".to_sql($_POST['title']).",
'".$g_user['user_id']."', 'NO', ".to_sql($sel_channels).",
".to_sql($_POST['tags']).", 0,
".to_sql($_POST['visible']).",
".to_sql($_POST['description']).",
'".date('Y-m-d')."', 'INACTIVE', 'NO', '" . $tmpfname . ".jpg', '" . $tmpfname . ".flv')"
);
$html->setvar("fn", $tmpfname);
$html->setvar("MAX_FILE_SIZE", $this->max_file_size());
$html->setvar("file_size", $this->file_size());
$html->setvar("url_absolute", $this->url_abs());

$html->parse("no_error", true);
}
$html->setvar("title", "UPLOAD VIDEO: STEP 2");
$html->parse("upload_2", true);
}

parent::parseBlock($html);
}
function max_file_size()
{
$post_max_size = ini_get("post_max_size");
$upload_max_filesize = ini_get("upload_max_filesize");
if (intval($post_max_size) < intval($upload_max_filesize)) {
$size = $post_max_size;
} else {
$size = $upload_max_filesize;
}
$val = substr($size,0,strlen($size)-1);
if ($val = 'M') {
$size = intval($size) * 1024 * 1024;
} elseif ($val = 'K') {
$size = intval($size) * 1024;
} else {
$size = intval($size);
}
return $size;
}
function file_size()
{
$post_max_size = ini_get("post_max_size");
$upload_max_filesize = ini_get("upload_max_filesize");
if (intval($post_max_size) < intval($upload_max_filesize)) {
$size = $post_max_size;
} else {
$size = $upload_max_filesize;
}
$size = $size . 'b';
return $size;
}
function url_abs()
{
$s = $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '/';
$s = str_replace("//", "/", $s);
$s = str_replace("\\", "", $s);
$s = "http://" . $s;
return $s;
}
}

class VidoHeader extends CHtmlBlock
{
function parseBlock(&$html)
{
global $g;
global $g_user;

$html->parse("navy", true);

parent::parseBlock($html);
}
}

$page = new CPhotoEdit("", $g['tmpl']['dir_tmpl_main'] . "videogallery_upload.html");
$header = new CHeader("header", $g['tmpl']['dir_tmpl_main'] . "_header.html");
$page->add($header);
$footer = new CFooter("footer", $g['tmpl']['dir_tmpl_main'] . "_footer.html");
$page->add($footer);

$users_ims = new CIms("ims", $g['tmpl']['dir_tmpl_main'] . "_ims.html");
$page->add($users_ims);

$vidoheader = new VidoHeader("videogallery_vido_header", $g['tmpl']['dir_tmpl_main'] . "videogallery_vido_header.html");
$page->add($vidoheader);

include("./_include/core/main_close.php");

?>





this is the website video section link. MastSpace | The Bigest Afghan Social Networking Website|
  • 0





Also tagged with one or more of these keywords: max_file_size

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download