PATH:
home
/
letacommog
/
rdvenunclick.fr1
/
wp-content
/
plugins
/
ultimate-faqs
/
Functions
<?php function EWD_UFAQ_Export_To_PDF() { // make sure that the request is coming from the admin form if ( ! isset( $_POST['EWD_UFAQ_Export_PDF_Nonce'] ) ) { return; } if ( ! wp_verify_nonce( $_POST['EWD_UFAQ_Export_PDF_Nonce'], 'EWD_UFAQ_Export_PDF' ) ) { return; } require_once(EWD_UFAQ_CD_PLUGIN_PATH . '/FPDF/fpdf.php'); if ($Category != "EWD_UFAQ_ALL_CATEGORIES") { $category_array = array( 'taxonomy' => 'ufaq-category', 'field' => 'slug', 'terms' => $Category->slug ); } $params = array( 'posts_per_page' => -1, 'post_type' => 'ufaq' ); $faqs = get_posts($params); $PDFPasses = array("FirstPageRun", "SecondPageRun", "Final"); foreach ($PDFPasses as $PDFRun) { $pdf = new FPDF(); $pdf->AddPage(); if ($PDFRun == "SecondPageRun" or $PDFRun == "Final") { $pdf->SetFont('Arial','B',14); $pdf->Cell(20, 10, "Page #"); $pdf->Cell(20, 10, "Article Title"); $pdf->Ln(); $pdf->SetFont('Arial','',12); foreach ($ToC as $entry) { $pdf->Cell(20, 5, " " . utf8_decode($entry['page'])); $pdf->MultiCell(0, 5, utf8_decode($entry['title'])); $pdf->Ln(); } unset($ToC); } foreach ($faqs as $faq) { $PostTitle = em(strip_tags(html_entity_decode($faq->post_title))); $PostText = em(strip_tags(html_entity_decode($faq->post_content))); $PostText = str_replace("[", "[", $PostText); $PostText = str_replace("]", "]", $PostText); $pdf->AddPage(); $Entry['page'] = $pdf->page; $Entry['title'] = $PostTitle; $pdf->SetFont('Arial','B',15); $pdf->MultiCell(0, 10, $PostTitle); $pdf->Ln(); $pdf->SetFont('Arial','',12); $pdf->MultiCell(0, 10, $PostText); $ToC[] = $Entry; unset($Entry); } if ($PDFRun == "FirstPageRun" or $PDFRun == "SecondPageRun") { $pdf->Close(); } if ($PDFRun == "Final") { $pdf->Output('Ultimate-FAQ-Manual.pdf', 'D'); } } } function em($word) { $word = str_replace("@","%40",$word); $word = str_replace("`","%60",$word); $word = str_replace("¢","%A2",$word); $word = str_replace("£","%A3",$word); $word = str_replace("¥","%A5",$word); $word = str_replace("|","%A6",$word); $word = str_replace("«","%AB",$word); $word = str_replace("¬","%AC",$word); $word = str_replace("¯","%AD",$word); $word = str_replace("º","%B0",$word); $word = str_replace("±","%B1",$word); $word = str_replace("ª","%B2",$word); $word = str_replace("µ","%B5",$word); $word = str_replace("»","%BB",$word); $word = str_replace("¼","%BC",$word); $word = str_replace("½","%BD",$word); $word = str_replace("¿","%BF",$word); $word = str_replace("À","%C0",$word); $word = str_replace("Á","%C1",$word); $word = str_replace("Â","%C2",$word); $word = str_replace("Ã","%C3",$word); $word = str_replace("Ä","%C4",$word); $word = str_replace("Å","%C5",$word); $word = str_replace("Æ","%C6",$word); $word = str_replace("Ç","%C7",$word); $word = str_replace("È","%C8",$word); $word = str_replace("É","%C9",$word); $word = str_replace("Ê","%CA",$word); $word = str_replace("Ë","%CB",$word); $word = str_replace("Ì","%CC",$word); $word = str_replace("Í","%CD",$word); $word = str_replace("Î","%CE",$word); $word = str_replace("Ï","%CF",$word); $word = str_replace("Ð","%D0",$word); $word = str_replace("Ñ","%D1",$word); $word = str_replace("Ò","%D2",$word); $word = str_replace("Ó","%D3",$word); $word = str_replace("Ô","%D4",$word); $word = str_replace("Õ","%D5",$word); $word = str_replace("Ö","%D6",$word); $word = str_replace("Ø","%D8",$word); $word = str_replace("Ù","%D9",$word); $word = str_replace("Ú","%DA",$word); $word = str_replace("Û","%DB",$word); $word = str_replace("Ü","%DC",$word); $word = str_replace("Ý","%DD",$word); $word = str_replace("Þ","%DE",$word); $word = str_replace("ß","%DF",$word); $word = str_replace("à","%E0",$word); $word = str_replace("á","%E1",$word); $word = str_replace("â","%E2",$word); $word = str_replace("ã","%E3",$word); $word = str_replace("ä","%E4",$word); $word = str_replace("å","%E5",$word); $word = str_replace("æ","%E6",$word); $word = str_replace("ç","%E7",$word); $word = str_replace("è","%E8",$word); $word = str_replace("é","%E9",$word); $word = str_replace("ê","%EA",$word); $word = str_replace("ë","%EB",$word); $word = str_replace("ì","%EC",$word); $word = str_replace("í","%ED",$word); $word = str_replace("î","%EE",$word); $word = str_replace("ï","%EF",$word); $word = str_replace("ð","%F0",$word); $word = str_replace("ñ","%F1",$word); $word = str_replace("ò","%F2",$word); $word = str_replace("ó","%F3",$word); $word = str_replace("ô","%F4",$word); $word = str_replace("õ","%F5",$word); $word = str_replace("ö","%F6",$word); $word = str_replace("÷","%F7",$word); $word = str_replace("ø","%F8",$word); $word = str_replace("ù","%F9",$word); $word = str_replace("ú","%FA",$word); $word = str_replace("û","%FB",$word); $word = str_replace("ü","%FC",$word); $word = str_replace("ý","%FD",$word); $word = str_replace("þ","%FE",$word); $word = str_replace("ÿ","%FF",$word); return urldecode($word); } ?>
[+]
..
[-] EWD_UFAQ_Upgrade_Box.php
[edit]
[-] EWD_UFAQ_Output_Options_Page.php
[edit]
[-] EWD_UFAQ_Add_Views_Column.php
[edit]
[-] EWD_UFAQ_WooCommerce_Tab.php
[edit]
[-] EWD_UFAQ_Pointers_Manager_Interface.php
[edit]
[-] EWD_UFAQ_Output_Statistics_Page.php
[edit]
[-] EWD_UFAQ_WPForms_Integration.php
[edit]
[-] Update_EWD_UFAQ_Content.php
[edit]
[-] EWD_UFAQ_Pointers_Manager_Class.php
[edit]
[-] EWD_UFAQ_Import.php
[edit]
[-] EWD_UFAQ_Create_Captcha_Image.php
[edit]
[-] EWD_UFAQ_Submit_Question.php
[edit]
[-] EWD_UFAQ_Rewrite_Rules.php
[edit]
[-] EWD_UFAQ_Initial_Data.php
[edit]
[-] EWD_UFAQ_Widgets.php
[edit]
[-] Process_Ajax.php
[edit]
[-] EWD_UFAQ_Export_To_PDF.php
[edit]
[-] Error_Notices.php
[edit]
[-] EWD_UFAQ_Output_Pages.php
[edit]
[-] EWD_UFAQ_Styling.php
[edit]
[-] Update_Admin_Databases.php
[edit]
[-] EWD_UFAQ_Deactivation_Survey.php
[edit]
[-] EWD_UFAQ_Admin_Image_Upload.php
[edit]
[-] EWD_UFAQ_Add_Social_Media_Buttons.php
[edit]
[-] EWD_UFAQ_Output_Import_Page.php
[edit]
[-] EWD_UFAQ_Export.php
[edit]
[-] FrontEndAjaxUrl.php
[edit]
[-] EWD_UFAQ_Help_Pointers.php
[edit]
[-] Register_EWD_UFAQ_Posts_Taxonomies.php
[edit]
[-] EWD_UFAQ_Meta_Boxes.php
[edit]
[-] EWD_UFAQ_Output_Export_Page.php
[edit]
[-] EWD_UFAQ_Version_Update.php
[edit]
[-] EWD_UFAQ_Captcha.php
[edit]