Changeset 1408030
- Timestamp:
- 04/30/2016 11:15:48 AM (10 years ago)
- Location:
- pl-car-dealer/trunk
- Files:
-
- 4 edited
-
PL-car-dealer.php (modified) (6 diffs)
-
README.txt (modified) (2 diffs)
-
languages/cde_pgl-it_IT.mo (modified) (previous)
-
languages/cde_pgl-it_IT.po (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pl-car-dealer/trunk/PL-car-dealer.php
r1404810 r1408030 4 4 Plugin URI: https://wordpress.org/plugins/pl-car-dealer/ 5 5 Description: Car dealer custom plugin 6 Version: 1. 26 Version: 1.3 7 7 Author: Roberto Bruno 8 8 Author URI: http://www.pigrecolab.com … … 203 203 'price' => __( 'Price', 'cde_pgl' ), 204 204 'year' => __( 'Year', 'cde_pgl' ), 205 'mileage' => __( 'Mileage', 'cde_pgl' ) 205 'mileage' => __( 'Mileage', 'cde_pgl' ), 206 'featured' => __( 'Featured', 'cde_pgl' ) 207 206 208 207 209 ); … … 274 276 echo the_post_thumbnail( array(80,80) ); 275 277 278 break; 279 280 case 'featured' : 281 $feat= get_post_meta( $post_id, $prefix.'featured', true ); 282 //echo var_dump($feat); 283 echo ($feat==0) ? '<span class="dashicons dashicons-star-empty pb" pid="'.$post_id.'"></span>' : '<span class="dashicons dashicons-star-filled pb" pid="'.$post_id.'"></span>'; 276 284 break; 277 285 … … 284 292 } 285 293 294 /****** VEHICLE FEATURED CHANGE STATUS ****/ 295 296 global $pagenow,$typenow; //&& $typenow =='page' 297 298 if (is_admin() && $typenow='vehicle'){ 299 // add_filter('admin_footer','insert_ajax_status_script'); 300 add_action( 'admin_footer', 'changefeat_javascript' ); // Write our JS below here 301 add_action( 'wp_ajax_changefeat', 'changefeat_callback' ); 302 } 303 304 305 function changefeat_javascript() { ?> 306 <div id="status_update_working" style="background-color: green; color: #fff; font-wieght: bolder; font-size: 22px; height: 33px; left: 40%; padding: 35px; position: fixed; top: 100px; width: 350px; display:none !important; ">Changing status...</div> 307 308 309 <script type="text/javascript"> 310 function chf(p){ 311 jQuery("#status_update_working").show('fast'); 312 313 params={}; 314 params.post_id=p.attr("pid"); 315 params.action="changefeat";//IMPORTANT: THE VALUE ACTION SHOULD BE THE SAME IN 'WP_AJAX_...' 316 jQuery.post(ajaxurl,params, 317 function(response) { 318 if (response.error){ 319 alert(response.error); 320 }else{ 321 console.log(response) 322 p.toggleClass("dashicons dashicons-star-empty dashicons dashicons-star-filled");; 323 } 324 } 325 ); 326 jQuery("#status_update_working").hide('9500'); 327 } 328 329 jQuery(document).ready(function($) { 330 331 332 jQuery(".pb").click(function(){ 333 chf(jQuery(this)); 334 }); 335 336 }); 337 </script> <?php 338 } 339 340 //js/jquery code to call ajax 341 function insert_ajax_status_script(){ 342 ?> 343 <div id="status_update_working" style="background-color: green; color: #fff; font-size: 22px; height: 33px; left: 40%; padding: 35px; position: fixed; top: 100px; width: 350px; display:none !important; ">Changing status...</div> 344 <script type="text/javascript"> 345 346 function changefeat(p){ 347 jQuery("#status_update_working").show(); 348 jQuery.getJSON(ajaxurl, 349 { post_id: p.attr("pid"), 350 action: "change_status", 351 }, 352 function(data) { 353 if (data.error){ 354 alert(data.error); 355 }else{ 356 p.toggleClass("dashicons dashicons-star-empty dashicons dashicons-star-filled");; 357 } 358 } 359 ); 360 jQuery("#status_update_working").hide(); 361 } 362 jQuery(document).ready(function(){ 363 jQuery(".pb").click(function(){ 364 ajax_change_status(jQuery(this)); 365 }); 366 }); 367 </script> 368 <?php 369 } 370 371 //ajax callback function 372 function changefeat_callback() { 373 374 if (!isset($_POST['post_id'])){ 375 $re = 'something went wrong ...'; 376 echo json_encode($re); 377 die(); 378 } 379 if (isset($_POST['action'])){ 380 381 change_feat_db($_POST['post_id']); 382 383 }else{ 384 $re = 'something went wrong ...'; 385 } 386 echo "ok"; 387 wp_die(); // this is required to terminate immediately and return a proper response 388 } 389 390 391 function change_feat_db($psid){ 392 $prefix="_cde_"; 393 $current_meta = get_post_meta( $psid); 394 $newval = 1-intval($current_meta[$prefix.'featured'][0]); 395 echo var_dump($current_meta); 396 update_post_meta($psid, $prefix.'featured',$newval ); 397 } 398 399 400 286 401 /****** VEHICLE CUSTOM TEMPLATE ****/ 287 402 … … 714 829 715 830 /*-----------------------------------------------------------------------------------*/ 716 /* LA ST VEHICLES SHORTCODE - MAINTAINED FOR COMPATIBILITY*/831 /* LATEST VEHICLES SHORTCODE 717 832 /*-----------------------------------------------------------------------------------*/ 718 833 … … 786 901 } 787 902 903 904 /*-----------------------------------------------------------------------------------*/ 905 /* FEATURED VEHICLES SHORTCODE 906 /*-----------------------------------------------------------------------------------*/ 907 908 add_shortcode( 'cde_featured_vehicles', 'cde_feat_vehicles' ); 909 910 function cde_feat_vehicles( $atts ) { 911 912 cde_scripts_styles(); 913 914 $r = new WP_Query( array( 915 'no_found_rows' => true, /*suppress found row count*/ 916 'post_status' => 'publish', 917 'post_type' => 'vehicle', 918 'ignore_sticky_posts' => true, 919 'meta_query' => array( 920 array( 921 'key' => '_cde_featured', 922 'value' => 1, 923 'compare' => '=' 924 ) 925 ) 926 ) 927 ); 928 929 930 global $cde_mil_abb; 931 global $cde_mon_sym; 932 933 $cnt=0; 934 $shrt=""; 935 if ($r->have_posts()){ 936 while ($r->have_posts()) : $r->the_post(); 937 $shrt.=" <div class=\"cde_col-sm-4 cde_col-md-4 \">"; 938 $shrt.="<div class=\"cde_thumbnail cde_grid\">"; 939 if ( has_post_thumbnail()) { 940 //Get the Thumbnail URL 941 $src_orig = wp_get_attachment_image_src( get_post_thumbnail_id($r->post->ID), 'full', false, '' ); 942 $src_thumb = wp_get_attachment_image_src( get_post_thumbnail_id($r->post->ID), 'cde_size', false, '' ); 943 944 945 $shrt.="<figure><a href=\"".$src_orig[0]."\" rel=\"gallery\" class=\"thumb\"><img src=\"".$src_thumb[0]."\" /></a>"; 946 } else { 947 $shrt.="<div style=\"background:url(".plugins_url( '/car-dealer/images/pattern-1.png' ) .");width:".get_option('cde_thumb_size_w', '303')."px;height:". get_option('cde_thumb_size_h', '210')."px\" title=\"". __( 'No Image', 'cde_pgl' )."\"></div>"; 948 } 949 $shrt.="<figcaption> 950 <h4>"; 951 $prefix = '_cde_'; 952 $mileage = get_post_meta( get_the_ID(), $prefix.'mileage', true ); 953 $year = get_post_meta( get_the_ID(), $prefix.'year', true ); 954 $price = get_post_meta( get_the_ID(), $prefix.'price', true ); 955 if ($price!='0,00') $shrt.= $cde_mon_sym." ".$price; 956 $shrt.="</h4><br /><span>".sprintf( __( '<strong>Year: </strong> %s', "cde_pgl" ), $year ); 957 $shrt.="<br>"; 958 $shrt.=sprintf( __( '<strong>'.$cde_mil_abb.' : </strong> %s', "cde_pgl" ), $mileage )."</span><br> 959 <a href=\"".get_the_permalink()."\">".__("Take a look", "cde_pgl")."</a>"; 960 $shrt.=" </figcaption>"; 961 $shrt.="</figure>"; 962 $shrt.="<div class=\"caption\"> 963 <h3> <a href=\"".get_the_permalink()."\" title=\"". get_the_title()."\">". get_the_title()."</a></h3>"; 964 $shrt.="<p>".get_the_excerpt()."</p>"; 965 $shrt.="</div>"; 966 $shrt.=" </div>"; 967 $shrt.=" </div>"; 968 969 $cnt+=1; 970 if ($cnt==3) { 971 $shrt.="<div class=\"cde_clearfix\"></div>"; 972 $cnt=0; 973 } 974 975 endwhile; 976 977 $shrt.="<div class=\"cde_clearfix\"></div>"; 978 } 979 return $shrt; 980 } -
pl-car-dealer/trunk/README.txt
r1404810 r1408030 5 5 Tags: car dealer, car seller, cars, autostock, selling cars 6 6 Requires at least: 3.0.1 7 Tested up to: 4. 4.28 Stable tag: 1. 2.17 Tested up to: 4.5.2 8 Stable tag: 1.3 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 28 28 5. A shortcode for latest vehicles [cde_latest_vehicles] 29 29 30 6. Three templates for archive vehicle, advanced vehicle result and a single vehicle30 6. A shortcode for featured vehicles [cde_featured_vehicles] 31 31 32 7. T ranslation ready (Italian language included)32 7. Three templates for archive vehicle, advanced search vehicle result and a single vehicle 33 33 34 8. Mileage abbreviation and money symbol setting 34 8. Translation ready (Italian language included) 35 36 9. Mileage abbreviation and money symbol setting 35 37 36 38 A demo is available at http://www.autobarbara.it/ -
pl-car-dealer/trunk/languages/cde_pgl-it_IT.po
r1344095 r1408030 2 2 msgstr "" 3 3 "Project-Id-Version: Car dealer\n" 4 "POT-Creation-Date: 2016-0 2-05 16:15+0100\n"5 "PO-Revision-Date: 2016-0 2-05 16:15+0100\n"4 "POT-Creation-Date: 2016-04-30 13:14+0100\n" 5 "PO-Revision-Date: 2016-04-30 13:14+0100\n" 6 6 "Last-Translator: \n" 7 7 "Language-Team: \n" … … 314 314 315 315 #: PL-car-dealer.php:167 PL-car-dealer.php:203 316 #: templates/single-vehicle.php:4 0316 #: templates/single-vehicle.php:41 317 317 msgid "Price" 318 318 msgstr "Prezzo" … … 322 322 msgstr "Prezzo del veicolo" 323 323 324 #: PL-car-dealer.php:176 templates/single-vehicle.php:5 5324 #: PL-car-dealer.php:176 templates/single-vehicle.php:58 325 325 msgid "Photos" 326 326 msgstr "Foto" … … 330 330 msgstr "" 331 331 332 #: PL-car-dealer.php:230 PL-car-dealer.php:246 PL-car-dealer.php:262 332 #: PL-car-dealer.php:206 333 msgid "Featured" 334 msgstr "In evidenza" 335 336 #: PL-car-dealer.php:232 PL-car-dealer.php:248 PL-car-dealer.php:264 333 337 msgid "Unknown" 334 338 msgstr "Sconosciuto" 335 339 336 #: PL-car-dealer.php:23 4 PL-car-dealer.php:266340 #: PL-car-dealer.php:236 PL-car-dealer.php:268 337 341 #, php-format 338 342 msgid " %s" 339 343 msgstr "" 340 344 341 #: PL-car-dealer.php:25 0345 #: PL-car-dealer.php:252 342 346 #, php-format 343 347 msgid "%s" 344 348 msgstr "" 345 349 346 #: PL-car-dealer.php: 398350 #: PL-car-dealer.php:513 347 351 msgid "Vehicle Search Widget" 348 352 msgstr "Widget Ricerca Veicoli" 349 353 350 #: PL-car-dealer.php: 401354 #: PL-car-dealer.php:516 351 355 msgid "widget for searching a vehicle" 352 356 msgstr "Widget Ricerca Veicoli" 353 357 354 #: PL-car-dealer.php: 421 PL-car-dealer.php:681358 #: PL-car-dealer.php:536 PL-car-dealer.php:796 355 359 msgid "Name: " 356 360 msgstr "Nome:" 357 361 358 #: PL-car-dealer.php: 422 PL-car-dealer.php:682362 #: PL-car-dealer.php:537 PL-car-dealer.php:797 359 363 msgid "Type the Car Name" 360 364 msgstr "Digitare il nome della vettura" 361 365 362 #: PL-car-dealer.php: 424 PL-car-dealer.php:684366 #: PL-car-dealer.php:539 PL-car-dealer.php:799 363 367 msgid "Make: " 364 368 msgstr "Marche:" 365 369 366 #: PL-car-dealer.php: 430 PL-car-dealer.php:690370 #: PL-car-dealer.php:545 PL-car-dealer.php:805 367 371 msgid "All the makes" 368 372 msgstr "Tutte le marche" 369 373 370 #: PL-car-dealer.php: 437 PL-car-dealer.php:697374 #: PL-car-dealer.php:552 PL-car-dealer.php:812 371 375 msgid "Max Mileage: " 372 376 msgstr "Max Chilometraggio:" 373 377 374 #: PL-car-dealer.php: 438 PL-car-dealer.php:698378 #: PL-car-dealer.php:553 PL-car-dealer.php:813 375 379 msgid "Maximum mileage" 376 380 msgstr "Chilometraggio massimo" 377 381 378 #: PL-car-dealer.php: 440 PL-car-dealer.php:700382 #: PL-car-dealer.php:555 PL-car-dealer.php:815 379 383 msgid "Max price: " 380 384 msgstr "Prezzo max:" 381 385 382 #: PL-car-dealer.php: 441 PL-car-dealer.php:701386 #: PL-car-dealer.php:556 PL-car-dealer.php:816 383 387 msgid "Maximum Price" 384 388 msgstr "Prezzo massimo" 385 389 386 #: PL-car-dealer.php: 443 PL-car-dealer.php:703390 #: PL-car-dealer.php:558 PL-car-dealer.php:818 387 391 msgid "Min Year: " 388 392 msgstr "Min Anno:" 389 393 390 #: PL-car-dealer.php: 444 PL-car-dealer.php:704394 #: PL-car-dealer.php:559 PL-car-dealer.php:819 391 395 msgid "Minimum Year of Constr." 392 396 msgstr "Minimo Anno di costr." 393 397 394 #: PL-car-dealer.php: 462398 #: PL-car-dealer.php:577 395 399 msgid "New title" 396 400 msgstr "Nuovo titolo" 397 401 398 #: PL-car-dealer.php: 467 PL-car-dealer.php:574402 #: PL-car-dealer.php:582 PL-car-dealer.php:689 399 403 msgid "Title:" 400 404 msgstr "Titolo:" 401 405 402 #: PL-car-dealer.php: 497406 #: PL-car-dealer.php:612 403 407 msgid "Allows you to create a new Sidebar widget to display makes!" 404 408 msgstr "Consente di creare un nuovo widget per visualizzare le marche!" 405 409 406 #: PL-car-dealer.php: 538410 #: PL-car-dealer.php:653 407 411 msgid "New Title" 408 412 msgstr "Nuovo titolo" 409 413 410 #: PL-car-dealer.php: 579414 #: PL-car-dealer.php:694 411 415 msgid "Options:" 412 416 msgstr "Opzioni:" 413 417 414 #: PL-car-dealer.php: 583418 #: PL-car-dealer.php:698 415 419 msgid "Hide Widget If There Are No Makes To Be Displayed?" 416 420 msgstr "Nascondi il widget se non vi sono marche da mostrare ?" 417 421 418 #: PL-car-dealer.php: 588422 #: PL-car-dealer.php:703 419 423 msgid "Hide Makes That Have No Related Vehicles?" 420 424 msgstr "Nascondi marche che non hanno veicoli ?" 421 425 422 #: PL-car-dealer.php: 592426 #: PL-car-dealer.php:707 423 427 msgid "Order Makes By:" 424 428 msgstr "Ordina marche per:" 425 429 426 #: PL-car-dealer.php: 594430 #: PL-car-dealer.php:709 427 431 msgid "ID Ascending" 428 432 msgstr "ID Crescente" 429 433 430 #: PL-car-dealer.php: 595434 #: PL-car-dealer.php:710 431 435 msgid "ID Descending" 432 436 msgstr "ID decrescente" 433 437 434 #: PL-car-dealer.php: 596438 #: PL-car-dealer.php:711 435 439 msgid "Count Ascending" 436 440 msgstr "Numero Crescente" 437 441 438 #: PL-car-dealer.php: 597442 #: PL-car-dealer.php:712 439 443 msgid "Count Descending" 440 444 msgstr "Numero decrescente" 441 445 442 #: PL-car-dealer.php: 598446 #: PL-car-dealer.php:713 443 447 msgid "Name Ascending" 444 448 msgstr "Nome Crescente" 445 449 446 #: PL-car-dealer.php: 599450 #: PL-car-dealer.php:714 447 451 msgid "Name Descending" 448 452 msgstr "Nome Decrescente" 449 453 450 #: PL-car-dealer.php: 600454 #: PL-car-dealer.php:715 451 455 msgid "Slug Ascending" 452 456 msgstr "Slug Crescente" 453 457 454 #: PL-car-dealer.php: 601458 #: PL-car-dealer.php:716 455 459 msgid "Slug Descending" 456 460 msgstr "Slug decrescente" 457 461 458 #: PL-car-dealer.php: 606462 #: PL-car-dealer.php:721 459 463 msgid "Maximum Number Of Makes To Return:" 460 464 msgstr "Numero massimo di marche da mostrare:" 461 465 462 #: PL-car-dealer.php: 607466 #: PL-car-dealer.php:722 463 467 msgid "Keep Empty To Display All" 464 468 msgstr "Lasciare Vuoto Per visualizzare tutti" 465 469 466 #: PL-car-dealer.php: 611470 #: PL-car-dealer.php:726 467 471 msgid "Ids To Exclude From Being Displayed:" 468 472 msgstr "ID da escludere dalla visualizzazione:" 469 473 470 #: PL-car-dealer.php: 612 PL-car-dealer.php:617474 #: PL-car-dealer.php:727 PL-car-dealer.php:732 471 475 msgid "Separate ids with a comma ," 472 476 msgstr "Separa gli ID con una virgola," 473 477 474 #: PL-car-dealer.php: 616478 #: PL-car-dealer.php:731 475 479 msgid "Only Display Makes With The Following Ids:" 476 480 msgstr "Mostra marche con i seguenti ID:" 477 481 478 #: PL-car-dealer.php:751 templates/advanced-vehicle-results.php:78 482 #: PL-car-dealer.php:868 PL-car-dealer.php:947 483 #: templates/advanced-vehicle-results.php:108 479 484 #: templates/archive-vehicle.php:72 480 485 msgid "No Image" 481 486 msgstr "Nessuna immagine" 482 487 483 #: PL-car-dealer.php:760 templates/advanced-vehicle-results.php:88 488 #: PL-car-dealer.php:877 PL-car-dealer.php:956 489 #: templates/advanced-vehicle-results.php:118 484 490 #: templates/archive-vehicle.php:82 485 491 #, php-format … … 487 493 msgstr "<strong>Anno: </strong> %s" 488 494 489 #: PL-car-dealer.php:762 templates/advanced-vehicle-results.php:90 495 #: PL-car-dealer.php:879 PL-car-dealer.php:958 496 #: templates/advanced-vehicle-results.php:120 490 497 #: templates/archive-vehicle.php:84 491 498 msgid "<strong>" 492 499 msgstr "" 493 500 494 #: PL-car-dealer.php:763 templates/advanced-vehicle-results.php:91 501 #: PL-car-dealer.php:880 PL-car-dealer.php:959 502 #: templates/advanced-vehicle-results.php:121 495 503 #: templates/archive-vehicle.php:85 496 504 msgid "Take a look" … … 521 529 msgstr "" 522 530 523 #: templates/advanced-vehicle-results.php: 59531 #: templates/advanced-vehicle-results.php:89 524 532 msgid "Advanced results" 525 533 msgstr "Risultati ricerca avanzata" 526 534 527 #: templates/advanced-vehicle-results.php:1 11535 #: templates/advanced-vehicle-results.php:141 528 536 #: templates/archive-vehicle.php:105 529 537 msgid "Nothing Found" 530 538 msgstr "Non è stato trovato nulla" 531 539 532 #: templates/advanced-vehicle-results.php:1 15540 #: templates/advanced-vehicle-results.php:145 533 541 msgid "Apologies, but no results were found." 534 542 msgstr "Siamo spiacenti, ma non è stato trovato alcun risultato."
Note: See TracChangeset
for help on using the changeset viewer.