Page 10 of 11

Posted: Mon Jul 07, 2014 6:08 pm
by faceless
wow, that's some going!

Posted: Tue Jul 08, 2014 2:13 pm
by Brown Sauce
Didn't have to be that much of a hacker to get in then. I bet there are lots of similar sites.

I don't envy you the cleanup job ..

Posted: Tue Jul 08, 2014 2:37 pm
by luke
luckily i'm just redoing the whole thing from scratch using coldfusion/mysql. i haven't used asp really since the late 90's, and have no intention of starting again!

Posted: Mon Jul 14, 2014 3:03 pm
by luke
can anyone see how to grab the background videos from this site?

https://www.calm.com/

i can grab the audio, but its the video i want and i can't see where they're at!

scrap that - just found them! :)

Posted: Sun Sep 07, 2014 10:47 pm
by luke
great jquery table plugin here

https://datatables.net/

you can sort, show however many records, shows next / previous, has responsive features and you can search entries

Posted: Mon Sep 08, 2014 1:04 am
by faceless
that's nice, cheers

Posted: Mon Oct 06, 2014 2:57 pm
by luke
great little tool here for converting an ms access database to mysql

https://www.bullzip.com/products/a2m/info.php

saved me loads of time :)

Posted: Thu Oct 16, 2014 5:57 pm
by luke
i'm redoing a page on a site at the moment, and i think i might be approaching it all wrong, so i thought i'd post it up to see if anyone else can think of alternative solutions ...

i've got a table, the headers 'cold water corals, environmental assessments' etc are actually page titles, and pages/headers can be added/removed etc. the main sections like 'ecological disturbance' and subsections like 'fish' can again be added/removed. theres numerous sections and subsections under those.

the numbers are reports/documents on the relevant page. so for fish, the numbers are reports/documents on the environmental assessments page. i'm redoing this page so that instead of just showing the numbers, you'll be able to click on any number and it'll display the correct report/document in a little modal window.

also, so this works correctly, where a range of numbers is displayed like '15 - 18' it will display '15, 16, 17, 18'

<img src="https://ist2-2.filesor.com/pimpandhost.c ... matrix.png" width="800">

so far so good, all easy. at the moment that table is just basic html, so overtime errors happen, report/document numbers change and they don't get updated in the table, or the table lists reports/document that don't actually exist on the relevant page. so i'm going to generate it all from a database so everything is tied together, you remove a report/document, it gets removed from the table etc, you add a report/document to the table, the correct link to that report/document is automatically generated instead of a user manually inputting it.

the problem comes when i think of the ways to generate all this from a database. i'm just kinda stuck. the solution i thought of initially would require so many queries that i think there must be a more efficient/better way of looking at this.

i thought you'd need a query to determine which pages to include as headers, then a query to get the sections and subsections, then - and this is where it'll goes wrong - as you go through each subsection/page combination/cell you'd need a query to retrieve any data for that cell/subsection-page combination, but for this one table that would require over 200 individual database queries! you get a few people running that page, shits going to melt down!

is there a more efficient way of doing this?! what am i missing?!

Posted: Fri Oct 17, 2014 12:38 am
by faceless
in php/sql, you would set each cell to display the contents of the relevant database entries. I've never found a way to do it in html

Posted: Fri Oct 17, 2014 11:24 am
by luke
how would you do that in php? i mean, if you can do it in php i should be able to do it in coldfusion, the database is mysql - and i can work the database for this however i need to

at the moment i have a table that contains the pages to include as headers, the sections and subsections, and then content for the table, and of course the reports/documents table

the content table contains the unique id for each report/document, and the unique id for the section/subsection and page/header its linked to/should be displayed in. note, that there can be multiple entries per cell, so in the fish/environmental assessments example, there would be 13 entries to cover all the numbers ( documents/reports ) needed to be displayed

so a basic example;

dbtable: pageHeaders
id = 1 / title = "cold water corals"
id = 2 / title = "environmental assessments"
id = 3 / title = "marine mammals"
etc

dbtable: sections
id = 1 / title = "ecological disturbance"
id = 2 / title = "other"
etc

dbtable: subsections
id = 1 / sectionsid = 1 / title = "birds"
id = 2 / sectionsid = 1 / title = "coastal flora / fauna"
id = 3 / sectionsid = 1 / title = "fish"
etc

dbtable: content
id = 1 / reportid = 800 / subsectionid = 3 / pageheadersid = 2
id = 2 / reportid = 801 / subsectionid = 3 / pageheadersid = 2
id = 3 / reportid = 802 / subsectionid = 3 / pageheadersid = 2
id = 4 / reportid = 803 / subsectionid = 3 / pageheadersid = 2
id = 5 / reportid = 804 / subsectionid = 3 / pageheadersid = 2
id = 6 / reportid = 805 / subsectionid = 3 / pageheadersid = 2
etc

dbtable: reports
id = 800 / fileid = 1000 / reportnumber = "2" / description = "The 156pp report has a substantial annex on potential impacts on the marine ecology, water quality and fisheries"
id = 801 / fileid = 1001 / reportnumber = "4" / description = "Potential impacts centre mainly on seabed disturbance and water quality resulting from jetting."
id = 802 / fileid = 1002 / reportnumber = "5" / description = "Contains a rigorous assessment of [1] potential environmental impacts resulting from cable laying and post-laying operations, and [2] mitigation of any impacts."
etc

see i could do it if this wasn't displayed in the table, you could do the query selecting what you need linking each unique id with its source db table, group the query by page/section and subsection. sorted. but do it in a table, so you gotta go down and across, its confusing me!

i just can't figure it out unless i run a crazy amount of queries and that can't be right ...

Posted: Wed Oct 22, 2014 6:55 pm
by luke
so ... although i haven't actually done this ( had to move on to other things ) i think i've found a way of working it ...

i never realised, but you can do a query on a query! this is like revolutionary to me - theres so many bits of code i could make more efficient now!

i see you can do it in coldfusion and php, so probably you can in every language.

so i'm thinking i'll just do one big query to get everything.

then one other query on the query getting the count of pages/headers - or even just keep a count when outputting them, them output everything else through grouped output, but keeping track of where you are in the table, because say for cold water corals/birds - that won't bring back any records, so just keep track of where you are in the table and what your current record set has to display, if the records don't belong where you are, then its a blank cell to display, move on displaying blank cells until your current record set item is where it should be displayed ( which is why you have to order and group the query and output )

or something like that anyway, i think it'll work :)

thinking more about it, you don't even really need the query on a query in this case, you can just set a count, but that whole query on a query thing is amazing to me!

Posted: Tue Nov 25, 2014 6:58 pm
by luke
does anyone know how to do something like they do in flickr to display images?

Image

they change the height so they can fit them in perfectly across the width of the screen, its really nice, but i don't know how they've done the calculations for the height based on the width of the images and the space available to them. its even responsive down to a certain size.

Posted: Sat Nov 29, 2014 1:51 pm
by Brown Sauce
Might be using CSS3 object-fit and object-position properties.

https://dev.opera.com/articles/css3-obj ... -position/

And or with cropping ..

https://css-tricks.com/crop-top/

Posted: Sun Nov 30, 2014 2:30 am
by faceless
There are wordpress plugins that do that sort of thing. I say that having just made a pretty nice new site for a charity though... and realised just how much you can do if you pay for the right theme and associated page designers.

Posted: Sun Nov 30, 2014 7:31 pm
by luke
i think there must be some server side stuff going on to work things out initially, as well as then css and jquery client side

the height of the rows are all different, in the example i'm looking at theres all sorts; 269, 287, 306, 318, 321, 330 etc, and these are set initially in the html, then changed with jquery to handle the responsiveness to resize things or move images down a row

its really well done, but i've no idea how to go about achieving it