SibSoft Ltd.
Development Services
software products
 RegisterRegister    SearchSearch   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
EZYWebhost - Cheap XUpload & XFileSharing 100% campatible hosting

AJAX upload progress bar

File sharing script
Displaying the email variables with labels

 
Post new topic   Reply to topic    SibSoft Ltd Forum Index -> XUpload
View previous topic :: View next topic  
Author Message
jimrws



Joined: 05 Feb 2008
Posts: 20

PostPosted: Jun 02, 2008 3:00 pm    Post subject: Displaying the email variables with labels Reply with quote

Hi,

Currently in the email template, the 'other form variables' appear together in a big chunk and use the variable name as a label for the value. These other variables just appear from a loop and there's no way to break them up and use them individually.

I'd like to be able to specify these variables and display them next to my own labels, or mix the variables with my own text.

In the past I have done something like this in php quite easily. But I don't know Perl at all so not sure how to do this for Xupload:

Code:

This is how it is at the moment:
<varible name> : <variable value>
<varible name> : <variable value>
<varible name> : <variable value>

This is an example of the kind of thing I need:
"Hello" <variable value> Your address is : <variable value>

In php I would normally use something like:
<?php echo "Hello" .$_POST("Name"). "Your address is" .$_POST("Address"); ?>

How do I do this in Xupload?


Thanks for any help.
Back to top
View user's profile Send private message
PilgrimX182



Joined: 22 Mar 2006
Posts: 1107
Location: Undisclosed location

PostPosted: Jun 03, 2008 10:45 am    Post subject: Reply with quote

What XUpload version?
Back to top
View user's profile Send private message Visit poster's website AIM Address
jimrws



Joined: 05 Feb 2008
Posts: 20

PostPosted: Jun 03, 2008 10:48 am    Post subject: Reply with quote

XUpload Pro 3.0
Back to top
View user's profile Send private message
PilgrimX182



Joined: 22 Mar 2006
Posts: 1107
Location: Undisclosed location

PostPosted: Jun 03, 2008 11:10 am    Post subject: Reply with quote

in upload.cgi find
Code:
$tmpl->param('files'     => \@files,

and add above it:
Code:
my %hh; $hh{$_->{name}}=$_->{value} for @har;


then add below it:
Code:
%hh,



Now you can use in your email template tags like
Code:
<TMPL_VAR ip>

using names of custom variables in tags.
Back to top
View user's profile Send private message Visit poster's website AIM Address
jimrws



Joined: 05 Feb 2008
Posts: 20

PostPosted: Jun 03, 2008 1:27 pm    Post subject: Reply with quote

EDIT: I got it working now. This is the full block of code for anyone interested.

Code:

my @t = &getTime;
   my $tmpl = HTML::Template->new( filename => "Templates/confirm_email.html", die_on_bad_params => 0 );
   my %hh; $hh{$_->{name}}=$_->{value} for @har;
   $tmpl->param('files'     => \@files,%hh,
                'params'    => \@har,
                'time'      => "$t[0]-$t[1]-$t[2] $t[3]:$t[4]:$t[5]",
                'total_size'=> "$ENV{CONTENT_LENGTH} bytes",
                'total_size_mb' => sprintf("%.1f",$ENV{CONTENT_LENGTH}/1048576)." Mb",
               );
   my $subject = $c->{email_subject} || "XUpload: New file(s) uploaded";


Thanks for the help Pilgrim
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SibSoft Ltd Forum Index -> XUpload All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group