Forum Replies Created

Viewing 15 posts - 31 through 45 (of 113 total)
  • Author
    Posts
  • in reply to: New Conditional Bug… YAAAY! #2193
    Marcus
    Member

    Hi Kattagami.

    Did you make sure to reference the outside group name inside your conditional?
    I posted an example of a problem I had earlier, that turned out I had just forgotten. 🙂

    So for your line:
    'field' => 'katt_schedule_choice',
    It should read:
    'field' => 'katt_schedule_group:katt_schedule_choice',

    Does that make it work?

    Marcus

    in reply to: New Conditional Bug… YAAAY! #2189
    Marcus
    Member

    Thanks Kevin.

    Nice one Jason. Broke it real good. 🙂

    Marcus

    in reply to: Named Groups #2168
    Marcus
    Member

    My bad, close this ticket.

    I forgot, since its inside a named group, I use the ‘:’ to access the named group, then the inside field.
    So this worked perfectly:

    
    
    piklist('field', array (
    	'type' => 'group'
    	,'field' => 'mae_merch_pay_frfro'
    	,'label' => 'Fees and Misc'
    	,'conditions' => array(
    		array(
    			'field' => 'mae_merch_pay_status'
    			,'value' => 'camps-refund'
    		)
    	)
    	,'fields' => array (
    		array (
    			'type' => 'text'
    			,'label' => 'Fees'
    			,'field' => 'mae_merch_pay_rfees'
    			,'columns' => 3
    			,'value' => ''
    		)
    		,array (
    			'type' => 'text'
    			,'label' => 'Other Reason'
    			,'field' => 'mae_merch_pay_rfro'
    			,'columns' => 9
    			,'value' => ''
    			,'conditions' => array(
    				array(
    					'field' => 'mae_merch_pay_ri:mae_merch_pay_rfr'
    					,'value' => 'other'
    				)
    			)
    		)
    	)
    ));
    

    ‘field’ => ‘mae_merch_pay_ri:mae_merch_pay_rfr’
    Works perfectly. Sorry guys.

    Marcus

    in reply to: Html validation not working #2165
    Marcus
    Member

    I really don’t think html validation is important. Only the ability to create your own callbacks and regex yourself.
    After all trying to support all the possible ways to validate would be a waste of your collective time and brain power.
    The usa uses zipcode, we use postal, phones validate differently internationally, etc. Only the basics are needed.
    Email, url, Text, Numeric, Alphanumeric, these are standard the world over.
    The rest should be left up to the community as maybe a plugin or addon we can create and upload to a central location for the communities use.

    I’ve even had to create validation that checks for Chinese characters and reminds the user to enter in english only, as its legally binding. 🙂
    Wouldn’t want to see you guys have to create stuff like that. Your plugins are a much better use of time. 🙂

    Marcus

    in reply to: Autosum field? #1618
    Marcus
    Member

    Adam, you can still use the code I provided, but just change one small line:

    $('#_post_meta_calcme_*').each
    

    So the format for hardcoded fields, is similar. #_post_meta_ tells the each statement that you want, the ids ‘#’ that start with ‘_post_meta_’ (as this is what piklist prenames the ids) then just add in your field name. ‘calcme_*’ (which means fields that start with calcme_)

    So for your hardcoded ones, just separate the different fields, with a comma ‘,’ such as:

    $('#_post_meta_trams,#_post_meta_gondolas,#_post_meta_hs_sixpack').each
    

    Then the final total line from:

    $('#_post_meta_finalcalc_*').val(total);
    

    to

    $('#_post_meta_total_lifts').val(total);
    

    Marcus

    in reply to: Displaying post meta from advanced add_more grouped fields #1610
    Marcus
    Member

    And this is why I love it when Steve or Kevin post. LOL

    Marcus

    in reply to: Piklist About & Settings Pages do not Display #1607
    Marcus
    Member
    in reply to: Displaying post meta from advanced add_more grouped fields #1606
    Marcus
    Member

    I haven’t used ADD-MORE’s within a grouped field structure yet. (what I mean by that, is I create simple groups, where the group has no field name, and all the fields within are then just arrays)

    So how I do it is let’s say I have the following:

    piklist('field', array(
    	'type' => 'group'
    	,'add_more' => true
    	,'label' => 'Week Bookings'
    	,'description' => 'Here you can book each week individually, including days off'
    	,'fields' => array (
    		array (
    			'type' => 'select'
    			,'field' => 'mae_sched_choose_week'
    			,'label' => 'Week'
    			,'columns' => 6
    			, 'choices' => piklist(
    				$wpdb->get_results("SELECT 
    				w.ID AS weekID, CONCAT('Week ',w.menu_order, ' (',REPLACE(wc1.meta_value,', ".$weekyear."',''),' - ',wc2.meta_value,')') AS weekTitle 
    				FROM {$wpdb->prefix}posts w
    				LEFT JOIN {$wpdb->prefix}posts wp ON wp.post_title='".$weekyear."' AND wp.post_type=w.post_type
    				LEFT JOIN {$wpdb->prefix}postmeta wc1 ON w.ID = wc1.post_id AND wc1.meta_key='mae_wks_start_week'
    				LEFT JOIN {$wpdb->prefix}postmeta wc2 ON w.ID = wc2.post_id AND wc2.meta_key='mae_wks_end_week'
    				WHERE w.post_parent = wp.ID AND w.post_type='weeks'
    				ORDER BY w.menu_order"), array("weekID","weekTitle")
    			)
    			,'on_post_status' => array(
    			  'value' => 'publish'
    			)
    		)
    		,array (
    			'type' => 'text'
    			,'field' => 'mae_sched_days_on'
    			,'label' => 'Days of Camp'
    			,'columns' => 6
    			,'value' => 'mon,tue,wed,thu,fri'
    			,'on_post_status' => array(
    			  'value' => 'publish'
    			)
    		)
    	)
    ));
    

    Notice there is no field name on the group level.
    But there is on the child levels.

    So I can retrieve the information quite simply by:

    get_post_meta($postid, 'mae_sched_choose_week', false);
    get_post_meta($postid, 'mae_sched_days_on', false);

    This returns an array of the first and second fields within my add more.

    You should be able to do the same with yours, provided its in post meta.
    You would grab the parent group field, which would contain all the arrays for the add_mores below it in just one get.
    get_post_meta($postid, 'pricing_tier_group', false);

    Would get all the arrays associated with that group.

    Hope this helps.

    Marcus

    in reply to: Piklist About & Settings Pages do not Display #1603
    Marcus
    Member

    Try changing lines 208-211 to this:

    $spt = (isset(self::$paths[$_theme]))?self::$paths[$_theme]:null;
    if (isset($spt))
    {
      $spt = substr($spt,0,strlen($spt)-8); // EDITED BY MARCUS
    

    Marcus

    in reply to: Piklist About & Settings Pages do not Display #1602
    Marcus
    Member

    It makes me wonder about your folder structure…

    Mine is:
    themename/piklist/parts/etc…

    Is that the same structure?

    Also, I’m not using a child theme.

    Marcus

    in reply to: Piklist About & Settings Pages do not Display #1584
    Marcus
    Member

    Hey CJ, take a look at this gist:
    https://gist.github.com/marcuseby/9676104

    It’s what I’ve done with my piklist class file to get it working on windows 7/wamp.

    Specifically, check the pathing changes, and the render function which was where I was getting all my errors and where you are too.

    It’s 0.9.3 but it’ll give you an idea of what to change for your template, and parts pathing.

    Hope this helps.

    If you have a program such as Beyond Compare, you’ll be able to see the changes quite easily and make the adjustments you need too.

    Marcus

    in reply to: Using the piklist function, an array question… #1574
    Marcus
    Member

    Wow, decided to take a hack at making this idea work. So in class-piklist.php in the includes directory of piklist, I changed these lines: (around the 20th line after the piklist function starts)

    
    $_value = $arguments[1];
    $list[$_key] = is_object($value) ? $value->$_value : $value[$_value];
    

    to this:

    
    if (is_array($arguments[1])) {
      $tmpp = '';
      foreach($arguments[1] AS $pk=>$pval) {
        if ((is_object($value) && isset($value->$pval)) || (is_array($value) && isset($value[$pval]))) {
          $tmpp .= is_object($value) ? $value->$pval : $value[$pval];
        } else {
          $tmpp .= $pval;
        }
      }
      $list[$_key] = $tmpp;
    } else {
      $_value = $arguments[1];
      $list[$_key] = is_object($value) ? $value->$_value : $value[$_value];
    }
    

    which allows me to make an array of the secondary value in the piklist array argument, such as this:

    
    ,array(
     'ID'
     ,array('user_login',' - (','display_name',')')
    )
    

    And the result is option text that is more readable and flexible, inside my dropdown EG:

    super_admin – (Marcus Eby)
    bobjay – (Robert Jay)
    etc…

    The ideas are limitless with piklist.
    Thanks.

    Marcus

    in reply to: Where is the Features? #1526
    Marcus
    Member

    So like a week?

    LOL

    M.

    in reply to: Autosum field? #1525
    Marcus
    Member

    You are far too kind and you get a massive reprieve for being a javascript god yourself, because your a dad. <grin>

    Hope you get to spend some time with jquery, you’ll love the api.

    Trust me, when I say, that Kevin is the guru of JS, I’m more like an old fart who likes to know a few things.

    Marcus

    in reply to: Autosum field? #1519
    Marcus
    Member

    I also forgot, jquery allows meta characters, so you could also use:

    jQuery(document).ready(function($){
    	calcMe = function () {
    		var total=0;
    		$('#_post_meta_calcme_*').each(function (e) {
    			var cur = $(this);
    			total += ($.trim(cur.val())=='')?0:parseInt(cur.val());
    		});
    		$('#_post_meta_finalcalc_*').val(total);
    	}
    });
    

    If you wanted to catch selects, and textareas too. (although why would you) 🙂

    Marcus

Viewing 15 posts - 31 through 45 (of 113 total)