Jump to content

Axeia

Members
  • Posts

    717
  • Joined

  • Last visited

    Never

Posts posted by Axeia

  1. Not all the rss and xml feeds end on those extensions.

     

    You could easily create an index.php sending out an rss or xml header and rss/xml.

    Then the name would be something not ending in any extension or .php.

    (Can come up with other exceptions as well, but you're not likely to come across those situations).

     

    Based on the url itself you wont be able to tell, you'll need to visit the page with php itself and either check the headers, or it's content.

    Which might not be possible depending on your host.

     

  2. I've no clue what you're trying to do but I'd wrap it in a function if you're gonna call it from the loop to keep the code easier to see.

    something like

    <?php
    function getScore( $counter )
    {
      switch( $counter )
      {
        case 1:
          return 500;
        case 2:
          return 350;
        case 3:
          return 250;
        case 4:
          return 200;
        case 5:
          return 150;
        case 6:
          return 150;
        case 7:
          return 75;
        case 8:
          return 50;
        default:
          return 0;
      }
    }
    ?>

     

    btw, you can use $counter++ instead of += 1.

  3. Quite like it, correct tags used in most places. (Could use an ol for numbered lists)

    Nice colors usage, though the contrast of the links and background is a bit low.. but I guess that goes with the type of the site :)

    Might set width and heights for the images btw.

     

    If you could make a liquid design out of it (100% width) I'd be really impressed, but I guess that might be a bit hard to do with that image at the top.

  4. If you want to make it better accessible you need to use semantic tags instead of tables, divs and spans.

     

    For example the links at the top, should be an <ul> there. (better your search engine rating as well)

    Contact information, stick it in an <address> element.

    Those divs you're already using where they shouldn't, use them were they should be used.. for the design, instead of using tables for that.

    Include the links under the images on the left in the same <a>, just style them so they look the same as they do atm.

    You're using <br's> to seperate paragraphs, why not use <p>? You can style it using padding or margin to look the same as it does atm.

    Use labels in the contact form instead of <b>, you can style the labels to have fat text in a stylesheet like "label { font-weight: bolder; }"

    If you really want it be accessible to everyone, try viewing your page in lynx so you get a better idea of how the site looks in "alternative browsers".

     

    And like already mentioned above, it doesn't have the "feel" of the target group. If I had to guess what it was by design only I'd guess it was a Lawyers site.

    Usually these type of sites have warmer colors, wine-red and pie-crust brown.

     

  5. Okay my apologies in advance for coming across like a complete ass, but there is a lot you can improve!

    I assume you want to leave a good impression since it's your portfolio so I'm not going to sugarcoat anything and put it as it is.

     

    It doesn't look too good on 1920*1200 in Firefox 3.

    I'll just post a screenshot so you can see for yourself.

    78edc831963710.gif

    Bottom would look better if aligned to the bottom of the screen and the blue background image shouldn't be repeating.

     

    The menus have lists of items.. but you're not using a list.

    Try using

    <ul>
      <li>Unique web design</li>
       <li>Premium quality</li>
    </ul>

    Leave the dashes out and style the list instead.

     

    You also used tables for design instead of divs, bad practice.. tables are for tabular data, not for positioning fancy images.

    You're using divs where you should be using other more semantic tags like <h1>.

    You're using images with text on them without an alt text, ctrl+f'd the source code for "Jye Parington Freelance" but couldn't find it.

    You're using an image to function as a <hr>, use a <hr> instead and style it to look like the image OR use the image as a background for the hr.

    You're using regular text on your form instead of labels to described what the form element is for. Use <label for="nameOfFormElement">

    Why is the bottom part a blockquote? Are you quoting your link structure and copyright?

     

    Okay I'm done for the most part of my 'harsh critique'

    You could use CSS for the mouseovers instead of javascript, that way it would still work for people who disable javascript.

    I personally don't like the amount of space on the top between the link text and the arrow.. would like to see it a bit less spacious.

     

    Portfolio is missing a background image pattern?

    Contact doesn't line up with the blue bar.. it's floating a 15-20 pixels below it.

     

    Tips:

    I suggest you google for "semantic web" to sort the things like the blockquote at the bottom.

    Googling for tables vs divs might be a good idea as well

    Never forget to set background-repeat: no-repeat; when you're using a background on an element who's dimensions aren't set and you only want the image to appear once.

     

    The positive

    I do like the design, bit graphical heavy but it looks good, I like the color use and you kept the contrast quite high everywhere which is good for colorblind people and designers seem to forget about those lately, using grey on black etc.

  6. Using Firefox 3 at a resolution of 1920*1200 the last image isn't displayed under the rest but it's between the content and the menu.

     

    5c6bd931961161.gif

     

    Overall.. I think the images could use some work as the borders aren't very eyepleasing, the tabs in particular.

    Also, that iframe is not going to do your search-engine rating much good. If you can try to do without frames.

  7. Can't you see she's already using DOM?  And I don't know what you mean by similar to javascript...?

    My bad, new to these boards and failed to notice the scrollbar in the code field.

    Assumed wrongly by the way the question was asked that she tried to get part of the source via CURL directly.

    (Comparison with javascript was made as I assume most webdevelopers are familiar with it, and manipulating the DOM with it makes you feel at home in the PHP DOM quite fast.. or at least I did.)

     

    If you're having problems with extracting the information out of it, the way I'd prolly attempt it would be to get the textnode of the font tag inside the paragraphs and doing an $arrRestaurantInfo = explode( '<br/>', $obtainedResult );.

    That should give you the all of the text in it a nice array. Once that's done it's simply a matter of doing a print_r( $arrRestaurantInfo ); so you know which part ended up where.

     

    If I'm not mistaken it should be like this:

    <?php
    $arrRestaurantInfo[0]; //Restaurant name
    $arrRestaurantInfo[1]; //Address
    $arrRestaurantInfo[2]; //Date +string "inspection"
    
    //Extract date by getting the the part before a space in the string is found.
    $date = substr( $arrRestaurantInfo[2], 0, stripos( $arrRestaurantInfo[2], ' ' ) );
    
    //Same as above, but requires a very recent PHP version (5.3.0)
    //$date = strstr( $arrRestaurantInfo[2], ' ', false );
    ?>

    Didn't test anything, so copy pasting might not be a good idea.

  8. I'm writing a script that lets a user create a custom graph and at the end of the ride the graph is created via either GD2 or Imagick, depending on if I figure out how to draw a pie slice with imagick.

     

    Anyhow, GD2 and Imagick take their toll on the server as they're both quite 'heavy' processes and I'd like to restrict the user to create a graph at most once every 10 seconds. What's the best approach to this, sessions, sessions in combination with cookies, something completely different?

  9. Could this possibly be a problem in the documentation btw? Can't seem to get anything out of it besides an error so I'm starting to suspect the documentation is flawed and one of those parameters shouldn't be of the type as it's documented.

  10. Depending on if I understood you correctly I'd do the following:

    <?php
    $arrGenre = array_flip( explode( ',', $genre ) );
    
    if ( isset( $arrGenr[1] ) )//this genreID is in the value $genres
      echo '<input checkbox name="genre[]" value="whatever" CHECKED>';
    else
       echo '<input checkbox name="genre[]" value="whatever" >';
    
    ?>
    

     

    explode creates an array out of your values using the comma (first parameter) to split the string.

    array_flip changes the keys and values around. So you can use isset() on the index instead of having to loop over the array for each checkbox.

     

    [edit]Looks like it took me too long to find the array_flip function. Maybe it's easier to understand for you? Please do post another response if it's still not clear.

  11. Undefined index means that the value isn't set.

    At the bottom of your code you do a isset($userfinal).. so that line would never given an undefined index error message.

     

    Basically you always got to make sure a value is set, you might want to wrap the entire thing in a,

    if( isset( $_SESSION['user'] ) && isset( $_SESSION['admin'] )
    {
    

     

    edit

    If you always want a default value to be used you could a ternary operator like this:

    <?php
    $username = isset( $_SESSION['user'] ) ? $_SESSION['user'] : 'default';
    ?>

    That would put the username from the session in $username if its set or default if it's not.

  12. If someone could tell me how to draw a pie slice using imagick I'd really appreciate it.

    This is what my test case looks like:

    <?php
    $width =  200;
    $height = 100;
    
    $img = new Imagick();
    $img->newImage( $width, $height, new ImagickPixel( 'orange' ) );
    
    $draw = new ImagickDraw();
    $draw->setStrokeColor( new ImagickPixel( 'black' ) );
    $draw->setStrokeWidth( 2 );
    $draw->setFillColor( new ImagickPixel( 'lime' ) );
    $draw->pathEllipticArcAbsolute( $width/2, $height/2, 0, true, false, 0, 30  );
    $img->drawImage( $draw );
    $img->setImageFormat( "png" );
    
    header( "Content-Type: image/png" );
    echo $img;
    ?>

     

    But it throws a

    “Fatal error: Uncaught exception ‘ImagickException’ with message ‘Non-conforming drawing primitive definition `A100” in /srv/www/htdocs/fetish/index.php:556 Stack trace: #0 /srv/www/htdocs/fetish/index.php(556): Imagick->drawimage(Object(ImagickDraw)) #1 {main} thrown in /srv/www/htdocs/fetish/index.php on line 556″

    Also tried creating a svg and converting that, but the converting process is too slow..

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