Submit Button
Submit Button
Can anyone tell me where the code is that when clicking on the Publish posts a new article?
- fraenkiman
- Posts: 368
- Joined: Thu Feb 03, 2022 7:25 pm
- Location: Berlin, Germany
- Contact:
Re: Submit Button
Hello WineMan,
in the file admin.entry.write.tpl in the directory /admin/panels/entry
Best regards
Frank
in the file admin.entry.write.tpl in the directory /admin/panels/entry
Best regards
Frank
My
Re: Submit Button
Thanks...I want to add an include file after the submit button is clicked...Is this where I would place it or should it be placed in the admin.entry.write.php file
- fraenkiman
- Posts: 368
- Joined: Thu Feb 03, 2022 7:25 pm
- Location: Berlin, Germany
- Contact:
Re: Submit Button
Depending on what the file to be included does, I would include it in the onsave() function in the admin.entry.write.php file.
What are you planning?
What are you planning?
My
Re: Submit Button
I'm planning on generating an email notification being sent to my subscribers. I know...the rss and atom feeds should do that but that is assuming that they have an rss reader. This way, if they subscribe they will be notified of any new articles and once I figure out how/where, they will also be notified of any comments posted.
Re: Submit Button
I'm perplexed. I placed the include code as suggested and as far as I know, it worked since there are no error messages from my webhost, but it did not work. Does Flatpress generate its own error message and if so, where do I find it?
- fraenkiman
- Posts: 368
- Joined: Thu Feb 03, 2022 7:25 pm
- Location: Berlin, Germany
- Contact:
Re: Submit Button
It's starting to get exciting and interesting. The collected e-mail addresses from the input in the widget are collected... In a text file or in the FlatPress configuration file? Do you already have a GDPR-compliant storage option? If possible, the email addresses should not be saved as plain text.
When you click on Save entry, mail() or Postfix is triggered and sends the URL to the created post to all email addresses. Is this already working for you?
When you click on Save entry, mail() or Postfix is triggered and sends the URL to the created post to all email addresses. Is this already working for you?
My
Re: Submit Button
Let's see if I can explain the process without confusion. At the moment, the subscribe widget takes the email address of anyone subscribing and writing it to a text file. The include file I am talking about uses the rss feed to add the title of the newly posted article and adds it to another text file and then generates an email to the subscribers notifying them of the new posted article, with a link to the article itself.
The answer to your question is that when I click on Save entry, the text file containing the titles is not updated and the email is not generated This process works if I enter the include file directly into the address bar however. At firs I thought that I did not have the correct path to the include file, but I am almost positive that is not the case.
The answer to your question is that when I click on Save entry, the text file containing the titles is not updated and the email is not generated This process works if I enter the include file directly into the address bar however. At firs I thought that I did not have the correct path to the include file, but I am almost positive that is not the case.
- fraenkiman
- Posts: 368
- Joined: Thu Feb 03, 2022 7:25 pm
- Location: Berlin, Germany
- Contact:
Re: Submit Button
This may be due to the fact that the new entry is saved with onsave(), but not output/read.
You may have to adapt the onsave() and onpreview() function slightly.
And create a new function outputEntryUrl() that outputs the public URL of the entry after saving.
get_permalink($id); returns the finished URL, which you can then send.
This is not a ready-made solution, just an approach.
You may have to adapt the onsave() and onpreview() function slightly.
Code: Select all
// Additional output of the entry URL
if (!$do_preview && is_numeric($success) && $success > 0) {
$this->outputEntryUrl($success);
}Code: Select all
function onpreview() {
/**
* Outputs the public URL of the entry after saving.
*
* @param int $id The ID of the entry just saved.
*/
protected function outputEntryUrl($id) {
$url = get_permalink($id);
//if ($url) {
//echo '<div class="entry-url">';
//echo 'URL of the entry: <a href="' . esc_url($url) . '">' . esc_html($url) . '</a>';
//echo '</div>';
//}
}
global $lang;
$this->_makePreview($this->_getposteddata());
$this->_getCatsFlags();
add_filter('wp_title', array(
&$this,
'makePageTitle'
), 10, 2);
if ($this->draft) {
add_filter('admin_body_class', array(
&$this,
'draft_class'
));
}
return 0;
}This is not a ready-made solution, just an approach.
- Attachments
-
- admin.entry.write.zip
- (1.96 KiB) Downloaded 818 times
My
Re: Submit Button
Where would I add the include file in the revised admin.entry.write.php file...after the onpreview module?
Who is online
Users browsing this forum: No registered users and 3 guests