Forum Replies Created

Viewing 15 replies - 151 through 165 (of 191 total)
  • Thread Starter supernova42

    (@supernova42)

    Using the shortcode you showed me which was

    echo do_shortcode(‘[pdb_list filter=”group_1=’.$activity.’|group_2=’.$activity.’|group_3=’.$activity.’|group_4=’.$activity.’|group_5=’.$activity.’” fields=”first_name,last_name]’);

    I can list all the members who have subscribed for say darts in any of the 5 groups.

    I can do a mockup of this by adding $activity=”Darts”; before the shortcode – but of course I need to select the activity from the front end so I have added a drop down menu as…

    [insert_php]
    $activity=array(“Anthropology”,”Armchair Travel”,”Darts” etc etc “);
    echo ‘<select name=”myactivity”>’;
    for ($i=0; $i<count($activity); $i++)
    {echo ‘<option value=$activity[$i]>’ . $activity[$i] . ‘</option>’;}
    echo ‘</select>’;
    [/insert_php]

    The drop down menu is loaded from the array with almost 100 activities. All is great but how do I get the value that has been selected from the drop down menu into the shortcode.

    I’ve been on this for ages using $_GET and $_POST etc but with no luck.

    Do you think you might give me a few pointers.

    Many Thanks

    Thread Starter supernova42

    (@supernova42)

    I’ve got it working now. I think I might have had an extra space somewhere which was rather odd. I did initially put the code inside an AddOn which I use for all my filters and extra code etc, so I guess it was inside WordPress. Would that be a better option rather than use php plugins? It’s just that I’ve read that some php plugins can leave the site open to hacking. However, if is was inside my AddOn I’m not sure how I would use it.

    The only problem I have at the moment is searching for activities which have a space(s). It finds ‘Backgammon’, ‘Darts’ ok but looking for ‘Creative Writing’ brings up the whole list. Any thoughts how I get ’round this?

    I’ve been reading your blog etc which I must say is rather interesting…

    Many Thanks

    Thread Starter supernova42

    (@supernova42)

    Hi Roland

    Thank you for your help it is much appreciated.
    I created a file called testlist.php
    You can see it here https://u3aswansea.co.uk/testlist.php

    This is the code for my file
    <?php
    echo “Hello, World!”;
    $activity=”Backgammon”;
    echo $activity;
    echo do_shortcode(‘[pdb_list orderby=last_name filter=”group_1=’.$activity.’|group_2=’.$activity.’|group_3=’.$activity.’|group_4=’.$activity.’|group_5=’.$activity.’” fields=”first_name, last_name,group_1,group_2,group_3,group_4,group_5″]’);
    ?>

    This is the output I got.

    Hello, World!Backgammon
    Fatal error: Uncaught Error: Call to undefined function do_shortcode() in /home/najad136/public_html/u3aswansea.co.uk/testlist.php:5 Stack trace: #0 {main} thrown in /home/najad136/public_html/u3aswansea.co.uk/testlist.php on line 5

    I thought I would try this mock up before moving on but unfortunately it doesn’t work for me. Can you give me some pointers please.

    Many Thanks

    PS
    I did initially try a php code plugin but that didn’t work either and that’s why I thought I would try this mockup.

    Thread Starter supernova42

    (@supernova42)

    I have previously created a list of members with a ‘Single Record Link’ that takes the user to a specific record for viewing and it works fine.

    However what I want to do know is for the user to just view their own single record. I can view the record with [pdb_single record_id=152] but I want to replace the record_id with a parameter so that all users can see their own individual records.

    I imported all my data into Participants Database and not sure if that might be causing a proble.

    Thanks

    Thread Starter supernova42

    (@supernova42)

    This is my shortcode

    [pdb_list orderby=last_name filter=”group_1=Backgammon|group_2=Backgammon|group_3=Backgammon|group_4=Backgammon|group_5=Backgammon” fields=”first_name, last_name,group_1,group_2,group_3,group_4,group_5″]

    To save me repeating this shortcode lots of times for all the activities I have available (I have 100 activities by the way) can I use a variable in place of where I have Backgammon and pass an Activity to that variable within the shortcode from a drop-down menu on the front end.

    Thanks

    Thread Starter supernova42

    (@supernova42)

    Got it. I left a space either side of the piping command.
    Thanks

    Thread Starter supernova42

    (@supernova42)

    By the way I am selecting my activity from a drop-down list

    Thread Starter supernova42

    (@supernova42)

    Success. After a bit of a slog I have done it. I needed to create a template. I can now list all my records on the front end and view the individual records and edit any field of a selected record. I can set fields to read only so that they can be edited. Total control.
    Thanks

    Thread Starter supernova42

    (@supernova42)

    I have made 6 drop down lists with my 100 Activities in each drop down list. It works very well, is fast and I can go straight to an activity of say ‘Tennis’by pressing ‘T’

    I guess this sort of sorts my problem out, even although I have to go to the backend to update the activities.

    Thank you

    Thread Starter supernova42

    (@supernova42)

    Okay that sounds great.
    I await the plugin with great enthusiasm
    Would it be cheeky to ask what release date you have in mind
    Thank you

    Thread Starter supernova42

    (@supernova42)

    Question asked in another thread
    Thank you

    Thread Starter supernova42

    (@supernova42)

    Question asked in another thread
    Thank you

    Thread Starter supernova42

    (@supernova42)

    Thank you

    Thread Starter supernova42

    (@supernova42)

    Solved in other thread
    Thank you

    Thread Starter supernova42

    (@supernova42)

    Thanks for that works a treat.
    Really pleased with the result
    Many Thanks

Viewing 15 replies - 151 through 165 (of 191 total)