Page 1 of 3 123 LastLast
Results 1 to 10 of 22
  1. #1
    Join Date
    Jun 2007
    Location
    Orlando, Florida
    Posts
    72
    Plugin Contributions
    0

    Default File Uploader Mod

    i need add a file uploader section. does anyone know how to do this. I need my client to be able to upload their art work.

  2. #2
    Join Date
    Apr 2004
    Location
    UK
    Posts
    5,821
    Plugin Contributions
    2

    Default Re: File Uploader Mod

    File uploads are already integrated into zencart
    i.e.
    http://www.zen-cart.com/forum/showth...hlight=uploads

  3. #3
    Join Date
    Feb 2009
    Posts
    157
    Plugin Contributions
    0

    Default How Do I Determine if Customer is Logged In?

    Hi, I am looking for the correct code to execute the following pseudocode:

    If [Customer Logged In] then
    <Display File Upload Form>
    Else
    <echo 'You must log in first to upload files to us'>
    <echo 'Please log in or register for a new account'>
    End if

    I can fill in the code for the form, but if someone can help me with the conditional if statement in PHP I would appreciate it.

    Second part:
    In the PHP I want to write the entries in the form for which I will execute the "POST_" statement. How do I query the database since the customer is already logged in? Sample statement would be helpful. Basically what I want to do is post name of file, file size, file description, customer ID, date posted to a table I am going to create in the database.

    I want admin notification as soon as new files are uploaded, so how would I execute a sendmail to notify me with information as shown above?

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: How Do I Determine if Customer is Logged In

    The value for:
    $_SESSION['customer_id']

    will be greater than 0 ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Feb 2009
    Posts
    157
    Plugin Contributions
    0

    Default Re: How Do I Determine if Customer is Logged In

    Quote Originally Posted by Ajeh View Post
    The value for:
    $_SESSION['customer_id']

    will be greater than 0 ...
    Now where do I get the example of how to use that?

    Looking for a more complete answer. Trying to figure out how to get it to work on define_page_7.php edited through Notepad++. Don't mean to say that I don't appreciate that, but I keep getting incomplete answers and can't find it in the manual I purchased.

    Basically, my project is an upload page that you have to be logged in to see.

  6. #6
    Join Date
    Feb 2009
    Posts
    157
    Plugin Contributions
    0

    Default Re: File Uploader Mod

    Quote Originally Posted by misty View Post
    File uploads are already integrated into zencart
    i.e.
    http://www.zen-cart.com/forum/showth...hlight=uploads
    Not quite...assumes uploading as a product feature. I am looking for one that uploads witout all that confusing methodology. One I don't have to create a product to get to it, but a page that a developer can upload files for be downloadable.

  7. #7
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: How Do I Determine if Customer is Logged In

    I am not sure what all you need for what you are doing, but the basic format of the IF would be:

    Code:
    if ($_SESSION['customer_id'] == 0) {
      // login stuff here
    } else {
      // do something here
    }
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  8. #8
    Join Date
    Feb 2009
    Posts
    157
    Plugin Contributions
    0

    Default Re: How Do I Determine if Customer is Logged In

    Quote Originally Posted by Ajeh View Post
    I am not sure what all you need for what you are doing, but the basic format of the IF would be:

    Code:
    if ($_SESSION['customer_id'] == 0) {
      // login stuff here
    } else {
      // do something here
    }
    What I am trying to do, is implement my Page_7 as a file uploader where:

    If customer is logged in then:

    DISPLAY UPLOADER FORM HTML

    Else

    ECHO "You must be logged in to upload files."
    Endif

    Still having a hard time figuring out the syntax when you have mixed PHP and XHTML script going.

  9. #9
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: How Do I Determine if Customer is Logged In

    There is a better way ...

    If you add to your header_php.php file for the:
    /includes/modules/pages/page_7.php

    Code:
    if (!$_SESSION['customer_id']) {
      $_SESSION['navigation']->set_snapshot();
      zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
    }
    It will force the customer to be logged in or take them to the login pages and then return to page_7 when done ...

    Look at how the:
    /includes/modules/pages/account/header_php.php

    is doing this, as an example, and how it behaves when logged in or not ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  10. #10
    Join Date
    Feb 2009
    Posts
    157
    Plugin Contributions
    0

    Default Re: How Do I Determine if Customer is Logged In

    Quote Originally Posted by Ajeh View Post
    There is a better way ...

    If you add to your header_php.php file for the:
    /includes/modules/pages/page_7.php

    Code:
    if (!$_SESSION['customer_id']) {
      $_SESSION['navigation']->set_snapshot();
      zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
    }
    It will force the customer to be logged in or take them to the login pages and then return to page_7 when done ...

    Look at how the:
    /includes/modules/pages/account/header_php.php

    is doing this, as an example, and how it behaves when logged in or not ...

    This works. Now, I can't figure out the form action parameter. Below is the line of code I am referring to. How do I get it to refer to the current page without running into the permissions error?

    Code:
    <form action="/define_page_7.php" enctype="multipart/form-data" id="upload" method="post">

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. Thumbnail Preview of file after upload via Attribute File uploader?
    By NWFAP in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 7 Aug 2015, 03:40 AM
  2. File uploader
    By mdivk in forum General Questions
    Replies: 14
    Last Post: 14 Feb 2012, 09:26 PM
  3. File Uploader help needed
    By goodnight in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 29 Jun 2009, 09:27 PM
  4. File Uploader capability?
    By parin123 in forum General Questions
    Replies: 7
    Last Post: 26 Jun 2009, 09:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg