This topic contains a post which is marked as Best Answer. Press here if you would like to see it.
*

siken

  • ****
  • 138 posts
predefined text in the item-post.php fields?
« on: February 04, 2018, 03:32:12 AM »
In itempost.php how can I put a predefined text in the title field?
« Last Edit: February 06, 2018, 05:37:45 PM by alexandromt »

*

MB Themes

Re: predefined text in the title field?
« Reply #1 on: February 05, 2018, 11:24:38 AM »
@alexandromt
Only via jQuery
Code: [Select]
$('input[id^=title]').prop('placeholder', 'some cool text');
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

siken

  • ****
  • 138 posts
Re: predefined text in the title field?
« Reply #2 on: February 05, 2018, 02:45:23 PM »
Where do I put that line? In what file? At the beginning or at the end? ...

*

MB Themes

Re: predefined text in the title field?
« Reply #3 on: February 05, 2018, 05:36:51 PM »
@alexandromt
Into javascript.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

siken

  • ****
  • 138 posts
Re: predefined text in the title field?
« Reply #4 on: February 05, 2018, 10:45:57 PM »
In what file?

*

MB Themes

Re: predefined text in the title field?
« Reply #5 on: February 06, 2018, 08:20:15 AM »
File with .js extension, ideally theme global.js
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

siken

  • ****
  • 138 posts
Re: predefined text in the title field?
« Reply #6 on: February 06, 2018, 03:46:23 PM »
http://prntscr.com/iaxbuy

It ask me to enter a title in the field. I have a sentence of recommendation, but what I want is that the field is filled or that I do not need to fill it out.
Is it possible that if you leave the Title field blank, that "View photo" is published?

Marked as best answer by leales_org on February 08, 2018, 09:43:08 AM
*

MB Themes

Re: predefined text in the title field?
« Reply #7 on: February 06, 2018, 03:49:47 PM »
$('input[id^=title]').prop('value', 'some cool pre-text');

You probably still need some title length on osclass.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

siken

  • ****
  • 138 posts
Re: predefined text in the title field?
« Reply #8 on: February 06, 2018, 04:05:36 PM »
Exactly, you have to add that last line and write the value you want by default. It is ideal for those who want to publish a poster with all the information in the image and do not want to write any title ... Faster and easier ...

*

siken

  • ****
  • 138 posts
Re: predefined text in the title field?
« Reply #9 on: February 06, 2018, 05:36:27 PM »
I already know how to automate the text in the Description field:

       static protected function generic_textarea($name, $value) {
            $name = osc_esc_html($name);
      if($value=='') echo '<textarea id="' . preg_replace('|([^_a-zA-Z0-9-]+)|', '', $name) . '" name="' . $name . '" rows="10">HERE YOUR PREDEFINED TEXT</textarea>';

in the form.form.class.php file of oc-includes / osclass / frm

And to finish the automation, I need to know how to put the predefined text in the E-mail field

By the way, for the next version of Veronika you could put in the settings a box if you want to leave a predefined text in the fields of Title, Description or E-mail.

The idea of the predefined e-mail is because there are those who do not use the e-mail or do not have it and want to only put their mobile phone number. And so do not leave so many errors of "must fill X field"

The question is:

How do you put the predefined text in the e-mail field?

*

MB Themes

Re: predefined text in the item-post.php fields?
« Reply #10 on: February 06, 2018, 07:34:06 PM »
Code: [Select]
$('input[name="s_email"]').val('[email protected]');
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

siken

  • ****
  • 138 posts
Re: predefined text in the item-post.php fields?
« Reply #11 on: February 06, 2018, 09:06:14 PM »
Unfortunately it does not work.


I have this code to create an automatic email at each user's visit: <?php $t=time(); echo($t . "@mymail.org"); ?>

The idea is to be able to offer a different email to users who do not want to put their email and just want to put their mobile phone. The problem is that I do not know how to put it as predefined text. Can you help me ?, thanks.

*

MB Themes

Re: predefined text in the item-post.php fields?
« Reply #12 on: February 07, 2018, 09:12:33 AM »
Code: [Select]
$('input[name="contactEmail"]').val('<?php $t=time(); echo($t "@mymail.org"); ?>');
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

siken

  • ****
  • 138 posts
Re: predefined text in the item-post.php fields?
« Reply #13 on: February 08, 2018, 09:41:58 AM »
Code: [Select]
$('input[name="contactEmail"]').val('<?php $t=time(); echo($t "@mymail.org"); ?>');

It works very well by putting it in footer.php

Now, whoever wants to publish with his mobile and without mail, can do it and the system will automatically create an account with the name of my domain. Every time you enter you have a different mail placed. Thread closed, thanks.

*

MB Themes

Re: predefined text in the item-post.php fields?
« Reply #14 on: February 08, 2018, 09:44:18 AM »
Welcome
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots