Changeset 2850555
- Timestamp:
- 01/18/2023 02:52:05 PM (3 years ago)
- File:
-
- 1 edited
-
print-bangla-news/trunk/templates/print.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
print-bangla-news/trunk/templates/print.php
r2788272 r2850555 1 1 <?php 2 date_default_timezone_set('Asia/Dhaka'); 2 3 3 4 $op = get_option( 'print_Options_option_name' ); … … 12 13 if ($op['epaper_col_4']) { 13 14 $noc = $op['epaper_col_4']; 15 14 16 }else{ 15 17 $noc = 2; 18 $ep_width = 310; 16 19 } 20 21 if ($noc == 2) { 22 $ep_width = 210; 23 } 24 25 17 26 if ($op['design_3'] == "epaper"): ?> 18 27 <style type="text/css"> … … 20 29 column-count: <?= $noc?>; 21 30 } 31 32 body.print-body { 33 width: <?= $ep_width?>mm; 34 35 } 36 37 22 38 23 39 </style> … … 27 43 </head> 28 44 <body class="print-body"> 45 <div id="epaper_ss" style="background: white!important;"> 29 46 <div class="content-center"> 30 47 <img src="<?php echo $op['header_banner_0'] ?>" alt="Logo"> … … 39 56 <?php endif ?> 40 57 41 <div class="news-details-print print-container"> 42 <?php if ($op['design_3'] == "epaper"): ?> 43 <center> <img src="<?php echo get_the_post_thumbnail_url(get_the_ID(),'full'); ?>"> </center> 58 <div id="my-element" class="news-details-print print-container"> 59 <?php if ($op['design_3'] == "epaper"): 60 $lead_photo = '<img src="'.get_the_post_thumbnail_url(get_the_ID(),"full").'">'; 61 ?> 44 62 45 46 63 <?php endif ?> 47 64 … … 51 68 $post = get_post(get_the_id()); 52 69 if ( !empty($post->post_content) ) { 53 echo wpautop($ post->post_content);70 echo wpautop($lead_photo.$post->post_content); 54 71 } 55 72 … … 58 75 </div> 59 76 60 <div class="print-copyright" style="font-size:18px;text-align: center;">77 <div id="" class="print-copyright" style="font-size:18px;text-align: center;"> 61 78 <hr> 62 79 <?php if ($op['editor_information_1']): ?> … … 74 91 </div> 75 92 </div> 76 <a href="#" class="print-float no-print" onclick="window.print()"> 77 <img src="<?= plugin_dir_url( __DIR__ ).'assest/img/print-news.png'?>"> 93 </div> 94 <div class="print-float no-print"> 95 <a href="#" class="btn red" onclick="window.print()"> <img src="https://cdn-icons-png.flaticon.com/512/3022/3022251.png"> 96 প্রিন্ট করুন 97 </a> <a href="#" id="print_news" onclick="download_NewsNow()" class="btn green"> <img src="https://cdn-icons-png.flaticon.com/512/4208/4208397.png"> 98 সেভ করুন 78 99 </a> 79 </body> 100 </div> 101 102 80 103 <?php wp_footer();?> 81 104 105 <script> 106 107 function download_NewsNow() { 108 var node = document.getElementById('epaper_ss'); 109 110 domtoimage.toJpeg(node) 111 .then(function (dataUrl) { 112 var link = document.createElement('a'); 113 link.download = 'News-<?=get_the_ID();?>-ePaper-Download.png'; 114 link.href = dataUrl; 115 link.click(); 116 117 118 }) 119 .catch(function (error) { 120 console.error('oops, something went wrong!', error); 121 }); 122 } 123 124 </script> 125 82 126 </html>
Note: See TracChangeset
for help on using the changeset viewer.