function op_api_message($messageList, $member, $useIsReadFlag = false) { $message = $messageList->getSendMessageData(); $body = preg_replace(array('/<op:.*?>/', '/<\\/op:.*?>/'), '', $message->getBody()); $body = preg_replace('/http.:\\/\\/maps\\.google\\.co[[:graph:]]*/', '', $body); $body = op_auto_link_text($body); $imagePath = null; $imageTag = null; $image = $message->getMessageFile(); if (0 < count($image)) { $imageTag = image_tag_sf_image($image[0]->getFile(), array('size' => '76x76')); $imagePath = sf_image_path($image[0]->getFile()); } $data = array('id' => $message->getId(), 'member' => op_api_member($member), 'subject' => $message->getSubject(), 'body' => nl2br($body), 'summary' => op_truncate(op_decoration($body, true), 25, '...'), 'image_path' => $imagePath, 'image_tag' => $imageTag, 'created_at' => $message->getCreatedAt(), 'formatted_date' => get_formatted_date($message->getCreatedAt())); if ($useIsReadFlag) { $data['is_read'] = $messageList->isSelf() ? (bool) $messageList->getIsRead() : null; } return $data; }
<td> <font face="arial" size="2"><b>Pixels</b></font> </td> </tr> <?php require_once "include/ads.inc.php"; //require ('include/mouseover_js.inc.php'); $sql = "SELECT *, MAX(order_date) as max_date, sum(quantity) AS pixels FROM orders where status='completed' AND banner_id='{$BID}' GROUP BY user_id, banner_id order by pixels desc "; $result = mysql_query($sql) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { ?> <tr bgcolor="#ffffff" > <td> <font face="arial" size="2"><?php echo get_formatted_date(get_local_time($row[max_date])); ?> </font> </td> <td> <font face="arial" size="2"><?php $sql = "Select * FROM `ads` as t1, `orders` AS t2 WHERE t1.ad_id=t2.ad_id AND t1.banner_id='{$BID}' and t1.order_id > 0 AND t1.user_id='" . $row['user_id'] . "' ORDER BY `ad_date`"; $m_result = mysql_query($sql) or die(mysql_error()); while ($prams = mysql_fetch_array($m_result, MYSQL_ASSOC)) { $ALT_TEXT = get_template_value('ALT_TEXT', 1); $ALT_TEXT = str_replace("'", "", $ALT_TEXT); $ALT_TEXT = str_replace("\"", '', $ALT_TEXT); $js_str = " onmousemove=\"sB(event, '" . $ALT_TEXT . "', this, " . $prams['ad_id'] . ")\" onmouseout=\"hI()\" "; echo $br . '<a target="_blank" ' . $js_str . ' href="' . get_template_value('URL', 1) . '">' . get_template_value('ALT_TEXT', 1) . '</a>'; $br = '<br>'; }
</a></h2> <ul> <li> <span class="fa fa-calendar"></span> <time datetime="<?php echo get_formatted_date($value['date']); ?> "><?php echo get_formatted_date($value['date']); ?> </time> </li> <li> <span class="fa fa-clock-o"></span> <span class="sermon-author"><?php echo get_formatted_date($value['date'], true); ?> </span> </li> <li> <span class="fa fa-map-marker"></span> <span class="sermon-verse"><?php echo $value['location']; ?> <span class="sermon-verse content none">The lord is always with you</span></span> </li> </ul> </div> </header> <div class="sermon-content"> <p><?php
?> "> </a> </div> <div class="sermon-title"> <h2><a href="<?php echo $sermon; ?> "><?php echo $value['title']; ?> </a></h2> <ul> <li> <time datetime="2014-03-12T02:09:39+00:00"><?php echo get_formatted_date($value['date']); ?> </time> </li> <li> <span class="fa fa-user"></span> <span class="sermon-author"><?php echo $value['author']; ?> </span> </li> <li> <span class="fa fa-book"></span> <span class="sermon-verse"><?php echo $value['verse']; ?>
function echo_ad_list_data($admin) { global $column_list, $column_info, $label, $cur_offset, $order_str, $q_offset, $show_emp, $cat, $list_mode; if ($_REQUEST['order_by'] != '') { $ord = $_REQUEST['ord']; if ($ord == 'asc') { $ord = 'desc'; } elseif ($ord == 'desc') { $ord = 'asc'; } else { $ord = 'desc'; } $order_str = "&order_by=" . $_REQUEST['order_by'] . "&ord=" . $ord; } foreach ($column_list as $template_tag) { $val = get_template_value($template_tag, 1, $admin); //$val = $val.$template_tag; if ($column_info[$template_tag]['admin'] == 'Y' && !$admin) { continue; // do not render this column } if ($column_info[$template_tag]['trunc'] > 0) { $val = truncate_html_str($val, $column_info[$template_tag]['trunc'], $trunc_str_len); } // process the value depending on what kind of template tag it was given. if ($template_tag == 'DATE') { $init_date = strtotime(trim_date($val) . " GMT"); // the last date modified $dst_date = strtotime(trim_date(gmdate("r")) . " GMT"); // now if (!$init_date) { $days = "x"; } else { $diff = $dst_date - $init_date; $days = floor($diff / 60 / 60 / 24); } //echo $days; $FORMATTED_DATE = get_formatted_date(get_local_time($val)); $val = $FORMATTED_DATE . "<br>"; if ($days == 0) { $val = $val . '<span class="today"><b>' . $label["ads_list_today"] . '</span>'; } elseif ($days > 0 && $days < 2) { $val = $val . '<span class="days_ago">' . $days . " " . $label["ads_list_day_ago"] . "</span>"; } elseif ($days > 1 && $days < 8) { $val = $val . '<span class="days_ago">' . $days . " " . $label["ads_list_days_ago"] . "</span>"; } elseif ($days >= 8) { $val = $val . '<span class="days_ago2">' . $days . " " . $label["ads_list_days_ago"] . "</span>"; } } if ($column_info[$template_tag]['is_bold'] == 'Y') { $b1 = "<b>"; $b2 = "</b>"; } else { $b1 = ''; $b2 = ''; } if ($column_info[$template_tag]['clean'] == 'Y') { // fix up punctuation spacing $val = preg_replace('/ *(,|\\.|\\?|!|\\/|\\\\) */i', '$1 ', $val); } if ($column_info[$template_tag]['link'] == 'Y') { // Render as a Link to the record? $AD_ID = get_template_value('AD_ID', 1, $admin); $val = '<a href="' . htmlentities($_SERVER['PHP_SELF']) . '?ad_id=' . $AD_ID . '&offset=' . $cur_offset . $order_str . $q_string . '"'; /// IMAGE PREVIEW MOUSEOVER Code // Note: to have this feature working, you must have a template tag called 'IMAGE' defined in the resume form define('PREVIEW_AD', 'YES'); if (PREVIEW_AD == 'YES') { $ALT_TEXT = get_template_value('ALT_TEXT', 1, $admin); //$AD_ID = get_template_value ('AD_ID', 1, $admin); $js_str = " onmousemove=\"sB(event,'" . htmlspecialchars(str_replace("'", "\\'", $ALT_TEXT)) . "',this, " . $AD_ID . ")\" onmouseout=\"hI()\" "; $val = $val . $js_str; } $val = $val . '>' . get_template_value($template_tag, 1, $admin) . "</a>"; } ?> <td class="list_data_cell" <?php if ($column_info[$template_tag]['no_wrap'] == 'Y') { echo ' nowrap '; } ?> > <?php echo $b1 . $val . $b2; ?> </td> <?php } }
function display_form($form_id, $mode, $prams, $section) { global $label; global $admin; global $subscr_block_status; //print_r( $prams); if (func_num_args() > 4) { $dont_break_table = func_get_arg(4); } $sql = "SELECT t2.field_label AS FLABEL, t1.* AS ID, t2.field_comment AS FCOMMENT FROM form_fields AS t1, form_field_translations AS t2 WHERE t1.field_id=t2.field_id AND lang='" . $_SESSION['MDS_LANG'] . "' AND section='{$section}' AND form_id='{$form_id}' {$where_sql} order by field_sort "; //echo $sql; $result = mysql_query($sql) or die(mysql_error()); if (!$dont_break_table) { ?> <table id="dynamic_form" class="dynamic_form" cellSpacing="1" cellPadding="3" > <?php } $count = mysql_num_rows($result); $i = 0; while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $i++; if ($mode == 'EDIT' && $_REQUEST['field_id'] == $row['field_id']) { $bg_selected = ' style="background-color: #FFFFCC;" '; } else { $bg_selected = ''; } // load init value... if ($prams[$row['field_id']] == '') { $prams[$row['field_id']] = $row['field_init']; } ######################## if ($row[is_hidden] == "Y" && $mode == "view" && !$admin) { # Hidden Fields, do not appear on website (view mode) } elseif ($row[field_type] == "SEPERATOR") { ?> <tr <?php echo $bg_selected; ?> > <td colspan="2" class="dynamic_form_seperator" ><font face="Arial" size="2"><b><?php if ($mode == 'EDIT') { echo_order_arrows($row); echo '<a href="' . htmlentities($_SERVER['PHP_SELF']) . '?field_id=' . $row['field_id'] . '&mode=EDIT"><IMG SRC="../admin/edit.gif" WIDTH="16" HEIGHT="16" align="middle" BORDER="0" ALT="-"> '; } echo $row[FLABEL]; if ($mode == 'EDIT') { echo '</a>'; } ?> </b></font></td> </tr> <?php } elseif ($row['field_type'] == "SKILL_MATRIX") { ?> <tr <?php echo $bg_selected; ?> > <td <?php echo $bg_selected; ?> class="dynamic_form_field"> <?php if ($mode == 'EDIT') { echo_order_arrows($row); echo '<a href="' . htmlentities($_SERVER['PHP_SELF']) . '?field_id=' . $row['field_id'] . '&mode=EDIT"><IMG SRC="../admin/edit.gif" WIDTH="16" HEIGHT="16" align="middle" BORDER="0" ALT="-"> '; } echo "<b>" . $row['FLABEL'] . "</b>"; if ($mode == 'EDIT') { echo '</a>'; ?> <br> - <a href="" onclick="window.open('build_matrix.php?field_id=<?php echo $row[field_id]; ?> ', '', 'toolbar=no,scrollbars=yes,location=no,statusbar=no,menubar=no,resizable=1,width=550,height=500,left = 50,top = 50');return false;"> [Skill Matrix Settings...] </a> <?php } ?> </td> <td <?php echo $bg_selected; ?> class="dynamic_form_value"><font face="Arial" size="2"><?php if ($row['FCOMMENT'] != '') { echo " <br>" . $row['FCOMMENT'] . ""; } display_matrix($row['field_id'], $prams, $mode); ?> </b></font></td> </tr> <?php } elseif ($row['field_type'] == "IMAGE") { ?> <tr> <td class="dynamic_form_2_col_field" nowrap valign="top" colspan="2" <?php echo $bg_selected; ?> > <?php if ($mode == 'EDIT') { echo_order_arrows($row); echo '<a href="' . htmlentities($_SERVER['PHP_SELF']) . '?field_id=' . $row['field_id'] . '&mode=EDIT"><IMG SRC="../admin/edit.gif" WIDTH="16" HEIGHT="16" align="middle" BORDER="0" ALT="-">'; } echo "<span class='dynamic_form_image_label'>" . $row['FLABEL'] . "</span><br>"; if ($mode == 'EDIT') { echo '</a>'; } if ($mode == 'EDIT' && is_reserved_template_tag($row['template_tag'])) { $alt = get_reserved_tag_description($row[template_tag]); ?> <a href="" onclick="alert('<?php echo htmlentities($alt); ?> ');return false;"> <IMG SRC="../admin/reserved.gif" WIDTH="13" HEIGHT="13" BORDER="0" ALT="<?php echo $alt; ?> "> </a> <?php } if ($prams[$row[field_id]] != '') { if ($is_hidden == 'Y' || $is_blocked == 'Y') { echo $prams[$row[field_id]]; } else { if ($_REQUEST['del_image' . $row[field_id]] != '') { unlink(UPLOAD_PATH . 'images/' . $prams[$row[field_id]]); //@unlink (UPLOAD_PATH.''.$prams[$row[field_id]]); } if (file_exists(UPLOAD_PATH . 'images/' . $prams[$row[field_id]])) { ?> <img alt="" src="<?php echo UPLOAD_HTTP_PATH . 'images/' . $prams[$row[field_id]]; ?> " > <?php } else { echo '<IMG SRC="' . UPLOAD_HTTP_PATH . 'images/no-image.gif" WIDTH="150" HEIGHT="150" BORDER="0" ALT="">'; } } } else { echo '<IMG SRC="' . UPLOAD_HTTP_PATH . 'images/no-image.gif" WIDTH="150" HEIGHT="150" BORDER="0" ALT="">'; } if (strtolower($mode) == 'edit') { // delete image button if (file_exists(UPLOAD_PATH . 'images/' . $prams[$row[field_id]]) && $prams[$row[field_id]] != '') { $image_field_id = $row[field_id]; echo "<br><input type='hidden' name='del_image" . $row[field_id] . "' value=''><input type='button' value='" . $label['delete_image_button'] . "' onclick='document.form1.del_image" . $row[field_id] . ".value=\"" . $image_field_id . "\"; document.form1.submit()'><br>"; } else { // upload image form echo "<br>" . $label['upload_image'] . '<br> ' . form_image_field($row[field_id], $prams[$row[field_id]]); if ($row['FCOMMENT'] != '') { echo " <br>" . $row['FCOMMENT'] . ""; } } } ?> </td> </tr> <?php } elseif ($row[field_type] == "FILE") { ?> <tr> <td valign="top" class="dynamic_form_2_col_field" colspan="2" <?php echo $bg_selected; ?> > <span > <?php if ($mode == 'EDIT') { echo_order_arrows($row); echo '<a href="' . htmlentities($_SERVER['PHP_SELF']) . '?field_id=' . $row['field_id'] . '&mode=EDIT"><IMG SRC="../admin/edit.gif" WIDTH="16" HEIGHT="16" align="middle" BORDER="0" ALT="-">'; } //if ($mode !='view') { echo "<span class=\"dynamic_form_image_label\" >" . $row[FLABEL] . "</span><br>"; //} if ($mode == 'EDIT') { echo '</a>'; } if ($mode == 'EDIT' && is_reserved_template_tag($row[template_tag])) { $alt = get_reserved_tag_description($row[template_tag]); ?> <a href="" onclick="alert('<?php echo htmlentities($alt); ?> ');return false;"> <IMG SRC="../admin/reserved.gif" WIDTH="13" HEIGHT="13" BORDER="0" ALT="<?php echo $alt; ?> "> </a> <?php } if ($_REQUEST['del_file' . $row[field_id]] != '') { @unlink(UPLOAD_PATH . 'docs/' . $prams[$row[field_id]]); //@unlink (IMG_PATH.''.$prams[$row[field_id]]); } if ($prams[$row[field_id]] != '' && file_exists(UPLOAD_PATH . '/docs' . $prams[$row[field_id]])) { ?> <a href="<?php echo UPLOAD_HTTP_PATH . '' . $prams[$row[field_id]]; ?> " > <IMG alt="" src="../images/file.gif" width="20" height="20" border="0" alt=""> <?php echo $prams[$row[field_id]]; ?> </a> - <?php echo filesize(UPLOAD_PATH . "" . $prams[$row[field_id]]); ?> <?php echo $label['bytes'] . "<br>"; ?> <?php } elseif ($mode == 'view') { echo '<i>' . $label['no_file_uploaded'] . '</i>'; } if (strtolower($mode) == 'edit') { if (file_exists(UPLOAD_PATH . '/docs/' . $prams[$row[field_id]]) && $prams[$row[field_id]] != '') { //if ($mode != 'view') { $image_field_id = $row[field_id]; echo "<br><input type='hidden' name='del_file" . $row[field_id] . "' value=''><input type='button' value='" . $label['delete_file_button'] . "' onclick='document.form1.del_file" . $row[field_id] . ".value=\"" . $image_field_id . "\"; document.form1.submit()'><br>"; //} } else { echo $label['upload_file'] . " " . form_file_field($row[field_id], $prams[$row[field_id]]); if ($row['FCOMMENT'] != '') { echo " <br>" . $row['FCOMMENT'] . ""; } } } ?> </span> </td> </tr> <?php } elseif ($row[field_type] == "NOTE") { if ($mode == 'view') { } else { ?> <tr> <td colspan="2" valign="top" class="dynamic_form_2_col_field" <?php echo $bg_selected; ?> ><span class="dynamic_form_note_label"><?php if ($mode == 'EDIT') { echo_order_arrows($row); echo '<a href="' . htmlentities($_SERVER['PHP_SELF']) . '?field_id=' . $row['field_id'] . '&mode=EDIT"><IMG SRC="../admin/edit.gif" WIDTH="16" HEIGHT="16" align="middle" BORDER="0" ALT="-"> '; } echo $row[FLABEL]; if ($mode == 'EDIT') { echo '</a>'; } if ($mode == 'EDIT' && is_reserved_template_tag($row[template_tag])) { $alt = get_reserved_tag_description($row[template_tag]); ?> <a href="" onclick="alert('<?php echo htmlentities($alt); ?> ');return false;"> <IMG SRC="../admin/reserved.gif" WIDTH="13" HEIGHT="13" BORDER="0" ALT="<?php echo $alt; ?> "> </a> <?php } ?> </span></td> </tr> <?php } } elseif ($row[field_type] == "MIME") { // do nothing. It is an extra field for FILE type fields.. } else { if ($row[FLABEL] == '') { $row[FLABEL] = '  '; } ?> <tr > <td class="dynamic_form_field" <?php echo $bg_selected; ?> valign="top" ><?php if ($mode == 'EDIT') { echo_order_arrows($row); echo '<a href="' . htmlentities($_SERVER['PHP_SELF']) . '?field_id=' . $row['field_id'] . '&mode=EDIT"><IMG SRC="../admin/edit.gif" WIDTH="16" HEIGHT="16" align="middle" BORDER="0" ALT="-">'; } echo $row[FLABEL]; if ($mode == 'EDIT') { echo '</a>'; } if ($row[is_required] == 'Y' && $mode != 'view') { echo "<FONT SIZE='4' COLOR='#FF0000'><b>*</B></FONT>"; } if ($mode == 'EDIT' && is_reserved_template_tag($row[template_tag])) { $alt = get_reserved_tag_description($row[template_tag]); ?> <a href="" onclick="alert('<?php echo htmlentities($alt); ?> ');return false;"> <IMG SRC="../admin/reserved.gif" WIDTH="13" HEIGHT="13" BORDER="0" ALT="<?php echo $alt; ?> "> </a> <?php } if ($mode == 'EDIT' && $row[field_type] == 'BLANK') { echo '<a href="' . htmlentities($_SERVER['PHP_SELF']) . '?field_id=' . $row['field_id'] . '&mode=EDIT">[]</a>'; } ?> </td> <td class="dynamic_form_value" <?php echo $bg_selected; ?> > <?php if ($is_hidden == 'Y' || $is_blocked == 'Y') { echo $prams[$row['field_id']]; // display blocked field message } else { switch ($row[field_type]) { case "TEXT": if ($mode == 'view') { $val = $prams[$row['field_id']]; $val = escape_html($val); if (EMAIL_AT_REPLACE == "YES") { $val = str_replace("@", '<IMG SRC="' . BASE_HTTP_PATH . 'images/at.gif" WIDTH="13" HEIGHT="9" BORDER="0" ALT="">', $val); } elseif (EMAIL_AT_REPLACE == "YES_2") { $val = str_replace("@", '@', $val); } echo $val; } else { echo form_text_field($row['field_id'], $prams[$row['field_id']], $row['field_width']); if ($row['FCOMMENT'] != '') { echo " " . $row['FCOMMENT'] . ""; } } break; case "SEPERATOR": break; case "EDITOR": $val = $prams[$row['field_id']]; if ($mode == 'view') { $val = process_for_html_output($val); //echo '<font face="arial" size="2">'.$prams[$row[field_id]].'</font>'; echo $val; } else { if ($row['FCOMMENT'] != '') { echo $row['FCOMMENT'] . "<br>"; } echo form_editor_field($row['field_id'], $val, $row['field_width'], $row['field_height']); } break; case "TEXTAREA": if ($mode == 'view') { //$val = process_for_html_output ($prams[$row[field_id]]); $val = escape_html($prams[$row['field_id']]); $val = str_replace("\n", "<br>", $val); if (EMAIL_AT_REPLACE == "YES") { $val = str_replace("@", '<IMG SRC="' . BASE_HTTP_PATH . 'images/at.gif" WIDTH="13" HEIGHT="9" BORDER="0" ALT="">', $val); } elseif (EMAIL_AT_REPLACE == "YES_2") { $val = str_replace("@", '@', $val); } echo $val; } else { if ($row['FCOMMENT'] != '') { $row['FCOMMENT'] . "<br>"; } echo form_textarea_field($row['field_id'], $prams[$row['field_id']], $row['field_width'], $row['field_height']); } break; case "CATEGORY": $str = getPath($prams[$row['field_id']]); //if (!$str) { //$str = $prams[$row[field_id]]; //} if ($mode == 'view') { echo $str; } else { echo form_category_field($row['field_id'], $row['category_init_id'], $prams[$row['field_id']], $form_id); if ($row['FCOMMENT'] != '') { echo "" . $row['FCOMMENT'] . "<br>"; } } break; case "DATE": case "DATE_CAL": if ($mode == 'view') { if ($is_blocked == 'Y') { // output a string echo $prams[$row['field_id']]; } else { // output a date if ($prams[$row['field_id']] != '0000-00-00 00:00:00') { echo get_formatted_date($prams[$row['field_id']]); } else { echo ""; } } } else { if ($row['field_type'] == 'DATE') { // traditional date input preg_match("/(\\d+)-(\\d+)-(\\d+)/", $prams[$row['field_id']], $m); // Year - Month - Day (database output format) $year = $m[1]; $day = $m[3]; $month = $m[2]; echo form_date_field($row['field_id'], $day, $month, $year, "dynamic_form_date_style"); } else { // scw input ?> <input name="<?php echo $row['field_id']; ?> " onclick= "scwShow(this,this);" size="10" onfocus= "scwShow(this,this);" type="text" value="<?php echo trim_date($prams[$row['field_id']]); ?> "> <?php } if ($row['FCOMMENT'] != '') { echo " " . $row['FCOMMENT'] . ""; } } break; case "SELECT": if ($mode == 'view') { echo getCodeDescription($row['field_id'], $prams[$row['field_id']]); } else { form_select_field($row['field_id'], $prams[$row['field_id']]); } if ($mode == 'EDIT') { ?> <a href="" onclick="window.open('maintain_codes.php?field_id=<?php echo $row['field_id']; ?> ', '', 'toolbar=no,scrollbars=yes,location=no,statusbar=no,menubar=no,resizable=1,width=400,height=500,left = 50,top = 50');return false;"> [Edit Options] </a> <?php } break; case "RADIO": if ($mode == 'view') { echo getCodeDescription($row['field_id'], $prams[$row['field_id']]); } else { form_radio_field($row['field_id'], $prams[$row['field_id']]); } if ($mode == 'EDIT') { ?> <a href="" onclick="window.open('maintain_codes.php?field_id=<?php echo $row['field_id']; ?> ', '', 'toolbar=no,scrollbars=yes,location=no,statusbar=no,menubar=no,resizable=1,width=400,height=500,left = 50,top = 50');return false;"> [Edit Options] </a> <?php } break; case "CHECK": form_checkbox_field($row['field_id'], $prams[$row['field_id']], $mode); if ($mode == 'EDIT') { ?> <a href="" onclick="window.open('maintain_codes.php?field_id=<?php echo $row['field_id']; ?> ', '', 'toolbar=no,scrollbars=yes,location=no,statusbar=no,menubar=no,resizable=1,width=400,height=500,left = 50,top = 50');return false;"> [Edit Options] </a> <?php } break; case "MSELECT": form_mselect_field($row['field_id'], $prams[$row['field_id']], $row['field_height'], $mode); if ($mode == 'EDIT') { ?> <a href="" onclick="window.open('maintain_codes.php?field_id=<?php echo $row['field_id']; ?> ', '', 'toolbar=no,scrollbars=yes,location=no,statusbar=no,menubar=no,resizable=1,width=400,height=500,left = 50,top = 50');return false;"> [Edit Options] </a> <?php } break; case "NOTE": break; case "MIME": break; case "BLANK": echo " "; break; } } ?> </td> </tr> <?php } } if (!$dont_break_table) { ?> </table> <?php } }