Profile Plugin on a CV upload form

wrongjon 15 Oct, 2008
Hi Max/Greyhead

Well Greyhead (BOB) has been very helpful and I now have a file upload form working and it assigns the filename to my community builder field.

AND I BOUGHT A LICENCE TONIGHT _ Wooooohooo its a great product - thanks😀 - I will also rate you highly on Joomla extensions site later today.

Now I'm desperately trying to find out how to:

1) When the form loads (using profile plugin) check this community builder field for a value (eg the upload file-name) and if a value exists then show a link to view this file (doc or pdf) in a new window.

2) Also need and option to delete this file and if they upload a second file to delete the first .... or just don't show the upload file option until they delete file first?

3) Also when upload a new file is there a way to show error or success... I know it shows if too big, too small, wrong file type but will it show an error if the file doesn't reach the server in one piece?

ALSO this is really stumping me...

I know when using the profile plugin i can call field values outside of PHP using {cb_cvresume} but if I use them inside PHP i get a blank form so what variable can I call to pull out fields from community builder table in to my php for checking and logic routing. Then I can check the cv field value and if has value show view and delete file options and is empty show upload file option.

I'm going to have to build a CB reg form next and also member search forms etc so I'm going to be using this heavily so calling these fields is essential...

Thanks guys
Jonathan
Max_admin 15 Oct, 2008
Hi Jonathan,

for #1- we need to do this using PHP, here is a quick code :
<?php $user = JFactory::getUser(); echo $user->id; ?>
<?php
$query = "SELECT * FROM #__comprofiler WHERE userid='".$user->id."'";
$database->setQuery($query);
$userdata = $database->loadObject();
if($userdata->filefieldname){
//show some file viewer here
}
?>

the code above to go in the form HTML, let me know when you test it so we can advance.

Cheers,

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
wrongjon 20 Oct, 2008
Hi Max

OK too me an hour to solve why your code wasn't working🙂

$query = "SELECT * FROM #__comprofiler WHERE userid='".$user->id."'";


Should be [/code]$query = "SELECT * FROM #__comprofiler WHERE user_id='".$user->id."'";[/code] :wink:

So that's all working great - thank you.

So what about the next step...

1) offering a button to link to delete their existing file from the server which will also remove value from field in table
2) When use the upload file check DB for existing value and delete value and file before applying new one..

Users should only have one CV uploaded at any time so need this to keep server tidy.

Thanks so much.
Jonathan
Max_admin 24 Oct, 2008
Hi Jonathan,

I didn't forget about this post but I'm just working on something to do it easier, doing those 2 points with Chronoforms will need a complete new form to handle each process and many code lines to be written, I'm working on a new Connectivity version and hopefully when its ready very soon (this weekend) will make it easier to do those 2 tasks.

Cheers,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
wrongjon 24 Oct, 2008
Thanks Max
Sounds great - have a good weekend 😀

My task today is to build a new form:

List members projects
Next to each project 3 links to view, edit or delete a project
Add project button up top

Can all this be achieved OK with one chronoform using maybe a task parameter?
Max_admin 24 Oct, 2008
this is an exact project to be done with the new Connectivity so don't do this today and keep it for the weekend or Monday because with the new version this will be very easy to do!

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
wrongjon 24 Oct, 2008
OK great.
It can wait until Monday but not long after that as client needs it but all sounds perfect.
Not familiar with your Connectivity product but says on homepage that does admin add/edit/delete tasks.
I need this form/feature to be frontend... that ok?

Confirm that and I'll leave you alone🙂

If you can PM or reply here as soon as its ready Ill buy a licence for that too

Good luck!
Max_admin 24 Oct, 2008
Hi Jon, yes, the new features at the new version is to be able to edit/delete records from the frontend and set permissions for doing this!

Cheers,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.