supernova42
Forum Replies Created
-
Forum: Plugins
In reply to: [Participants Database] get more data$data[‘all_data’]=$all_data;
Forum: Plugins
In reply to: [Participants Database] get more dataYou can output it using the shortcode
[pdb_list fields=”all_data,other fields etc”]
Forum: Plugins
In reply to: [Participants Database] get more dataYou don’t need anything in the default value. Leave it empty,
Forum: Plugins
In reply to: [Participants Database] get more dataThere are a few small errors such as $data for the array.
also you create the field in pdb ‘Manage Database Fields’Forum: Plugins
In reply to: [Participants Database] get more dataFor the attribute for that field you could add
data-after::,
Which would display a comma.
However that only applies to the display of that fieldTo put all the data in one field you could do something like…
First create a field in pdp called ‘all_data’ or something like that.
Then write some php. Download a php snippet plugin.<?php // Get all your required fields from WP $wp_user_id = get_current_user_id(); $current_user = wp_get_current_user(); $wp_username = $current_user->user_login; $wp_email = $current_user->user_email; $wp_firstname = $current_user->user_firstname; $wp_lastname = $current_user->user_lastname; $pdb_id=Participants_Db::get_record_id_by_term('username',$wp_username); //Now combine the data (Concatenate) $all_data=$wp_firstname.' '.$wp_lastname.', '.$wp_email.', '.$wp_user_id // This will display something like // Joseph Campbell, [email protected], 192 //Now write the data to pdb data['all_data']=$all_data; $data = array(); Participants_Db::write_participant($data,$pdb_id); ?>
You can then display this on the front end using
echo $all_data;Forum: Plugins
In reply to: [Participants Database] get more dataYou could always get them separately and concatenate them.
Forum: Plugins
In reply to: [Participants Database] Image Categories based on Users NameOkay thank you
Forum: Plugins
In reply to: [Participants Database] Auto Filter List on Log-InThe easiest way to get a little php into your site is to use a ‘php snippet’ plugin. I use Woody Ad.
Basically you put your php into a thing called a snippet and access it with a shortcode.
As I see it, to get the best out of WordPress you need to have some knowledge of css and a little php. I’ve put an example below…
<?php // Get the name of the current logged in user from WP $current_user=wp_get_current_user(); $wp_username=$current_user->user_login; // Get the current user id from pdb $pdb_id=Participants_Db::get_record_id_by_term('username',$wp_username); // Get the users data from pdb which is in an array $data=Participants_Db::get_participant($pdb_id); // Get the names from the $data array //'first_name' and 'last_name' would be defined fields within pdb $first_name=$data['first_name']; $last_name=$data['last_name']; ?>
Of course you can also write to the PDB and you can include shortcodes within php.
Forum: Plugins
In reply to: [Participants Database] Different EventsIn ‘Manage Database Fields’ there are many field definitions. Would it be possible to include an array() definition?
Forum: Plugins
In reply to: [Participants Database] Max Image upload for different usersMeant to close it
Forum: Plugins
In reply to: [Participants Database] Max Image upload for different usersWonderful, works a treat. I can now set different file upload levels for users.
Many Thanks
Forum: Plugins
In reply to: [Participants Database] Max Image upload for different usersChanged that to a single = sign but still doesn’t work.
function change_max_files($files) { $files='7'; return $files; } add_filter('pdb-photo_library_maxfiles','change_max_files');
Forum: Plugins
In reply to: [Participants Database] Max Image upload for different usersI have a field called ‘photo_library’ which is defined as a ‘Multi Image Upload’.
I have set my default value of maximum files to upload as 5.This is my function, but it doesn’t work. It won’t let me upload more than 5 files.
// filter hook - pdb-photo_library_maxfiles function change_max_files($files) { $files=='7'; return $files; } add_filter('pdb-photo_library_maxfiles','change_max_files');
Many thanks
Forum: Plugins
In reply to: [Participants Database] Auto Filter List on Log-InSomething like the following would work
This is how you would pick up the user_id. I’ve also shown how you can get the name and email etc from the WP backend.
$current_user= wp_get_current_user();
$wp_username = $current_user->user_login;
$wp_firstname= $current_user->user_firstname;
$wp_lastname = $current_user->user_lastname;
$wp_email = $current_user->user_email;$user_id = Participants_Db::get_record_id_by_term(‘username’,$wp_username);
$data = Participants_Db::get_participant($user_id);
// You can access the users info in the $data arrayNow that you have the user_id you can output the data for that user, using several shortcode options. I’ve shown one below.
[pdb_record fields=”etc,etc”,record_id=$user_id]
Hope that helps…
Forum: Plugins
In reply to: [Participants Database] Image Categories based on Users NameI need all images to be seen by all users.
My enquiry is about the files in the Media Library. I’m able to create Categories in the Media Library based on each users name etc.
What I need to do now is assign that users Category name to each of the images he uploads. By doing that I can look at just the images for each user by selecting their category name.
Thanks