Forum Replies Created

Viewing 15 replies - 61 through 75 (of 274 total)
  • Plugin Author ka2

    (@ka2)

    Thank you very much for reporting. Also I apologize for the inconvenience.

    I will intend to research about your problem asap.

    I am terribly sorry, but please wait for a while.

    Plugin Author ka2

    (@ka2)

    Thank you for your inquiry.

    Please see the below ticket, these should help you out.

    https://wordpress.org/support/topic/column-image-link?replies=6

    Thank you for everything.

    Plugin Author ka2

    (@ka2)

    Please insert all filter hook codes, into the such as “functions.php” at on your theme.

    Thank you,

    Plugin Author ka2

    (@ka2)

    Thank you for your inquiry.

    Firstly, I do not know whether the “FE Users” plugin and “CDBT” can be cooperation successfully because I’ve never used that plugin until now.
    However, this plugin can provide your created custom table to specific users at the front-end.
    I recommend to refer of my reply in the below ticket, that probably is like same of your issue.

    https://wordpress.org/support/topic/how-to-show-only-current-user-records-from-db?replies=5

    It is difficult to be created a new table from the front-end by the specific user, and I do not recommended because it may become the security weakness. But you can be operated the already created table from the front-end to the user.
    That main way to do such, it is to set the specific accessible user role to the table, or it is to do an access restrictions to each users at the filter hook.

    Sorry, an english documents is nothing yet.

    Thank you,

    Plugin Author ka2

    (@ka2)

    In the latest version, it is as follows.

    e.g. shortcode:

    [cdbt-view table="your_created_table"]

    e.g. filter hook (as like “functions.php” in your theme):

    function custom_filter_get_data_sql( $sql, $table_name, $sql_clauses ) {
      if ( ! is_admin() && 'your_created_table' === $table_name ) {
        $_current_user_id = 0; // For guest user
        if ( is_user_logged_in() ) {
          $current_user = wp_get_current_user();
          $_current_user_id = $current_user->ID;
        }
        $_new_sql = <<<SQL
    SELECT %s
    FROM %s
    WHERE user_id=%s
    %s %s
    SQL;
    	$sql = sprintf( $_new_sql, $sql_clauses[0], $table_name, $_current_user_id, $sql_clauses[2], $sql_clauses[3] );
      }
      return $sql;
    }
    add_filter( 'cdbt_crud_get_data_sql', 'custom_filter_get_data_sql', 10, 3 );

    Thank you,

    Plugin Author ka2

    (@ka2)

    Unfortunately, the currently plugin do not have a function as like an autofill of the user ID at the data registration form. That related function is not too.

    The option of “Filters Definition” is for “cdbt-view” shortcode. It is the UI (of the select box) for filtering the displayed data list further. Please note different from the filter hook of wordpress.

    Thank you,

    Plugin Author ka2

    (@ka2)

    I closed this issue because that has resolved.

    Plugin Author ka2

    (@ka2)

    I closed this issue because that has resolved.

    Plugin Author ka2

    (@ka2)

    I closed this issue because that has resolved.

    Plugin Author ka2

    (@ka2)

    When will you change to other theme, is the same trouble occurs?
    Also, is there difference in your themes and plugins in your local environment and the production environment?

    Plugin Author ka2

    (@ka2)

    Thank you for your inquiry.

    To realize your needs, you will need a highly customizable by making full use of the filter hook and JavaScript.

    About “1.”, you will want to trigger the edit button to pick up the click event at JavaScript.

    About needs of “2.”, I think that may be quite difficult to achieve only in the “cdbt-edit” shortcode.

    Both needs also, maybe, the best way will be handling as own components using the plugin builtin methods, rather than the shortcodes.

    Thank you,

    Plugin Author ka2

    (@ka2)

    Thank you for your continued support.

    I can not currently help you because I do not have only a few knowledges of your trouble.

    Is there a difference, such as PHP and WordPress and theme settings in the local environment and the production environment?

    Is it occurring some error (of the php or javascript) at your production environment?

    Sorry to trouble you, please tell me the detailed situation.

    Plugin Author ka2

    (@ka2)

    If the image and the URL is stored in separate columns, please try as following.

    foreach ( $columns as $_i => $_column ) {
      $_custom_column = '';
      switch( $_column['property'] ) {
        case 'book':
          $_custom_column = 'rowData.book_url != "" ? $("<a/>").attr("href",_.unescape(rowData.book_url)).attr("target","_blank").css({display:"block",textAlign:"center"}).html("<img src=\""+_.unescape(rowData.book)+"\" height=\"150\">") : rowData.book';
          break;
        case 'book_url':
          unset( $columns[$_i] );
          break;
      }
      if ( ! empty( $_custom_column ) )
        $columns[$_i]['customColumnRenderer'] = $_custom_column;
    }
    $columns = array_values( $columns );

    Thank you,

    Plugin Author ka2

    (@ka2)

    I have closed this issue because it resolved.

    Plugin Author ka2

    (@ka2)

    Yes, you can.

    The following documents will be a good sample.

    https://ka2.org/cdbt/v2/tutorial/#customize-shortcode

    For example, if the “image_url” column in the “sample” table is stored url of image, it’s as following:

    function my_shortcode_custom_columns( $columns, $shortcode_name, $table ) {
      if ( 'sample' === $table ) {
        foreach ( $columns as $_i => $_column ) {
          $_custom_column = '';
          switch( $_column['property'] ) {
            case 'image_url':
              // Add an image tag with link
              $_custom_column = 'rowData.image_url != "" ? $("<a/>").attr("href",_.unescape(rowData.image_url)).attr("target","_blank").html("<img src=\""+_.unescape(rowData.image_url)+"\">") : "-"';
              break;
          }
          if ( ! empty( $_custom_column ) )
            $columns[$_i]['customColumnRenderer'] = $_custom_column;
        }
      }
      return $columns;
    }
    add_filter( 'cdbt_shortcode_custom_columns', 'my_shortcode_custom_columns', 10, 3 );

    please refer above code and try it.

    Thank you,

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