Forum Replies Created

Viewing 15 replies - 61 through 75 (of 120 total)
  • Thread Starter netzgestaltung

    (@netzgestaltung)

    like avg, total and rating count
    when a new comment is posted post meta value is updated but. when I delete the comment it is again updated post meta but the value increases not downgrade

    i think that the behaviour you are describing ist OK when the comment you have deleted had low stars.

    the new values are then being calculated on the rest of the approved comments because it only gets data from them.

    maybe its questionable if all ever given stars should be kept but i thought it should only represent whats in the database right now.

    if you like to keep the number of all ever posted comments (why deletion?) then you need another post_meta field that gets counted up whenever a comment gets postet

    for more sort options one also will need more fields to store the data in

    Thread Starter netzgestaltung

    (@netzgestaltung)

    hi, i will look into it tomorrow and post an update.

    i took the calculation from the original shortcode, but maybe i put a bug into it.

    Thread Starter netzgestaltung

    (@netzgestaltung)

    i did place it in my themes function.php but you can add it to any file that gets included inside a theme or customizations plugin as well.

    i dont think so.

    since i have a client with it i start now to custumize it on my own:
    https://github.com/netzgestaltung/alpha-downloads/issues?utf8=%E2%9C%93&q=

    i also looked around and there are several forks on github:
    https://github.com/netzgestaltung/alpha-downloads/network/members

    i personally never did write a plugin on my own AND published it on WPs plugin directory so i dont know if i will get it to be an “update”

    kind regards
    tom

    hi there,

    i wrote a quick fix for this problem – targeting only Really Simple CAPTCHA in CF7 Smart Grid Design Extension: https://www.ads-software.com/support/topic/really-simple-captcha-does-not-validate/

    kind regards
    tom

    Plugin Contributor netzgestaltung

    (@netzgestaltung)

    Plugin Contributor netzgestaltung

    (@netzgestaltung)

    Keep in mind that you won’t be able to have responsive forms or columns/rows grid layout as the plugin needs to format the html to do this out of the box.You’ll need to write your own css to style your forms as such…which the plugin allows you to do (see the faq on how to customise your form)

    thats what my business is about ?? – surely responsive and styled. that also causes usually conflicts with grid systems and pagebuilders. Your Grid html output ist better then others i have seen, but my class system differs from that.

    i first need to finish my form – maybe i can write the part on the next weekend

    greets
    tom

    Plugin Contributor netzgestaltung

    (@netzgestaltung)

    Hi,

    i am used to write my own HTML from scratch and the Form disables the “Grid” tab then automatically.

    maybe the usage of the select2 plugin or the jquery nice select could be seperated from the “Grid” feature because that button works also for the “Text” tab.

    That would be an enhancement/feature request.

    in my case i will use the jquery plugin in my template where i can put them collected in a “jquery-plugins.js” file an only have one file request.

    kind regards
    tom

    Plugin Contributor netzgestaltung

    (@netzgestaltung)

    OK After thinking about whats going on it and trying to make a fresh new form i see that “Grid” tab which is not there with my own html.

    So one needs to use the “Grid” to get a “_cf7sg_managed_form”

    so my solution will be either to use the grid or to enqueue the specific js/css files in my template.

    Plugin Contributor netzgestaltung

    (@netzgestaltung)

    After debugging deeper the filter hook returns the output before it enqueues the scripts at /public/class-cf7-grid-layout-public.php line 265

    
        /**
        * @since 1.2.3 disable cf7sg styling/js for non-cf7sg forms.
        */
        $is_form = get_post_meta($cf7_id, '_cf7sg_managed_form', true);
        if(''===$is_form || !$is_form){
          wp_enqueue_style('contact-form-7'); //default cf7 plugin css.
          return $output;
        }
    

    maybe this helps to find my mistake

    Thread Starter netzgestaltung

    (@netzgestaltung)

    here is some final translation system for post type description, labels->name and labels->singular_name

    <?php 
    
    // theme setup
    add_action( 'after_setup_theme', 'myTheme_setup_theme' );
    
    function myTheme_setup_theme() {
      // translate polylang strings
      add_action('admin_init', 'myTheme_string_translations');
      // translate post type descriptions
      add_filter('get_the_post_type_description', 'myTheme_post_type_description', 10, 2);
      // translate post type labels
      $post_types = get_post_types(array(
        'public'   => true,
        '_builtin' => false,
      ), 'objects');
      foreach ( $post_types as $post_type ) {
        add_filter( 'post_type_labels_' . $post_type->name, 'myTheme_post_type_labels');
      }
    }
    
    // translate post type descriptions
    function myTheme_post_type_description($description, $post_type_obj){
      if ( function_exists('pll__') ) {
        // dont edit de, keeping one textfield
        if ( pll_current_language() !== 'de' ) {
          $translation = pll__($post_type_obj->name . '-description');
          if ( !empty($translation) && $translation !== $post_type_obj->name . '-description') {
            $description = $translation;
          }
        }
      }
      return $description;
    }
    
    // translate post type labels
    function myTheme_post_type_labels($labels){
      if ( function_exists('pll__') ) {
        // dont edit de, keeping one textfield
        if ( pll_current_language() !== 'de' ) {
          $name = pll__($labels->name . '-label-name');
          if ( !empty($name) && $name !== $labels->name . '-label-name' ) {
            $labels->name = $name;
          }
          $singular_name = pll__($labels->singular_name . '-label-singular_name');
          if ( !empty($singular_name) && $singular_name !== $labels->singular_name . '-label-singular_name' ) {
            $labels->singular_name = $singular_name;
          }
        }
      }
      return $labels;
    }
    // translate polylang strings
    function myTheme_string_translations(){
      // use identifier
      $strings = array(
        'mystring',
        'yourstring',
      );
      $post_types = get_post_types(array(
        'public'   => true,
        '_builtin' => false,
      ), 'objects');
      foreach ( $post_types as $post_type ) {
        $strings[] = $post_type->name . '-description';
        $strings[] = $post_type->labels->name . '-label-name';
        $strings[] = $post_type->labels->singular_name . '-label-singular_name';
      }
      if ( function_exists('pll_register_string') ) {
        foreach ( $strings as $string ) {
          pll_register_string('myTheme', $string, 'theme');
        }
      }
    }
    ?>
    Thread Starter netzgestaltung

    (@netzgestaltung)

    I tested the above code now and it works but one need to add the second parameter to add_filter – HTML seems not realy possible in the string translation fields

    
    add_filter( 'get_the_post_type_description', 'myTheme_post_type_description', 10, 2);
    
    Thread Starter netzgestaltung

    (@netzgestaltung)

    thank you for clearifying!

    Hi all,

    thank you for the solution provided here.

    What i still don’t know is what the zemanta ping is good for (and it seems to be down), so i decided to leave this part out completely.

    Solution for me was:

    
    /*
    function se_post_publish_ping($post_id) {
    	//should happen only on first publish
    	$status = false;
    	if( !empty( $_POST['post_status'] ) && ( $_POST['post_status'] == 'publish' ) && ( $_POST['original_post_status'] != 'publish' ) ) {
    		$permalink = get_permalink($post_id);
    		$zemanta_response = se_api(array(
    			'method' => 'zemanta.post_published_ping',
    			'current_url' => $permalink,
    			'post_url' => $permalink,
    			'post_rid' => '',
    			'interface' => 'wordpress-se',
    			'deployment' => 'search-everything',
    			'format' => 'json'
    		));
    	  $response = json_decode($zemanta_response['body']);
    		if (isset($response->status) && !is_wp_error($zemanta_response)) {
    			$status = $response->status;
    		}
    	}
    	return $status;
    }
    
    add_action( 'publish_post', 'se_post_publish_ping' );
    */
    

    i also like to keep it here so i can reference this thread in the copied/renamed plugin

    
    /*
    Plugin Name: Search Everything - Bugfix Error 500 on Publishing Posts
    Plugin URI: https://www.ads-software.com/support/topic/solution-resolve-the-500-server-error-when-publishing-new-posts/
    Description: [Netzgestaltung 2019-01-22] includes Bugfix from https://www.ads-software.com/support/topic/solution-resolve-the-500-server-error-when-publishing-new-posts/
    Version: 8.1.9
    Author: Sovrn, zemanta
    Author URI: https://www.sovrn.com
    */
    

    maybe its possible to append the menu item to the bottom of the root as other plugins do so a possible custom menu order wont get much affected.

    how can i disable the new “Gallery” post type?

    Ah – found it at Lightbox -> Builder -> and decheck “Enable advanced gallery builder”

    i also looked up the post_type name: rl_gallery – just in case to check possible naming confilcts here.

    I will discover the new features on a test instance later.

    anyways – the plugin runs fine since years!

Viewing 15 replies - 61 through 75 (of 120 total)