How to add a new Input Field Type?
nier3 Offline
Member
***
Posts: 125
Joined: Jul 2012
Post: #20
RE: How to add a new Input Field Type?
With this I have again error "Invalid value", when I create new thread and when I edit a thread Frown

Custom regex: ^(0?[1-9]|[12]\d|3[01])\-(0?[1-9]|1[012])\-((?:19|20)\d\d)$

Input Formatter: <?=strtotime({VALUE})?>

Input Field HTML:

Code:
<input type="text" class="textbox"{NAME_PROP}{MAXLE​​N_PROP}{WIDTH_PROP_SIZE}{TABINDE​X​_PROP}{REQUIRED_PROP} value="<if {VALUE} && !$mybb->input['my_post_key'] then><?=my_date('dd/mm/yyyy',{VALUE})?><else>{VALUE}</if>" id="datepicker" />


Display format: <?=date('d-m-Y', {VALUE})?>

This custom thread field isn't required.


In the template:

Code:
1
2
3
4
5
6
7
8
9
10
11
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css">

  <script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
  <script src="/datepicker-it.js"></script>
  
<script type="text/javascript">
jQuery(function() {
jQuery("#datepicker").datepicker({ dateFormat: "dd/mm/yyyy" }).val()
$.datepicker.setDefaults($.datepicker.regional['it']);
});
</script>


I need string number in database for move automatically threads every day on date of expiration:

Code:
if ($result = @$mysqli->query("UPDATE mybb_threads 
    LEFT JOIN mybb_threadfields_data
    ON mybb_threads.tid=mybb_threadfields_data.tid
    SET mybb_threads.fid='130' WHERE mybb_threads.fid IN('128','73') AND mybb_threadfields_data.datexp > 0 AND mybb_threadfields_data.datexp < UNIX_TIMESTAMP(NOW())"))

09-23-2015 04:33 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
RE: How to add a new Input Field Type? - nier3 - 09-23-2015 04:33 AM

 Standard Tools
Forum Jump: