Jump to content

premiso

Members
  • Posts

    6,951
  • Joined

  • Last visited

  • Days Won

    2

Everything 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. Don't know what you are talking about.
  4. You can join the IRC Chat! irc.phpfreaks.com #help / #chat We are very selective (about 20 members) and we are el33t.
  5. More than likely it will be a path issue. Do you have display errors turned on and your error_reporting set to E_ALL? If not that would be the first step I do is to try and get an error.
  6. $pos = strpos($description, 'I hate this part'); if ($pos !== false) { $firstpart = substr($description, 0, $pos); }else { echo 'Section was not found'; } echo $firstpart; Using a mixture of substr and strpos
  7. I use bash I know of http://sourceforge.net/projects/mysqlcc/ which works decent. The workbench I just hated. The MySQLCC program was the best I found, but I still prefer to use the CLI.
  8. 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.
  9. As mikosiko said, remove the <br/> and you will also want to add a \n inside of it for the break. echo "Exec dbo.hiddenprocedure '".$i ."', 350000 \n";
  10. You do realize that those URLs do nothing for SEO. They are just friendlier to use / prettier to look at.
  11. According to the Sourceforge Code site: $element = $html->find("font[size=-1]", 3); echo "Width is: " . $element->width . '<br />';
  12. 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.
  13. You will want to use the MySQL LIKE comparison function. $sql= "SELECT * FROM categories WHERE categories_name LIKE '%{$search}%'"; The %'s are wild cards.
  14. 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.
  15. 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.
  16. Please Read: http://forums.phpfreaks.com/topic/1895-header-errors-read-here-before-posting-them/ And see if that helps you understand / solve your problem.
  17. STOP YELLING AT ME! /me curls up in fetal position rocking back and forth mumbling nonsense.
  18. I do not see this being relevant to PHP, as Javascript seems to be more prudent for doing what you need. Moved accordingly.
  19. 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.
  20. 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.
  21. 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.