Sapphire_luna232
Forum Replies Created
-
You’re very welcome! ^^
Hi guys,
There are two files you have to modify for this fix. To access them, go to your Dashboard –> Plugins –> Editor. Select ‘Post from Site’ in the dropdown menu on the upper right, hit ‘Select’. You should see a list of editable files for the plugin appear as blue links below the dropdown menu.
The first file you need to edit for this fix is: “post-from-site/post-from-site.class.php“
There should be a line somewhere that looks something like:
$out .= “<form class=’pfs’ id=’pfs_form’ method=’post’ action='”.plugins_url(“pfs-submit.php”,__FILE__). “‘ enctype=’multipart/form-data’>\n”;
near the beginning of this line, where it says: form class = ‘pfs’, delete ONLY the pfs (not the single quotes around it), so that it now says
$out .= “<form class=” id=’pfs_form’ method=’post’ action='”.plugins_url(“pfs-submit.php”,__FILE__). “‘ enctype=’multipart/form-data’>\n”;
The second file you want to edit is: “post-from-site/pfs-submit.php“
scroll to the bottom of the code. You should see a few lines that go something like:
if (!empty($_POST)){
$pfs = pfs_submit($_POST,$_FILES);
echo json_encode($pfs);
//echo “<pre style=\”border:1px solid #ccc;margin-top:5px;\”>”.print_r($pfs, true).”\n”;Below the last line, add:
wp_redirect(“https://www.blah-blah-redirect-to-this-address.com”);
exit;so that the line now reads:
if (!empty($_POST)){
$pfs = pfs_submit($_POST,$_FILES);
echo json_encode($pfs);
//echo “<pre style=\”border:1px solid #ccc;margin-top:5px;\”>”.print_r($pfs, true).”\n”;
wp_redirect(“https://www.blah-blah-redirect-to-this-address.com”);
exit;add the address you wish to redirect the user to upon successful submission of a post in place of the “blah-blah-etc”. Make sure you use double quotes “like this” instead of single quotes ‘like this’ around your address, or your browser may read the code and result in an “unexpected ‘:’ ” error.
Personally, I redirected my users to a page I had created with a ‘Your submission has been successful!” message so that they would be reassured that their submission had gone through, but you could also redirect users to your homepage, an external page somewhere on the net outside of your WordPress site, etc.
Hope that helps, let me know if you have any more questions!
~AnnaChang-
Thanks for the fix; after experiencing the same ‘no visible reaction’ error, I deleted the ‘pfs’ class, added wp_redirect, and after initially getting an “unexpected ‘:'” error, placed double quotes “” around the address I was trying to redirect to. Worked like a charm!
Thanks again,
~AnnaForum: Plugins
In reply to: [Quick Post Widget] Quick Post Widget in Page Viewhaha, I’m having almost the opposite problem. Similar to you, it works on sidebar with no issues.
But in-page, I get nothing! no post whatsoever.
update:
locating “session_start();” in setsess.php, quick-post-widget.php, and CaptchaSecurityImage.php and replacing that with “session_save_path(“/tmp”); session_start();” causes error on login page to go away, and captcha images successfully appear on the page.
However, page still reloads upon ‘submit’- no success message, nothing is posted. Ideas?