Jump to content

dabaR

Members
  • Posts

    189
  • Joined

  • Last visited

Everything posted by dabaR

  1. Could you show the actual numbers inside 0:, 1:, 2:, etc.? Also, what would those numbers be if the number string was not 5 but rather 8?
  2. Your exclamation point button seems to be stuck. Can you post the code that defines the class that $session is an object of?
  3. <?php $images = "path/to/videos/covers/"; # Location of thumbs $videos = "path/to/videos/videos/"; # Location of video files $cols = 3; # Number of columns to display if ($handle = opendir($images)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != ".." && $file != rtrim($videos,"/")) { $files[] = $file; } } closedir($handle); } $colCtr = 0; echo "<table><tr>"; foreach($files as $file) { if($colCtr %$cols == 0) echo "</tr><tr><td colspan=\"" . $cols . "\"><hr /></td></tr><tr>"; echo "<td align=\"center\"><a href=\"" . $videos . $file . "\"><img src=\"" . $images . $file . "\" /></a><br /><br /><a href=\"" . $videos . str_replace('jpg', 'wmv', $file) . "\">Right click and 'save as' to download video</a></td>"; $colCtr++; } echo "</table>" . "\r\n"; ?> Or use substr($file, 0, -3) . 'wmv'
  4. AFAIK, you have to have as many loops as levels of arrays.
  5. Did you try printing out $domain so that you can see whether its contents are .domain.com? It appears you end up with domain.com, I am not sure whether that would be your problem.
  6. Ya, I knew that was the case.
  7. $getteams=safe_query("SELECT clanID, userID FROM ".PREFIX."cup_clan_members WHERE userID='$userID'"); while($te=mysql_fetch_array($getteams)) { $registered=safe_query("SELECT * FROM ".PREFIX."cup_clans WHERE clanID='".$te['clanID']."' && 1on1='0' && cupID='$cupID'"); if (mysql_num_rows($registered)) $is_registered_on_at_least_one_team = true; } if (empty($is_registered_on_at_least_one_team)) die('error message');
  8. Does foreach ($subcats['lighting-effects'] as $category => $effects)... do the trick? I think you would benefit from learning how to better name your variables, so you could read http://www.objectmentor.com/resources/articles/naming.htm
  9. You're welcome. I will keep subscribed to the thread, and please post when you find out. I can't think of any other problem than that code in that block never gets executed, or potentially some email delivery problem, so I would like to learn something new if you find out a different cause.
  10. foreach ($team_ids as $team_id) { $registered = ...; if (mysql_num_rows($registered)) $is_registered_on_at_least_one_team = true; } if (empty($is_registered_on_at_least_one_team)) die('a horrible death'); //jk
  11. AFAICT there is nothing wrong with the code inside the if block.
  12. Ya, there is definitely no code that would place the value of what you click on into the input field as far as I can see either.
  13. Can you write something like db_query("..." . (empty($field_data) ? 'NULL' : db_quote($field_data, 'text')) . "...");
  14. Did you test that code within if ($testModeStatus == "1") { gets executed? You could put die('BALH');
  15. Thanks, either way was fine. Do you actually have any spaces before '<?php' in line 1 of products.php?
  16. You will thank yourself once you start using jQuery.
  17. I'll probably help, please post the files you did before as attachments this time. Somehow when I copy/paste I have to delete extra blank lines.
  18. The autocomplete text field is implemented and the usage well documented here: http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/
  19. You're welcome. Ya, keep working on it. You know what you should probably do to get a feel of what they are looking for? Look for job ads, apply to each one of them, interview, and after a while you will have the answer to your question, and you will know what they are looking for. I've been looking for a while now, but my city is small, so I don't really know what to tell ya. You could post a new thread in one of the forums. But yes, really whatever their ads say is what they want.
  20. Not sure whether it makes sense, but all that matters is that it works. From what I was sensing is that there were 8 images exactly, and that was causing a problem with the $count >= 8 Good job figuring it out.
  21. I asked about your programming background because using a class for the task at hand (Files class) somehow seemed forced, not a great fit. I would have written a function; what's a class with one function? Ya, the difference was you were assigning the value, but not because of the reasons you list there, it is just basically that the constructor does not return a value to be assigned to a variable, like $s3.
  22. I think you should be able to post a link. I link to my site all the time with the signature. You say you get an error on a certain page. That means a certain user has too many pictures. I would like to know how many pictures that exact user has right now.
  23. How many images are there now?
  24. Sure. <? if (!class_exists('S3')) require_once 'S3.php'; class Files extends S3{ public $bucket_contents; public $fileType; public $extraExtension; function __construct($accessVar, $keyVar, $bucket, $fileType, $extraExtension=null){ parent::__construct($accessVar, $keyVar); $bucket_contents = $this->getBucket($bucket); $this->bucket_contents=$bucket_contents; $this->fileType=$fileType; $this->extraExtension=$extraExtension; } function listFiles(){ foreach ($this->bucket_contents as $file){ $fname = $file['name']; //gets the files with the extension we want if ( empty($this->extraExtension) ){ $ExtensionSplit = "."; }else{ $searchResult = stripos($fname, $this->extraExtension); if($searchResult){ $ExtensionSplit = $this->extraExtension . "."; } } if ( end( explode( $ExtensionSplit, $fname ) ) == $this->fileType ){ $furl = "http://s3.amazonaws.com/gmt.dvd.052110/".$fname; echo "<a href=\"$furl\">$fname</a><br />"; } } } } //$accessVar and $keyVar is populate with actual access and keys //this lists the files $files = new Files($accessVar, $keyVar, "gmt.dvd.052110", "zip", $searchExtraExtension = "mov" ); $files->listFiles(); That's basically it.
  25. Stop the user from uploading any images after 8 but not stop the user from even trying to upload the image, right? The reason I ask, is because the code that checks for number of uploaded images is not inside a if($this_is_a_post).
×
×
  • 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.