Plugin Directory

Changeset 2850555


Ignore:
Timestamp:
01/18/2023 02:52:05 PM (3 years ago)
Author:
synthiasoft
Message:

update-temp-v2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • print-bangla-news/trunk/templates/print.php

    r2788272 r2850555  
    11<?php
     2date_default_timezone_set('Asia/Dhaka');
    23
    34$op = get_option( 'print_Options_option_name' );
     
    1213     if ($op['epaper_col_4']) {
    1314         $noc = $op['epaper_col_4'];
     15         
    1416     }else{
    1517        $noc = 2;
     18        $ep_width = 310;
    1619     }
     20
     21     if ($noc == 2) {
     22         $ep_width = 210;
     23     }
     24     
     25
    1726      if ($op['design_3'] == "epaper"): ?>
    1827    <style type="text/css">
     
    2029  column-count: <?= $noc?>;
    2130}
     31
     32body.print-body {
     33  width: <?= $ep_width?>mm;
     34
     35  }
     36
     37
    2238
    2339    </style>
     
    2743</head>
    2844<body class="print-body">
     45    <div  id="epaper_ss" style="background: white!important;">
    2946    <div class="content-center">
    3047        <img src="<?php echo  $op['header_banner_0'] ?>" alt="Logo">
     
    3956    <?php endif ?>
    4057 
    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?>
    4462
    45        
    4663    <?php endif ?>
    4764
     
    5168$post = get_post(get_the_id());
    5269if ( !empty($post->post_content) ) {
    53   echo wpautop($post->post_content);
     70  echo wpautop($lead_photo.$post->post_content);
    5471}
    5572
     
    5875</div>
    5976
    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;">
    6178    <hr>
    6279    <?php if ($op['editor_information_1']): ?>
     
    7491</div>
    7592</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সেভ করুন
    7899</a>
    79 </body>
     100</div>
     101
     102
    80103<?php wp_footer();?>
    81104
     105<script>
     106
     107function download_NewsNow() {
     108    var node = document.getElementById('epaper_ss');
     109
     110domtoimage.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
    82126</html>
Note: See TracChangeset for help on using the changeset viewer.