Jump to content

doddsey_65

Members
  • Posts

    902
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by doddsey_65

  1. I had to look up the actual library since it is nearly impossible to read minified code like that. Anyway, you can set autoplay to false in your options. You will need to define this in a condition. var autoplay = true; if (images.length === 1) autoplay = false;
  2. Can you show where $js_inc["id"] is defined? Your syntax is correct so the value of that must be less than 2.
  3. Hi. I have user profiles on my forum and to the right is the latest posts by that user. http://www.asimpleforum.co.uk/forum/user/cjmarkham/ These links don't work correctly as the page is missing. It will always take you to the first page of the topic. Now given that the page can be any number and not always the last what methods to you reccommend to getting the number? I don't want to run too many queries so getting all of the posts for each topic and calculating the page isn't an option. It would be the easiest but would involve alot of queries. Anyone have any thoughts? Thanks
  4. Not many people are going to download a file from someone they don't know. Perhaps you could share your code on Github Gist or Pastebin
  5. And what is $first_name? What does it contain? Also, no need to use die() and exit(), they are the same function.
  6. mysqli_real_escape_string requires the database object as a first parameter. Can you show the code which defines $dbc? Also what do you mean by "the function doesnt execute"? What is the input variable and what are you expecting to be returned?
  7. Sorry for the late reply. If you haven't sorted it yet you could use my example with a small change at the end (.*(?=http))(http:\/\/.*?(?=\s))(.*?)\d\.\d
  8. You would need to iterate over the values in each $cell. Since $cell is an array I don't know what you want to echo with it since you cannot echo an array. foreach ($values as $cell) { $links = $cell[0]; $classes = $cell[1]; foreach ($links as $key => $link) { echo $link; echo $classes[$key]; } }
  9. So $values contains 14 arrays, each with 19 values?
  10. Where did you get the variables $class and $link from?
  11. glob() will get any files you want. As you can see I specified a wildcard (*) meaning pull all files in the directory. In order to get only the ones you want you could use the wildcard with a prefix: glob('meteocode/ont/cmml/TRANSMIT.FTP011.*')
  12. Wasn't aware you wanted it to stop. Will it always end in 8.99 or can the string change?
  13. As said just use glob to iterate over all the folders files and get the latest using filemtime (file modified time). $latest_file = null; foreach (glob('meteocode/ont/cmml/*') as $file) { if ($latest_file === null || filemtime($file) > $latest_file) $latest_file = $file; }
  14. Haven't tested this but maybe try (.*(?=http))(http:\/\/.*?(?=\s))(.*) Matches everything upto http, then matches http upto first whitespace character, then matches everything after it.
  15. Hi. Firstly I would like to thank everyone who tested that version of the forum. God knows it had it's issues. But, not one for letting a project die, I decided to resurrect it a few weeks ago. I have learnt alot since the last version and the new version is a lot better. If you are interested in testing it can be found at http://staging.asimpleforum.com/. This version uses the PHP framework "Silex" and HTML template system "Twig". Because of this, errors should be kept to a minimum and development will be a lot faster. There are also several tests ran both while coding and deploying. Stuff like grunt and jshint for parsing errors and php unit for unit tests. The code is also deployed via git which means no more FTP errors. I have also implemented caching in 2 forms. The first and default method is disk caching. Data will be encoded and saved in files so they can be accessed later rather than pulling info from the database all the time. The other method is NoSQL. I use mongodb as a caching layer and store information in collections (similar to disk caching method). Feel free to contribute to the site too if you like at the github repo https://github.com/cjmarkham/asimpleforum. The design of the site has been improved a lot and will continue to see improvements as I develop more towards a mobile friendly structure. There is a test account if you don't wish to register. Username: tester, password: tester. Thanks
  16. You could use filemtime() to get the last modified time of the file.
  17. Hi, Just to let the admins know that the staging env of php freaks is being indexed by google and as a result I was able to bypass the password protection (which is only at the root). The link showed stack tracing and sql structure. Rather than post the link here I will PM an admin if you want it. Thanks
  18. Structure is all about what you want. If you find it easy to work with, and you can access everything you need efficiently then go for it. There is no definitive structure that works for everyone. The layout you have above seems to be a standard layout for something like a brochure site and I see no problems with it, although there doesnt seem to be much point in the amount of includes. I would limit to header, body and footer, rather than having header and footer calling more files.
  19. A better way to avoid global would be to specify to use $path in the closure $folders = array_filter(scandir($path), function($item) use ($path) { return is_dir($path . $item); });
  20. http://linkwayhosting.com/test/ajax/domain_availability/'/.com/ returns a 400 error The grammar on the site is pretty bad. I assume you are not english. When I click the "x" to close a message the message is removed but the red box stays.
  21. I should mention that the staging subdomain will reveal the errors as it is set as a development subdomain. This is just so people can be more descriptive if things do break. But the user error just refers to a missing variable assignment since the user doesn't exist. As for the activation, those with a keen eye will notice the email points to the main website even if you registered on staging I never planned to stage this project so never considered that. Thanks
  22. Are you running this script locally? If so, do you have a mail server setup so that the mail is actually sent? Also you could add this to the top to get descriptive errors: ini_set('display_errors','on'); error_reporting(E_ALL);
×
×
  • 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.