steeleweed
Forum Replies Created
-
Forum: Plugins
In reply to: [Latest Posts by Author] Usernames with blanks etcCode work bur you disable Editors from editing Admin’s posts, which is a problem. Role Manager plugi N/A or not supported by current WP.
Is there a way to only block Editors if the post has PHP? We don’t put PHP in posts (altho we could, so I understand your logic), but I would like to use it ina Page (which editors never touch).Forum: Plugins
In reply to: [Latest Posts by Author] Usernames with blanks etcWorking code in case someone else wants a Page:
<?php
/*
Search for posts by author.
Returns list of links to posts.
Requires:
exec_php plugin
latestbyauthor plugin
*/
if (!isset($_POST[‘submit’]))
{
echo ‘<form action=”” method=”post”>’;
echo ‘Author: <input type=”text” name=”who”>
‘;
echo ‘Number:<input type=”text” name=”many” value=”10″>
‘;
echo ‘<input type=”submit” name=”submit” value=”Search”>’;
echo “</form>”;
}
else
{
$v = ‘”‘;
$q = “]”;
$x = “[latestbyauthor author=”.”$v”;
$w = $_POST[‘who’];
$y = “$v”.” show=”.$_POST[‘many’];
$z = “$x”.”$w”.”$y”.”$q”;echo “$z”;]
}
?>Forum: Plugins
In reply to: [Latest Posts by Author] Usernames with blanks etcBTW: Thanks for the prompt response – and the plugin.
Forum: Plugins
In reply to: [Latest Posts by Author] Usernames with blanks etcFixed the problem by tweaking my cod based on your comment that quotes are needed.
Instead of framing the name with quotes when entering into the form, I inserted quotes before and after the name when constructing the string for the short code.
Search for John Smith now yields shortcode:
[latestbyauthor author=”John Smith” show=10]
It works!Search for John yields shortcode:
[latestbyauthor author=”John” show=10]
Quotes not needed but cause no problem. ??Forum: Plugins
In reply to: [Latest Posts by Author] Usernames with blanks etcThe code posted above lacks some ending apostrophes and/or semi-colons which were in the code – sloppy copy/paste ??
Forum: Plugins
In reply to: [Latest Posts by Author] Usernames with blanks etcProgramming various machines and languages for 50 years.
My first attempt at PHP.Code on the page is:
<?php
if (!isset($_POST[‘submit’]))
{
echo ‘<form action=”” method=”post”>’;
echo ‘Author: <input type=”text” name=”who”>
‘;
echo ‘Number:<input type=”text” name=”many” value=”10″>
‘;
echo ‘<input type=”submit” name=”submit” value=”Search”>’;
echo “</form>”;
}
else
{
$q = “]”;
$x = “[latestbyauthor author=”;
$w = $_POST[‘who’];
$y = ” show=”.$_POST[‘many’];
$z = “$x”.”$w”.”$y”.”$q”;
echo “$z”;
}
?>Works for users with no space/blank in name.
Trying to debug the problem, I removed the [ ] from $q and $x so that $z was just a string instead of shortcode.
Search for John Doe created string:
latestbyauthor author=John Doe show=10Search for “John Doe” created string:
latestbyauthor author=\”John Doe\” show=10Don’t know where the \s came from. My bad PHP?
Forum: Plugins
In reply to: [Latest Posts by Author] Usernames with blanks etcFYI:
Removed the brackets { and } from the string to verify output without executing it as shortcode. Result as expected was:
latestbyauthor author=John Smith show=10
Shortcode of [latestbyauthor author=John Smith show=10] fails to display John Smith’s posts. If I searched “John Smith”, PHP passes a string with backslash inserted front & back – and I get my own posts.
Anything between ‘author=’ and ‘show=’ should be considered username.
Forum: Fixing WordPress
In reply to: Controlling threads and postingsIssue 2 resolved via Author Category Plugin. . Issue 3 is on the back burner for now.
Forum: Fixing WordPress
In reply to: Controlling threads and postingsIssue 1 resolved – plugin Ultimate Category Excluder was used to prevent Newswire category from showing on Front Page.
Issues 2 & 3 still unresolved