Author Topic: [Update/News] Info on V. 0.25 & V. 0.30  (Read 5013 times)

0 Members and 1 Guest are viewing this topic.

Offline winracer

  • Development Team
  • Pro Member
  • *******
  • Posts: 446
  • Karma: 3
    • View Profile
    • helpmewithperl.com
  • Script Version: 1.0+
[Update/News] Info on V. 0.25 & V. 0.30
« Reply #30 on: November 24, 2009, 06:06:15 PM »
sample upload script two part php files create

form.php

Code: [Select]
<form action="upload.php" method="post" ENCTYPE="multipart/form-data">
File: <input type="file" name="file" size="30"> <input type="submit"
value="Upload!">
</form>




then create upload.php

Code: [Select]
<?php
// ==============
// Configuration
// ==============
$uploaddir "uploads"// Where you want the files to upload to - Important: Make sure this folders permissions is 0777!
$allowed_ext "jpg, gif, png, pdf, mov, wmv, flv, mpg, mp3"// These are the allowed extensions of the files that are uploaded
$max_size "750000"// 50000 is the same as 50kb
$max_height "100"// This is in pixels - Leave this field empty if you don't want to upload images
$max_width "100"// This is in pixels - Leave this field empty if you don't want to upload images

// Check Entension
$extension pathinfo($_FILES['file']['name']);
$extension $extension[extension];
$allowed_paths explode(", "$allowed_ext);
for(
$i 0$i count($allowed_paths); $i++) {
if (
$allowed_paths[$i] == "$extension") {
$ok "1";
}
}

// Check File Size
if ($ok == "1") {
if(
$_FILES['file']['size'] > $max_size)
{
print 
"File size is too big!";
exit;
}

// Check Height & Width
if ($max_width && $max_height) {
list(
$width$height$type$w) =
getimagesize($_FILES['file']['tmp_name']);
if(
$width $max_width || $height $max_height)
{
print 
"File height and/or width are too big!";
exit;
}
}

// The Upload Part
if(is_uploaded_file($_FILES['file']['tmp_name']))
{
move_uploaded_file($_FILES['file']['tmp_name'],$uploaddir.'/'.$_FILES['file']['name']);
}
print 
"Your file has been uploaded successfully!";
} else {
print 
"Incorrect file extension!";
}
?>




also create dir called uploads


I would place these files in dir by them self for testing.


call the script by form.php
I will work on tieing it to the database
« Last Edit: November 24, 2009, 11:30:40 PM by Jeff »
winracer
myfunnypets.com
helpmewithperl.com
coosavalleyclassifieds.com
brownlows.net
myphpforum.com

Offline FireDart

  • Project Leader
  • Pro Member
  • *****
  • Posts: 406
  • Karma: 4
    • View Profile
    • FireDart
[Update/News] Info on V. 0.25 & V. 0.30
« Reply #31 on: November 24, 2009, 06:07:07 PM »
In no way we can use perl in the script.

Why?


sample upload script two part php files create

form.php

Code: [Select]
<form action="upload.php" method="post" ENCTYPE="multipart/form-data">
File: <input type="file" name="file" size="30"> <input type="submit"
value="Upload!">
</form>




then create upload.php

Code: [Select]
<?php
// ==============
// Configuration
// ==============
$uploaddir "uploads"// Where you want the files to upload to - Important: Make sure this folders permissions is 0777!
$allowed_ext "jpg, gif, png, pdf, mov, wmv, flv, mpg, mp3"// These are the allowed extensions of the files that are uploaded
$max_size "750000"// 50000 is the same as 50kb
$max_height "100"// This is in pixels - Leave this field empty if you don't want to upload images
$max_width "100"// This is in pixels - Leave this field empty if you don't want to upload images

// Check Entension
$extension pathinfo($_FILES['file']['name']);
$extension $extension[extension];
$allowed_paths explode(", "$allowed_ext);
for(
$i 0$i count($allowed_paths); $i++) {
if (
$allowed_paths[$i] == "$extension") {
$ok "1";
}
}

// Check File Size
if ($ok == "1") {
if(
$_FILES['file']['size'] > $max_size)
{
print 
"File size is too big!";
exit;
}

// Check Height & Width
if ($max_width && $max_height) {
list(
$width$height$type$w) =
getimagesize($_FILES['file']['tmp_name']);
if(
$width $max_width || $height $max_height)
{
print 
"File height and/or width are too big!";
exit;
}
}

// The Upload Part
if(is_uploaded_file($_FILES['file']['tmp_name']))
{
move_uploaded_file($_FILES['file']['tmp_name'],$uploaddir.'/'.$_FILES['file']['name']);
}
print 
"Your file has been uploaded successfully!";
} else {
print 
"Incorrect file extension!";
}
?>




also create dir called uploads


I would place these files in dir by them self for testing.


call scipt by form.php

Just saw you post, looks good. How stable is it?

Also, will this still go through the admin panel for approval or not?
« Last Edit: November 24, 2009, 11:30:48 PM by Jeff »

Offline Chris (krissy)

  • Project Leader
  • Sr phpd Member
  • *****
  • Posts: 219
  • Karma: 1000
    • View Profile
    • PHPDirector
[Update/News] Info on V. 0.25 & V. 0.30
« Reply #32 on: November 24, 2009, 06:10:12 PM »
All private servers and freehosts have php. Hardly any freehosts have perl. This would loose a HUGE amount of users.
« Last Edit: November 24, 2009, 11:31:03 PM by Jeff »

Offline winracer

  • Development Team
  • Pro Member
  • *******
  • Posts: 446
  • Karma: 3
    • View Profile
    • helpmewithperl.com
  • Script Version: 1.0+
[Update/News] Info on V. 0.25 & V. 0.30
« Reply #33 on: November 24, 2009, 06:10:47 PM »
it will upload any file in the $allowed_ext  and meets the $max_size


not yet! Also, will this still go through the admin panel for approval or not?

right now it just uploads a file.

 
« Last Edit: November 24, 2009, 11:31:14 PM by Jeff »
winracer
myfunnypets.com
helpmewithperl.com
coosavalleyclassifieds.com
brownlows.net
myphpforum.com

Offline winracer

  • Development Team
  • Pro Member
  • *******
  • Posts: 446
  • Karma: 3
    • View Profile
    • helpmewithperl.com
  • Script Version: 1.0+
[Update/News] Info on V. 0.25 & V. 0.30
« Reply #34 on: November 24, 2009, 06:21:28 PM »
All private servers and freehosts have php. Hardly any freehosts have perl. This would loose a HUGE amount of users.


I could be wrong, but I have not seen a hosting company yet that does not have both. even windows servers will run perl/cgi


anyway the upload script is in php not perl and is just a start. I would think that it would need to be tied to the database and admin panel along with pulling the files back into the main script
« Last Edit: November 24, 2009, 11:31:22 PM by Jeff »
winracer
myfunnypets.com
helpmewithperl.com
coosavalleyclassifieds.com
brownlows.net
myphpforum.com

Offline FireDart

  • Project Leader
  • Pro Member
  • *****
  • Posts: 406
  • Karma: 4
    • View Profile
    • FireDart
[Update/News] Info on V. 0.25 & V. 0.30
« Reply #35 on: November 24, 2009, 06:50:49 PM »
Krissy you are right,
We should try to keep the script available for all users BUT Perl scripts could be mods that are not needed for PHPDirector to run, but just to improve the experience of the script.
« Last Edit: November 24, 2009, 11:30:33 PM by Jeff »

Offline FireDart

  • Project Leader
  • Pro Member
  • *****
  • Posts: 406
  • Karma: 4
    • View Profile
    • FireDart
[Update/News] Info on V. 0.25 & V. 0.30
« Reply #36 on: November 24, 2009, 08:06:50 PM »
0.25 is almost on the way!

It will offer the much needed:
• YouTube API Fix
• DailyMotion API Fix
• Google Video API Fix

As well as:
• New Languages: German, Spanish, Czech, Polish, Russian, Italian, Dutch, Portuguese(On top of the English & French Lang's)
• XHTML Transitional Valid Code(Admin Panel not included)


I just need help on this before it goes live:
http://phpdirector.co.uk/forum/index.php/topic,201.msg1023.html#msg1023

and I need a new options.tpl file. Then one on the download is corrupted.



GOAL FOR Version 0.30
New Default Template(That will use some new Parameters)
Upgraded Admin Panel(Which will use these features below:)
Populated Drop Down Section Box for Templates and Languages(MySql Driven)
5 New languages(You guys choose which ones you want)
Ability for Users to select a language(Not using the admin panel, will use Sessions)
Edit Video Details Ability(Improved anyway)
Search Feature for Videos in the Admin Panel
Upload Feature for Admins Only(Click Here for more info)

Got some suggestions? Post them below.
« Last Edit: November 25, 2009, 10:57:07 PM by krissy »

Offline winracer

  • Development Team
  • Pro Member
  • *******
  • Posts: 446
  • Karma: 3
    • View Profile
    • helpmewithperl.com
  • Script Version: 1.0+
Re: [Update/News] Info on V. 0.25 & V. 0.30
« Reply #37 on: November 26, 2009, 02:15:48 AM »
on the upload script I am working on it just being one page with a process bar so that you can see the upload process.

I am still reviewing all the code but is there away to have the upload script only viewable to the admin with something like

Code: [Select]
//this would be place at top of pages only viewed by admin
logged_in_only ();
if (!admin_only ()) {

//code would go here

{



function admin_only () {
    $return = false;
    global $mysql, $username;
    $query = sprintf ("SELECT COUNT(*) FROM user WHERE admin='1'
                       AND username='%s'",
                       $mysql->escape ($username));
    if ($mysql->query ($query)) {
        if (mysql_result ($mysql->result, 0) == "1") {
            $return = true;
        }
    }
    return input_validation ($return);




/*
 * Checks whether the user is logged in.
 * Displays a link to login if not and exit application.
 */
function logged_in_only () {
if (! isset ($_SESSION['logged_in']) || ! $_SESSION['logged_in']) {
global $auth;
$auth->display_login_form ();
require_once (ABSOLUTE_PATH . "footer.php");
}
}




above code taking from another script that I have worked on. the other script had  logins and you set them to 1 for admin.




also on the e-mail script that I posted does anyone know how to make $e-mail = to the e-mail address in the database?


I found out that you can use $email = $_GET["email"]; for the e-mail and it will pull from the database

also found out that you can use
session_start();
include("admin_header.php");
if (checkLoggedin()){
« Last Edit: November 27, 2009, 07:48:17 AM by winracer »
winracer
myfunnypets.com
helpmewithperl.com
coosavalleyclassifieds.com
brownlows.net
myphpforum.com

Offline FireDart

  • Project Leader
  • Pro Member
  • *****
  • Posts: 406
  • Karma: 4
    • View Profile
    • FireDart
Re: [Update/News] PHPDirector V. 0.25 Beta - Released
« Reply #38 on: November 27, 2009, 06:22:40 PM »
Here it is, PHPDirector V. 0.25 Beta.

Fixing the much needed:
• YouTube API Fix
• DailyMotion API Fix
• Google Video API Fix

As well as:
• New Languages: German, Spanish, Czech, Polish, Russian, Italian, Dutch, Portuguese(On top of the English & French Lang's)
• XHTML Transitional Valid Code(Admin Panel not included)

READ! There are 2 installers!
1) PHPDirector-Version_2.5-Beta-Installer.zip
   All Files are included, installer too.

2) PHPDirector-Version_2.5-Beta-Min.zip
   Folders and/or Files:
      lang
      processes
      templates

Which one do I choose?
PHPDirector-Version_2.5-Beta-Installer.zip is a fresh install, while PHPDirector-Version_2.5-Beta-Min.zip is if you have already installed PHPDirector and want to fix the problems listed above.



Now, I believe all you have to do is upload the files to the root and you will be good to go.

Remember this is a Beta file(For a reason). Report any bugs.

-FireDart
« Last Edit: November 27, 2009, 06:25:10 PM by FireDart »

Offline Chris (krissy)

  • Project Leader
  • Sr phpd Member
  • *****
  • Posts: 219
  • Karma: 1000
    • View Profile
    • PHPDirector
Re: [Update/News] Info on V. 0.25 & V. 0.30
« Reply #39 on: November 27, 2009, 11:28:41 PM »
Firedart, upload it to the site officialy and release it all over the site properly  :P Make sure people know how to update and stuff :P


Offline FireDart

  • Project Leader
  • Pro Member
  • *****
  • Posts: 406
  • Karma: 4
    • View Profile
    • FireDart
Re: [Update/News] Info on V. 0.25 & V. 0.30
« Reply #40 on: November 27, 2009, 11:46:02 PM »
I wanted to do a quick Beta to see if it worked. If so I was going to officially upload it to the site.

Offline Shave.

  • Development Team
  • Full phpd Member
  • *******
  • Posts: 80
  • Karma: 0
    • View Profile
    • PHPD Mods
Re: [Update/News] Info on V. 0.25 & V. 0.30
« Reply #41 on: November 28, 2009, 12:24:46 AM »
before you upload it fd you need to change the footer file to say 0.25 instead of 0.22  :)

Offline FireDart

  • Project Leader
  • Pro Member
  • *****
  • Posts: 406
  • Karma: 4
    • View Profile
    • FireDart
Re: [Update/News] Info on V. 0.25 & V. 0.30
« Reply #42 on: November 28, 2009, 03:45:15 AM »
Yah..... That would be a good idea.

----

Uh... Does anyone know how to change the version number in the admin panel?
« Last Edit: November 28, 2009, 03:54:16 AM by FireDart »

Offline Jeff

  • Global Moderator
  • Sr phpd Member
  • *****
  • Posts: 359
  • Karma: 5
  • Need help? Feel free to ask.
    • View Profile
Re: [Update/News] Info on V. 0.25 & V. 0.30
« Reply #43 on: November 28, 2009, 04:10:07 AM »
it is embeded inside the users mysql database (in settings => pp_config)

sorry about the last post... lol
« Last Edit: November 28, 2009, 04:12:47 AM by Jeff »

Offline ruffa

  • phpd Basic Member
  • **
  • Posts: 39
  • Karma: 0
    • View Profile
Re: [Update/News] Info on V. 0.25 & V. 0.30
« Reply #44 on: December 05, 2009, 08:03:27 AM »
has anyone tried this out yet? is it working ok?
I'd like to update but want to check that it's working ok before i do.

In the last version i uploaded about 2 weeks ago, only youtube videos upload properly, google works but with no picture, dailymotion doesn't work at all even using all the new updated files with fixes.

I'd love to see a bulk uploaded function for youtube, so you can simply enter several URLs at a time as it takes ages to upload videos having to type in all the descriptions each time, so the other thing would be to import the descriptions, the titles being most important.