Error con plugin de autopublicación por invitados
-
Hola amigos de wordpress.org, he instalado y modificado el plugin wordpress guest post, que sirve para que los usuarios del blog puedan publicar artículos que luego yo decido si apruebo o no y se autopublican. El problema es que al autopublicarse se publican mal. Por ejemplo se publican así:
<p>Hace relativamente poco os trajimos un artículo en el que hablábamos de los países con más oportunidades de trabajo del mundo. Los países con menos paro del mundo. El índice de paro es un buen indicador de las <strong>oportunidades de trabajo</strong> que un país puede ofrecer a sus habitantes, pero un paro inferior no quiere decir automáticamente que ese país tendrás las mejores oportunidades para una persona.</p> <p> </p>
Si yo, una vez publicado, voy al articulo en mi editor y corto el texto completo y lo pego tal cuál pero en HTML MODE, sí que sale a la perfección el texto (tildes, p tags y todo). Entonces lo que supongo es que el php que realiza la función manda el artículo al editor pero al VISUAL MODE, en vez de al HTML MODE.
El caso es que como no piloto tanto de Php quería ver si algún experto me podía ver dónde está la función que llama a pegar el texto recopilado y a pegarlo en el visual mode y publicarlo para que en vez de esto, lo envíe al html mode y se autopublique bien. Os dejo la parte del código en dónde creo que está:
mi blog: Vida Emigrante
página para que los invitados publiquen: http://vidaemigrante.com/enviar/<?php /* Plugin Name: WordPress Guest Post Plugin Plugin URI: http://lisaangelettieblog.com/wordpress-guest-post-plugin/ Description: Review posts submitted by the users to approval... Author: Lisa Angelettie Version: 2.7 Author URI: http:/wp-admin/upgrade-functions.php'); register_activation_hook(__FILE__, 'wppostreviewbyadmin_install'); register_deactivation_hook(__FILE__, 'wppostreviewbyadmin_uninstall'); add_action('admin_menu', 'wppostreviewbyadmin_admin_menus'); //add_action('init', 'wppostreviewbyadmin_install'); add_action('init', 'wppostreviewbyadmin_init'); add_action('wp_head', 'wppostreviewbyadmin_styling'); //session_start(); global $wpdb; define("WPUSER_POSTS_TABLE",$wpdb->prefix."usersposts"); wp_enqueue_script('postreviewbyadmin_script',get_bloginfo('wpurl').'/wp-content/plugins/wordpress-guest-post/js/postreviewbyadmin_script.js'); wp_enqueue_script('inneditor_script',get_bloginfo('wpurl').'/wp-content/plugins/wordpress-guest-post/jscripts/tiny_mce/tiny_mce.js'); function wppostreviewbyadmin_init() { session_start(); } function wppostreviewbyadmin_install() { global $wpdb, $wp_rewrite; $table_userposts = WPUSER_POSTS_TABLE; $getTable = mysql_query("SHOW TABLES LIKE '".WPUSER_POSTS_TABLE."'"); $Version = get_option('wppostreviewbyadmin_version'); $Now = time(); $createqry = "CREATE TABLE $table_userposts( <code>ID</code> bigint(20) NOT NULL auto_increment, <code>post_author</code> bigint(20) NOT NULL, <code>post_author_name</code> varchar(255) NOT NULL, <code>post_author_fname</code> varchar(255) NOT NULL, <code>post_author_lname</code> varchar(255) NOT NULL, <code>post_author_email</code> varchar(100) NOT NULL, <code>post_date</code> datetime NOT NULL, <code>post_date_gmt</code> datetime NOT NULL, <code>post_content</code> longtext NOT NULL, <code>post_title</code> text NOT NULL, <code>post_excerpt</code> text NOT NULL, <code>post_status</code> varchar(20) NOT NULL, <code>post_type</code> varchar(20) NOT NULL, <code>category_ids</code> varchar(500) NOT NULL, <code>post_tags</code> varchar(500) NOT NULL, <code>approval</code> int(11) NOT NULL, PRIMARY KEY (<code>ID</code>) )"; $wpdb->query($createqry); add_option('wppostreviewbyadmin_version','1.8'); add_option('wppostreviewbyadmin_guestpage', ''); add_option('wppostreviewbyadmin_adminmailid',get_option('admin_email')); add_option('wppostreviewbyadmin_paginationno',25); add_option('wppostreviewbyadmin_postsubmsg', "Gracias por enviar este artículo a Vida Emigrante. Lo hemos recibido satisfactoriamente y pasará en pocas horas por el proceso de edición. Una vez que el artículo sea aprobado, será publicado en el blog de Vida Emigrante y recibirás una confirmación por email."); add_option('wppostreviewbyadmin_postappmsg', 'Your Post "%postapp_title%" has got reviewed and approved by the admin.'); add_option('wppostreviewbyadmin_enableeditor', ''); /* $post_date = date("Y-m-d H:i:s"); $post_date_gmt = gmdate("Y-m-d H:i:s"); $num = 0; $pages[$num]['name'] = 'add-posts'; $pages[$num]['title'] = 'Add Post'; $pages[$num]['tag'] = '[addposts]'; $pages[$num]['option'] = 'addposts_url'; $num++; $newpages = false; $i = 0; $post_parent = 0; foreach($pages as $page) { $check_page = $wpdb->get_row("SELECT * FROM <code>".$wpdb->posts."</code> WHERE <code>post_content</code> LIKE '%".$page['tag']."%' AND <code>post_type</code> NOT IN('revision') LIMIT 1",ARRAY_A); if($check_page == null) { if($i == 0) { $post_parent = 0; } else { $post_parent = $first_id; } if($wp_version >= 2.1) { $sql ="INSERT INTO ".$wpdb->posts."(post_author, post_date, post_date_gmt, post_content, post_content_filtered, post_title, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping, pinged, post_modified, post_modified_gmt, post_parent, menu_order, post_type) VALUES ('1', '$post_date', '$post_date_gmt', '".$page['tag']."', '', '".$page['title']."', '', 'publish', 'open', 'open', '', '".$page['name']."', '', '', '$post_date', '$post_date_gmt', '$post_parent', '0', 'page')"; } else { $sql ="INSERT INTO ".$wpdb->posts."(post_author, post_date, post_date_gmt, post_content, post_content_filtered, post_title, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping, pinged, post_modified, post_modified_gmt, post_parent, menu_order, post_type) VALUES ('1', '$post_date', '$post_date_gmt', '".$page['tag']."', '', '".$page['title']."', '', 'publish', 'open', 'open', '', '".$page['name']."', '', '', '$post_date', '$post_date_gmt', '$post_parent', '0', 'page')"; } $wpdb->query($sql); $post_id = $wpdb->insert_id; if($i == 0) { $first_id = $post_id; } $wpdb->query("UPDATE $wpdb->posts SET guid = '" . get_permalink($post_id) . "' WHERE ID = '$post_id'"); update_option($page['option'], get_permalink($post_id)); $newpages = true; $i++; } } */ add_option('wppostreviewbyadmin_style','original.css'); } function wppostreviewbyadmin_uninstall() { // The uninstall function is no longer used as of v1.2 but if you wish to do a clean uninstall and remove everything // Then uncomment the line '// register_deactivation_hook(__FILE__, 'wpmenudir_uninstall');' above then deactivate the plugin. global $wpdb; $table_links = WPUSER_POSTS_TABLE; $wpdb->query("DROP TABLE {$table_links}"); delete_option('wppostreviewbyadmin_version'); delete_option('wppostreviewbyadmin_guestpage'); delete_option('wppostreviewbyadmin_adminmailid'); delete_option('wppostreviewbyadmin_paginationno'); delete_option('wppostreviewbyadmin_postsubmsg'); delete_option('wppostreviewbyadmin_postappmsg'); delete_option('wppostreviewbyadmin_style'); delete_option('wppostreviewbyadmin_enableeditor'); } function wppostreviewbyadmin_styling($Style='original.css') { if($Style=='') { $Style=get_option('wppostreviewbyadmin_style'); } $StyleFile=dirname(__FILE__).'/styles/'.$Style; if(file_exists($StyleFile) && $Style) { include_once($StyleFile); } // session_start(); } function wppostreviewbyadmin_admin_menus() { add_menu_page('Wordpress Guest Post', 'Wordpress Guest Post', 8, __FILE__, 'wppostreviewbyadmin_reviewposts'); add_submenu_page(__FILE__, 'Settings', 'Settings', 8, 'sub-page', 'wppostreviewbyadmin_settings'); } function wp_delete_userpost($spl_id) { global $wpdb; $query = "DELETE FROM ".$wpdb->prefix."usersposts WHERE ID=$spl_id "; $wpdb->query($query); } function wp_select_userpost($postid) { global $wpdb; if($postid != "") { $selpostdetails_query = "SELECT * FROM ".$wpdb->prefix."usersposts where ID = ".$postid; $selpostdetails = $wpdb->get_results($selpostdetails_query, ARRAY_A); } return $selpostdetails; } function wppostreviewbyadmin_reviewposts() { global $wpdb, $wp_rewrite; wppostreviewbyadmin_styling(); if(($_POST["submit"]) && ($_POST["postid"])) { $addpostval = wp_select_userpost($_POST["postid"]); $newpost = array(); $newpost["post_author"] = 1; $newpost["post_category"][0] = $_POST["cat"]; $newpost["post_date"] = $addpostval[0]["post_date"]; $newpost["post_title"] = $_POST["post_title"]; $newpost["post_content"] = htmlspecialchars(trim($_POST['post_content'], "\t\n "), ENT_QUOTES); $newpost["post_excerpt"] = $_POST["excerpt"]; $newpost["post_status"] = 'publish'; $newpost["post_type"] = 'post'; $newpost["tags_input"] = $_POST["tags"]; $pid = wp_insert_post( $newpost, $wp_error ); if($pid != "") { $StrMailcontent1 = <?php } else { ?> <div class="wrap"> <p>Lo siento, no puedes ver esta página.</p> </div> <?php } ?> <?php } elseif(($_REQUEST["sns_reviewposts_view"] == "disapprove") && ($_REQUEST["sns_reviewposts_id"] != "") ) { wp_delete_userpost($_REQUEST["sns_reviewposts_id"]); $delmsg = "The selected post has been disapprove successfully"; echo "<div id=\"message\" class=\"updated fade\"><p>$delmsg</p></div>"; } else { $selpostdetails_query = "SELECT * FROM ".$wpdb->prefix."usersposts"; $selpostdetails = $wpdb->get_results($selpostdetails_query); $paginno = get_option('wppostreviewbyadmin_paginationno'); if($_REQUEST['pno']) $pgno=$_REQUEST['pno']-1; else $pgno=0; $pno= $_REQUEST['pno']; // $limit=$pgno*25; $limit=$pgno*$paginno; // $getpostdetails_query = "SELECT * FROM ".$wpdb->prefix."usersposts ORDER BY ID ASC LIMIT $limit, 25"; $getpostdetails_query = "SELECT * FROM ".$wpdb->prefix."usersposts ORDER BY ID ASC LIMIT $limit, $paginno"; $getpostdetails = $wpdb->get_results($getpostdetails_query); $totalselpostdetails = count($selpostdetails); if(empty($getpostdetails)) { echo '<div class="error"><p>There are 0 posts for review.</p></div>'; } else { echo '<div class="error"><p>There are '; echo count($getpostdetails); echo ' posts for review.</p></div>'; } ?> <?php $class = ""; $homesss = get_settings('home'); $i=1; foreach($getpostdetails as $hh) { echo "<tr id=\"search-{$hh->ID}\" class=\"$class\">"; echo "<td>". $hh->ID."</td>\n"; echo "<td>". $hh->post_title."</td>\n"; echo "<td>". $hh->post_author_name."</td>\n"; echo "<td>". $hh->post_date."</td>\n"; echo "<td><a class='view' href='admin.php?page=wordpress-guest-post/wordpressguestpost.php&sns_reviewposts_view=approve&sns_reviewposts_id={$hh->ID}'>Approve</a></td>\n"; echo "<td><a class='view' href='admin.php?page=wordpress-guest-post/wordpressguestpost.php&sns_reviewposts_view=disapprove&sns_reviewposts_id={$hh->ID}' onclick=\"return confirm('" . js_escape(sprintf( __("You are about to delete the slider image '%s'.\n'OK' to delete, 'Cancel' to stop.", 'slider_images'), $hh->id)) . "' );\">Disapprove</a></td>\n"; echo "</tr>"; $class = empty($class)?"alternate":""; $i++; } } ?> </tbody> </table> <?php //echo wppostreviewbyadmin_perpagefun($totalselpostdetails,25,$pno,$getcatlist); ?> <?php echo wppostreviewbyadmin_perpagefun($totalselpostdetails,$paginno,$pno,$getcatlist); ?> </div> <?php } } function wppostreviewbyadmin_get_pages() { global $post; // $nonce= wp_create_nonce('kgp_nonce'); $args = array('post_type' => 'page', 'numberposts' => -1, 'order'=> 'ASC', 'orderby' => 'menu_order'); // $myposts = get_posts('post_type=page'); $myposts = get_posts($args); ?> <select id="wppostreviewbyadmin_guestpage" name="wppostreviewbyadmin_guestpage"> <option value="">Select WordPress Guest Post Page</option> <?php foreach($myposts as $post) : setup_postdata($post); if(get_option('wppostreviewbyadmin_guestpage')==$post->ID) : ?> <option SELECTED value="<?php echo $post->ID; ?>"><?php the_title(); ?></option> <?php else : ?> <option value="<?php echo $post->ID; ?>"><?php the_title(); ?></option> <?php endif; ?> <?php endforeach; ?> </select> <?php } function wppostreviewbyadmin_get_adminemailid() { if(get_option('wppostreviewbyadmin_adminmailid') == "") { $adminemail = get_option('admin_email'); } else { $adminemail = get_option('wppostreviewbyadmin_adminmailid'); } ?> <input type="text" value="<?php echo $adminemail; ?>" name="adminmailid" id="adminmailid" size="50" /> <?php } function wppostreviewbyadmin_get_paginationno() { if(get_option('wppostreviewbyadmin_paginationno') == "") { $postsno = 25; } else { $postsno = get_option('wppostreviewbyadmin_paginationno'); } ?> <input type="text" value="<?php echo $postsno; ?>" name="paginationno" id="paginationno" size="50" /> <?php } function wppostreviewbyadmin_get_enableeditor() { if(get_option('wppostreviewbyadmin_enableeditor') == "") { $enableeditor = ""; } else { $enableeditor = get_option('wppostreviewbyadmin_enableeditor'); } ?> <input type="checkbox" value="Y" name="enableeditor" id="enableeditor" <?php if($enableeditor == "Y") { ?> checked="checked" <?php } ?> /> <?php } function wppostreviewbyadmin_replace_posttitle($posttitle) { $msg=stripslashes(get_option('wppostreviewbyadmin_postappmsg')); $msg=str_replace('%postapp_title%', $posttitle, $msg); return $msg; else { $postssubmsg = get_option('wppostreviewbyadmin_postsubmsg'); } ?> <textarea name="postssubmsg" id="postssubmsg" style="height:200px;" cols="50"><?php echo $postssubmsg; ?></textarea> <?php } function wppostreviewbyadmin_get_postappmsg() { if(get_option('wppostreviewbyadmin_postappmsg') == "") { $postsappmsg = 'Your Post "%postapp_title%" has got reviewed and approved by the admin.'; } else { $postsappmsg = get_option('wppostreviewbyadmin_postappmsg'); } ?> <textarea name="postsappmsg" id="postsappmsg" style="height:200px;" cols="50"><?php echo $postsappmsg; ?></textarea> <?php } function wppostreviewbyadmin_settings() { echo '<div class="wrap"> <h2>Settings</h2> <p></p>'; if(get_option('wppostreviewbyadmin_guestpage') == "") { echo '<div class="error"><p>Please select the page from the dropdown next to "Wordpress Guest Post Page"</p></div>'; } if($_POST) { update_option('wppostreviewbyadmin_guestpage', $_POST['wppostreviewbyadmin_guestpage']); update_option('wppostreviewbyadmin_adminmailid', $_POST['adminmailid']); update_option('wppostreviewbyadmin_paginationno', $_POST['paginationno']); update_option('wppostreviewbyadmin_postsubmsg', stripslashes($_POST['postssubmsg'])); update_option('wppostreviewbyadmin_postappmsg', stripslashes($_POST['postsappmsg'])); update_option('wppostreviewbyadmin_enableeditor', $_POST['enableeditor']); $wppostreviewbyadmin_guestpage = get_option('wppostreviewbyadmin_guestpage'); } // echo "<div id=\"message\" class=\"updated fade\"><p>Setting will be available on upgraded version</p></div>"; ?> <?php if(get_option('wppostreviewbyadmin_enableeditor') != "") { ?> <script type="text/javascript"> tinyMCE.init({ // General options mode : "exact", // mode : "textareas", elements : "post_content", theme : "advanced", plugins : <?php } ?> <?php if($error) { ?> <p style="color:#FF0000; font-weight:bold;"><?php echo $error; ?></p> <?php } ?> <form id="frmaddpost" name="frmaddpost" method="post" action="" enctype="multipart/form-data"> <div class="addpostmaindiv"> <?php } } add_action('the_content', 'callpostcnt'); function callpostcnt($content) { global $post; $theme_name = get_current_theme(); $wppostreviewbyadmin_guestpage = get_option("wppostreviewbyadmin_guestpage"); // if(is_page(get_option('wppostreviewbyadmin_guestpage'))) { if($post->ID == get_option('wppostreviewbyadmin_guestpage')) { if($theme_name == "Thesis") { add_action('thesis_hook_before_post', 'addpostbyuser_func'); } else { add_action('the_content', 'addpostbyuser_func'); return $content = addpostbyuser_func(); } } else { return $content; } } function wp_insert_userpost($postarr) { global $wpdb; $post_title = $postarr["post_title"]; $post_author_name = $postarr["posted_aname"].''.$postarr["posted_lname"]; $post_author_fname = $postarr["posted_aname"]; $post_author_lname = $postarr["posted_lname"]; $post_author_email = $postarr["posted_aemail"]; $post_content = $postarr["post_content"]; $excerpt = $postarr["excerpt"]; $post_tags = $postarr["tags"]; $cat_ids = $postarr["cat"]; $post_status = "publish"; $post_type = "post"; $post_date = date("Y-m-d H:i:s"); $query = "INSERT IGNORE INTO ".$wpdb->prefix."usersposts(post_author_name, post_author_fname, post_author_lname, post_author_email, post_date, post_content, post_title, post_excerpt, post_status, post_type, category_ids, post_tags) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)"; $query = $wpdb->prepare($query, $post_author_name, $post_author_fname, $post_author_lname, $post_author_email, $post_date, $post_content, $post_title, $excerpt, $post_status, $post_type, $cat_ids, $post_tags); $wpdb->query($query); $spl_id = $wpdb->insert_id; if($spl_id != "") { $inspostdetails_query = "SELECT * FROM ".$wpdb->prefix."usersposts where ID = ".$spl_id; $inspostdetails = $wpdb->get_results($inspostdetails_query, ARRAY_A); } $inspostdetails[0]["category_names"] .= get_cat_name($inspostdetails[0]["category_ids"]); $StrMailcontent = ' <html> <head><title>New Post Added in Temp Table</title></head> <body> <div style="border:10px solid #3AABE3float:left;width:610px;"> <table align="center" width="610px" border="0" cellpadding="4" cellspacing="4" align="center"> <tr><td colspan="3"> </td></tr> <tr> <td style="color:#4E6E8E;" colspan="3"><font size="2" face="Verdana, Arial, Helvetica, sans-serif;"><strong>Hi Admin</strong></font></td> </tr> <tr> <td width="130" valign="top" style="color:#4E6E8E;"> <font size="2" face="Verdana, Arial, Helvetica, sans-serif;"><strong>Title Of Article</strong></font> </td> <td width="8" valign="top">:</td> <td width="332" style="color:#4E6E8E;" valign="top"> <font size="2" face="Verdana, Arial, Helvetica, sans-serif;">'.$inspostdetails[0]['post_title'].' </font> </td> </tr>'; $StrMailcontent .= ' <tr> <td valign="top" style="color:#4E6E8E;"> <font size="2" face="Verdana, Arial, Helvetica, sans-serif;"><strong>Author First Name</strong></font> </td> <td width="8" valign="top">:</td> <td valign="top" style="color:#4E6E8E;"> <font size="2" face="Verdana, Arial, Helvetica, sans-serif;">'.$inspostdetails[0]['post_author_fname'].'</font> </td> </tr> <tr> <td valign="top" style="color:#4E6E8E;"> <font size="2" face="Verdana, Arial, Helvetica, sans-serif;"><strong>Author Last Name</strong></font> </td> <td width="8" valign="top">:</td> <td valign="top" style="color:#4E6E8E;"> <font size="2" face="Verdana, Arial, Helvetica, sans-serif;">'.$inspostdetails[0]['post_author_lname'].'</font> </td> </tr>'; $StrMailcontent .= ' <tr> <td style="color:#4E6E8E;" valign="top"> <font size="2" face="Verdana, Arial, Helvetica, sans-serif;"><strong>Article Summary</strong></font> </td> <td width="8" valign="top">:</td> <td style="color:#4E6E8E;" valign="top"> <font size="2" face="Verdana, Arial, Helvetica, sans-serif;">'.$inspostdetails[0]['post_excerpt'].'</font> </td> </tr> <tr> <td style="color:#4E6E8E;" valign="top"> <font size="2" face="Verdana, Arial, Helvetica, sans-serif;"><strong>Article Content</strong></font> </td> <td width="8" valign="top">:</td> <td style="color:#4E6E8E;" valign="top"> <font size="2" face="Verdana, Arial, Helvetica, sans-serif;">'.$inspostdetails[0]['post_content'].'</font> </td> </tr> <tr> <td valign="top" style="color:#4E6E8E;"> <font size="2" face="Verdana, Arial, Helvetica, sans-serif;"><strong>Category</strong></font> </td> <td width="8" valign="top">:</td> <td valign="top" style="color:#4E6E8E;"> <font size="2" face="Verdana, Arial, Helvetica, sans-serif;">'.$inspostdetails[0]['category_names'].'</font> </td> </tr> <tr> <td valign="top" style="color:#4E6E8E;"> <font size="2" face="Verdana, Arial, Helvetica, sans-serif;"><strong>Tags</strong></font> </td> <td width="8" valign="top">:</td> <td valign="top" style="color:#4E6E8E;"> <font size="2" face="Verdana, Arial, Helvetica, sans-serif;">'.$inspostdetails[0]['post_tags'].'</font> </td> </tr> <tr> <td valign="top" style="color:#4E6E8E;"> <font size="2" face="Verdana, Arial, Helvetica, sans-serif;"><strong>Posted on</strong></font> </td> <td width="8" valign="top">:</td> <td valign="top" style="color:#4E6E8E;"> <font size="2" face="Verdana, Arial, Helvetica, sans-serif;">'.$inspostdetails[0]['post_date'].'</font> </td> </tr> <tr> <td valign="top" style="color:#4E6E8E;"> <font size="2" face="Verdana, Arial, Helvetica, sans-serif;"><strong>To review and approve the post</strong></font> </td> <td width="8" valign="top">:</td> <td valign="top" style="color:#4E6E8E;"> <font size="2" face="Verdana, Arial, Helvetica, sans-serif;"><a href=" '.get_option('home').'/wp-admin/admin.php?page=wordpress-guest-post/wordpressguestpost.php&sns_reviewposts_view=approve&sns_reviewposts_id='.$inspostdetails[0]['ID'].'">Click the link to review and approve posts</a></font> </td> </tr>'; $StrMailcontent .= '<tr><td colspan="3"> </td></tr> <tr> <td style="color:#4E6E8E;" colspan="3"> <font size="2" face="Verdana, Arial, Helvetica, sans-serif;">Thanks & Regards <br>'; $StrMailcontent .= $inspostdetails[0]['post_author_fname'].' '.$inspostdetails[0]['post_author_lname']; $StrMailcontent .='</font> </td> </tr> <tr><td style="border-bottom:1px dotted #cccccc" colspan="3"></td></tr> </table> </div> </body> </html>'; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'From: '.$inspostdetails[0]['post_author_name'].'<'.$inspostdetails[0]['post_author_email'].'>'.'' . "\r\n"; $subject = "Artículo en Vidaemigrante | Nuevo artículo para revisar."; $ToEmail = get_option('wppostreviewbyadmin_adminmailid'); mail($ToEmail, $subject, $StrMailcontent, $headers); $StrMailcontent1 = ' <html> <head><title>Articulo recibido en VidaEmigrante</title></head> <body> <div style="border:10px solid #3AABE3float:left;width:610px;"> <table align="center" width="610px" border="0" cellpadding="4" cellspacing="4" align="center"> <tr><td> </td></tr> <tr> <td style="color:#4E6E8E;"><font size="2" face="Verdana, Arial, Helvetica, sans-serif;"><strong>Hola '.$inspostdetails[0]['post_author_fname'].'</strong></font></td> </tr> <tr> <td width="130" valign="top" style="color:#4E6E8E;"> <font size="2" face="Verdana, Arial, Helvetica, sans-serif;"><strong>'; //$StrMailcontent1 .= "Gracias por enviar este artículo a Vida Emigrante. Lo hemos recibido satisfactoriamente y pasará en pocas horas por el proceso de edición. Una vez que el artículo sea aprobado, será publicado en el blog de Vida Emigrante y recibirás una confirmación por email."; $StrMailcontent1 .= get_option('wppostreviewbyadmin_postsubmsg'); $StrMailcontent1 .= '</strong></font> </td> </tr>'; $StrMailcontent1 .= '<tr><td> </td></tr> <tr> <td style="color:#4E6E8E;"> <font size="2" face="Verdana, Arial, Helvetica, sans-serif;">Muchas gracias, <br>El equipo de VidaeMigrante.com</font> </td> </tr> <tr><td style="border-bottom:1px dotted #cccccc"></td></tr> </table> </div> </body> </html>'; $headers1 = 'MIME-Version: 1.0' . "\r\n"; $headers1 .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers1 .= 'From: VidaEmigrante.com<'.get_option('wppostreviewbyadmin_adminmailid').'>'.'' . "\r\n"; $subject1 = "Nuevo artículo enviado a Vidaemigrante"; $ToEmail1 = $inspostdetails[0]['post_author_email']; mail($ToEmail1, $subject1, $StrMailcontent1, $headers1); return $spl_id; } function wppostreviewbyadmin_perpagefun($total,$limit,$page='',$Search='') { global $_REQUEST,$global_config,$_SESSION; $Searchval=$Search; $totalrecords = $total; if($limit=='') $limit=5; //$pagenumber = intval(($offset + $limit) / $limit); $totalpages = intval($totalrecords/$limit); if ($totalrecords%$limit > 0) { // partial page $lastpage = $totalpages * $limit; $totalpages++; } else { $lastpage = ($totalpages - 1) * $limit; } $navstring = " <script type='text/javascript'> function perpages(pno) { document.getElementById('pno').value=pno; document.perpage.submit(); } </script> <div class='perpage' align='right' >"; if ($totalrecords > $limit) { // only show <<PREV NEXT>> row if $totalrecords is greater than $limit $navstring .= " <div><form name='perpage' method='post'> <input type='hidden' name='pno' id='pno' value='' /> <input type='hidden' name='Search' id='Search' value='$Searchval'/>"; $navstring .= "<div align='right' style='padding-right:20px;padding-top:10px;'>"; if($page=='') $page=0; $blocksize=6; if($pagenumber=='') $pagenumber=$page; if ($totalpages < $blocksize) { $blocksize = $totalpages; $firstpage = 1; } elseif($pagenumber > $blocksize) { $firstpage = ($pagenumber-$blocksize) + 2; } elseif ($pagenumber == $blocksize) { $firstpage = 2; } else { $firstpage = 1; } $blocklimit = $blocksize + $firstpage; for ($i=$firstpage;$i<$blocklimit;$i++) { if ($i == $pagenumber) { $navstring .= " <span class='NavPageFont'>$i</span> "; } else { if ($i <= $totalpages) { $nextoffset = $limit * ($i-1); //$navstring .= " <a title='Page ". $i ." of ". $totalpages ."' class='WhiteFont' onmouseover=this.className='WhiteFont-Over' onmouseout=this.className='WhiteFont' href='".$page_url."?pno=".$i."&Search=".$Search."'>$i</a> "; $navstring .= " <a title='Page ". $i ." of ". $totalpages ."' class='WhiteFont' onmouseover=this.className='WhiteFont-Over' onmouseout=this.className='WhiteFont' onclick=perpages('$i') >$i</a> "; } } } $navstring .= "</div></div></form>"; } return $navstring .= "</div>"; } ?>
¡Ojo! ¡Sé que en el código veréis que hay cosas que no se cierran y tal, lo que pasa es que he recortado partes para que quepa!
- El debate ‘Error con plugin de autopublicación por invitados’ está cerrado a nuevas respuestas.