Quote:
Originally Posted by zerovic
here's another version..sorry, the code is a bit messy, but does the job you need
this will work with links, titles and descriptions.. you set the number of posts, separator and the order you want to display and it will display it to you...
again, the code is messy as hell, but it works
Code:
<?php
include('wp-load.php');
if($_POST['number']) {
query_posts('showposts=' . $_POST['number']);
while (have_posts()) : the_post();
if($_POST['order_1'] == "url") {
echo the_permalink();
}
if($_POST['order_1'] == "title") {
echo get_the_title();
}
if($_POST['order_1'] == "description") {
echo get_the_content();
}
if($_POST['order_1'] != "none") { if($_POST['separator'] == "tab") { echo "\t"; } else { echo $_POST['separator']; } }
if($_POST['order_2'] == "url") {
echo the_permalink();
}
if($_POST['order_2'] == "title") {
echo get_the_title();
}
if($_POST['order_2'] == "description") {
echo get_the_content();
}
if($_POST['order_2'] != "none") { if($_POST['separator'] == "tab") { echo "\t"; } else { echo $_POST['separator']; } }
if($_POST['order_3'] == "url") {
echo the_permalink();
}
if($_POST['order_3'] == "title") {
echo get_the_title();
}
if($_POST['order_3'] == "description") {
echo get_the_content();
}
echo "<br />";
endwhile;
} else {
echo "<form method=\"post\">";
echo "<label>Number Of Posts</label> <input type=\"text\" name=\"number\" /><br />";
echo "<label>Order</label> <select name=\"order_1\"><option value=\"none\">None</option><option value=\"url\">URL</option><option value=\"title\">Title</option><option value=\"description\">Description</option></select>";
echo "<select name=\"order_2\"><option value=\"none\">None</option><option value=\"url\">URL</option><option value=\"title\">Title</option><option value=\"description\">Description</option></select>";
echo "<select name=\"order_3\"><option value=\"none\">None</option><option value=\"url\">URL</option><option value=\"title\">Title</option><option value=\"description\">Description</option></select><br />";
echo "<label>Separator</label> <select name=\"separator\"><option value=\"|\">|</option><option value=\"tab\">TAB</option><option value=\";\">;</option><option value=\":\">:</option></select>";
echo "<input type=\"submit\" value=\"export\" />";
echo "</form>";
}
?>
|
didn't tried 1st code, just 2nd one - works perfect!
thanks a lot, let me know if you would have some asian site i'll help you start with some traffic
