当前位置: 首页>>代码示例>>PHP>>正文


PHP misc::urlencode_to_sef方法代码示例

本文整理汇总了PHP中misc::urlencode_to_sef方法的典型用法代码示例。如果您正苦于以下问题:PHP misc::urlencode_to_sef方法的具体用法?PHP misc::urlencode_to_sef怎么用?PHP misc::urlencode_to_sef使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在misc的用法示例。


在下文中一共展示了misc::urlencode_to_sef方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: replace_listing_field_tags


//.........这里部分代码省略.........
                         $tempate_section = preg_replace('/{listing_agent_field_' . $block . '_block}(.*?){\\/listing_agent_field_' . $block . '_block}/is', '', $tempate_section);
                     } else {
                         $tempate_section = str_replace('{listing_agent_field_' . $block . '_block}', '', $tempate_section);
                         $tempate_section = str_replace('{/listing_agent_field_' . $block . '_block}', '', $tempate_section);
                     }
                 }
             }
             // Replace listing_agent tags
             // Handle Caption Only
             $tempate_section = preg_replace_callback('/{listing_agent_field_([^{}]*?)_caption}/', create_function('$matches', 'global $config,$or_replace_listing_owner,$lang;require_once($config[\'basepath\'].\'/include/user.inc.php\'); return user::renderSingleListingItem($or_replace_listing_owner, $matches[1],\'caption\');'), $tempate_section);
             // Hanle Value Only
             $tempate_section = preg_replace_callback('/{listing_agent_field_([^{}]*?)_value}/', create_function('$matches', 'global $config,$or_replace_listing_owner,$lang;require_once($config[\'basepath\'].\'/include/user.inc.php\'); return user::renderSingleListingItem($or_replace_listing_owner, $matches[1],\'value\');'), $tempate_section);
             // Handle Raw Value
             $tempate_section = preg_replace_callback('/{listing_agent_field_([^{}]*?)_rawvalue}/', create_function('$matches', 'global $config,$or_replace_listing_owner,$lang;require_once($config[\'basepath\'].\'/include/user.inc.php\'); return user::renderSingleListingItem($or_replace_listing_owner, $matches[1],\'rawvalue\');'), $tempate_section);
             // Handle Both Caption and Value
             $tempate_section = preg_replace_callback('/{listing_agent_field_([^{}]*?)}/', create_function('$matches', 'global $config,$or_replace_listing_owner,$lang;require_once($config[\'basepath\'].\'/include/user.inc.php\'); return user::renderSingleListingItem($or_replace_listing_owner, $matches[1]);'), $tempate_section);
         }
         // Listing Images
         $sql2 = "SELECT listingsdb_title FROM " . $config['table_prefix'] . "listingsdb WHERE listingsdb_id = {$listing_id}";
         $recordSet2 = $conn->Execute($sql2);
         if (!$recordSet2) {
             $misc->log_error($sql2);
         }
         $Title = $misc->make_db_unsafe($recordSet2->fields['listingsdb_title']);
         if ($config['url_style'] == '1') {
             $url = '<a href="index.php?action=listingview&amp;listingID=' . $listing_id . '">';
             $fullurl = '<a href="' . $config["baseurl"] . '/index.php?action=listingview&amp;listingID=' . $listing_id . '">';
             // Listing Link
             $tempate_section = str_replace('{link_to_listing}', 'index.php?action=listingview&amp;listingID=' . $listing_id, $tempate_section);
             $tempate_section = str_replace('{fulllink_to_listing}', $config['baseurl'] . '/index.php?action=listingview&amp;listingID=' . $listing_id, $tempate_section);
         } else {
             $url_title = str_replace("/", "", $Title);
             $url_title = strtolower(str_replace(" ", $config['seo_url_seperator'], $url_title));
             $url = '<a href="listing-' . misc::urlencode_to_sef($url_title) . '-' . $listing_id . '.html">';
             $fullurl = '<a href="' . $config["baseurl"] . '/listing-' . misc::urlencode_to_sef($url_title) . '-' . $listing_id . '.html">';
             // Listing Link
             $tempate_section = str_replace('{link_to_listing}', 'listing-' . misc::urlencode_to_sef($url_title) . '-' . $listing_id . '.html', $tempate_section);
             $tempate_section = str_replace('{fulllink_to_listing}', '' . $config["baseurl"] . '/listing-' . misc::urlencode_to_sef($url_title) . '-' . $listing_id . '.html', $tempate_section);
         }
         // grab the listing's image
         $sql2 = "SELECT listingsimages_id, listingsimages_caption, listingsimages_thumb_file_name, listingsimages_file_name FROM " . $config['table_prefix'] . "listingsimages WHERE listingsdb_id = {$listing_id} ORDER BY listingsimages_rank";
         $recordSet2 = $conn->Execute($sql2);
         if (!$recordSet2) {
             $misc->log_error($sql2);
         }
         $num_images = $recordSet2->RecordCount();
         if ($num_images == 0) {
             if ($config['show_no_photo'] == 1) {
                 $listing_image = $url . '<img src="' . $config["baseurl"] . '/images/nophoto.gif" alt="' . $lang['no_photo'] . '" /></a>';
                 $listing_image_full = $fullurl . '<img src="' . $config["baseurl"] . '/images/nophoto.gif" alt="' . $lang['no_photo'] . '" /></a>';
                 if ($_GET['action'] == 'listingview') {
                     $listing_image = '<img src="' . $config["baseurl"] . '/images/nophoto.gif" alt="' . $lang['no_photo'] . '" />';
                     $listing_image_full = '<img src="' . $config["baseurl"] . '/images/nophoto.gif" alt="' . $lang['no_photo'] . '" />';
                 }
                 $tempate_section = str_replace('{raw_image_thumb_1}', $config['baseurl'] . '/images/nophoto.gif', $tempate_section);
             } else {
                 $listing_image = '';
                 $tempate_section = str_replace('{raw_image_thumb_1}', '', $tempate_section);
             }
             $tempate_section = str_replace('{image_thumb_1}', $listing_image, $tempate_section);
             $tempate_section = str_replace('{image_thumb_fullurl_1}', $listing_image, $tempate_section);
         }
         $x = 1;
         while (!$recordSet2->EOF) {
             //if we're already on the listing then make the urls goto the view image
             $listingsimages_id = $misc->make_db_unsafe($recordSet2->fields['listingsimages_id']);
开发者ID:henryhe514,项目名称:ChineseCommercial,代码行数:67,代码来源:core.inc.old.php

示例2: listing_next_prev

 public static function listing_next_prev()
 {
     global $config, $lang;
     $display = '';
     $listingID = intval($_GET['listingID']);
     if (isset($_SERVER['HTTP_REFERER'])) {
         $pos = strpos($_SERVER['HTTP_REFERER'], 'search');
         $pos1 = strpos($_SERVER['HTTP_REFERER'], 'listingview');
         $pos2 = strpos($_SERVER['HTTP_REFERER'], 'view_listing_image');
         $pos3 = strpos($_SERVER['HTTP_REFERER'], 'listing-');
         $pos4 = strpos($_SERVER['HTTP_REFERER'], 'listing_image_');
         if ($pos == "" && $pos1 == "" && $pos2 == "" && $pos3 == "" && $pos4 == "") {
             unset($_SESSION['results']);
         }
         if (isset($_SESSION['results'])) {
             $url = $_SESSION['searchstring'];
             $cur_page = $_SESSION['cur_page'];
             $url_with_page = $url . '&amp;cur_page=' . $cur_page;
             $np_listings = $_SESSION['results'];
             $np_titles = $_SESSION['titles'];
             $i = 1;
             $array = '';
             foreach ($np_listings as $np_listing) {
                 $myarray[$i] = $np_listing;
                 $i++;
             }
             $i = 1;
             $array = '';
             foreach ($np_titles as $np_title) {
                 $myarray2[$i] = misc::urlencode_to_sef($np_title);
                 $i++;
             }
             if ($_SESSION['count'] > 1) {
                 $display .= '<div class="next_prev_listing"><div class="count">' . $lang['there_are_currently'] . ' ' . $_SESSION['count'] . ' ' . $lang['that_match_search'] . '<br />' . $lang['navigate'] . '</div><ul>';
                 foreach ($myarray as $i => $item) {
                     if ($item == $listingID) {
                         //Show First and Previous Buttons if we are not on the first listing.
                         if ($i != 1) {
                             if ($config['url_style'] == '1') {
                                 $display .= '<li><a href="index.php?action=listingview&amp;listingID=' . $myarray[1] . '" ><img src="' . $config["template_url"] . '/images/nextprev/first.png" alt="' . $lang['first'] . '" title="' . $lang['first'] . '" /></a></li><li><a href="index.php?action=listingview&amp;listingID=' . $myarray[$i - 1] . '" ><img src="' . $config["template_url"] . '/images/nextprev/previous.png" alt="' . $lang['previous'] . '" title="' . $lang['previous'] . '" /></a></li>';
                             } else {
                                 $display .= '<li><a href="listing-' . $myarray2[1] . '-' . $myarray[1] . '.html" ><img src="' . $config["template_url"] . '/images/nextprev/first.png" alt="' . $lang['first'] . '" title="' . $lang['first'] . '" /></a></li><li><a href="listing-' . $myarray2[$i - 1] . '-' . $myarray[$i - 1] . '.html" ><img src="' . $config["template_url"] . '/images/nextprev/previous.png" alt="' . $lang['previous'] . '" title="' . $lang['previous'] . '" /></a></li>';
                             }
                         }
                         //Show Disabled Previous Button if we are on the first listing
                         if ($i == 1) {
                             $display .= '<li><img src="' . $config["template_url"] . '/images/nextprev/first_n.png" alt="' . $lang['first'] . '" title="' . $lang['first'] . '" /></li><li><img src="' . $config["template_url"] . '/images/nextprev/previous_n.png" alt="' . $lang['previous'] . '" title="' . $lang['previous'] . '" /></li>';
                         }
                         //Show Refine Search and Save Search Buttons if the search string was not empty
                         if (!empty($url)) {
                             $display .= '<li><a href="index.php?action=searchresults' . $url_with_page . '" > <img src="' . $config["template_url"] . '/images/nextprev/search.png" alt="' . $lang['return_to_search'] . '" title="' . $lang['return_to_search'] . '" /></a></li><li><a href="index.php?action=save_search' . $url . '" ><img src="' . $config["template_url"] . '/images/nextprev/save.png" alt="' . $lang['save_this_search'] . '" title="' . $lang['save_this_search'] . '" /></a></li>';
                         }
                         if (empty($url)) {
                             $display .= '<li><a href="index.php?action=searchpage" ><img src="' . $config["template_url"] . '/images/nextprev/search.png" alt="' . $lang['refine_search'] . '" title="' . $lang['refine_search'] . '" /></a></li><li><a href="index.php?action=save_search' . $url . '" ><img src="' . $config["template_url"] . '/images/nextprev/save.png" alt="' . $lang['save_this_search'] . '" title="' . $lang['save_this_search'] . '"  /></a></li>';
                         }
                         //Show Next Last Buttons if we are not on the last Listing
                         if ($i != $_SESSION['count']) {
                             if ($config['url_style'] == '1') {
                                 $display .= '<li><a href="index.php?action=listingview&amp;listingID=' . $myarray[$i + 1] . '" ><img src="' . $config["template_url"] . '/images/nextprev/next.png" alt="' . $lang['next'] . '" title="' . $lang['next'] . '" /></a></li><li><a href="index.php?action=listingview&amp;listingID=' . $myarray[$_SESSION['count']] . '" ><img src="' . $config["template_url"] . '/images/nextprev/last.png" alt="' . $lang['last'] . '" title="' . $lang['last'] . '" /></a></li></ul><div class="listing_xy">' . $lang['next_prev_listing'] . ' ' . $i . ' ' . $lang['next_prev_of'] . ' ' . $_SESSION['count'] . '</div>';
                             } else {
                                 $display .= '<li><a href="listing-' . $myarray2[$i + 1] . '-' . $myarray[$i + 1] . '.html" ><img src="' . $config["template_url"] . '/images/nextprev/next.png" alt="' . $lang['next'] . '" title="' . $lang['next'] . '" /></a></li><li><a href="listing-' . $myarray2[$_SESSION['count']] . '-' . $myarray[$_SESSION['count']] . '.html" ><img src="' . $config["template_url"] . '/images/nextprev/last.png" alt="' . $lang['last'] . '" title="' . $lang['last'] . '" /></a></li></ul><div class="listing_xy">' . $lang['next_prev_listing'] . ' ' . $i . ' ' . $lang['next_prev_of'] . ' ' . $_SESSION['count'] . '</div>';
                             }
                         }
                         if ($i == $_SESSION['count']) {
                             $display .= '<li><img src="' . $config["template_url"] . '/images/nextprev/next_n.png" alt="' . $lang['next'] . '" title="' . $lang['next'] . '" /></li><li><img src="' . $config["template_url"] . '/images/nextprev/last_n.png" alt="' . $lang['last'] . '" title="' . $lang['last'] . '" /></li></ul><div class="listing_xy">' . $lang['next_prev_listing'] . ' ' . $i . ' ' . $lang['next_prev_of'] . ' ' . $_SESSION['count'] . '</div>';
                         }
                     }
                 }
                 $display .= '</div>';
             }
         }
     }
     return $display;
 }
开发者ID:josegonzalez,项目名称:php-openrealty,代码行数:74,代码来源:listing.inc.php

示例3: userListings

 function userListings($user)
 {
     // produces the rest of the listings for users
     global $conn, $config, $lang;
     require_once $config['basepath'] . '/include/misc.inc.php';
     $misc = new misc();
     $display = '';
     $user = $misc->make_db_extra_safe($user);
     $display .= '<strong>' . $lang['users_other_listings'] . '</strong>';
     $sql = "SELECT listingsdb_id, listingsdb_title FROM " . $config['table_prefix'] . "listingsdb WHERE userdb_id = {$user} AND listingsdb_active = 'yes'";
     $recordSet = $conn->SelectLimit($sql, 50, 0);
     if ($recordSet === false) {
         $misc->log_error($sql);
     }
     if ($recordSet->RecordCount() > 0) {
         $display .= '<ul>';
         while (!$recordSet->EOF) {
             $ID = $misc->make_db_unsafe($recordSet->fields['listingsdb_id']);
             $Title = $misc->make_db_unsafe($recordSet->fields['listingsdb_title']);
             if ($config['url_style'] == '1') {
                 $url = '<a href="index.php?action=listingview&amp;listingID=' . $ID . '">';
             } else {
                 $url_title = str_replace("/", "", $Title);
                 $url_title = strtolower(str_replace(" ", $config['seo_url_seperator'], $url_title));
                 $url = '<a href="listing-' . misc::urlencode_to_sef($url_title) . '-' . $ID . '.html">';
             }
             $display .= '<li> ' . $url . $Title . '</a></li>';
             $recordSet->MoveNext();
         }
         $display .= '</ul>';
     }
     return $display;
 }
开发者ID:henryhe514,项目名称:ChineseCommercial,代码行数:33,代码来源:user.inc.php

示例4: search_results


//.........这里部分代码省略.........
             // end while
             // We have all the header information so we can now parse that section
             $header_section = $page->parse_template_section($header_section, 'header_title', $header_title);
             $header_section = $page->parse_template_section($header_section, 'header_title_no_sort', $header_title_no_sort);
             $header_section = $page->parse_template_section($header_section, 'header_pclass', $header_pclass);
             $header_section = $page->parse_template_section($header_section, 'header_pclass_no_sort', $header_pclass_no_sort);
             foreach ($field as $x => $f) {
                 $header_section = $page->parse_template_section($header_section, 'header_' . $x, $f);
             }
             foreach ($field_no_sort as $x => $f) {
                 $header_section = $page->parse_template_section($header_section, 'header_' . $x . '_no_sort', $f);
             }
             // We have the title now we need the image
             $num_columns = $num_columns + 1;
             // add one for the image
             $count = 0;
             while (!$resultRecordSet->EOF) {
                 // Start a new section for each listing.
                 $search_result .= $search_result_section;
                 // alternate the colors
                 if ($count == 0) {
                     $count = $count + 1;
                 } else {
                     $count = 0;
                 }
                 $Title = $misc->make_db_unsafe($resultRecordSet->fields['listingsdb_title']);
                 $current_ID = $resultRecordSet->fields['listingsdb_id'];
                 $or_owner = $resultRecordSet->fields['userdb_id'];
                 if ($config['url_style'] == '1') {
                     $url = '<a href="index.php?action=listingview&amp;listingID=' . $current_ID . '">';
                 } else {
                     $url_title = str_replace("/", "", $Title);
                     $url_title = strtolower(str_replace(" ", $config['seo_url_seperator'], $url_title));
                     $url = '<a href="listing-' . misc::urlencode_to_sef($url_title) . '-' . $current_ID . '.html">';
                 }
                 $field_title = $url . $Title . '</a>';
                 // Insert the title as we grabbed it earlier
                 $search_result = $page->parse_template_section($search_result, 'field_title', $field_title);
                 $search_result = $page->parse_template_section($search_result, 'listingid', $current_ID);
                 $search_result = $page->replace_listing_field_tags($current_ID, $search_result);
                 //get distance for postal code distance searches
                 if (isset($_GET['postalcode_dist_dist'])) {
                     $sql3 = "SELECT listingsdbelements_field_value FROM " . $config['table_prefix'] . "listingsdbelements WHERE ((listingsdb_id = {$current_ID}) AND (listingsdbelements_field_name = '" . $config['map_zip'] . "'))";
                     $recordSet3 = $conn->Execute($sql3);
                     $sql4 = 'SELECT zipdist_latitude, zipdist_longitude FROM ' . $config['table_prefix_no_lang'] . 'zipdist WHERE zipdist_zipcode =' . $recordSet3->fields['listingsdbelements_field_value'];
                     $recordSet4 = $conn->Execute($sql4);
                     $postalcode_distance = round($this->calculate_mileage($postalcode_dist_lat, $recordSet4->fields['zipdist_latitude'], $postalcode_dist_long, $recordSet4->fields['zipdist_longitude']), 2) . ' ' . $lang['postalcode_miles_away'];
                     $search_result = $page->parse_template_section($search_result, 'postalcode_search_distance', $postalcode_distance);
                 }
                 // grab the rest of the listing's data
                 $sql2 = "SELECT listingsdbelements_field_name, listingsdbelements_field_value, listingsformelements_field_type, listingsformelements_display_priv, listingsformelements_search_result_rank  FROM " . $config['table_prefix'] . "listingsdbelements, " . $config['table_prefix'] . "listingsformelements WHERE ((listingsdb_id = {$current_ID}) AND (listingsformelements_display_on_browse = 'Yes')  " . "AND (listingsdbelements_field_name = listingsformelements_field_name)) ORDER BY listingsformelements_search_result_rank";
                 $recordSet2 = $conn->Execute($sql2);
                 if ($DEBUG_SQL) {
                     echo '<strong>Listing Data:</strong> ' . $sql2 . '<br />';
                 }
                 if (!$recordSet2) {
                     $misc->log_error($sql2);
                 }
                 $field = array();
                 $textarea = array();
                 while (!$recordSet2->EOF) {
                     $field_name = $misc->make_db_unsafe($recordSet2->fields['listingsdbelements_field_name']);
                     $field_value = $misc->make_db_unsafe($recordSet2->fields['listingsdbelements_field_value']);
                     $field_type = $misc->make_db_unsafe($recordSet2->fields['listingsformelements_field_type']);
                     $display_priv = $misc->make_db_unsafe($recordSet2->fields['listingsformelements_display_priv']);
                     $x = $misc->make_db_unsafe($recordSet2->fields['listingsformelements_search_result_rank']);
开发者ID:henryhe514,项目名称:ChineseCommercial,代码行数:67,代码来源:search.inc.php

示例5: 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&amp;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 = '';
//.........这里部分代码省略.........
开发者ID:henryhe514,项目名称:ChineseCommercial,代码行数:101,代码来源:notification.inc.php

示例6: view_image

 function view_image($type)
 {
     global $conn, $config, $lang;
     require_once $config['basepath'] . '/include/misc.inc.php';
     require_once $config['basepath'] . '/include/listing.inc.php';
     $misc = new misc();
     $display = '';
     if (!isset($_GET['image_id'])) {
         return $lang['image_not_found'];
     }
     $sql_imageID = $misc->make_db_safe($_GET['image_id']);
     if ($type == "listing") {
         // get the image data
         $sql = "SELECT listingsimages_caption, listingsimages_file_name, listingsimages_description, listingsdb_id FROM " . $config['table_prefix'] . "listingsimages WHERE (listingsimages_id = {$sql_imageID})";
         $recordSet = $conn->Execute($sql);
         if ($recordSet === false) {
             $misc->log_error($sql);
         }
         while (!$recordSet->EOF) {
             $caption = $misc->make_db_unsafe($recordSet->fields['listingsimages_caption']);
             $file_name = $misc->make_db_unsafe($recordSet->fields['listingsimages_file_name']);
             $description = $misc->make_db_unsafe($recordSet->fields['listingsimages_description']);
             $listing_id = $misc->make_db_unsafe($recordSet->fields['listingsdb_id']);
             $recordSet->MoveNext();
         }
         $display .= '<div class="view_image">';
         $display .= '<span class="image_caption">';
         if ($caption != "") {
             $display .= "{$caption} - ";
         }
         //SEO Friendly Links
         $Title = listing_pages::get_title($listing_id);
         if ($config['url_style'] == '1') {
             $url = '<a href="index.php?action=listingview&amp;listingID=' . $listing_id . '">';
         } else {
             $url_title = str_replace("/", "", $Title);
             $url_title = strtolower(str_replace(" ", $config['seo_url_seperator'], $url_title));
             $url = '<a href="listing-' . misc::urlencode_to_sef($url_title) . '-' . $listing_id . '.html">';
         }
         $display .= $url . $lang['return_to_listing'] . '</a></span><br />';
         $display .= '<img src="' . $config['listings_view_images_path'] . '/' . $file_name . '" alt="' . $caption . '"  />';
         $display .= '<br />';
         $display .= $description;
         $display .= '</div>';
     } elseif ($type == "userimage") {
         // get the image data
         $sql = "SELECT userimages_caption, userimages_file_name, userimages_description, userdb_id FROM " . $config['table_prefix'] . "userimages WHERE (userimages_id = {$sql_imageID})";
         $recordSet = $conn->Execute($sql);
         if ($recordSet === false) {
             $misc->log_error($sql);
         }
         while (!$recordSet->EOF) {
             $caption = $misc->make_db_unsafe($recordSet->fields['userimages_caption']);
             $file_name = $misc->make_db_unsafe($recordSet->fields['userimages_file_name']);
             $description = $misc->make_db_unsafe($recordSet->fields['userimages_description']);
             $user_id = $recordSet->fields['userdb_id'];
             $recordSet->MoveNext();
         }
         $display .= '<table class="form_" align="center">';
         $display .= '<tr>';
         $display .= '	<td class="row_main">';
         $display .= '		<h3>';
         if ($caption != "") {
             $display .= "{$caption} - ";
         }
         $display .= '<a href="index.php?action=view_user&amp;user=' . $user_id . '">' . $lang['return_to_user'] . '</a></h3>';
         $display .= '		<center>';
         $display .= '		<img src="' . $config['user_view_images_path'] . '/' . $file_name . '" alt="' . $caption . '" border="1">';
         $display .= '		</center>';
         $display .= '		<br />';
         $display .= $description;
         $display .= '	</td>';
         $display .= '</tr>';
         $display .= '</table>';
     }
     // end if ($type == "listing")
     return $display;
 }
开发者ID:henryhe514,项目名称:ChineseCommercial,代码行数:78,代码来源:images.inc.php


注:本文中的misc::urlencode_to_sef方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。