Jump to content

QuickOldCar

Staff Alumni
  • Posts

    2,972
  • Joined

  • Last visited

  • Days Won

    28

Everything posted by QuickOldCar

  1. That ip 66.40.52.167 is dead test it http://www.selfseo.com/ping_test.php
  2. placing exit; at the end is not always a good idea, you may want to continue processing the script
  3. I still don't see the point in what you are doing. You could simply just append their username to the front of any quote upon display, versus trying to save all these values into a database. Doing something like below would save a lot of resources, no selects and inserts needed session_start(); $username = $_SESSION['loginusername']; $quotes = array("Go ahead, bite the big apple, don't mind the maggots, uh huh.","Happiness is a warm gun. (bang-bang, shoot-shoot.)","You may be a lover but you ain't no dancer.","Yeah you got lucky, babe. When I found you.","Out here in the fields, I fight for my meals."); shuffle($quotes); $rand_array = array_rand($quotes,2); $random_quote = $username . " ". $quotes[$rand_array[0]]; echo $random_quote . "<br />"; and if you need to use someone else's user name then you can select one random user from the database and append that to it instead echo $row['username'] . " ". $quotes[$rand_quote[0]] . "<br />"; But lets do this as a function, I made a simple users array to emulate your while loop $users_array = array("Angry Mike","Flexy Phil","Barbaria","Hank the Shank","Cool Carlito"); function getQuote($username){ $quotes = array("Go ahead, bite the big apple, don't mind the maggots, uh huh.","Happiness is a warm gun. (bang-bang, shoot-shoot.)","You may be a lover but you ain't no dancer.","Yeah you got lucky, babe. When I found you.","Out here in the fields, I fight for my meals."); shuffle($quotes); $rand_array = array_rand($quotes,2); $random_quote = $username . " ". $quotes[$rand_array[0]]; //mysql_query("INSERT INTO some_table (username,quote) VALUES ($username, $random_quote)"); return $random_quote; } foreach($users_array as $user){ echo getQuote($user) . "<br />"; } just one of the many results when refreshed it: I didn't add as many quotes in the array Angry Mike Out here in the fields, I fight for my meals. Flexy Phil You may be a lover but you ain't no dancer. Barbaria Yeah you got lucky, babe. When I found you. Hank the Shank Yeah you got lucky, babe. When I found you. Cool Carlito Happiness is a warm gun. (bang-bang, shoot-shoot.)
  4. I guess can also just check if they are equal to one another as well if($match_quote == $row['quotes']){ //mysql_query("INSERT INTO some_table (username,quote) VALUES ($row['username'], $row['quotes'])"); echo "it matched"; }
  5. Did you just add those quotes in there in the mysql while loop to show the type data you get try something like this $match_quote = "Go ahead, bite the big apple, don't mind the maggots, uh huh."; while($row = mysql_fetch_array($result)) { if(preg_match("/$match_quote/i", $row['quotes'])){ //mysql_query("INSERT INTO some_table (username,quote) VALUES ($row['username'], $row['quotes'])"); echo "it matched"; } } Is not your exact values, but giving you the idea I don't see the full purpose for doing this though.
  6. or do you want to match a quote, and if matches then insert? What would determine your "a certain quote"? Match a word within a quote or match the exact quote.
  7. $quotes = array("Go ahead, bite the big apple, don't mind the maggots, uh huh.","Happiness is a warm gun. (bang-bang, shoot-shoot.)","You may be a lover but you ain't no dancer.","Yeah you got lucky, babe. When I found you.","Out here in the fields, I fight for my meals."); shuffle($quotes); $rand_quote = array_rand($quotes,2); echo $quotes[$rand_quote[0]] . "<br />";
  8. some loading information and times http://tools.pingdom.com/fpt/#!/GAmE7bcLB/http://www.webtechdev.net/ gzip compression could make the pages smaller to load http://www.whatsmyip.org/http-compression-test/?url=aHR0cDovL3d3dy53ZWJ0ZWNoZGV2Lm5ldC8= A handy compression checking tool http://www.gidnetwork.com/tools/gzip-test.php I would incorporate some type of compression and cache the pages as well wp-supercache plugin is very good for wordpress http://wordpress.org/extend/plugins/wp-super-cache/ layout and design looks fine to me some sort of tagging system or show what category the post belongs in couldn't hurt
  9. Lose the butterfly get a better host? fix your javascript popup so it doesn't throw way up into your head of page...which makes it unable to close also i see something under your grass in the footer and unable to click it or see properly your "simon-like" colored links do not work resize your thumb images and cache them instead of just resizing them for display as a thumb
  10. it's most likely easier to have a login system using sessions on top of the page the session would start if user is logged in continue, else redirect them somewhere else or to login the login process would check if it's a proper user and password There was a tutorial online that I edited it so it worked http://www.phpfreaks.com/forums/index.php?topic=338735.msg1596372#msg1596372 use this for the sql CREATE TABLE IF NOT EXISTS `dbusers` ( `id` int(11) NOT NULL auto_increment, `username` varchar(32) collate utf8_unicode_ci default NULL, `password` char(32) collate utf8_unicode_ci default NULL, `email` varchar(32) collate utf8_unicode_ci default NULL, PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; I myself took this code here and modified it a lot for my own use http://www.evolt.org/node/60265 Ther may have been a few errors in it, can look through the comments or ask me and maybe I'll whip up a version of my edited one.
  11. you should post a few lines of example data within your database_log.inc will have to explode it by it's delimiter for each value http://php.net/manual/en/function.explode.php
  12. or in simpler terms, every time you do = after a variable, it is now that value $bar = "Bob"; echo $bar."<br />"; $bar = "My name is $bar"; echo $bar."<br />"; $bar = 'now this is also '.$bar; echo $bar."<br />"; $bar = "Bob"; echo "now bar is just $bar again <br />"; $last = " Jones"; $bar .= $last; echo $bar; results: Bob My name is Bob now this is also My name is Bob now bar is just Bob again Bob Jones
  13. http://phpthumb.sourceforge.net/ makes thumbs from images and caches them then can just glob() a folder for images to make galleries http://php.net/manual/en/function.glob.php http://net.tutsplus.com/tutorials/php/quick-tip-loop-through-folders-with-phps-glob/ try this one out using jquery http://www.twospy.com/galleriffic/ view each example but these may be what you want http://www.twospy.com/galleriffic/example-2.html http://www.twospy.com/galleriffic/example-5.html#6 there are many premade photo galleries out there http://coppermine-gallery.net/ there has to be hundreds if not thousands of scripts already made related to image galleries look for tutorials or opensource ones
  14. line 934 of your included pluggable.php is a header() call, before this your theme is already outputting data to the browser. you could just use a meta rtedirect versus the header and call it done <meta http-equiv="refresh" content="0;url=URL TO GO TO" />
  15. You can not echo/display out anything before calling header() absolutely nothing I'll refer you to this page for more on it http://www.phpfreaks.com/forums/index.php?topic=37442.0 also, does you html page read php code for that $_GET request of memberId? if not edit your .htacess with AddType application/x-httpd-php .htm .html , save and restart the server
  16. Since nobody ever responded to this , I'll write a few things. To edit the way it opens the images can be done within the javascript script // Bolgallery Javascript popup function $bolGalleryPopup = "<!-- BolGallery Javascript popup window function --> <SCRIPT type=\"text/javascript\"> function bolGalleryPopup(imageFile, width, height, title){ var html = '<title>' + title + ' - Click to close </title><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onclick=\"javascript:window.close()\"><img src=\"' + imageFile + '\" alt=\"Click to close\"></body>'; var popup = window.open(imageFile, '_blank', 'width=' + width+ ', height=' + height + ', status=no'); popup.document.write(html); popup.focus(); } </SCRIPT>\n\n"; simply just doing this would open in a new window as just the image....same as if would right click on the thumb and "view image" // Bolgallery Javascript popup function $bolGalleryPopup = "<!-- BolGallery Javascript popup window function --> <SCRIPT type=\"text/javascript\"> function bolGalleryPopup(imageFile, width, height, title){ var html = '<title>' + title + ' imageFile + ' </title><body></body>'; var popup = window.open('imageFile','scrollbars=yes,menubar=yes,height=768,width=1024,resizable=yes,toolbar=yes,location=yes,status=yes'); popup.document.write(html); } </SCRIPT>\n\n"; Gonna quote you here "I want the image to load in the same page not in any other window seperately " This script is to lower server load and to not load all those large images at the same time on a single page by making and displaying a thumbnail of it. I'm sure you could use ajax to make the fullsize image replace the thumb image on click, but it would cause a lot of havoc with your style on the page. Otherwise the only way to do as you say would be to use hidden dividers and css trickery, which again defeats the purpose because the large images will all still have to load...even if not visible at first. The popup is more like a poor mans way of simulating a lightbox, btw, you could style that. The way they have the script set up, it caches the thumb images and also the display page as html, so delete the following folder and file to see any changes. bolGallery folder within your images folder images_bolGalleryStaticPage.html within your gallery folder
  17. can try any of these here http://alternativeto.net/software/floorplanner/?license=free
  18. you could just visit http://localhost/newfolder/ it should read any index.html or index.php file you place within that folder the "but how do I tell my database to use files from a folder in htdocs" is a bit vague htdocs is your local filename which is the same location as http://localhost aka:the root of your site you could also include a script http://php.net/manual/en/function.include.php
  19. your posted link doesn't work
  20. Here are your fixes $values = array($title,$img,$post,$aurthor_id,$category_id,$date_posted); $fields = array("title","img","post","aurthor_id","category_id","date_posted"); $values_imploded = implode(",",$values); $fields_imploded = implode(",",$fields); $i = "INSERT INTO $table ($fields_imploded) VALUES ($values_imploded)"; there was a quote issue with the values array, and then you had the fields and values reversed for the insert you should also escape/sanitize everything before inserting into mysql
  21. You should have the directory/path to the exact location of the file $filename = '/path/to/version1.tar.gz'; http://php.net/manual/en/function.file-exists.php
  22. http://php.net/manual/en/function.ctype-alnum.php
  23. would have to first find out what the file extension is, and if not an image, use some image you created $filename = "up/rss.rar"; $image_source = $filename; $ext = pathinfo($filename, PATHINFO_EXTENSION); $images_ext = array("jpeg","jpg","png","gif","bmp","tiff");//add or remove as needed if(!in_array($ext, $images_ext)){ $image_source = "/images/default-$ext.png";//create a default image for each file type //$image_source = "/images/default-image.png";//a general image for all } so now when you display your code, place the $filename and $image_source into it something like this. <div class='tiedosto'><a href='<?php echo $filename;?>' class='tiedosto screenshot' rel='<?php echo $filename;?>' ><img src='thumb.php?src=<?php echo $image_source;?>&h=100&w=100&zc=1' alt=''></a></div>
  24. Some code related to what you are doing usually helps. Displaying data in php with line breaks should use <br /> If you have an extremely long paragragh, you can use wordwrap. http://php.net/manual/en/function.wordwrap.php
  25. would unsetting that user if no file exists work? function fetch_users_login($limit) { $limit = $limit(int); $sql = "SELECT `users`.`id`, `users`.`firstname`, `users`.`lastname`, `users`.`username`, `user_privacy`.`avatar` FROM `users` LEFT JOIN `user_privacy` ON `users`.`id` = `user_privacy`.`uid` WHERE `users`.`status` > 2 AND `user_privacy`.`avatar` = 1 ORDER BY `users`.`id` DESC LIMIT 0, {$limit}"; $result = mysql_query($sql) or die(mysql_error()); $users = array(); $i = 0; while(($row = mysql_fetch_assoc($result)) !== false) { $users[$i] = array( 'id' => $row['id'], 'firstname' => $row['firstname'], 'lastname' => $row['lastname'], ); $users[$i]['avatar'] = getUserAvatar($row['username']); if (!file_exists($users[$i]['avatar'])) { unset($users[$i]); } $i++; } return $users; }
×
×
  • 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.