コード例 #1
0
ファイル: format.class.php プロジェクト: Nvenom/Cellwiz
 public static function TIME_AGO($T, $R)
 {
     if (STRPOS($T, ':') !== FALSE) {
         $T = STRTOTIME($T);
     }
     $C = TIME();
     $D = $C - $T;
     $P = array('second', 'minute', 'hour', 'day', 'week', 'month', 'year', 'decade');
     $L = array(1, 60, 3600, 86400, 604800, 2630880, 31570560, 315705600);
     for ($V = SIZEOF($L) - 1; $V >= 0 && ($N = $D / $L[$V]) <= 1; $V--) {
     }
     if ($V < 0) {
         $V = 0;
     }
     $_T = $C - $D % $L[$V];
     $N = FLOOR($N);
     if ($N != 1) {
         $P[$V] .= 's';
     }
     $X = SPRINTF("%d %s ", $N, $P[$V]);
     if ($R == 1 && $V >= 1 && $C - $_T > 0) {
         $X .= self::TIME_AGO($_T);
     }
     return $X;
 }
コード例 #2
0
 public function saveMarketHighlight(MarketHighlight $MarketHighlight)
 {
     $data = array('forex' => $MarketHighlight->forex, 'aev' => $MarketHighlight->aev, 'ap' => $MarketHighlight->ap, 'ubp' => $MarketHighlight->ubp, 'mh_date' => $MarketHighlight->mh_date, 'mh_time' => Date("H:i", STRTOTIME($MarketHighlight->mh_time)), 'blockout_aev' => $MarketHighlight->blockout_aev, 'blockout_ap' => $MarketHighlight->blockout_ap, 'blockout_ubp' => $MarketHighlight->blockout_ubp, 'bo_aev_from' => $MarketHighlight->bo_aev_from, 'bo_aev_to' => $MarketHighlight->bo_aev_to, 'bo_ap_from' => $MarketHighlight->bo_ap_from, 'bo_ap_to' => $MarketHighlight->bo_ap_to, 'bo_ubp_from' => $MarketHighlight->bo_ubp_from, 'bo_ubp_to' => $MarketHighlight->bo_ubp_to, 'status' => $MarketHighlight->status);
     $id = (int) $MarketHighlight->market_highlights_id;
     if ($id == 0) {
         $this->tableGateway->insert($data);
     } else {
         if ($this->getMarketHighlight($id)) {
             $this->tableGateway->update($data, array('market_highlights_id' => $id));
         } else {
             throw new \Exception('Market highlight id does not exist');
         }
     }
 }
コード例 #3
0
ファイル: index.php プロジェクト: Miroqil/fabfi
	map = new google.maps.Map(document.getElementById("map_canvas"),mapOptions);

	<?php 
    $lines_array = array();
    // This array holds the lines we've drawn
    mysql_select_db($map_db, $con);
    $query = mysql_query("SELECT * FROM  `node`");
    while ($row = mysql_fetch_array($query)) {
        if (time() - STRTOTIME($row['timestamp']) < 180) {
            $node_status = "UP";
        } elseif (time() - STRTOTIME($row['timestamp']) < 600) {
            $node_status = "TEMPDOWN";
        } elseif (time() - STRTOTIME($row['timestamp']) < 86400) {
            $node_status = "DOWN";
        } elseif (time() - STRTOTIME($row['timestamp']) > 86400) {
            $node_status = "DEAD";
        } else {
            $node_status = "UNKNOWN";
        }
        $node_coordinates = $row['latitude'] . ", " . $row['longitude'];
        $node_type = $row['type'] . "_NODE";
        $node_icon = $node_type . "_" . $node_status;
        $node_fabfi_number = $row['fabfi_number'];
        $node_ip = $row['ipv6_address'];
        $node_id = $node_fabfi_number;
        $node_info = $row['node_info'];
        mysql_select_db($cacti_db, $cacti_con);
        $cacti_graph = mysql_fetch_array(mysql_query("select `id` from `graph_tree_items` where `host_id` =' " . $row['cacti_index'] . "' limit 1 "));
        $cacti_graph_id = $cacti_graph['id'];
        if (is_null($cacti_graph_id)) {
コード例 #4
0
ファイル: PostScheduler2.php プロジェクト: VBGAMER45/SMFMods
function EditPost2()
{
    global $txt, $smcFunc, $sourcedir;
    checkSession('post');
    // Get the ID
    $id = (int) $_REQUEST['id'];
    if (empty($id)) {
        fatal_error($txt['postscheduler_nopostselected'], false);
    }
    // If we came from WYSIWYG then turn it back into BBC regardless.
    if (!empty($_REQUEST['message_mode']) && isset($_REQUEST['message'])) {
        require_once $sourcedir . '/Subs-Editor.php';
        $_REQUEST['message'] = html_to_bbc($_REQUEST['message']);
        // We need to unhtml it now as it gets done shortly.
        $_REQUEST['message'] = un_htmlspecialchars($_REQUEST['message']);
    }
    $subject = $smcFunc['htmlspecialchars']($_REQUEST['subject'], ENT_QUOTES);
    $boardselect = (int) $_REQUEST['boardselect'];
    $postername = str_replace('"', '', $_REQUEST['postername']);
    $postername = str_replace("'", '', $postername);
    $postername = str_replace('\\', '', $postername);
    $postername = $smcFunc['htmlspecialchars']($postername, ENT_QUOTES);
    $msgicon = $smcFunc['htmlspecialchars']($_REQUEST['msgicon'], ENT_QUOTES);
    $message = $smcFunc['htmlspecialchars']($_REQUEST['message'], ENT_QUOTES);
    $topicid = (int) $_REQUEST['topicid'];
    if ($subject == '') {
        fatal_error($txt['postscheduler_err_subject'], false);
    }
    if ($postername == '') {
        fatal_error($txt['postscheduler_err_postername'], false);
    }
    if ($boardselect == 0) {
        fatal_error($txt['postscheduler_err_forum'], false);
    }
    if ($message == '') {
        fatal_error($txt['postscheduler_err_message'], false);
    }
    $topiclocked = isset($_REQUEST['topiclocked']) ? 1 : 0;
    $month = (int) $_REQUEST['month'];
    $day = (int) $_REQUEST['day'];
    $year = (int) $_REQUEST['year'];
    $hour = (int) $_REQUEST['hour'];
    $minute = (int) $_REQUEST['minute'];
    $ampm = $_REQUEST['ampm'];
    $minute = str_pad($minute, 2, "0", STR_PAD_LEFT);
    $time_in_24_hour_format = DATE("H", STRTOTIME("{$hour}:{$minute} {$ampm}"));
    if (!empty($month) && !empty($day) && !empty($year)) {
        $post_time = mktime($time_in_24_hour_format, $minute, 0, $month, $day, $year);
    } else {
        fatal_error($txt['postscheduler_err_date'], false);
    }
    // Lookup the Memeber ID of the postername
    $memid = 0;
    $dbresult = $smcFunc['db_query']('', "\n\tSELECT \n\t\treal_name, ID_MEMBER \n\tFROM {db_prefix}members \n\tWHERE real_name = '{$postername}' OR member_name = '{$postername}'  LIMIT 1");
    $row = $smcFunc['db_fetch_assoc']($dbresult);
    $smcFunc['db_free_result']($dbresult);
    if ($smcFunc['db_affected_rows']() != 0) {
        $memid = $row['ID_MEMBER'];
    }
    $smcFunc['db_query']('', "\n\t\tUPDATE {db_prefix}postscheduler \n\t\tSET \n\t\t\tID_BOARD = {$boardselect}, subject = '{$subject}', postername  = '{$postername}', ID_MEMBER = {$memid}, locked = '{$topiclocked}', \n\t\t\tbody = '{$message}',id_topic = '{$topicid}',post_time = '{$post_time}',\n\t\t\tmsgicon  = '{$msgicon}'\n\n\t    WHERE ID_POST = {$id} LIMIT 1");
    // Redirect to the Admin
    redirectexit('action=admin;area=postscheduler;sa=admin');
}
コード例 #5
0
ファイル: Global.php プロジェクト: uskumar33/DeltaONE
 public static function _sendCalendarEmailOld1($options)
 {
     // Pear Mail Library
     require_once "Mail.php";
     $email_model = new Default_Model_EmailLogs();
     $date = new Zend_Date();
     if (is_array($options['toEmail'])) {
         $toemailData = implode(',', $options['toEmail']);
     } else {
         $toemailData = $options['toEmail'];
     }
     $meeting_duration = 3600;
     // 1hours
     $ISTTimeDifferenceInMS = 16200;
     $from_address = !empty($options['fromEmail']) ? $options['fromEmail'] : SUPERADMIN_EMAIL;
     $from_name = !empty($options['fromName']) ? $options['fromName'] : DONOTREPLYNAME;
     $to_name = isset($options['toName']) ? $options['toName'] : NULL;
     $to_address = $toemailData;
     $startTime = !empty($options['starttime']) ? $options['starttime'] : "01/01/2015 13:00:00";
     /* Meeting Stamp = Interview Date + Time */
     $startdatetime = sprintf("%s %s", $options['interviewdate'], $options['starttime']);
     $meetingstamp = STRTOTIME($startdatetime . " UTC");
     //$endTime = (!empty($options['endtime'])) ? $options['endtime'] : "01/01/2015 14:00:00";
     //$meetingstamp = STRTOTIME($startTime . " UTC");
     $dtstart = GMDATE("Ymd\\THis\\Z", $meetingstamp - $ISTTimeDifferenceInMS);
     $dtend = GMDATE("Ymd\\THis\\Z", $meetingstamp - ($ISTTimeDifferenceInMS + $meeting_duration));
     $subject = $options['subject'];
     $description = str_replace("\r\n", "\\n", $options['message']);
     $location = !empty($options['location']) ? $options['location'] : "Delta HR Office";
     $domain = 'deltaintech.com';
     $cal_unique_id = isset($options['calUniqueID']) ? $options['calUniqueID'] : date("Ymd\\TGis", strtotime($startTime)) . rand() . "@" . $domain;
     $cal_method = isset($options['method']) ? $options['method'] : 'REQUEST';
     $mime_boundary = "----Meeting Booking----" . MD5(TIME());
     $headers = array("From" => $from_name . " <" . $from_address . ">", "Reply-To" => $from_name . " <" . $from_address . ">", "MIME-Version" => "1.0", "Content-Type" => "multipart/alternative; boundary=\"{$mime_boundary}\"", "Content-class" => "urn:content-classes:calendarmessage");
     //Create Email Body (HTML)
     $message = "--{$mime_boundary}\r\n";
     $message .= "Content-Type: text/html; charset=UTF-8\n";
     $message .= "Content-Transfer-Encoding: 8bit\n\n";
     $message .= "<html>\n";
     $message .= "<body>\n";
     $message .= '<p>Dear ' . $to_name . ',</p>';
     $message .= '<p>' . $description . '</p>';
     $message .= "</body>\n";
     $message .= "</html>\n";
     $message .= "--{$mime_boundary}\r\n";
     $ical = 'BEGIN:VCALENDAR' . "\r\n" . 'PRODID:-//Microsoft Corporation//Outlook 10.0 MIMEDIR//EN' . "\r\n" . 'VERSION:2.0' . "\r\n" . 'METHOD:' . $cal_method . "\r\n" . 'BEGIN:VTIMEZONE' . "\r\n" . 'TZID:(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi' . "\r\n" . 'BEGIN:STANDARD' . "\r\n" . 'DTSTART:20091101T020000' . "\r\n" . 'RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11' . "\r\n" . 'TZOFFSETFROM:-0400' . "\r\n" . 'TZOFFSETTO:-0500' . "\r\n" . 'TZNAME:EST' . "\r\n" . 'END:STANDARD' . "\r\n" . 'BEGIN:DAYLIGHT' . "\r\n" . 'DTSTART:20090301T020000' . "\r\n" . 'RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2SU;BYMONTH=3' . "\r\n" . 'TZOFFSETFROM:-0500' . "\r\n" . 'TZOFFSETTO:-0400' . "\r\n" . 'TZNAME:EDST' . "\r\n" . 'END:DAYLIGHT' . "\r\n" . 'END:VTIMEZONE' . "\r\n" . 'BEGIN:VEVENT' . "\r\n" . 'ORGANIZER;CN="' . $from_name . '":MAILTO:' . $from_address . "\r\n" . 'ATTENDEE;CN="' . $to_name . '";ROLE=REQ-PARTICIPANT;RSVP=TRUE:MAILTO:' . $to_address . "\r\n" . 'LAST-MODIFIED:' . date("Ymd\\TGis") . "\r\n" . 'UID:' . $cal_unique_id . "\r\n" . 'DTSTAMP:' . date("Ymd\\TGis") . "\r\n" . 'DTSTART:' . $dtstart . "\r\n" . 'DTEND:' . $dtend . "\r\n" . 'TRANSP:OPAQUE' . "\r\n" . 'SEQUENCE:1' . "\r\n" . 'SUMMARY:' . $subject . "\r\n" . 'LOCATION:' . $location . "\r\n" . 'CLASS:PUBLIC' . "\r\n" . 'PRIORITY:5' . "\r\n" . 'BEGIN:VALARM' . "\r\n" . 'TRIGGER:-PT15M' . "\r\n" . 'ACTION:DISPLAY' . "\r\n" . 'DESCRIPTION:Reminder' . "\r\n" . 'END:VALARM' . "\r\n" . 'END:VEVENT' . "\r\n" . 'END:VCALENDAR' . "\r\n";
     $message .= 'Content-Type: text/calendar;name="meeting.ics";method=REQUEST\\n';
     $message .= "Content-Transfer-Encoding: 8bit\n\n";
     $message .= $ical;
     //$options['ical'] = (!empty($options['ical'])) ? $options['ical'] : $ical;
     $options['message'] = $message;
     $data = array('toEmail' => $toemailData, 'toName' => isset($options['toName']) ? $options['toName'] : NULL, 'emailsubject' => $options['subject'], 'header' => $options['header'], 'message' => $message, 'createddate' => $date->get('yyyy-MM-dd HH:mm:ss'), 'modifieddate' => $date->get('yyyy-MM-dd HH:mm:ss'));
     /* if (isset($options['cc']))
        $data['cc'] = $options['cc'];
        if (isset($options['bcc']))
        $data['bcc'] = $options['bcc']; */
     $id = $email_model->SaveorUpdateEmailData($data, '');
     if (!isset($options['cron'])) {
         //$mail_status = sapp_Mail::_emailascalendar($options);
         $smtp = Mail::factory('smtp', array('host' => MAIL_TLS . '://' . MAIL_SMTP, 'port' => MAIL_PORT, 'auth' => true, 'username' => MAIL_USERNAME, 'password' => MAIL_PASSWORD));
         $mail_status = $smtp->send($to_address, $headers, $message);
         $where = array('id=?' => $id);
         $newdata['modifieddate'] = $date->get('yyyy-MM-dd HH:mm:ss');
         $newdata['is_sent'] = 1;
         if ($mail_status) {
             $id = $email_model->SaveorUpdateEmailData($newdata, $where);
             return $id;
         } else {
             return "fail";
         }
     }
 }
コード例 #6
0
ファイル: WorkTime.php プロジェクト: hew86i/panorama
        ?>
					</td>
					<td width="50%">
						<?php 
        echo $row1['shift'] . " (" . dic_("Settings." . $row1['shift']) . ")";
        ?>
					</td>
				</tr>
			</table>
			
		</td>
			
		<td align = "center" height="30px" class="text2" style="background-color:#fff; border:1px dotted #B8B8B8; ">
			<?php 
        if (strpos($korisnikZona, 'h:i:s A') !== false) {
            echo DATE("g:i A", STRTOTIME($row1['timefrom'])) . " - " . DATE("g:i A", STRTOTIME($row1['timeto']));
        } else {
            echo $row1['timefrom'] . " - " . $row1['timeto'];
        }
        ?>

		</td>
						
		<td align = "center" height="30px" class="text2" style="background-color:#fff; border:1px dotted #B8B8B8; ">
			<button id="btnEdit<?php 
        echo $cnt;
        ?>
"  onclick="EditTimeClick(<?php 
        echo $row1["id"];
        ?>
)" style="height:22px; width:30px"></button>
コード例 #7
0
 function timeFormateConv1($strTime)
 {
     if (trim($strTime)) {
         $arrPart = explode(" ", $strTime);
         $arrDate = explode("/", $arrPart[0]);
         $month = $arrDate[0];
         $day = $arrDate[1];
         $year = $arrDate[2];
         if (!empty($arrPart[2]) && !empty($arrPart[1])) {
             $time = DATE("H:i:s", STRTOTIME($arrPart[1] . " " . $arrPart[2]));
             return trim($year) . "-" . trim($month) . "-" . trim($day) . " " . $time;
         } else {
             return trim($year) . "-" . trim($month) . "-" . trim($day);
         }
     } else {
         return false;
     }
 }
コード例 #8
0
ファイル: users.class.php プロジェクト: Nvenom/Cellwiz
 public static function REWARD()
 {
     if (DATE('D') == 'Mon') {
         $INT = '-2 days';
     } else {
         $INT = '-1 day';
     }
     $D = DATE('Y-m-d', STRTOTIME($INT, TIME()));
     $DAY = DATE('d') - 0;
     if ($DAY == 1) {
         $M = DATE('Y-m-00', STRTOTIME('-1 month', TIME()));
         $R = MYSQL::QUERY('SELECT * FROM core_users_leaderboard_rewards WHERE d_date=? AND r_id=? LIMIT 1', array($M, 5));
         if (empty($R)) {
             $MONTH = DATE('F', STRTOTIME('-1 month', TIME()));
             $DATE = DATE("Y-m-d H:i:s");
             $RD = MYSQL::QUERY('SELECT * FROM core_users_repairs_monthly WHERE d_date=? ORDER BY d_key DESC LIMIT 1', array($M));
             $TD = MYSQL::QUERY('SELECT * FROM core_users_tickets_monthly WHERE d_date=? ORDER BY d_key DESC LIMIT 1', array($M));
             $CD = MYSQL::QUERY('SELECT * FROM core_users_checkouts_monthly WHERE d_date=? ORDER BY d_key DESC LIMIT 1', array($M));
             $ED = MYSQL::QUERY('SELECT * FROM core_users_estimates_monthly WHERE d_date=? ORDER BY d_key DESC LIMIT 1', array($M));
             MYSQL::QUERY('INSERT IGNORE INTO core_users_leaderboard_rewards (r_id,u_id,reward,d_date) VALUES (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)', array(5, $RD['u_id'], '0-1-0', $D, 6, $TD['u_id'], '0-1-0', $D, 7, $CD['u_id'], '0-1-0', $D, 8, $ED['u_id'], '0-1-0', $D));
             MYSQL::QUERY('INSERT INTO core_messages (m_to,m_from,m_message,m_from_avatar,m_sent) VALUES (?,?,?,?,?),(?,?,?,?,?),(?,?,?,?,?),(?,?,?,?,?)', array($RD['u_id'], 'LeaderBoard Reward', 'You have earned 1 Silver Medal for the most Repairs in ' . $MONTH, '02', $DATE, $TD['u_id'], 'LeaderBoard Reward', 'You have earned 1 Silver Medal for the most Tickets in ' . $MONTH, '02', $DATE, $CD['u_id'], 'LeaderBoard Reward', 'You have earned 1 Silver Medal for the most Checkouts in ' . $MONTH, '02', $DATE, $ED['u_id'], 'LeaderBoard Reward', 'You have earned 1 Silver Medal for the most Estimates in ' . $MONTH, '02', $DATE));
             self::MEDAL('silver', 1, $RD['u_id']);
             self::MEDAL('silver', 1, $TD['u_id']);
             self::MEDAL('silver', 1, $CD['u_id']);
             self::MEDAL('silver', 1, $ED['u_id']);
         }
     }
     $R = MYSQL::QUERY('SELECT * FROM core_users_leaderboard_rewards WHERE d_date=? AND r_id=? LIMIT 1', array($D, 1));
     if (empty($R)) {
         $DATE = DATE("Y-m-d H:i:s");
         $RD = MYSQL::QUERY('SELECT * FROM core_users_repairs_daily WHERE d_date=? ORDER BY d_key DESC LIMIT 1', array($D));
         $TD = MYSQL::QUERY('SELECT * FROM core_users_tickets_daily WHERE d_date=? ORDER BY d_key DESC LIMIT 1', array($D));
         $CD = MYSQL::QUERY('SELECT * FROM core_users_checkouts_daily WHERE d_date=? ORDER BY d_key DESC LIMIT 1', array($D));
         $ED = MYSQL::QUERY('SELECT * FROM core_users_estimates_daily WHERE d_date=? ORDER BY d_key DESC LIMIT 1', array($D));
         MYSQL::QUERY('INSERT IGNORE INTO core_users_leaderboard_rewards (r_id,u_id,reward,d_date) VALUES (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)', array(1, $RD['u_id'], '0-0-35', $D, 2, $TD['u_id'], '0-0-35', $D, 3, $CD['u_id'], '0-0-35', $D, 4, $ED['u_id'], '0-0-35', $D));
         MYSQL::QUERY('INSERT INTO core_messages (m_to,m_from,m_message,m_from_avatar,m_sent) VALUES (?,?,?,?,?),(?,?,?,?,?),(?,?,?,?,?),(?,?,?,?,?)', array($RD['u_id'], 'LeaderBoard Reward', 'You have earned 35 Bronze Medals for the most Repairs on ' . $D, '01', $DATE, $TD['u_id'], 'LeaderBoard Reward', 'You have earned 35 Bronze Medals for the most Tickets on ' . $D, '01', $DATE, $CD['u_id'], 'LeaderBoard Reward', 'You have earned 35 Bronze Medals for the most Checkouts on ' . $D, '01', $DATE, $ED['u_id'], 'LeaderBoard Reward', 'You have earned 35 Bronze Medals for the most Estimates on ' . $D, '01', $DATE));
         self::MEDAL('bronze', 35, $RD['u_id']);
         self::MEDAL('bronze', 35, $TD['u_id']);
         self::MEDAL('bronze', 35, $CD['u_id']);
         self::MEDAL('bronze', 35, $ED['u_id']);
     }
 }
コード例 #9
0
ファイル: MY_date_helper.php プロジェクト: petersonb/ourvigor
function date_24_to_twelve($time)
{
    return DATE("g:i a", STRTOTIME($time));
}
コード例 #10
0
ファイル: PostScheduler.php プロジェクト: VBGAMER45/SMFMods
function EditPost2()
{
    global $txt, $db_prefix, $func;
    checkSession('post');
    // Get the ID
    $id = (int) $_REQUEST['id'];
    if (empty($id)) {
        fatal_error($txt['postscheduler_nopostselected'], false);
    }
    $subject = $func['htmlspecialchars']($_REQUEST['subject'], ENT_QUOTES);
    $boardselect = (int) $_REQUEST['boardselect'];
    $postername = str_replace('"', '', $_REQUEST['postername']);
    $postername = str_replace("'", '', $postername);
    $postername = str_replace('\\', '', $postername);
    $postername = $func['htmlspecialchars']($postername, ENT_QUOTES);
    $msgicon = $func['htmlspecialchars']($_REQUEST['msgicon'], ENT_QUOTES);
    $message = $func['htmlspecialchars']($_REQUEST['message'], ENT_QUOTES);
    $topicid = (int) $_REQUEST['topicid'];
    if ($subject == '') {
        fatal_error($txt['postscheduler_err_subject'], false);
    }
    if ($postername == '') {
        fatal_error($txt['postscheduler_err_postername'], false);
    }
    if ($boardselect == 0) {
        fatal_error($txt['postscheduler_err_forum'], false);
    }
    if ($message == '') {
        fatal_error($txt['postscheduler_err_message'], false);
    }
    $topiclocked = isset($_REQUEST['topiclocked']) ? 1 : 0;
    $month = (int) $_REQUEST['month'];
    $day = (int) $_REQUEST['day'];
    $year = (int) $_REQUEST['year'];
    $hour = (int) $_REQUEST['hour'];
    $minute = (int) $_REQUEST['minute'];
    $ampm = $_REQUEST['ampm'];
    $minute = str_pad($minute, 2, "0", STR_PAD_LEFT);
    $time_in_24_hour_format = DATE("H", STRTOTIME("{$hour}:{$minute} {$ampm}"));
    if (!empty($month) && !empty($day) && !empty($year)) {
        $post_time = mktime($time_in_24_hour_format, $minute, 0, $month, $day, $year);
    } else {
        fatal_error($txt['postscheduler_err_date'], false);
    }
    // Lookup the Memeber ID of the postername
    $memid = 0;
    $dbresult = db_query("\n\tSELECT \n\t\trealName, ID_MEMBER \n\tFROM {$db_prefix}members \n\tWHERE realName = '{$postername}' OR memberName = '{$postername}'  LIMIT 1", __FILE__, __LINE__);
    $row = mysql_fetch_assoc($dbresult);
    mysql_free_result($dbresult);
    if (db_affected_rows() != 0) {
        $memid = $row['ID_MEMBER'];
    }
    db_query("\n\t\tUPDATE {$db_prefix}postscheduler \n\t\tSET \n\t\t\tID_BOARD = {$boardselect}, subject = '{$subject}', postername  = '{$postername}', ID_MEMBER = {$memid}, locked = '{$topiclocked}', \n\t\t\tbody = '{$message}',id_topic = '{$topicid}',post_time = '{$post_time}',\n\t\t\tmsgicon  = '{$msgicon}'\n\n\t    WHERE ID_POST = {$id} LIMIT 1", __FILE__, __LINE__);
    // Redirect to the Admin
    redirectexit('action=postscheduler;sa=admin');
}
コード例 #11
0
 /**
  * Constructor
  *
  * @access public
  * @param SimpleXMLObject $config A simplexmlobject created from tvrage.com's xml data for the tv show
  * @return void
  **/
 function __construct($config)
 {
     $this->showId = (string) $config->showid;
     $this->name = isset($config->showname) ? (string) $config->showname : (string) $config->name;
     $this->showLink = isset($config->showlink) ? (string) $config->showlink : (string) $config->link;
     $this->country = isset($config->origin_country) ? (string) $config->origin_country : (string) $config->country;
     if (isset($config->startdate)) {
         $this->started = strtotime(str_replace('/', ' ', (string) $config->startdate));
     } else {
         $this->started = strtotime(str_replace('/', ' ', (string) $config->started));
     }
     $this->ended = strtotime(str_replace('/', ' ', (string) $config->ended));
     $this->seasons = (string) $config->seasons;
     $this->status = (string) $config->status;
     $this->network = (string) $config->network;
     $this->runtime = (string) $config->runtime;
     $this->classification = (string) $config->classification;
     $this->genres = array();
     foreach ($config->genres->genre as $genre) {
         $this->genres[] = (string) $genre;
     }
     $this->airTime = (string) $config->airtime;
     $this->twelveHourAirTime = (string) DATE("g:i a", STRTOTIME($config->airtime));
     $this->airDay = (string) $config->airday;
 }