TimeJunky Posted June 22, 2004 Posted June 22, 2004 For hours, I 'am analysing the source code of banner_manager.php (and more) now. Unfortunately, I was still unable to programm a solution. After installing multi_admin_levels, I intend to define a field for admins' birthdays. The table admin is altered inluding birthday in the format datetime already. 1) I added following lines in the main code of admin/admin_members.php below <title...>. <link rel="stylesheet" type="text/css" href="includes/stylesheet.css"> <script language="javascript" src="includes/general.js"></script> <script language="javascript"> 2) Afterwards, I added in admin/admin_members.php after the case 'new_member': $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW . '</b>'); $contents = array('form' => tep_draw_form('newmember', FILENAME_ADMIN_MEMBERS, 'action=member_new&page=' . $page . '&mID=' . $HTTP_GET_VARS['mID'], 'post', 'enctype="multipart/form-data"')); if ($HTTP_GET_VARS['error']) { $contents[] = array('text' => TEXT_INFO_ERROR); } $contents[] = array('text' => '<br> ' . TEXT_INFO_FIRSTNAME . '<br> ' . tep_draw_input_field('admin_firstname')); $contents[] = array('text' => '<br> ' . TEXT_INFO_LASTNAME . '<br> ' . tep_draw_input_field('admin_lastname')); this binding codes: $contents[] = array('text' => '<br> ' . TEXT_INFO_BIRTHDAY . '<br> ' . tep_draw_input_field('admin_birthday')); (the constanst TEXT_INFO_BIRTHDAY is defined in admin_members.php within the language folder.) My problem: According to the example of banner_manager, I have to put after (2) following similar code inbetween the lines of admin/admin_members.php. The question above all is 'HOW?' <link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css"> <script language="JavaScript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script> <script language="javascript"> var dateExpires = new ctlSpiffyCalendarBox("dateExpires", "new_banner", "expires_date","btnDate1","<?php echo $bInfo->expires_date; ?>",scBTNMODE_CUSTOMBLUE); var dateScheduled = new ctlSpiffyCalendarBox("dateScheduled", "new_banner", "date_scheduled","btnDate2","<?php echo $bInfo->date_scheduled; ?>",scBTNMODE_CUSTOMBLUE); </script> and the second: <td valign="top" class="main"><?php echo TEXT_BANNERS_EXPIRES_ON; ?><br><small>(dd/mm/yyyy)</small></td> <td class="main"><script language="javascript">dateExpires.writeControl(); dateExpires.dateFormat="dd/MM/yyyy";</script><?php echo TEXT_BANNERS_OR_AT . '<br>' . tep_draw_input_field('expires_impressions', $bInfo->expires_impressions, 'maxlength="7" size="7"') . ' ' . TEXT_BANNERS_IMPRESSIONS; ?></td> Unfortunatelly, it is not apparently how to implement the java code according to "$contents[] = array('text' => '<br> ' . TEXT_INFO_BIRTHDAY . '<br> ' . tep_draw_input_field('admin_birthday'));" for controlling the callendar input output to the database :( Who can help me :?:
TimeJunky Posted July 10, 2004 Author Posted July 10, 2004 No one an idea? Nobody knowing where to find a manual?
TimeJunky Posted July 10, 2004 Author Posted July 10, 2004 After hours I got it. Although it is very much of a pity that nobody helped me... here is the solution to help other people facing similar problems. Step 1) see above... step is okay 2) You have to code like this in the part of calling 'source defining arrays': $contents[] = array('text' => '<br> ' . TEXT_INFO_BIRTHDAY . "<br> <small>(YYYY-MM-DD)</small><br> <script language=\"javascript\">dateScheduled.writeControl(); dateScheduled.dateFormat=\"dd/MM/yyyy\"; </script></tr>" . "\n" ); see also http://www.oscommerce.com/forums/index.php?sho...=0entry128275 3) Put in somewhere in the code after <!-- body //--> If you know how, you can change the size of popping up calender with: <div id="spiffycalendar" class="text"></div> If you don't know how, you should try following values: <div id="spiffycalendar" class="text" style="position: absolute; left: 138px; top: 153px; width: 244px; height: 180px"></div> 4) After that you need somewhere in the source after <!-- body //-->: <link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css"> <script language="JavaScript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script> <script language="javascript"> var dateScheduled = new ctlSpiffyCalendarBox("dateScheduled", "_NAME_OF_CALLING_FORM_", "_NAME_OF_DB_TABLE_FIELD_","btnDate1","_DEFAULT_",scBTNMODE_CUSTOMBLUE); var dateScheduled = new ctlSpiffyCalendarBox </script> Remember: - This may be a good choice for most purposes of _DEFAULT_ - : <?php echo strftime("%d/%m/%Y") ?> e.g. var dateScheduled = new ctlSpiffyCalendarBox("dateScheduled", "_NAME_OF_CALLING_FORM_", "_NAME_OF_DB_TABLE_FIELD_","btnDate1","<?php echo strftime(\"%d/%m/%Y\") ?>",scBTNMODE_CUSTOMBLUE) - If you break a php-code for inserting html, do not forget to interrupt accordingly: ... ?> here are my html-code or <script language="JavaScript" src="includes/javascript/...."> var test ...</script> <?php echo $test; ... Example values: var admin_birthday = new ctlSpiffyCalendarBox("admin_birthday", "newmember", "admin_birthday","btnDate1","",scBTNMODE_CUSTOMBLUE); case 'new_member': $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW . '</b>'); $contents = array('form' => tep_draw_form('newmember', FILENAME_ADMIN_MEMBERS, 'action=member_new&page=' . $page . '&mID=' . $HTTP_GET_VARS['mID'], 'post', 'enctype="multipart/form-data"')); if ($HTTP_GET_VARS['error']) { $contents[] = array('text' => TEXT_INFO_ERROR); } $contents[] = array('text' => '<br> ' . TEXT_INFO_FIRSTNAME . '<br> ' . tep_draw_input_field('admin_firstname')); $contents[] = array('text' => '<br> ' . TEXT_INFO_LASTNAME . '<br> ' . tep_draw_input_field('admin_lastname')); ... $contents[] = array('text' => '<br> ' . TEXT_INFO_BIRTHDAY . "<br> <small>(DD/MM/YYYY)</small><br> <script language=\"javascript\">admin_birthday.writeControl(); admin_birthday.dateFormat=\"dd/MM/yyyy\"; </script></tr>" . "\n" );
Recommended Posts
Archived
This topic is now archived and is closed to further replies.