Jump to content

premiso

Members
  • Posts

    6,951
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by premiso

  1. Try these headers:

     

    /* Your other code above, minus the image/png header */
    $image = imagecreatefromstring($row['thumb']);
    
    header('Content-Description: File Transfer');
    header('Content-Type: application/octet-stream');
    header('Content-Disposition: attachment; filename="'.$filename.'"'); //<<< Note the " " surrounding the file name
    header('Content-Transfer-Encoding: binary');
    header('Connection: Keep-Alive');
    header('Expires: 0');
    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    header('Pragma: public');
    header('Content-Length: ' . strlen($image));
    
    echo $image;
    ?>
    

     

    Making necessary changes like the file name. You only use the image/png header when you want to display the image.

  2. I just cranked out my latest Article / Blog type site, lxt.me and wanting some feedback on it. 

     

    It is very simple just meant for me and was a project that I used to learn more about Symfony2. I am more or less looking for critique on the flow of the site / colors etc, not so much functionality.

     

    Thanks!

  3. Edit: Here's an article that explains more in depth how each part of a URL is interpreted by a search engine. For example it talks about the difference in using _ and -.

    http://searchenginel...ractices-134218

     

    Sorry, I tend to take articles written by self proclaimed SEO experts very lightly.

     

    http://goo.gl/Qfc9w

     

    That is a PDF written by Google about SEO Practices for their search engine. They state that no matter URL format used, they do their best for the relevant content and not just the URL. Now, for other search engines other than Google, it may matter. However, I doubt it matters as much as people think it does and as far as it being the effort just for SEO, I think it is not worth it. However, if you want people to be able to know what they are going to by the URL, then it is worth it.

     

    My 2 cents from my experiences.

  4. why wouldn't you keep that in the database? Why does the id number need to jumble up the url ?

     

    Because it is the unique identifier? Either or, I would say give it a try to pretty up the URLs and see how it goes, maybe you will then understand why. 

  5. We cannot assist you unless you provide us with a bit more information.

     

    What webserver are you running?

    What changes did you make before this happened?

    What are the similar traits to the hyperlinks?

     

    And any other relevant information you can think of. Given the error, I moved this to the WebServer form. 

  6. Because no one has felt like attempting to code it and do it.

     

    Last I checked phpBB was OpenSource, you could code it and submit the patch / plugin to get the URLs you want. And also with forums that have tons of users, duplicate topics will probably happen, and it is just easier to use the id's as appose to coming up with an algorithm to handle that. 

  7. It is just saying that it is not an object, you can solve it by defining it as a stdClass:

     

    function bp_group_hierarchy_setup_globals()
    {
    global $bp, $wpdb;
    
    /* Define a default class if one has not been instantiated */
    if (!is_object($bp->group_hierarchy)) 
        $bp->group_hierarchy = new stdClass();
    
    /* For internal identification */
    $bp->group_hierarchy->id = 'group_hierarchy'; // line 22
    $bp->group_hierarchy->table_name = $wpdb->base_prefix . 'bp_group_hierarchy';
    $bp->group_hierarchy->slug = BP_GROUP_HIERARCHY_SLUG;
    
    /* Register this in the active components array */
    $bp->active_components[$bp->group_hierarchy->slug] = $bp->group_hierarchy->id;
    
    do_action('bp_group_hierarchy_globals_loaded');
    }

     

    And that should get rid of the warnings. 

  8.  

     

    I used to work on some IIS setups that did not define DOCUMENT_ROOT for some reason, though if I remember correctly, there was a similar variable, just went by a different name.  Since then I've gotten into the habit of always define'ing my own DOCUMENT_ROOT constant based on __FILE__.  I can't remember which IIS version it was that did that.  The newer version we are using now does define it properly.

     

    Not to mention that DOCUMENT_ROOT is defined by the webserver, so it can be a variation of different items, depending on who setup the web server or even be left off at times. So yea, the __FILE__ method is definitely my preference as well. 

  9. Using cURL over file_get_contents will be about 3-5times faster than file_get_contents, so if you have the option to use cURL, I would opt for that for a bit more efficiency.

     

    Also, you can display the text without echo's using <?php echo $weekly; ?> such as:

     

    ?>
    <strong>How many times have people tweeted #TeamRylan</strong><br /><br />
    In the last Hour: <?php echo $hourly; ?><br />
    In the last Day: <?php echo $daily; ?><br />
    In the last Week: <?php echo $weekly; ?><br />
    In the last Month: <?php echo $monthly; ?><br />
    Ever: <?php echo $alltime; ?> <br />

     

    Granted the display part is more or less preference, but to me that would be easier to edit not having to worry about quotes etc. 

     

    Finally, you do not need a foreach, instead just do this:

     

    <?php
    error_reporting(0);
    $jsonurl         = "http://otter.topsy.com/searchcount.json?q=%23teamrylan&type=tweet&apikey=FJWCK5YSZIBEUZX4HYJQAAAAABLTPFQ3DVIQAAAAAAAFQGYA";
    $json           = file_get_contents($jsonurl, 0, null, null);
    $json_output = json_decode($json, true);
    
    $hourly  = number_format($json_output['response']["h"]);
    $daily   = number_format($json_output['response']["d"]);
    $weekly  = number_format($json_output['response']["w"]);
    $monthly = number_format($json_output['response']["m"]);
    $alltime = number_format($json_output['response']["a"]);

     

    None of this stuff is really necessary, just some items that will help efficiency a little bit, ie not having to loop etc. 

     

    Best of luck.

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