Jump to content

doddsey_65

Members
  • Posts

    902
  • Joined

  • Last visited

  • Days Won

    9

Posts 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. 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

  3. 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];
        }
    }
    
  4. 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;
    }
  5. 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.

  6. 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

  7. 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

  8. 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.

  9. 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 :P

    I never planned to stage this project so never considered that.

     

    Thanks

×
×
  • 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.