本文整理汇总了PHP中misc::log_error方法的典型用法代码示例。如果您正苦于以下问题:PHP misc::log_error方法的具体用法?PHP misc::log_error怎么用?PHP misc::log_error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类misc
的用法示例。
在下文中一共展示了misc::log_error方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: misc
function delete_favorites()
{
global $config, $lang, $conn;
require_once $config['basepath'] . '/include/misc.inc.php';
$misc = new misc();
$display = '';
login::loginCheck('Member');
if (!isset($_GET['listingID'])) {
$display .= '<a href="' . $config['baseurl'] . '/index.php">' . $lang['perhaps_you_were_looking_something_else'] . '</a>';
} elseif ($_GET['listingID'] == '') {
$display .= '<a href="' . $config['baseurl'] . '/index.php">' . $lang['perhaps_you_were_looking_something_else'] . '</a>';
} else {
$userID = $misc->make_db_safe($_SESSION['userID']);
$listingID = $misc->make_db_safe($_GET['listingID']);
$sql = "DELETE FROM " . $config['table_prefix'] . "userfavoritelistings WHERE userdb_id = {$userID} AND listingsdb_id = {$listingID}";
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
$misc->log_error($sql);
}
$display .= '<br />' . $lang['listing_deleted_from_favorites'];
$display .= membersfavorites::view_favorites();
}
return $display;
}
示例2: misc
function save_search()
{
global $config, $lang, $conn;
require_once $config['basepath'] . '/include/misc.inc.php';
$misc = new misc();
$display = '';
$status = login::loginCheck('Member');
if ($status === true) {
$userID = $misc->make_db_safe($_SESSION['userID']);
if (isset($_POST['title'])) {
$title = $misc->make_db_safe($_POST['title']);
$query = $misc->make_db_safe($_POST['query']);
$notify = $misc->make_db_safe($_POST['notify']);
$misc->make_db_safe($_POST['title']);
$sql = "SELECT * FROM " . $config['table_prefix'] . "usersavedsearches WHERE userdb_id = {$userID} AND usersavedsearches_title = {$title}";
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
log_error($sql);
}
$num_columns = $recordSet->RecordCount();
if ($num_columns == 0) {
$sql = "INSERT INTO " . $config['table_prefix'] . "usersavedsearches (userdb_id, usersavedsearches_title, usersavedsearches_query_string,usersavedsearches_last_viewed,usersavedsearches_new_listings,usersavedsearches_notify) VALUES ({$userID}, {$title}, {$query},now(),0, {$notify})";
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
$misc->log_error($sql);
} else {
$display .= '<br />' . $lang['search_added_to_saved_searches'];
}
} else {
$display .= '<br />' . $lang['search_title_already_in_saved_searches'] . '<br />';
$guidestring = '';
foreach ($_GET as $k => $v) {
if (is_array($v)) {
foreach ($v as $vitem) {
$guidestring .= '&' . urlencode("{$k}") . '[]=' . urlencode("{$vitem}");
}
} else {
$guidestring .= '&' . urlencode("{$k}") . '=' . urlencode("{$v}");
}
}
$display .= '<br />';
$display .= '<form action="index.php?' . $guidestring . '" method="post">';
$display .= $lang['enter_title_for_search'];
$display .= '<input type="text" name="title" /><br /><br />';
if ($config['email_users_notification_of_new_listings'] == "1") {
$display .= $lang['notify_saved_search'];
$display .= '<select name="notify" size="1"><option value="yes">' . $lang['yes'] . '<option value="no">' . $lang['no'] . '</select><br /><br />';
} else {
$display .= $lang['notify_saved_search_disabled'] . '<br />';
$display .= $lang['notify_saved_search'];
$display .= '<select name="notify" size="1"><option value="yes">' . $lang['yes'] . '<option value="no">' . $lang['no'] . '</select><br /><br />';
}
$display .= '<input type="submit" value=' . $lang['save_search'] . '" />';
$display .= '<input type="hidden" name="query" value="' . $query . '" />';
$display .= '</form>';
$display .= '<br />';
}
} else {
$query = '';
foreach ($_GET as $k => $v) {
if ($v && $k != 'action' && $k != 'PHPSESSID') {
if (is_array($v)) {
foreach ($v as $vitem) {
$query .= '&' . urlencode("{$k}") . '[]=' . urlencode("{$vitem}");
}
} else {
$query .= '&' . urlencode("{$k}") . '=' . urlencode("{$v}");
}
}
}
if (substr($query, 0, strcspn($query, "=")) == "cur_page") {
$query = substr($query, strcspn($query, "&") + 1);
// echo $QUERY_STRING;
}
$sql = "SELECT usersavedsearches_title, usersavedsearches_query_string FROM " . $config['table_prefix'] . "usersavedsearches WHERE userdb_id = {$_SESSION['userID']} AND usersavedsearches_query_string = '{$query}'";
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
log_error($sql);
}
$num_columns = $recordSet->RecordCount();
if ($num_columns != 0) {
$display .= '<br />' . $lang['search_already_in_saved_searches'] . '<a href="' . $config['baseurl'] . '/index.php?searchresults&' . make_db_unsafe($recordSet->fields['usersavedsearches_query_string'] . '">' . make_db_unsafe($recordSet->fields['usersavedsearches_title']) . '</a><br />');
} else {
// Get full guidesting
$guidestring = '';
foreach ($_GET as $k => $v) {
if (is_array($v)) {
foreach ($v as $vitem) {
$guidestring .= '&' . urlencode("{$k}") . '[]=' . urlencode("{$vitem}");
}
} else {
$guidestring .= '&' . urlencode("{$k}") . '=' . urlencode("{$v}");
}
}
$display .= '<br />';
$display .= '<form action="index.php?' . $guidestring . '" method="post">';
$display .= $lang['enter_title_for_search'] . '<input type="text" name="title" /><br /><br />';
if ($config['email_users_notification_of_new_listings'] == "1") {
$display .= $lang['notify_saved_search'];
$display .= '<select name="notify" size="1"><option value="yes">' . $lang['yes'] . '<option value="no">' . $lang['no'] . '</select><br /><br />';
//.........这里部分代码省略.........
示例3: display
function display()
{
global $conn, $config, $lang;
require_once $config['basepath'] . '/include/misc.inc.php';
$misc = new misc();
// Make Sure we passed the PageID
$display = '';
if (!isset($_GET['PageID'])) {
$display .= "ERROR. PageID not sent";
}
$page_id = $misc->make_db_safe($_GET['PageID']);
$display .= '<div class="page_display">';
$sql = "SELECT pagesmain_full,pagesmain_id FROM " . $config['table_prefix'] . "pagesmain WHERE pagesmain_id=" . $page_id;
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
$misc->log_error($sql);
}
$full = html_entity_decode($misc->make_db_unsafe($recordSet->fields['pagesmain_full']), ENT_NOQUOTES, $config['charset']);
//$full = $misc->make_db_unsafe($recordSet->fields['pagesmain_full']);
$id = $recordSet->fields['pagesmain_id'];
if ($config["wysiwyg_execute_php"] == 1) {
ob_start();
$full = str_replace("<!--<?php", "<?php", $full);
$full = str_replace("?>-->", "?>", $full);
eval('?>' . "{$full}" . '<?php ');
$display .= ob_get_contents();
ob_end_clean();
} else {
$display .= $full;
}
// Allow Admin To Edit #
if (isset($_SESSION['editpages']) && $_SESSION['admin_privs'] == 'yes' && $config["wysiwyg_show_edit"] == 1) {
$display .= "<p> </p>";
$display .= "<a href=\"{$config['baseurl']}/admin/index.php?action=edit_page&id={$id}\">{$lang['edit_html_from_site']}</a>";
}
$display .= '</div>';
// parse page for template varibales
require_once $config['basepath'] . '/include/class/template/core.inc.php';
$template = new page_user();
$template->page = $display;
$template->replace_tags(array('templated_search_form', 'featured_listings_horizontal', 'featured_listings_vertical', 'company_name', 'link_printer_friendly'));
$display = $template->return_page();
return $display;
}
示例4: get_featured
public static function get_featured($listing_id, $raw)
{
global $conn, $config;
require_once $config['basepath'] . '/include/misc.inc.php';
$misc = new misc();
$listing_id = $misc->make_db_extra_safe($listing_id);
$sql = "SELECT listingsdb_featured FROM " . $config['table_prefix'] . "listingsdb WHERE listingsdb_id = {$listing_id}";
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
$misc->log_error($sql);
}
$featured = $recordSet->fields['listingsdb_featured'];
if ($raw == 'no') {
if ($featured == 'yes') {
$featured = 'featured';
} else {
$featured = '';
}
}
return $featured;
}
示例5: misc
function verify_email()
{
global $conn, $config, $lang;
$display = '';
require_once $config['basepath'] . '/include/misc.inc.php';
$misc = new misc();
if (isset($_GET['id']) && isset($_GET['key'])) {
$userID = $misc->make_db_unsafe($_GET['id']);
$sql = 'SELECT userdb_id, userdb_user_name, userdb_user_password, userdb_emailaddress, userdb_is_agent FROM ' . $config['table_prefix'] . 'userdb WHERE userdb_id = ' . $userID;
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
$misc->log_error($sql);
}
$user_id = $misc->make_db_unsafe($recordSet->fields['userdb_id']);
$user_name = $misc->make_db_unsafe($recordSet->fields['userdb_user_name']);
$user_pass = $misc->make_db_unsafe($recordSet->fields['userdb_user_password']);
$emailAddress = $misc->make_db_unsafe($recordSet->fields['userdb_emailaddress']);
if (md5($user_id . ':' . $emailAddress) == $_GET['key']) {
$valid = true;
}
if ($recordSet->fields['userdb_is_agent'] == 'yes') {
$type = 'agent';
} else {
$type = 'member';
}
if ($config['moderate_' . $type . 's'] == 0) {
if ($type == 'agent') {
if ($config["agent_default_active"] == 0) {
$set_active = "no";
} else {
$set_active = "yes";
}
} else {
$set_active = "yes";
}
} else {
$set_active = "no";
}
$sql_set_active = $misc->make_db_safe($set_active);
if ($valid == true) {
if ($config['email_notification_of_new_users'] == 1) {
// if the site admin should be notified when a new user is added
$message = $_SERVER['REMOTE_ADDR'] . ' -- ' . date('F j, Y, g:i:s a') . "\r\n\r\n" . $lang['admin_new_user'] . ":\r\n" . $config['baseurl'] . '/admin/index.php?action=user_manager&edit=' . $userID . "\r\n";
$header = 'From: ' . $config['admin_name'] . ' <' . $config['admin_email'] . ">\r\n";
$header .= "X-Sender: {$config['admin_email']}\r\n";
$header .= "Return-Path: {$config['admin_email']}\r\n";
mail("{$config['admin_email']}", "{$lang['admin_new_user']}", $message, $header);
}
// end if
$verified = $misc->make_db_safe('yes');
$sql = 'UPDATE ' . $config['table_prefix'] . 'userdb SET userdb_active = ' . $sql_set_active . ', userdb_email_verified = ' . $verified . ' WHERE userdb_id = ' . $userID;
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
$misc->log_error($sql);
}
$display .= '<p class="notice">' . $lang['verify_email_thanks'] . '</p>';
if ($config['moderate_' . $type . 's'] == 1) {
// if moderation is turned on...
$display .= '<p>' . $lang['admin_new_user_moderated'] . '</p>';
} else {
//log the user in
$_SESSION['username'] = $user_name;
$_SESSION['userpassword'] = $user_pass;
login::loginCheck('Member');
$display .= '<p>' . $lang['you_may_now_view_priv'] . '</p>';
}
} else {
$display .= '<p class="notice">' . $lang['verify_email_invalid_link'] . '</div>';
}
} else {
$display .= '<p class="notice">' . $lang['verify_email_invalid_link'] . '</div>';
}
return $display;
}
示例6: misc
function update_active_status($user_id, $status)
{
global $conn, $config, $lang;
require_once $config['basepath'] . '/include/misc.inc.php';
$misc = new misc();
$sql_status = $misc->make_db_safe($status);
$sql = 'UPDATE ' . $config['table_prefix'] . 'listingsdb SET listingsdb_active = ' . $sql_status . ' WHERE userdb_id = ' . $user_id;
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
$misc->log_error($sql);
}
return '<p>' . $lang['agent_listings_updated'] . $status . '</p>';
}
示例7: goodvtour
function goodvtour($listingID)
{
global $lang, $conn, $config, $jscript;
require_once $config['basepath'] . '/include/misc.inc.php';
$misc = new misc();
$ext = 'bad';
if (isset($_GET['listingID'])) {
if ($_GET['listingID'] != "") {
$listingID = intval($listingID);
$sql = "SELECT vtourimages_file_name, vtourimages_rank FROM " . $config['table_prefix'] . "vtourimages WHERE (listingsdb_id = {$listingID}) ORDER BY vtourimages_rank";
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
$misc->log_error($sql);
}
}
$num_images = $recordSet->RecordCount();
if ($num_images > 0) {
while (!$recordSet->EOF) {
$file_name = $misc->make_db_unsafe($recordSet->fields['vtourimages_file_name']);
$ext = substr(strrchr($file_name, '.'), 1);
$recordSet->MoveNext();
}
// end while
}
// end if ($num_images > 0)
}
if ($ext == 'jpg' || $ext == 'egg') {
return true;
} else {
return false;
}
}
示例8: misc
//.........这里部分代码省略.........
$map_types['mapquest_TO'] = $lang['mapquest_TO'];
$map_types['mapquest_TP'] = $lang['mapquest_TP'];
$map_types['mapquest_TR'] = $lang['mapquest_TR'];
$map_types['mapquest_TT'] = $lang['mapquest_TT'];
$map_types['mapquest_TV'] = $lang['mapquest_TV'];
$map_types['mapquest_TW'] = $lang['mapquest_TW'];
$map_types['mapquest_TZ'] = $lang['mapquest_TZ'];
$map_types['mapquest_UA'] = $lang['mapquest_UA'];
$map_types['mapquest_UG'] = $lang['mapquest_UG'];
$map_types['multimap_GB'] = $lang['multimap_uk'];
$map_types['google_us'] = $lang['google_us'];
$map_types['mapquest_US'] = $lang['mapquest_US'];
$map_types['yahoo_us'] = $lang['yahoo_us'];
$map_types['mapquest_UY'] = $lang['mapquest_UY'];
$map_types['mapquest_UZ'] = $lang['mapquest_UZ'];
$map_types['mapquest_VA'] = $lang['mapquest_VA'];
$map_types['mapquest_VC'] = $lang['mapquest_VC'];
$map_types['mapquest_VE'] = $lang['mapquest_VE'];
$map_types['mapquest_VG'] = $lang['mapquest_VG'];
$map_types['mapquest_VI'] = $lang['mapquest_VI'];
$map_types['mapquest_VN'] = $lang['mapquest_VN'];
$map_types['mapquest_VU'] = $lang['mapquest_VU'];
$map_types['mapquest_WF'] = $lang['mapquest_WF'];
$map_types['mapquest_WS'] = $lang['mapquest_WS'];
$map_types['mapquest_YE'] = $lang['mapquest_YE'];
$map_types['mapquest_YT'] = $lang['mapquest_YT'];
$map_types['mapquest_ZA'] = $lang['mapquest_ZA'];
$map_types['mapquest_ZM'] = $lang['mapquest_ZM'];
$map_types['mapquest_ZW'] = $lang['mapquest_ZW'];
// Listing Template Field Names for Map Field Selection
$sql = "SELECT listingsformelements_field_name, listingsformelements_field_caption FROM " . $config['table_prefix'] . "listingsformelements";
$recordSet = $conn->Execute($sql);
if (!$recordSet) {
$misc->log_error($sql);
}
$listing_field_name_options[''] = '';
while (!$recordSet->EOF) {
$field_name = $recordSet->fields['listingsformelements_field_name'];
$listing_field_name_options[$field_name] = $field_name . ' (' . $recordSet->fields['listingsformelements_field_caption'] . ')';
$recordSet->MoveNext();
}
// Agent Template Field Names for Vcard Selection
$sql = "SELECT agentformelements_field_name, agentformelements_field_caption FROM " . $config['table_prefix'] . "agentformelements";
$recordSet = $conn->Execute($sql);
if (!$recordSet) {
$misc->log_error($sql);
}
$agent_field_name_options[''] = '';
while (!$recordSet->EOF) {
$field_name = $recordSet->fields['agentformelements_field_name'];
$agent_field_name_options[$field_name] = $field_name . ' (' . $recordSet->fields['agentformelements_field_caption'] . ')';
$recordSet->MoveNext();
}
// Listing Template Field Names for Search Field Selection
$sql = "SELECT listingsformelements_field_name, listingsformelements_field_caption FROM " . $config['table_prefix'] . "listingsformelements WHERE listingsformelements_display_on_browse = 'Yes'";
$recordSet = $conn->Execute($sql);
$search_field_sortby_options['random'] = $lang['random'];
$search_field_sortby_options['listingsdb_id'] = $lang['id'];
$search_field_sortby_options['listingsdb_title'] = $lang['title'];
$search_field_sortby_options['listingsdb_featured'] = $lang['featured'];
$search_field_sortby_options['listingsdb_last_modified'] = $lang['last_modified'];
$search_field_special_sortby_options['none'] = $lang['none'];
$search_field_special_sortby_options['listingsdb_featured'] = $lang['featured'];
$search_field_special_sortby_options['listingsdb_id'] = $lang['id'];
$search_field_special_sortby_options['listingsdb_title'] = $lang['title'];
$search_field_special_sortby_options['listingsdb_last_modified'] = $lang['last_modified'];
示例9: misc
function edit_vtour_images()
{
global $lang, $conn, $config;
require_once $config['basepath'] . '/include/misc.inc.php';
$misc = new misc();
$display = '';
if (isset($_GET['edit']) && $_GET['edit'] != '') {
$_POST['edit'] = $_GET['edit'];
}
$edit = intval($_POST['edit']);
$sql_edit = intval($_POST['edit']);
if (!isset($_POST['action'])) {
$_POST['action'] = '';
}
// does this person have access to these listings?
if ($_SESSION['edit_all_listings'] != "yes" && $_SESSION['admin_privs'] != "yes") {
$sql = "SELECT userdb_id FROM " . $config['table_prefix'] . "listingsdb WHERE (listingsdb_id = {$sql_edit})";
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
$misc->log_error($sql);
}
while (!$recordSet->EOF) {
$owner = $recordSet->fields['userdb_id'];
$recordSet->MoveNext();
}
if ($_SESSION['userID'] != $owner) {
die($lang['priv_failure']);
}
}
// end priv check
if ($_POST['action'] == "update_pic") {
$count = 0;
$num_fields = count($_POST['pic']);
$sql_edit = $misc->make_db_safe($_POST['edit']);
while ($count < $num_fields) {
$sql_caption = $misc->make_db_safe($_POST['caption'][$count]);
$sql_description = $misc->make_db_safe($_POST['description'][$count]);
$sql_rank = $misc->make_db_safe($_POST['rank'][$count]);
$sql_pic = $misc->make_db_safe($_POST['pic'][$count]);
if ($_SESSION['edit_all_listings'] == "yes" || $_SESSION['admin_privs'] == "yes") {
$sql = "UPDATE " . $config['table_prefix'] . "vtourimages SET vtourimages_caption = {$sql_caption}, vtourimages_description = {$sql_description}, vtourimages_rank = {$sql_rank} WHERE ((listingsdb_id = {$sql_edit}) AND (vtourimages_file_name = {$sql_pic}))";
} else {
$sql = "UPDATE " . $config['table_prefix'] . "vtourimages SET vtourimages_caption = {$sql_caption}, vtourimages_description = {$sql_description}, vtourimages_rank = {$sql_rank} WHERE ((listingsdb_id = {$sql_edit}) AND (vtourimages_file_name = {$sql_pic}) AND (userdb_id = {$_SESSION['userID']}))";
}
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
$misc->log_error($sql);
}
$count++;
}
$display .= '<p>' . $lang['images_update'] . '</p>';
$misc->log_action($lang['log_updated_listing_image'] . $edit);
}
if (isset($_GET['delete'])) {
// get the data for the pic being deleted
$sql_pic_id = $misc->make_db_safe($_GET['delete']);
$sql_edit = $misc->make_db_safe($_GET['edit']);
if ($_SESSION['edit_all_listings'] == "yes" || $_SESSION['admin_privs'] == "yes") {
$sql = "SELECT vtourimages_file_name, vtourimages_thumb_file_name FROM " . $config['table_prefix'] . "vtourimages WHERE ((listingsdb_id = {$sql_edit}) AND (vtourimages_id = {$sql_pic_id}))";
} else {
$sql = "SELECT vtourimages_file_name, vtourimages_thumb_file_name FROM " . $config['table_prefix'] . "vtourimages WHERE ((listingsdb_id = {$sql_edit}) AND (vtourimages_id = {$sql_pic_id}) AND (userdb_id = {$_SESSION['userID']}))";
}
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
$misc->log_error($sql);
}
while (!$recordSet->EOF) {
$thumb_file_name = $misc->make_db_unsafe($recordSet->fields['vtourimages_thumb_file_name']);
$file_name = $misc->make_db_unsafe($recordSet->fields['vtourimages_file_name']);
$recordSet->MoveNext();
}
// end while
// delete from the db
if ($_SESSION['edit_all_listings'] == "yes" || $_SESSION['admin_privs'] == "yes") {
$sql = "DELETE FROM " . $config['table_prefix'] . "vtourimages WHERE ((listingsdb_id = {$sql_edit}) AND (vtourimages_file_name = '{$file_name}'))";
} else {
$sql = "DELETE FROM " . $config['table_prefix'] . "vtourimages WHERE ((listingsdb_id = {$sql_edit}) AND (vtourimages_file_name = '{$file_name}') AND (userdb_id = '{$_SESSION['userID']}'))";
}
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
$misc->log_error($sql);
}
// delete the files themselves
// on widows, required php 4.11 or better (I think)
if (!unlink("{$config['vtour_upload_path']}/{$file_name}")) {
die("{$lang['alert_site_admin']}");
}
if ($file_name != $thumb_file_name) {
if (!unlink("{$config['vtour_upload_path']}/{$thumb_file_name}")) {
die("{$lang['alert_site_admin']}");
}
}
$misc->log_action("{$lang['log_deleted_listing_image']} {$file_name}");
$display .= "<p>{$lang['image']} '{$file_name}' {$lang['has_been_deleted']}</p>";
}
if ($_POST['action'] == "upload") {
if ($_SESSION['edit_all_listings'] == "yes" || $_SESSION['admin_privs'] == "yes") {
// get the owner of the listing
$sql = "SELECT userdb_id FROM " . $config['table_prefix'] . "listingsdb WHERE (listingsdb_id = {$sql_edit})";
$recordSet = $conn->Execute($sql);
//.........这里部分代码省略.........
示例10: misc
function create_download($ID, $file_id, $type)
{
global $config, $conn;
require_once $config['basepath'] . '/include/misc.inc.php';
$misc = new misc();
$folderid = $ID;
$ID = $misc->make_db_extra_safe($ID);
$fileID = $misc->make_db_extra_safe($file_id);
if ($type == 'listing') {
$file_upload_path = $config['listings_file_upload_path'];
$file_view_path = $config['listings_view_file_path'];
$sqltype = 'listings';
} else {
$file_upload_path = $config['users_file_upload_path'];
$file_view_path = $config['users_view_file_path'];
$sqltype = 'user';
}
$sql = "SELECT DISTINCT " . $type . "sfiles_file_name FROM " . $config['table_prefix'] . "" . $type . "sfiles WHERE (" . $sqltype . "db_id = {$ID}) AND (" . $type . "sfiles_id = " . $fileID . ") ORDER BY " . $type . "sfiles_rank";
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
$misc->log_error($sql);
}
while (!$recordSet->EOF) {
$file_filename = $misc->make_db_unsafe($recordSet->fields[$type . 'sfiles_file_name']);
$recordSet->MoveNext();
}
$fullPath = $file_upload_path . '/' . $folderid . '/' . $file_filename;
if ($fd = fopen($fullPath, "r")) {
$fsize = filesize($fullPath);
$path_parts = pathinfo($fullPath);
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"" . $path_parts["basename"] . "\"");
header("Content-length: {$fsize}");
header("Cache-control: private");
//use this to open files directly
while (!feof($fd)) {
$buffer = fread($fd, 2048);
echo $buffer;
}
}
fclose($fd);
}
示例11: misc
function get_blog_keywords($blog_id)
{
global $conn, $config;
require_once $config['basepath'] . '/include/misc.inc.php';
$misc = new misc();
if (isset($_GET['PageID'])) {
$blog_id = $misc->make_db_safe($blog_id);
$sql = "SELECT blogmain_keywords FROM " . $config['table_prefix'] . "blogmain WHERE blogmain_id=" . $blog_id;
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
$misc->log_error($sql);
}
$keywords = $misc->make_db_unsafe($recordSet->fields['blogmain_keywords']);
return $keywords;
} else {
return '';
}
}
示例12: renderNotifyListings
function renderNotifyListings($listingIDArray, $search_title, $user_name, $email)
{
global $conn, $lang, $config, $db_type, $current_ID;
//Load the Core Template class and the Misc Class
require_once $config['basepath'] . '/include/class/template/core.inc.php';
$page = new page_user();
require_once $config['basepath'] . '/include/misc.inc.php';
$misc = new misc();
require_once $config['basepath'] . '/include/listing.inc.php';
$listingclass = new listing_pages();
//Declare an empty display variable to hold all output from function.
$display = '';
//If We have a $current_ID save it
$old_current_ID = '';
if ($current_ID != '') {
$old_current_ID = $current_ID;
}
//Load the Notify Listing Template specified in the Site Config
$page->load_page($config['template_path'] . '/' . $config['notify_listings_template']);
// Determine if the template uses rows.
// First item in array is the row conent second item is the number of block per block row
$notify_template_row = $page->get_template_section_row('notify_listing_block_row');
if (is_array($notify_template_row)) {
$row = $notify_template_row[0];
$col_count = $notify_template_row[1];
$user_rows = true;
$x = 1;
//Create an empty array to hold the row conents
$new_row_data = array();
} else {
$user_rows = false;
}
$notify_template_section = '';
foreach ($listingIDArray as $current_ID) {
if ($user_rows == true && $x > $col_count) {
//We are at then end of a row. Save the template section as a new row.
$new_row_data[] = $page->replace_template_section('notify_listing_block', $notify_template_section, $row);
//$new_row_data[] = $notify_template_section;
$notify_template_section = $page->get_template_section('notify_listing_block');
$x = 1;
} else {
$notify_template_section .= $page->get_template_section('notify_listing_block');
}
$listing_title = $listingclass->get_title($current_ID);
if ($config['url_style'] == '1') {
$notify_url = $config['baseurl'] . '/index.php?action=listingview&listingID=' . $current_ID;
// #####
} else {
$url_title = str_replace("/", "", $listing_title);
$url_title = strtolower(str_replace(" ", $config['seo_url_seperator'], $url_title));
$notify_url = $config['baseurl'] . '/listing-' . misc::urlencode_to_sef($url_title) . '-' . $current_ID . '.html';
// #####
}
$notify_template_section = $page->replace_listing_field_tags($current_ID, $notify_template_section);
$notify_template_section = $page->replace_listing_field_tags($current_ID, $notify_template_section);
$notify_template_section = $page->parse_template_section($notify_template_section, 'notify_url', $notify_url);
$notify_template_section = $page->parse_template_section($notify_template_section, 'listingid', $current_ID);
// Setup Image Tags
$sql2 = "SELECT listingsimages_thumb_file_name,listingsimages_file_name\n\t\t\t\t\tFROM " . $config['table_prefix'] . "listingsimages\n\t\t\t\t\tWHERE (listingsdb_id = {$current_ID})\n\t\t\t\t\tORDER BY listingsimages_rank";
$recordSet2 = $conn->SelectLimit($sql2, 1, 0);
if ($recordSet2 === false) {
$misc->log_error($sql2);
}
if ($recordSet2->RecordCount() > 0) {
$thumb_file_name = $misc->make_db_unsafe($recordSet2->fields['listingsimages_thumb_file_name']);
$file_name = $misc->make_db_unsafe($recordSet2->fields['listingsimages_file_name']);
if ($thumb_file_name != "" && file_exists("{$config['listings_upload_path']}/{$thumb_file_name}")) {
// gotta grab the thumbnail image size
$imagedata = GetImageSize("{$config['listings_upload_path']}/{$thumb_file_name}");
$imagewidth = $imagedata[0];
$imageheight = $imagedata[1];
$shrinkage = $config['thumbnail_width'] / $imagewidth;
$notify_thumb_width = $imagewidth * $shrinkage;
$notify_thumb_height = $imageheight * $shrinkage;
$notify_thumb_src = $config['listings_view_images_path'] . '/' . $thumb_file_name;
// gotta grab the thumbnail image size
$imagedata = GetImageSize("{$config['listings_upload_path']}/{$file_name}");
$imagewidth = $imagedata[0];
$imageheight = $imagedata[1];
$notify_width = $imagewidth;
$notify_height = $imageheight;
$notify_src = $config['listings_view_images_path'] . '/' . $file_name;
}
} else {
if ($config['show_no_photo'] == 1) {
$imagedata = GetImageSize($config['basepath'] . "/images/nophoto.gif");
$imagewidth = $imagedata[0];
$imageheight = $imagedata[1];
$shrinkage = $config['thumbnail_width'] / $imagewidth;
$notify_thumb_width = $imagewidth * $shrinkage;
$notify_thumb_height = $imageheight * $shrinkage;
$notify_thumb_src = $config['baseurl'] . '/images/nophoto.gif';
$notify_width = $notify_thumb_width;
$notify_height = $notify_thumb_height;
$notify_src = $config['baseurl'] . '/images/nophoto.gif';
} else {
$notify_thumb_width = '';
$notify_thumb_height = '';
$notify_thumb_src = '';
$notify_width = '';
//.........这里部分代码省略.........
示例13: misc
/**
* maps::create_map_link()
* This is the function to call to show a map link. It should be called from the listing detail page, or any page where $_GET['listingID'] is set.
* This function then calls the appropriate make_mapname function as specified in the configuration.
*
* @see maps::make_mapquest()
* @see maps::make_yahoo_us()
* @return string Return the URL for the map as long as the required fields are filled out, if not it returns a empty string.
*/
function create_map_link($url_only = 'no')
{
global $conn, $config;
require_once $config['basepath'] . '/include/misc.inc.php';
$misc = new misc();
// Map Type
// Get Address, City, State, Zip
// Create Blank Variables
$display = '';
$address = '';
$city = '';
$state = '';
$zip = '';
// Get Listing ID
$sql_listingID = $misc->make_db_safe($_GET['listingID']);
$listing_title = urlencode(listing_pages::get_title($_GET['listingID']));
// get address
$sql_address_field = $misc->make_db_safe($config['map_address']);
$sql = "SELECT listingsdbelements_field_value, listingsformelements_field_type, listingsformelements_field_caption FROM " . $config['table_prefix'] . "listingsdbelements, " . $config['table_prefix'] . "listingsformelements WHERE ((" . $config['table_prefix'] . "listingsdbelements.listingsdb_id = {$sql_listingID}) AND (listingsformelements_field_name = listingsdbelements_field_name) AND (listingsdbelements_field_name = {$sql_address_field}))";
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
$misc->log_error($sql);
}
while (!$recordSet->EOF) {
$address = urlencode($misc->make_db_unsafe($recordSet->fields['listingsdbelements_field_value']));
$recordSet->MoveNext();
}
// end while
// Add address fields 2 & 3
$sql_address_field = $misc->make_db_safe($config['map_address2']);
$sql = "SELECT listingsdbelements_field_value, listingsformelements_field_type, listingsformelements_field_caption FROM " . $config['table_prefix'] . "listingsdbelements, " . $config['table_prefix'] . "listingsformelements WHERE ((" . $config['table_prefix'] . "listingsdbelements.listingsdb_id = {$sql_listingID}) AND (listingsformelements_field_name = listingsdbelements_field_name) AND (listingsdbelements_field_name = {$sql_address_field}))";
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
$misc->log_error($sql);
}
while (!$recordSet->EOF) {
$address .= ' ' . urlencode($misc->make_db_unsafe($recordSet->fields['listingsdbelements_field_value']));
$recordSet->MoveNext();
}
// end while
$sql_address_field = $misc->make_db_safe($config['map_address3']);
$sql = "SELECT listingsdbelements_field_value, listingsformelements_field_type, listingsformelements_field_caption FROM " . $config['table_prefix'] . "listingsdbelements, " . $config['table_prefix'] . "listingsformelements WHERE ((" . $config['table_prefix'] . "listingsdbelements.listingsdb_id = {$sql_listingID}) AND (listingsformelements_field_name = listingsdbelements_field_name) AND (listingsdbelements_field_name = {$sql_address_field}))";
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
$misc->log_error($sql);
}
while (!$recordSet->EOF) {
$address .= ' ' . urlencode($misc->make_db_unsafe($recordSet->fields['listingsdbelements_field_value']));
$recordSet->MoveNext();
}
// end while
$sql_address_field = $misc->make_db_safe($config['map_address4']);
$sql = "SELECT listingsdbelements_field_value, listingsformelements_field_type, listingsformelements_field_caption FROM " . $config['table_prefix'] . "listingsdbelements, " . $config['table_prefix'] . "listingsformelements WHERE ((" . $config['table_prefix'] . "listingsdbelements.listingsdb_id = {$sql_listingID}) AND (listingsformelements_field_name = listingsdbelements_field_name) AND (listingsdbelements_field_name = {$sql_address_field}))";
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
$misc->log_error($sql);
}
while (!$recordSet->EOF) {
$address .= ' ' . urlencode($misc->make_db_unsafe($recordSet->fields['listingsdbelements_field_value']));
$recordSet->MoveNext();
}
// end while
// get city
$sql_city_field = $misc->make_db_safe($config['map_city']);
$sql = "SELECT listingsdbelements_field_value, listingsformelements_field_type, listingsformelements_field_caption FROM " . $config['table_prefix'] . "listingsdbelements, " . $config['table_prefix'] . "listingsformelements WHERE ((" . $config['table_prefix'] . "listingsdbelements.listingsdb_id = {$sql_listingID}) AND (listingsformelements_field_name = listingsdbelements_field_name) AND (listingsdbelements_field_name = {$sql_city_field}))";
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
$misc->log_error($sql);
}
while (!$recordSet->EOF) {
$city = urlencode($misc->make_db_unsafe($recordSet->fields['listingsdbelements_field_value']));
$recordSet->MoveNext();
}
// end while
// get state
$sql_state_field = $misc->make_db_safe($config['map_state']);
$sql = "SELECT listingsdbelements_field_value, listingsformelements_field_type, listingsformelements_field_caption FROM " . $config['table_prefix'] . "listingsdbelements, " . $config['table_prefix'] . "listingsformelements WHERE ((" . $config['table_prefix'] . "listingsdbelements.listingsdb_id = {$sql_listingID}) AND (listingsformelements_field_name = listingsdbelements_field_name) AND (listingsdbelements_field_name = {$sql_state_field}))";
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
$misc->log_error($sql);
}
while (!$recordSet->EOF) {
$state = urlencode($misc->make_db_unsafe($recordSet->fields['listingsdbelements_field_value']));
$recordSet->MoveNext();
}
// end while
// get zip
$sql_zip_field = $misc->make_db_safe($config['map_zip']);
$sql = "SELECT listingsdbelements_field_value, listingsformelements_field_type, listingsformelements_field_caption FROM " . $config['table_prefix'] . "listingsdbelements, " . $config['table_prefix'] . "listingsformelements WHERE ((" . $config['table_prefix'] . "listingsdbelements.listingsdb_id = {$sql_listingID}) AND (listingsformelements_field_name = listingsdbelements_field_name) AND (listingsdbelements_field_name = {$sql_zip_field}))";
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
//.........这里部分代码省略.........
示例14: misc
function show_users($filter = '', $lookup_field = '', $lookup_value = '')
{
global $conn, $config, $lang;
require_once $config['basepath'] . '/include/misc.inc.php';
$misc = new misc();
// Verify User is an Admin
$security = login::loginCheck('edit_all_users', true);
$display = '';
$filter_sql = '';
if ($filter == 'agents') {
$filter_sql = " WHERE userdb_is_agent = 'yes'";
} elseif ($filter == 'members') {
$filter_sql = " WHERE userdb_is_agent = 'no' AND userdb_is_admin = 'no'";
} elseif ($filter == 'admins') {
$filter_sql = " WHERE userdb_is_admin = 'yes'";
}
if ($security === true) {
$sql = "SELECT * FROM " . $config['table_prefix'] . "userdb {$filter_sql} ORDER BY userdb_id ";
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
$misc->log_error($sql);
}
$num_rows = $recordSet->RecordCount();
if (!isset($_GET['cur_page'])) {
$_GET['cur_page'] = 0;
}
$display .= '<center>' . $misc->next_prev($num_rows, intval($_GET['cur_page'])) . '</center>';
// put in the next/previous stuff
// build the string to select a certain number of users per page
$limit_str = intval($_GET['cur_page']) * $config['listings_per_page'];
$recordSet = $conn->SelectLimit($sql, $config['listings_per_page'], $limit_str);
if ($recordSet === false) {
$misc->log_error($sql);
}
$count = 0;
// $display .= "<br /><br />";
while (!$recordSet->EOF) {
// alternate the colors
if ($count == 0) {
$count = $count + 1;
} else {
$count = 0;
}
// strip slashes so input appears correctly
$edit_ID = $recordSet->fields['userdb_id'];
$edit_user_name = $misc->make_db_unsafe($recordSet->fields['userdb_user_name']);
$edit_user_first_name = $misc->make_db_unsafe($recordSet->fields['userdb_user_first_name']);
$edit_user_last_name = $misc->make_db_unsafe($recordSet->fields['userdb_user_last_name']);
$edit_emailAddress = $misc->make_db_unsafe($recordSet->fields['userdb_emailaddress']);
$edit_active = $recordSet->fields['userdb_active'];
$edit_isAgent = $recordSet->fields['userdb_is_agent'];
$edit_isAdmin = $recordSet->fields['userdb_is_admin'];
$edit_canEditSiteConfig = $recordSet->fields['userdb_can_edit_site_config'];
$edit_canEditMemberTemplate = $recordSet->fields['userdb_can_edit_member_template'];
$edit_canEditAgentTemplate = $recordSet->fields['userdb_can_edit_agent_template'];
$edit_canEditListingTemplate = $recordSet->fields['userdb_can_edit_listing_template'];
$edit_canFeatureListings = $recordSet->fields['userdb_can_feature_listings'];
$edit_canViewLogs = $recordSet->fields['userdb_can_view_logs'];
$edit_canModerate = $recordSet->fields['userdb_can_moderate'];
$edit_can_have_vtours = $recordSet->fields['userdb_can_have_vtours'];
$edit_can_edit_expiration = $recordSet->fields['userdb_can_edit_expiration'];
$edit_can_export_listings = $recordSet->fields['userdb_can_export_listings'];
$edit_canEditAllListings = $recordSet->fields['userdb_can_edit_all_listings'];
$edit_canEditAllUsers = $recordSet->fields['userdb_can_edit_all_users'];
$edit_canEditPropertyClasses = $recordSet->fields['userdb_can_edit_property_classes'];
// Determine user type
if ($edit_isAgent == 'yes') {
$user_type = $lang['user_manager_agent'];
} elseif ($edit_isAdmin == 'yes') {
$user_type = $lang['user_manager_admin'];
} else {
$user_type = $lang['user_manager_member'];
}
// Layout Start
$display .= '<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">';
// $display .= '<tbody style="border-width:thin;border-style:solid;border-color:#FFFFFF;">';
$display .= '<tr bgcolor="#330099">';
$display .= '<td width="510" colspan="2" style="padding-left:2px">';
$display .= '<span style="color:#FFFFFF;font-weight:bold;">' . $edit_user_first_name . ' ' . $edit_user_last_name . ' (' . $edit_ID . '): ' . $edit_emailAddress . '</span>';
$display .= '</td>';
$display .= '<td width="90" align="right">';
$display .= '<a href="index.php?action=user_manager&edit=' . $edit_ID . '"><img src="images/' . $config['lang'] . '/user_manager_edit.jpg" alt="' . $lang['user_manager_edit_user'] . '" width="16" height="16"></a>';
$display .= '<img src="images/blank.gif" alt=" " width="16" height="16">';
$display .= '<a href="index.php?action=user_manager&delete=' . $edit_ID . '" onclick="return confirmDelete(\'' . $lang['delete_user'] . '\')"><img src="images/' . $config['lang'] . '/user_manager_delete.jpg" alt="' . $lang['user_manager_delete_user'] . '" width="16" height="16"></a>';
$display .= '</td>';
$display .= '</tr>';
$display .= '<tr>';
$display .= '<td colspan="2"><strong>' . $lang['user_manager_user_name'] . ': ' . $edit_user_name . '</strong></td>';
$display .= '<td></td>';
$display .= '</tr>';
$display .= '<tr>';
$display .= '<td colspan="2"><strong>' . $lang['user_manager_account_type'] . ': ' . $user_type . '</strong></td>';
$display .= '<td></td>';
$display .= '</tr>';
$display .= '<tr>';
$display .= '<td colspan="2"><strong>' . $lang['user_manager_active'] . ': ' . $edit_active . '</strong></td>';
$display .= '<td></td>';
$display .= '</tr>';
if ($edit_isAgent == 'yes') {
$display .= '<tr>';
//.........这里部分代码省略.........
示例15: ContactAgentForm
/**
* Contact::ContactAgentForm()
*
* @param integer $listing_id This should hold the listing ID. Listing_id is used only if agent_id is not set
* @param integer $agent_id This should hold the agent id
* @return
*/
function ContactAgentForm($listing_id = 0, $agent_id = 0)
{
global $conn, $config, $lang;
require_once $config['basepath'] . '/include/misc.inc.php';
$misc = new misc();
$display = '';
$error = array();
$listing_id = intval($listing_id);
$agent_id = intval($agent_id);
if ($agent_id == 0) {
if ($listing_id != 0) {
$sql_listing_id = $misc->make_db_safe($listing_id);
$sql = 'SELECT userdb_id FROM ' . $config['table_prefix'] . 'listingsdb WHERE listingsdb_id = ' . $sql_listing_id;
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
$misc->log_error($sql);
}
$agent_id = $misc->make_db_unsafe($recordSet->fields['userdb_id']);
}
}
if (isset($_POST['message'])) {
// Make sure there is a message
if ($_SESSION['security_code'] != md5($_POST['security_code']) && $config["use_email_image_verification"] == 1) {
$error[] = 'email_verification_code_not_valid';
}
if (trim($_POST['name']) == '') {
$error[] = 'email_no_name';
}
if (trim($_POST['email']) == '') {
$error[] = 'email_no_email_address';
} elseif ($misc->validate_email($_POST['email']) !== true) {
$error[] = 'email_invalid_email_address';
}
if (trim($_POST['subject']) == '') {
$error[] = 'email_no_subject';
}
if (trim($_POST['message']) == '') {
$error[] = 'email_no_message';
}
}
if (count($error) == 0 && isset($_POST['message'])) {
// Grab Agents Email
$sql_agent_id = $misc->make_db_safe($agent_id);
$sql = 'SELECT userdb_emailaddress FROM ' . $config['table_prefix'] . 'userdb WHERE userdb_id = ' . $sql_agent_id;
$recordSet = $conn->Execute($sql);
if ($recordSet === false) {
$misc->log_error($sql);
}
if ($config["include_senders_ip"] == 1) {
$_POST['message'] .= "\r\n" . $lang['senders_ip_address'] . $_SERVER["REMOTE_ADDR"];
}
if ($recordSet->RecordCount() != 0) {
$emailaddress = $misc->make_db_unsafe($recordSet->fields['userdb_emailaddress']);
// Send Mail
$sent = $misc->send_email($_POST['name'], $_POST['email'], $emailaddress, $_POST['message'], $_POST['subject']);
if ($sent === true) {
$display .= $lang['email_listing_agent_sent'];
} else {
$display .= $sent;
}
}
} else {
if (count($error) != 0) {
foreach ($error as $err) {
$display .= '<div class="error_text">' . $lang[$err] . '</div>';
}
}
$name = '';
$email = '';
$subject = '';
if ($listing_id !== 0) {
$subject = $lang['email_in_reference_to_listing'] . $listing_id;
}
$message = '';
if (isset($_POST['message'])) {
$email = stripslashes($_POST['email']);
$name = stripslashes($_POST['name']);
$message = stripslashes($_POST['message']);
$subject = stripslashes($_POST['subject']);
}
$display .= '<form name="contact_agent" method="post" action="index.php?action=contact_agent&popup=yes&listing_id=' . $listing_id . '&agent_id=' . $agent_id . '">
<table border="0" cellspacing="2" cellpadding="4">
<tr>
<td colspan="2" style="vertical-align: top" class="TitleColor"><label for="name">' . $lang['email_your_name'] . ' </label>
<input id="name" name="name" value="' . htmlentities($name) . '" type="text" size="50">
</td>
</tr>
<tr>
<td colspan="2" style="vertical-align: top" class="TitleColor"><label for="email">' . $lang['email_your_email'] . ' </label>
<input id="email" name="email" value="' . htmlentities($email) . '" type="text" size="50">
</td>
</tr>
<tr>
//.........这里部分代码省略.........