shadowgr
Forum Replies Created
-
i have not errors
just not display anythingForum: Plugins
In reply to: [Custom DataBase Tables] Column Image Linkthank you 🙂
Forum: Plugins
In reply to: [Custom DataBase Tables] Column Image LinkThere is way to do it as below;
switch( $_column['property'] ) { case 'league': // Add an image tag with link $_custom_column = 'rowData.league_url != "" ? $("<a/>").attr("href",_.unescape(rowData.league_url)).attr("target","_blank").text(_.unescape(rowData.league)) : rowData.league'; break; case 'match': // Add an image tag with link $_custom_column = 'rowData.match_url != "" ? $("<a/>").attr("href",_.unescape(rowData.match_url)).attr("target","_blank").text(_.unescape(rowData.match)) : rowData.match'; break; case 'book':Forum: Plugins
In reply to: [Custom DataBase Tables] sql queries count(id)Forum: Plugins
In reply to: [Custom DataBase Tables] sql queries count(id)Forum: Plugins
In reply to: [Custom DataBase Tables] sql queries count(id)if( ! is_admin()): function wp_tips_get_data_sql( $sql, $table_name, $sql_clauses ) { if ('wp_tips' === $table_name ) { $_overwrite_sql = <<< SQL SELECT count(id) AS BETS, Sum(IF(win_loss = 'win', 1, 0)) As Wins, Sum(IF(win_loss = 'loss', 1, 0)) As Looses, Sum(IF(win_loss = 'void',1, 0)) AS Void FROM %s ; SQL; $sql = sprintf( $_overwrite_sql, $table_name ); } return $sql; } add_filter( 'cdbt_crud_get_data_sql', 'wp_tips_get_data_sql', 10, 3 ); function wp_tips_shortcode_custom_columns( $columns, $shortcode_name, $table ){ if ( 'cdbt-view' === $shortcode_name && 'wp_tips' === $table ) { $columns = []; $columns[] = [ 'label' => 'BETS', 'property' => 'BETS', 'sortable' => false, 'sortDirection' => 'asc', 'dataNumric' => true, 'truncateStrings' => '0', 'className' => '', ]; $columns[] = [ 'label' => 'Wins', 'property' => 'Wins', 'sortable' => false, 'sortDirection' => 'asc', 'dataNumric' => true, 'truncateStrings' => '0', 'className' => '', ]; $columns[] = [ 'label' => 'Looses', 'property' => 'Looses', 'sortable' => false, 'sortDirection' => 'asc', 'dataNumric' => true, 'truncateStrings' => '0', 'className' => '', ]; $columns[] = [ 'label' => 'Void', 'property' => 'Void', 'sortable' => false, 'sortDirection' => 'asc', 'dataNumric' => true, 'truncateStrings' => '0', 'className' => '', ]; } return $columns; } add_filter( 'cdbt_shortcode_custom_columns', 'wp_tips_shortcode_custom_columns', 10, 3 ); endif;Forum: Plugins
In reply to: [Custom DataBase Tables] sql queries count(id)i did it but still i cant display my |date,time,league,match,tip,odds,book,win_loss| 🙁
check my test pageForum: Plugins
In reply to: [Custom DataBase Tables] sql queries count(id)you were right 🙂
Talbe with betsbut now how can i display data from my table ..when i go to make a new shortcode my data has lost..
Table with code in functions.php
Beforecan you understand what I mean?
Thank you!
Forum: Plugins
In reply to: [Custom DataBase Tables] sql queries count(id)my backoffice table in wordpress w/o code in fuctions.php
my backoffice table in wordpress after codei cant display data like this
[cdbt-view table=”wp_tips” order_cols=”date,time,league,match,tip,odds,book,win_loss”]
cause if i have write code in functions.php my data in wp_tips has gone and BETS/WINS/LOSS/VOID had 0 columns to count :/
Thanks for You help!
sorry for being annoying.Forum: Plugins
In reply to: [Custom DataBase Tables] sql queries count(id)Forum: Plugins
In reply to: [Custom DataBase Tables] sql queries count(id)sir can i add you on skype? or can you give me your email?
Forum: Plugins
In reply to: [Custom DataBase Tables] sql queries count(id)Forum: Plugins
In reply to: [Custom DataBase Tables] sql queries count(id)Parse error: syntax error, unexpected ‘{‘
here:
if ( get_post()->ID === {Displayed Post ID} && 'bc_tips' === $table_name ) {i m trying your code to understand how this works
but i have this error and all brackets its ok…*UPDATE
i placed a semicolon here$_overwrite_sql = <<< SQL;
but i have the same error
Forum: Plugins
In reply to: [Custom DataBase Tables] display data from different tables with queriesthanks this was very helpful 🙂