Jump to content

gaza165

Members
  • Posts

    472
  • Joined

  • Last visited

    Never

Posts posted by gaza165

  1. Hi guys,

     

    My word press installation is currently in my directory

     

    http://www.example.com/wordpress

     

    Howevere when i try to access a post it sends me to

     

    http://www.example.com/?p=3#comments

     

    Is there anything I can do about this, I have set the appropriate target in the word press settings.

     

    Can i make a rewrite rule to deal with this...if so can someone help me with the right expression to use to achieve it.

     

    Thanks

     

    Garry

  2. I have a string

     

    <p>Bollywood romcom: a pair of wouldbe suicides choose the same bridge at the same time.</p><p><a href="http://www.dailyinfo.co.uk/reviews/venue/1320/Vue_Cinema">Vue Cinema</a> (<a href="http://www.myvue.com/cinemas/index.asp?SessionID=0D86903A19334C93A7491563A77862A3&cn=1&ln=1&ci=66" target="_blank">www.myvue.com/cinemas/index.asp?SessionID=0D86903A19334C93A7491563A77862A3&cn=1&ln=1&ci=66</a>), Ozone Leisure Park, Grenoble Road (next Kassam Stadium), Oxford OX4 4XP; Tel. 08712 240 240 (10p per min from BT).<br /> </p>

     

    Using php i want to extract

     

    http://www.myvue.com/cinemas/index.asp?SessionID=0D86903A19334C93A7491563A77862A3&cn=1&ln=1&ci=66

     

    from the <a> tag.

     

    I have already tried using

     

        
    <?php
    
    $pattern = "/<a href=\"([^\"]*)\">(.*)<\/a>/iU";
    preg_match_all($pattern, $link, $matches);
    var_dump($matches);
    ?> 

     

    The output I get is

     

    array

      0 =>

        array

          0 => string '<a href="http://www.dailyinfo.co.uk/reviews/venue/1320/Vue_Cinema">Vue Cinema</a>' (length=81)

      1 =>

        array

          0 => string 'http://www.dailyinfo.co.uk/reviews/venue/1320/Vue_Cinema' (length=56)

      2 =>

        array

          0 => string 'Vue Cinema' (length=10)

     

     

     

  3. I have multiple arrays containing data for each entry.

     

    What I am trying to do is group each item in the array by the date which is also in an array.

     

    Where do I start??

     

    array
      'pubDate' => string 'Mon, 15 Feb 10 00:00:00 +0000' (length=29)
      'title' => 
        object(SimpleXMLElement)[6]
      'description' => 
        object(SimpleXMLElement)[7]
      'guid' => string 'http://www.dailyinfo.co.uk/events.php?colname=Events&period=7&eventday=25&eventmonth=9&eventyear=2010#72741' (length=107)
      'link' => string 'http://www.dailyinfo.co.uk/events.php?colname=Events&period=7&eventday=25&eventmonth=9&eventyear=2010#72741' (length=107)
    
    array
      'date' => 
        array
          0 => string '2010-09-25T01:00:00+01:00' (length=25)
          1 => string '2010-10-02T01:00:00+01:00' (length=25)
    
    -------------------------------------------------------------------------------------------------------------------
    
    array
      'pubDate' => string 'Fri, 26 Feb 10 00:00:00 +0000' (length=29)
      'title' => 
        object(SimpleXMLElement)[5]
      'description' => 
        object(SimpleXMLElement)[8]
      'guid' => string 'http://www.dailyinfo.co.uk/events.php?colname=Events&period=7&eventday=1&eventmonth=10&eventyear=2010#73266' (length=107)
      'link' => string 'http://www.dailyinfo.co.uk/events.php?colname=Events&period=7&eventday=1&eventmonth=10&eventyear=2010#73266' (length=107)
    
    array
      'date' => 
        array
          0 => string '2010-09-25T01:00:00+01:00' (length=25)
          1 => string '2010-09-30T01:00:00+01:00' (length=25)
    
    -------------------------------------------------------------------------------------------------------------------
    

  4. Can someone tell me the best way to group elements in an XML file?

     

    	<item>
                 <title>Event 1</title>
                 <dc:date>2010-09-25T01:00:00+01:00</dc:date>
                 <dc:date>2010-10-02T01:00:00+01:00</dc:date>
                 <dc:date>2010-10-09T01:00:00+01:00</dc:date>
    </item>
    
    <item>
                 <title>Event 2</title>
                 <dc:date>2010-09-25T01:00:00+01:00</dc:date>
                 <dc:date>2010-10-02T01:00:00+01:00</dc:date>
                 <dc:date>2010-10-09T01:00:00+01:00</dc:date>
    </item>

     

    Above is an example of what im trying to do and below is what i want the output to be

     

    
       25th September 2010
    
                       Event 1
                       Event 2
    
       2nd October 2010
    
                        Event 1
                        Event 2
    

     

     

    And so on, can anyone point me in the right direction on where to start looking to do something like this in PHP.

     

    Thanks

     

    Garry

  5. What im trying to do is this... I have an XML File and i want to sort the events out by date

     

    So like

     

    26th Septemeer

     

    List of all the events that have this date in their <dc:date> field.

     

    28th September

     

    List of all the events that have this date in their <dc:date> field.

     

     

    XML FILE

     

    <?xml version="1.0" encoding="UTF-8"?>
    <rss version='2.0'   xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:xCal="urn:ietf:params:xml:ns:xcal" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" >
            
    <channel>
    
        <item>
            <title><![CDATA[15 Feb 2010 - 10 Oct 2010: Funk, Soul, Disco, Hiphop]]></title>
            <geo:lat>51.74713</geo:lat><geo:long>-1.23755</geo:long>
            <dc:date>2010-09-25T01:00:00+01:00</dc:date>
            <dc:date>2010-10-02T01:00:00+01:00</dc:date>
            <dc:date>2010-10-09T01:00:00+01:00</dc:date>
    
        </item>
        
            <item>
                <title><![CDATA[26 Feb 2010 - 26 Oct 2010: Get Down]]></title>
                <geo:lat>51.74707</geo:lat><geo:long>-1.2351</geo:long>
                <dc:date>2010-09-24T01:00:00+01:00</dc:date>
                <dc:date>2010-10-01T01:00:00+01:00</dc:date>
                <dc:date>2010-10-08T01:00:00+01:00</dc:date>
                <dc:date>2010-10-15T01:00:00+01:00</dc:date>
                <dc:date>2010-10-22T01:00:00+01:00</dc:date>
            </item>
    
    
    
    </channel>
    </rss>

  6. Maybe if i post the code im doing you can better understand.

     

     

    <?php
    $feed = file_get_contents("events.xml");
    $xml = new SimpleXmlElement($feed);
    $time = time();
    foreach ($xml->channel->item as $entry){
      
      $dc = $entry->children("http://purl.org/dc/elements/1.1/");
      $geo = $entry->children("http://www.w3.org/2003/01/geo/wgs84_pos#");
      
      echo "Title: ".$entry->title."</br>";
    
      //Dates that event is on.
      foreach($dc as $date) {
    
    echo "Date: ".strtotime($date)."<br/>";
    
      }
      
      //Geo Location - Latitude and Londitude
    echo "Lat: ".$geo[0]."<br/>";
    echo "Long: ".$geo[1]."<br/>";
      
      
      
      echo "------------------------------------------------------------<br/>";
      
      
      
    }
    
    ?>
    

  7. This is probably a really easy question

     

    say i have timestamps like this

     

    Date: 1285372800

    Date: 1285977600

    Date: 1286582400

     

    How can i find out and assign to a variable which of those is on or closest to todays date??

  8. Hello, I have an xml file below with multiple namespaces called "date".

     

    I want to know how to echo out each date that is associated with that "item" if that makes sense.

     

    Thanks

     

    <?xml version="1.0" encoding="UTF-8"?>
    <rss version="2.0" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
    
      <item>
        <title>My Title</title>
        <dc:date>2009-02-12</dc:date>
        <dc:date>2010-09-01</dc:date>
      </item>
    
    </channel>
    </rss>

  9. Hi Guys,

     

    I have produced and uploaded 3 different designs for you to look at.

     

    Can you give me a critique and your opinon on which one you think is the best.

     

    Thanks

     

    Site 1: http://www.thedesignmonkeys.co.uk/TheMillV1

     

    Site 2: http://www.thedesignmonkeys.co.uk/TheMillV2

     

    Site 3: http://www.thedesignmonkeys.co.uk/TheMillV3

     

    I personall like number 3 the best, but it would be nice to get an outside opinon.

     

    Thanks for taking the time to look

     

    Garry

     

     

     

     

  10. Hello Everyone,

     

    I am currently reading Zend Framework 1.8 Web Application Development by Keith Pope

     

    In his Store Front example he uses Apache Ant to produce all his configurations using the build folder...which should contain

     

    ant.properties and build.xml

     

    However I am using Zend_Tool to create my project and once the project has been made... there is no sign of the build folder or any of the files i need to continue with the example.

     

    Am I talking rubbish...

     

    I cannot proceed with the book until i figure out how he sets the thing up??

     

    Thanks

     

     

    Garry

     

     

     

  11. Hi Guys,

     

    Im keeping this context out of PHP...just concentrating on SQL.

     

    What you have suggested is brilliant, the whole idea of this question is that I create a suitable database schema for the operations to be performed on the tables.

     

    So, you are saying...if I set both ID's as primary keys i wont be able to have duplicate values in my table???

     

    Garry

  12. Hi Everyone,

     

    I have a table structure as follows:

     

    Store_ID            |  Employee_ID

    -------------------------------------------

              1              |          2

              1              |          2                        <<<<<<<<<< cant have this!!

              2              |          2                        <<<<<<<<<< can have this!!

     

     

    Basically, one of the criterias is that I cant have the same employee as part of the same store...

     

    So i guess what im trying to achieve is that duplicate records cant appear in the table.

     

    Can anyone offer any advice on how to enforce this in my table structure??

     

    Thanks

     

    Garry

     

     

  13. Hi,

     

    Thankyou Axeia for your excellent reply.

     

    I have taken your advice and shrunk the logo, i have also decrased the header height and updated the menu to not use images.

     

    In terms have the accessability, are you saying...

     

    If the javascript is enabled then show the Text Size buttons and if not, then let them figure it out on their own??

     

    Would you say this website is accessible??

     

    Thanks

     

    Garry

×
×
  • 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.