Jump to content

dfrojd

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dfrojd's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, I am editing a joomla component to suit my needs and there is lots of code in the form echo adsmanager_html::getLangDefinition($field->title)."<br />"; Now I have not been able to find help on, or figure put what :: does in here. Neither Google nor php help will respond to "::" as search phrase. Can someone elaborate or point me to an explanation. Thanks Dennis (from sunny Tenerife Island)
  2. Hi, I am looking for general help here. I dont know how to start at this... maybe someone can point me in the right direction. I need to calculate how many nights of a given time frame (variable dates) lie within certain ranges of times given to calcutate pricing for a hotel which has different prices depending on the season. (fixed dates). So I have this table (MYSQL) which for example says: from : to : price 01/01 : 03/31 : 100,- 04/01 : 12/20 : 120,- 12/21 : 12/31 : 160,- How do I tackle (or at least attack) the problem to calculate the price of a stay in this hotel for, lets say Dec. 18th to Jan. 5th??? Obviously the dates which fix the pricing do not have/need the attribute (year) as they are always the same (repeat every year)... but I do not know how to put this into praxis... Any help greatly appreciated. THX Dennis (from sunny Tenerife island)
  3. HI, Im working with xampp on localhost. I start all pages with session_start(); All session vars work fine. now I: setCookie("name",$_POST["name"],time()+2592000); and the cookie is sent and accepted. I can see it in firefox extras... BUT print_r($_COOKIE); delivers only one cookie that is: PHPSESSIONID, and isset($_COOKIE["name"]) replies false! count($_COOKIE) replies (one!) even though I can see: pma_lang PHPSESSIONID pma_collation_connection pma_theme name (sic) pma_charset six cookies set and valid for localhost. Amyone an idea what I am doing wrong? Dennis
  4. HI, I am using a Fulltext query with rank as described in: [dev.mysql.com] with score to list most relevant hits for a php project. Now using a large database with 7000 entries and a long "against" String I am returned too many results with scores ranging fro ~6.xxx to 0.00xxx. Could someone please explain how to modify my query so that only results with a relevance (score) greater than 1 are returned. My Query now is: --------------------------- $against = "Hotel City Cityreise Cityreisen Städtereise Städtereisen"; $query = "SELECT DISTINCT obj_lfd, obj_bez, obj_krz, obj_img_path_01,"; $query .= "MATCH ("; $query .= "obj_bez, "; $query .= "obj_krz, "; $query .= "obj_region_text, "; $query .= "obj_ort, "; $query .= "obj_detail, "; $query .= "obj_freizeit, "; $query .= "obj_sonst, "; $query .= "obj_ort_info, "; $query .= "obj_anreise_info, "; $query .= "obj_add_desc_01, "; $query .= "obj_cont_desc_01, "; $query .= "obj_add_desc_02, "; $query .= "obj_cont_desc_02, "; $query .= "obj_add_desc_03, "; $query .= "obj_cont_desc_03, "; $query .= "obj_img_desc_01 "; $query .= ") AGAINST ('"; $query .= $against; $query .= "') as score "; $query .= "FROM objekte WHERE MATCH "; $query .= "( "; $query .= "obj_bez, "; $query .= "obj_krz, "; $query .= "obj_region_text, "; $query .= "obj_ort, "; $query .= "obj_detail, "; $query .= "obj_freizeit, "; $query .= "obj_sonst, "; $query .= "obj_ort_info, "; $query .= "obj_anreise_info, "; $query .= "obj_add_desc_01, "; $query .= "obj_cont_desc_01, "; $query .= "obj_add_desc_02, "; $query .= "obj_cont_desc_02, "; $query .= "obj_add_desc_03, "; $query .= "obj_cont_desc_03, "; $query .= "obj_img_desc_01 "; $query .= ") AGAINST ('"; $query .= $against; $query .= "')"; $query .= " limit $Anfangsposition, $Zeilen_pro_Seite";
  5. Hi, I have two tables (mysql). One: "regions" with the fields "region_id" and "region" Two: "objects" with the fields "ID"; "region_id" and "properties". Every object belongs to a specific region (linked by region_id). Now I want a list of all my regions sorted by, and displaying, how many objects belong to every specific region. Can anyone help me with this one? Thanks Dennis
  6. that would be nice, but before that I would need all subregions of GB obviously...
  7. Hi Folks, - looking for a snipplet reinvent the wheel? I dont want to. So I am looking for the source code for a drop down (a number of drop downs to be precise) that will let the user of my page input where in the world he is. No, a country chooser (only nations (or states if in the US)) is not precise enough for me. I found lots of those, but I want more precise definitions. I need regions of all countries worldwide, and if possible a third subdivision (subregions) too. If anyone knows where to get one, or is willing to share his, thank you in advance. Dennis
  8. Hey, great, THANX! I´ll get to work and try that. Dennis
  9. OK then, The text file xxx.txt looks like: [nobbc]http://www.yahoo.com http://www.google.com http://www.thisismysite.com ... ...[/nobbc] and so on the code I have up to now accepts any one of these urls in a dialog box on a page called index.php in a form and gives this url to a php script like the one below. The script stores whatever it has done in a database. What I want is that the php script below accepts the text file directly as input and works on it line for line. CODE: <? $content = $_POST; // ************* Here come the url from a dialog box one page before... $content = file_get_contents($content['url']); // ******************************** Now a lot of stuff (WHOOPHIE) is done to that file... // BEZEICHNUNG preg_match("=<h1[^>]*>(.*)</h1>=siU", $content, $hit); $data['obj_bez'] = trim($hit[1]); // KURZTEXT preg_match("=<h2[^>]*>(.*)</h2>=siU", $content, $hit); $data['obj_krz'] = trim($hit[1]); ... ... ... // ******************************* and store array (WHOOPHIE) in a database... $insert_data = array(   'obj_bez'=> $data['obj_bez'],   'obj_krz'=> $data['obj_krz'] ); DB_Sql::query(DB_Sql::insert('objekte', $insert_data)); $insert_id = mysql_insert_id(); if(DB_Sql::error()) {     echo DB_Sql::error();     exit;     } ?>
  10. Hi folks, I have a neat function that does WHOPPHIE with a given url. I also have a text file [urls.txt] that consists of urls, each in a single line, that I want to be WHOOPIED. Hmmm - now how do I do that? Any help would be very much appreciated. Dennis
  11. Hi folks, sorry for a surely simple question but (I swear) I have tried all normal sources for hours now and cant find what I need (sob). I just simply need to subtract a part of a string from a larger string and keep the remainder. The strings involved contain html code with lots-o-tags and must stay that way. maybe can someone help. The code in question finds two parts of a string using a regex. No all I need is to subtract the two found strings from the original and keep the rest. [code]<?php $teststr = "<table cellpadding=5 cellspacing=0><tr><td align=center width=358 nowrap style=\"color:#CCDDCC\">\n"; $teststr .= "<img src=\"Karten/Regionen/164-22-11-Armenime.gif\" alt=\"Lage von Armenime auf den Kanarischen Inseln\" \n"; $teststr .= "width=350 height=150 class=r><br>Lage auf den Kanarischen Inseln</td></tr></table>\n"; $teststr .= "    <br>\n"; $teststr .= "    <br>\n"; $teststr .= "    <br>\n"; $teststr .= "    <span class=g12f>Detail-Informationen zu diesem Angebot</span>\n"; $teststr .= "    <div class=r style=\"margin-top:12px;\">\n"; $teststr .= "      <strong>Finca Constanza mit Pool - Ruhe - Luxus - Golf - Aloe-vera - Erholung - Sonne\n"; $teststr .= "</strong><br>\n"; $teststr .= "      <br>\n"; $teststr .= "      6 Wohneinheiten auf 10.000 qm Finca mit Pool ***** Herrenhaus 204m2 -9 Pers. ***** Patio Suite -8 Pers.\n"; $teststr .= "***** Bungalow, Cesar -6 Pers. ***** Apartment, Casita Sira 4 Pers. ***** Bungalow, Cleopatra -4 Pers. *****\n"; $teststr .= "Wintergartenhaus -3 Pers<br>\n"; $teststr .= "      <br>\n"; $teststr .= "      Detailinfos macht Siggi Detailinfos macht Siggi Detailinfos macht Siggi Detailinfos macht Siggi\n"; $teststr .= "Detailinfos macht Siggi Detailinfos macht Siggi Detailinfos macht Siggi Detailinfos macht Siggi\n"; $teststr .= "Detailinfos macht Siggi Detailinfos macht Siggi Detailinfos macht Siggi Detailinfos macht Siggi \n"; $teststr .= "Detailinfos macht Siggi Detailinfos macht Siggi Detailinfos macht Siggi Detailinfos macht Siggi \n"; $teststr .= "Detailinfos macht Siggi Detailinfos macht Siggi Detailinfos macht Siggi Detailinfos macht Siggi \n"; $teststr .= "Detailinfos macht Siggi Detailinfos macht Siggixxx\n"; $teststr .= "    </div>\n"; $teststr .= "    <br>\n"; $teststr .= "    <br>\n"; $teststr .= "    <span class=g12f>Besonderheit Titel 1</span>\n"; $teststr .= "    <div class=r>\n"; $teststr .= "        Besonderheit: Beschreibung: 1\n"; $teststr .= "    </div>\n"; $teststr .= "    <br>\n"; $teststr .= "    <br>\n"; $teststr .= "    <span class=g12f>Besonderheit Titel 2</span>\n"; $teststr .= "    <div class=r>\n"; $teststr .= "      Besonderheit: Beschreibung: 2\n"; $teststr .= "    </div>\n"; $teststr .= "    <br>\n"; $teststr .= "    <br>\n"; $teststr .= "    <span class=g12f>Besonderheit Titel 3</span>\n"; $teststr .= "    <div class=r>\n"; $teststr .= "      Besonderheit: Beschreibung: 3\n"; $teststr .= "    </div>\n"; $teststr .= "    <br>\n"; $teststr .= "    <br>\n"; $teststr .= "    <span class=g12f>Urlaubsort Armenime</span>\n"; $teststr .= "    <div class=r>\n"; $teststr .= "      Spanien\n"; $teststr .= "      <span class=g10>&nbsp;&gt;&nbsp;</span> Kanarische Inseln\n"; $teststr .= "      <span class=g10>&nbsp;&gt;&nbsp;</span> Insel Teneriffa-Süd\n"; $teststr .= "      <span class=g10>&nbsp;&gt;&nbsp;</span> Armenime\n"; $teststr .= "<br><br>nfos zum<br>Urlaubsort: -... -Die von der Hauptstrasse ca. 400 m abseits und sehr ruhig gelegene Finca\n"; $teststr .= "Constanza bietet unseren Gästen optimalen Erholungsgenuss. Die geteerte, schmale Privatstrasse endet an der\n"; $teststr .= "Finca, sodass kein Durchgangsverkehr besteht. Da auch kein Baumaschinen-Lärm in der näheren Umgebung\n"; $teststr .= "stört, wird das Fincagelände den Ruhe suchenden Gästen in jeder Weise gerecht.\n"; $teststr .= "    </div>\n"; $teststr .= "    <div style=\"text-align:right; width:600px;\">&nbsp;<a href=\"#Anreise-Armenime\" class=f8>Anreise nach Armenime</a></div>\n"; $teststr .= "    <br>\n"; $teststr .= "    <span class=g12f>Freizeitangebote in der Umgebung</span> \n"; $content = $teststr; // DETAILINFOS -------------------------------------------------- FD ist sozusagen die vordere Grenze.... preg_match("=Detail-Informationen zu diesem Angebot(.*)<\/div>=siU", $content, $hit); $data['obj_detail'] = trim($hit[1]); echo "obj_detail = ".$data['obj_detail']."<br>\n"; // ORT INFO -------------------------------------------------- FD ist sozusagen die hintere Grenze.... preg_match("=<span class\=g12f>Urlaubsort(.*)<\/div>=siU", $content, $hit); $data['obj_ort_info'] = trim($hit[1]); echo "obj_ort_info = ".$data['obj_ort_info']."<br>\n"; ?>[/code] MOD EDIT - code tags added
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.