Jump to content

Adam

Moderators
  • Posts

    5,717
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Adam

  1. How many files exactly do you combine into a single file??
  2. You'd have a cluttered file? Personally if I were to pass the page name in like that I'd use templates, and a neat file structure.
  3. Could shorten it a bit, looks best way to go using an array though... if (!in_array($player->staff, array(1, 4, 5))) {
  4. Take a look here: http://www.php.net/manual/en/language.variables.external.php
  5. Seems better, though that background still has to go in my opinion. Don't like how the boxes get wider further down the page. When you login and go to the members lounge, everything's really dotted around, doesn't look planned out. There's also text that's impossible to read without highlighting. Sorry but, think it still needs fair bit of work doing to it...
  6. Try this: foreach($files as $ind_file){ if ($ind_file != '.' && $ind_file != '..') { echo '<img src="'.$dir.'/'.$ind_file.'" width="120">'; } } http://us.php.net/manual/en/function.scandir.php If you look at the manual you'll see two directories in there as well: '.' & '..' I bet if you look at the source of your page you'll notice the images where trying to use these as the 'src'.
  7. The links and images won't work as what's probably happening is the email client is rendering the HTML taken from the web page - it's not taking an actual screen shot. As for taking a screen shot, I can't really help you. Google's probably best way to go...
  8. The best things in life are free! http://phpmygraph.abisvmm.nl/ I've never used it, but looks pretty good.
  9. Try this... $pattern = '%(0?[1-9]{1}|1[0-2]{1})/([0-2]?[0-9]{1}|3[0-1]{1})/[0-9]{4,4}%';
  10. If you go with something like, just be sure all links are accessible if JavaScript is disabled...
  11. No...
  12. I think this is what you mean: if (($lastNotified) < strtotime($timeAdded) { echo ($i == $count) ? '<li class="unread last">'.$row['message'].'</li>' : '<li class="unread">'.$row['message'].'</li>'; } else { echo ($i == $count) ? '<li class="last">'.$row['message'].'</li>' : '<li>'.$row['message'].'</li>'; } I've never used a ternary operator with echo before, but should work! Personally though, for easier reading and future development I prefer to use ternary operators as little as possible.
  13. In-fact, scrub that... Didn't realise this wasn't the complete code, and when I saw that assumed it was $_GET['find'] it was encoding. It's early...
  14. Looks like you're trying to pass $find to the function, but you're setting it in the 'else' case of it failing. Try moving: $find = urlencode($find); Just after: if ($anymatches == 0) {
  15. Agree with above. Plus when you do click through to a page, the italic links on the left are small, hard to read and very uninteresting. The whole site looks really boring in-fact, I certainly wouldn't stick around. Also keep the fancy web talk to a minimum, if you confuse him you'll probably do yourself damage.
  16. Your menus break without JavaScript, which means search engines can't navigate through your site, which means people will never find your site. It doesn't matter how many people don't use it in your case. EDIT: Actually it does. Statistics vary but it's around 5-10% of people I think. So it's possible 5-10% of the people who do manage to find your site, can't use it anyway.
  17. Where did you get that, in the database?
  18. Actually come to think of it, I bet you were right anyway...
  19. I'd disagree there. Sessions should really be used for session data, not data for a single script. try this: foreach($openedfile as $Key => $Val) { $Data = explode("|", $Val); $user = $Data[0]; $psw= $Data[1]; if($user ==$username && $psw == $password) { echo" We have a match"; } else { echo" SORRY- No match here"; } } I'm not sure where you originally get $username and $password from, but you should be able to use them later in the script if there's a match.
  20. And... where does the avatar come from?
  21. In this line: if((move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) || (move_uploaded_file($_FILES['imagefile']['tmp_name'], $imgtarget_path))) { You're saying if "uploadedfile" OR "imagefile" are uploaded (...) That should be && (AND); although to be honest I wouldn't do it that way. Do you have errors enabled do you know? If there's no warning message that suggests the file you're trying to upload is not valid.
  22. That's a lot of code... Perhaps asking a bit much of peoples good will there. Where abouts in the code do you want the avatar? Where does the avatar come from? Where abouts in the code is the functionality for your quote button, where is the quote button? What doesn't work with it?
  23. ... foreach($openedfile as $Key => $Val) { $Data = explode("|", $Val); $user = $Data[0]; $psw= $Data[1]; if($user ==$username && $psw == $password) { echo" We have a match"; } else { echo" SORRY- No match here"; } } ... Should work. I'd recommend this method though: $openedfile = file($db_file); if (in_array($username . '|' . $password, $openedfile)) { // match } else { // no match } Why not just use a database?
  24. I think you have 'display errors' off, if it didn't pick up the syntax error from before. Try adding the following just after your first opening PHP tag: error_reporting(E_ALL); ini_set("display_errors", 1); This will show you any errors occurring within the script.
  25. The way you're looping through the files could be improved. See if this works (obviously not tested it): if(isset($_POST['submitimages'])) { $im1= $_POST['img1']; $im2= $_POST['img2']; $im3= $_POST['img3']; $im4= $_POST['img4']; $success=0; $DestinationDir="../ad_images/"; //Place the destination dir here $ThumbDir="/thumb/"; //Place the thumb dir here $insert_fields = ''; $insert_values = ''; foreach ($_FILES as $key => $file) { $Unique=microtime(); // We want unique names, right? $destination=$DestinationDir.md5($Unique).".jpg"; $thumb=$ThumbDir.md5($Unique).".jpg"; $IMG=getimagesize($file['tmp_name']); $finalimage = resize($file['tmp_name'], 250, $destination); //use the filename variable below to record the image name entered so that you can then use this variable to update your database if $filename = md5($Unique).".jpg"; $insert_fields .= "image" . intval($key) . ","; $insert_values .= "'" . $filename . "',"; } $insert_fields = rtrim($insert_fields, ','); $insert_values = rtrim($insert_values, ','); $insert_query = mysql_query("insert into ad_image (ad," . $insert_fields . ") values ('__advalue__'," . $insert_values . ")") or die(mysql_error()); if($success>=1) { $message = "Images uploaded!"; } else {echo "We might have a problem???";} echo $im1; echo $im2; echo $im3; echo $im4; } I just replaced where you'll need to put the value for the 'ad' field with "__advalue__" ...
×
×
  • 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.