Link sheet names to profile users ?

Viewing 6 reply threads
  • Author
    Posts
    • #10355
      Arthur Ashes
      Participant

      Hi !

      Before my speach : I really like your plugin (I already ***** rated on wordpress). It is really nice !

      I have some suggestions to the sheet.
      – First, I would like to link name subscribers to their profile. That should imply they are logged in (ok) and the signup form have a hidden field to get the user ID. Then, it would be easy to get their URL profile. (URL of a user profile on wordpress is always reachable with this URL : http://www.domain.com/?author=18

      <?php echo "<a href=\"".get_bloginfo('url')."/?author=";
      echo $author->ID;
      echo "\">"; ?>

      – Secondly, I would like to use sign ups for a quite different usage, and I don’t need to display time / hour. (anyway, I still can hide these columns). But your plugin would be more appreciated if he offers simple features.

      That’s just a suggestion 😉

      See U

    • #10357
      Stephen Sherrard
      Keymaster

      Hi Arthur,

      Thanks for rating the plugin. I appreciate it.

      Regarding your feature requests, #1 is already possible. My plugin already saves the user ID for each signup if the user is logged in when they sign up, or if the admin uses the ajax search feature to sign up other users. But, signups are NOT a custom post type, so there is no author->ID field to get. Instead, you would get the user_id property of the signup object: $signup->user_id

      Using that, along with the filter hook that is already built-into the plugin to allows others to change how volunteer names are displayed, you could add a small code snippet to your child theme’s functions.php file to modify how those names are displayed (by creating your link around the name). Depending on which version of my plugin you are using, you can find the filter hook around line 770 of the class-pta_sus_public.php file. Should look like this:

      
      // hook to allow others to modify how the signed up names are displayed
      $display_signup = apply_filters( 'pta_sus_display_signup_name', $display_signup, $signup );
      

      That filter hook passes you the signup name as it will be displayed ($display_signup), along with the $signup object (from which you can get the user_id).

      Of course, you would probably want to add some conditional code to your function to make sure that there is a user_id that is an integer and greater than 1, and an actual display name first (not an empty string or some other string) before trying to create the link. But, it would be a fairly easy piece of code to do.

      This is not a feature I would add myself because it’s not something we needed for our school, and not everyone who uses this plugins requires people to be signed into a user account before signing up (we did not at our school).

      For #2, I don’t understand what the feature request is? You can add the shortcode argument (which I need to put into the documentation and the shortcode generator) to hide the time columns. Not sure what you mean to make the plugin more simple? The plugin started out MUCH simpler, but then people keep asking for more and more features, and then it starts to get very complex! =) Too late to go back now and start removing features to make things more simple.

      If, however, you mean that you just want a more simple way to display things, there is the calendar extension:
      https://stephensherrardplugins.com/plugins/pta-volunteer-sign-up-sheets-calendar-display/
      Which is VERY customizable on how everything is displayed within your calendar, and also has a template and CSS system built-in to allow you to easily modify and/or replace the templates and CSS used to generate the calendar, so you can make it appear almost anyway that you want (if you are good with templates and CSS).

      But, the main plugin is set up with a LOT of filter and action hooks, as well as public functions & methods that you can access from your own plugins or custom functions, so that if you are decent with PHP and understand the WordPress action/filter hook system, you can create your own custom display of signups in any way that you like.

    • #10359
      Arthur Ashes
      Participant

      Thanks for your quick answer !

      – I finally found a way to get the user profile links on my sheet !
      – I changed the name displayed on some fields.
      – I added some classes to the columns (directly on the plugin file)
      (file class-pta_sus_public.php line 827 to 837, you didn’t add cell classes “column-title”, “column-time” …) Maybe these classes could be added to the next update ?

      Thanks for your help !!! I don’t need your calendar plugin, but I will donate to your plugin and I’ll talk about it 🙂

      I would also volunteer to complete the French translation ! (what is the best way to give you these translations ?)

      PS : I get the last version of the plugin, but the page “ADDONS” can’t be displayed. Maybe it’s just on my website ? I don’t know. But I get these error messages :

      Warning: include(admin-addons-html.php): failed to open stream: No such file or directory in /home/u705467423/public_html/wp-content/plugins/pta-volunteer-sign-up-sheets/classes/class-pta_sus_admin.php on line 1103

      Warning: include(): Failed opening ‘admin-addons-html.php’ for inclusion (include_path=’.:/opt/php-5.5/pear’) in /home/u705467423/public_html/wp-content/plugins/pta-volunteer-sign-up-sheets/classes/class-pta_sus_admin.php on line 1103

    • #10363
      Stephen Sherrard
      Keymaster

      I added some classes to the columns (directly on the plugin file)
      (file class-pta_sus_public.php line 827 to 837, you didn’t add cell classes “column-title”, “column-time” …) Maybe these classes could be added to the next update ?

      Well, if you are needing to target for CSS, you could use things like nth-child to get the column you want. But, if I can remember, I will add some classes to that in the next update.

      I would also volunteer to complete the French translation ! (what is the best way to give you these translations ?)

      There is a French translation already that somebody did a long time ago, but it probably needs to be updated since a lot has changed since that translation. Best way to edit translations is to use PoEdit. If you then have an updated set of French .mo and .po files, please send them to me and I’ll put them into the next update. I have another language translation that someone else did a month of so ago that I haven’t included yet since I have not done any updates since he sent it.

      PS : I get the last version of the plugin, but the page “ADDONS” can’t be displayed. Maybe it’s just on my website ? I don’t know. But I get these error messages :

      Thanks for letting me know… looks like that file is missing from the WordPress repository. Of course, I don’t get that error on my development machine because I have the file here. I must have forgot to select that file and click on “ADD” to have it added to the SVN when I did the last update, so my SVN program skipped uploading it. I’ll make sure to get it in there in the next update. It’s just a page that shows the simple graphics and links to my add-on extensions on my site… nothing that affects the functionality of the plugin in any way.

    • #10436
      Arthur Ashes
      Participant

      So I finally did the whole French translation 🙂 Just tell me where I can sent you the files !

    • #10441
      Stephen Sherrard
      Keymaster

      I will email you privately, then you can just reply with the translations attached.

    • #10647
      Arthur Ashes
      Participant

      Totally forgot to let the the code I used (maybe for next users)

      on the sheet, put a link on user’s name to their own profile page (they need to be logged in)

      function user_planning_link($display_signup, $signup) {
      $display_signup = '<a href=\''.get_bloginfo('url').'/?author='.$signup->user_id.'\' target=\'_blank\'>'.$signup->firstname.' '.$signup->lastname.'</a>';
      return $display_signup;
      }
      add_filter( 'pta_sus_display_signup_name', 'user_planning_link', 10, 2);

      I hope you received the french translation of the plugin.

      ++

Viewing 6 reply threads
  • You must be logged in to reply to this topic.