Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!

pipes! posted:

What does your viewport tag look like?

<meta name="viewport" content="width=device-width,max-scale=1,user-scalable=0"> We want something where you click on an image and then can zoom, not the whole time. I tried temporarily removing/editing the tag via JavaScript but it had no effect.

Adbot
ADBOT LOVES YOU

pipes!
Jul 10, 2001
Nap Ghost

The Merkinman posted:

<meta name="viewport" content="width=device-width,max-scale=1,user-scalable=0"> We want something where you click on an image and then can zoom, not the whole time. I tried temporarily removing/editing the tag via JavaScript but it had no effect.

I'd say that unless there's some nuanced technical criteria preventing it, always use <meta name="viewport" content="width=device-width, initial-scale=1">. Restricting pinch to zoom is a major accessibility no-no, and it'll allow you to have sitewide, content and device-independent zooming without any JS dependency.

pipes! fucked around with this message at 21:32 on Oct 10, 2013

Ghostlight
Sep 25, 2009

maybe for one second you can pause; try to step into another person's perspective, and understand that a watermelon is cursing me



fidel sarcastro posted:

You could pretty easily make a PHP (or whatever language your host supports, really) template that loops through your array and creates the html for each item. You probably don't even need to write a function, honestly. How are you getting the data into the array in the first place?
They're static, so I was just passing them as an array to the function and then thought I should ask if performance-wise that's going to be an issue down the road.

Basically I have a page full of these
code:
<?php PublicationDivs(array(
	'img'=>'',
	'link'=>'URL',
	'title'=>'PUBLICATION',
	'blurb'=>'DESCRIPTION',
	'author'=>'AUTHOR',
	'date'=>'PUBLISHED'),1); ?>
And at the top I have a templating function so that I can change the presentation structure during design phase easily
code:
function PublicationDivs($bits, $place) {
	echo '<div class="publicationscontainer"'; if($place == 1) { echo ' style="clear: left;"'; } echo '>';
	echo '<div class="drip"><img src="/images/publications/'.$bits['img'].'.jpg" width="150px" height="106px"></div>';
	echo '<div class="pubtext">'; 
	if($bits['link']!=='') { echo '<a href="'.$bits['link'].'">'; }
	echo '<h2>'.$bits['title']; if($bits['link']!=='') { echo '&nbsp;&gt;</h2></a>'; } else { echo '</h2>'; }
	echo '<p>'.$bits['blurb'].'</p>';
	echo '<p>'.$bits['author'].'</p>';
	echo '<p>'.$bits['date'].'</p>';
	echo '</div>'; }
I'm just curious how bad it would be if I went "gently caress it, ship it" and published it like that instead of reducing it back to static HTML once the design committee stopped changing their minds.

Oh My Science posted:

You could skip all the PHP and use http://jekyllrb.com/
I'm vaguely aware of Ruby existing but I have no idea what this is and it's kind of frightening. I did say I was unskilled!

jony neuemonic
Nov 13, 2009

Ghostlight posted:

They're static, so I was just passing them as an array to the function and then thought I should ask if performance-wise that's going to be an issue down the road.

I doubt if you'd have any issues, that page sounds simple enough that performance isn't going to be a problem. Bias up-front: I really don't like echoing HTML out from PHP, so if you're going to stick with PHP I'd be more inclined to do something like this:

(Syntax might be off, but you should get the general idea).

php:
<?php

$publications = array(
    => array(
        'img'=>'',
        'link'=>'URL',
        'title'=>'PUBLICATION',
        'blurb'=>'DESCRIPTION',
        'author'=>'AUTHOR',
        'date'=>'PUBLISHED')
    ),
    => array( etcetcetc.
);

?>

Then under all that or in a separate included file:

php:
<?php foreach ($publications as $publication) : ?>
    <div class="publicationscontainer">

        <div class="drip"><img src="/images/publications/<?= $publication['img']; ?>"></div>

        <div class="pubtext">
            <?php if ($publication['link'] !== '') : ?>
                <h2><a href="<?= $publication['link']; ?>"><?= $publication['title']; ?></a></h2>
            <?php else : ?>
                <h2><?= $publication['title']; ?></h2>
            <?php endif; ?>

            <p><?= $publication['blurb']; ?></p>
            etc. etc. etc.
        </div>
    </div>
<?php endforeach; ?>

That way your data and your output are totally separate: the template doesn't care how the data gets into that array, just that the array exists. If things change down the road you don't need to scrap everything.

That being said, Jekyll is ideal for this sort of thing and you should definitely consider it if your system can run Ruby scripts. It generates a static website, so you don't need to worry about your host having Ruby available, and it means you can write your publication entires in Markdown instead of wrestling with PHP arrays. There's a pretty in-depth tutorial on it here.

jony neuemonic fucked around with this message at 00:52 on Oct 11, 2013

DholmbladRU
May 4, 2006
Having some problems with a div on a webpage. In chrome when the browser page is re-sized the div overlaps others and par of it is hidden. In IE the height:auto works as I would expect it and nothing gets overlapped. Currently I have tried;

height: auto
*causes div to overlap below

height: 510px
*does not seem to re-size the div
code:
    <div class=parent>
     <div class=child1>
    overlapping
     </div>
     <div class=child2>
    being overlapped
     </div>
    </div>
The problem is a little more complicated than this simple scenario I am outlining. This is actually the MicroStrategy BI application which has a ton of js and a ton of css affecting the page. So I am attempting to alter these pages. Attached is a jsfiddle of the closes I could get to reproducing the issue. Unfortunately I was unable to simplify the issue too far down or I wouldn't reproduce it.

But as you can see the div with ID of List is the one which is overlapping the below div. This behavior does not happen in IE but only in chrome and firefox.

http://jsfiddle.net/MF6fR/1/

Long story short, I need the div with ID of list to not overlapp the below div

kedo
Nov 27, 2007

Alright I'm being forced to dive into a little more backend work than I've done previously, so I'm looking for some recommendations.

I have a restaurant client who has a catering request form on their site. Previously it was just dumping everything into an email and sending it off, but now the client would like it to dump into a database instead (they're getting more requests than they can keep up with w/ email). The form itself is designed to be super-pretty and interactive, so using something like Formstack or Wufoo is unfortunately not an option because they cannot be customized as much as we'd like.

Any suggestions? Site is built on WordPress, but I don't really care about using a plugin. I feel like what I'm looking for is more or less a pretty simple PHP widget with a nice gui that ties into an SQL database (or something), but I'm not entirely sure where to start. A secure login, ability to sort entries, export a CVS, etc. would all be nice options.

Ideas?

e: Also, I should say that an easy to use gui is pretty important – the client isn't the sort who'll want to muck around with some really developerly, confusing interface.

kedo fucked around with this message at 22:41 on Oct 11, 2013

hmm yes
Dec 2, 2000
College Slice
Build the form in Gravity Forms. Saves to the WP back-end, can be exported to CSV, can render the form fields without any styling so you can do whatever you want, conditional logic in response to field selection, etc. It's a great little plugin.

kedo
Nov 27, 2007

Looks like that might do the trick! Thanks!

And for my own edification, I'd also be interested in any non-WP solutions for future projects.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

kedo posted:

Looks like that might do the trick! Thanks!

And for my own edification, I'd also be interested in any non-WP solutions for future projects.

Well, it's a very simple thing to whip up in any of the popular web frameworks out there (Rails, Flask, Django, etc)...but you have to know the framework to do it.

It's worth the effort to learn any of them...IIRC, Flask has the simplest getting started tutorial.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



I'm trying to find a way, using just CSS, to do a layout like this with a video element.


The black box represents the containing element, not necessarily the viewport. The little red box is an overlay that scales to the video's size while maintaining position relative to the edges, so I'm assuming I need a wrapper div for the video that sticks to the edges of the video but somehow still allows the video to expand to fill just the narrowest axis in order to maintain the aspect ratio. In order to do that I guess I'd need some spacer elements? Hell, is this even possible without biting the bullet and doing the layout in JS?

Of note, only browsers that support video are of concern, so fun stuff like transforms are possible, but I've only figured out how to center it vertically by abusing transforms only to watch it get cut off at the top and bottom as soon as I make the container too small vertically.

Sorry I don't have any code because I've just been loving around in Chrome all day because making a clean repro of the original layout in jsfiddle is a pain in the dick.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
This is amazing: http://baconipsum.com/

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!

In that same vein http://dummyimage.com/ or http://lorempixel.com/.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

I'm partial to this one:

http://slipsum.com/

Fayez Butts
Aug 24, 2006

http://placekitten.com/ and http://http://bullshitipsum.com/ motherfuckers.

Depressing Box
Jun 27, 2010

Half-price sideshow.

Munkeymon posted:

I'm trying to find a way, using just CSS, to do a layout like this with a video element.


Would something like this work?

Cthulhuite
Mar 22, 2007

Shwmae!
So, i'm trying to build a simple site for an RPG that some friends and I play, and my coding skills aren't good enough for me to get everything they want in one package that i've done myself, so i'm trying to cobble together something from a bunch of different, ready-made frameworks. First, some sort of blog thing on the front page, so a CMS for that. A forum, i've gone with phpBB because I know that best, and then a character database on the backend that can be managed. Ideally, I would like a single logon to manage it all, and I can tie my character database into the phpBB stuff without much problem probably, but I was wondering if there's some sort of php based blogging tool/cms webpage thing that's easy to play around with?

Or am I going about this all wrong, and there's actually an incredibly simple way to do it all in one package? (tell me this is true)

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!
Maybe I'm overthinking this, but when making an SEO friendly URL how do you distinguish between a two word phrase and a list of two separate things?
For example: "kitchen utensils" and "pots, pans, & appliances".
If the former converted to /kitchen-utensils and the latter /pots-pans-and-appliances; how does Google know the first is two words that go together where as the second is a list?

pipes!
Jul 10, 2001
Nap Ghost

Cthulhuite posted:

Or am I going about this all wrong, and there's actually an incredibly simple way to do it all in one package? (tell me this is true)

Would Obsidial Portal fit the bill?

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

Blinkz0rz posted:

I'm partial to this one:

http://slipsum.com/

http://www.boganipsum.com is not bad either if you want an Aussie slant.

fuf
Sep 12, 2004

haha
It drives me crazy how often I get confused by the same loving issue: how to centre content. I never know if I'm doing it right.

If I want to centre a row of list items, is this enough?

code:
ul {
    text-align:center;
}

li {
    display:inline;
}
Or is there something else I need to watch out for?

sim
Sep 24, 2003

The Merkinman posted:

Maybe I'm overthinking this, but when making an SEO friendly URL how do you distinguish between a two word phrase and a list of two separate things?
For example: "kitchen utensils" and "pots, pans, & appliances".
If the former converted to /kitchen-utensils and the latter /pots-pans-and-appliances; how does Google know the first is two words that go together where as the second is a list?

I don't think Google cares whether the words are a list or a phrase, since they both "go together". In either case, you're targeting a keyword phrase.

DholmbladRU
May 4, 2006
Having some problems with a div on a webpage. In chrome when the browser page is re-sized the div overlaps others and par of it is hidden. In IE the height:auto works as I would expect it and nothing gets overlapped. Currently I have tried;

height: auto *causes div to overlap below

height: 510px *does not seem to re-size the div

code:
<div class=parent>
 <div class=child1>
overlapping
 </div>
 <div class=child2>
being overlapped
 </div>
</div>

The problem is a little more complicated than this simple scenario I am outlining. This is actually the MicroStrategy BI application which has a ton of js and a ton of css affecting the page. So I am attempting to alter these pages. Attached is a jsfiddle of the closes I could get to reproducing the issue. Unfortunately I was unable to simplify the issue too far down or I wouldn't reproduce it.

But as you can see the div with ID of List is the one which is overlapping the below div. This behavior does not happen in IE but only in chrome and firefox.

http://jsfiddle.net/MF6fR/3/

Long story short, I need the div with ID of list to not overlapp the below div

DholmbladRU fucked around with this message at 15:37 on Oct 14, 2013

kedo
Nov 27, 2007

DholmbladRU posted:

Having some problems with a div on a webpage. In chrome when the browser page is re-sized the div overlaps others and par of it is hidden. In IE the height:auto works as I would expect it and nothing gets overlapped. Currently I have tried;

height: auto *causes div to overlap below

height: 510px *does not seem to re-size the div

code:
<div class=parent>
 <div class=child1>
overlapping
 </div>
 <div class=child2>
being overlapped
 </div>
</div>

The problem is a little more complicated than this simple scenario I am outlining. This is actually the MicroStrategy BI application which has a ton of js and a ton of css affecting the page. So I am attempting to alter these pages. Attached is a jsfiddle of the closes I could get to reproducing the issue. Unfortunately I was unable to simplify the issue too far down or I wouldn't reproduce it.

But as you can see the div with ID of List is the one which is overlapping the below div. This behavior does not happen in IE but only in chrome and firefox.

http://jsfiddle.net/MF6fR/1/

Long story short, I need the div with ID of list to not overlapp the below div

Look for set heights. On <div id="accordion_AccordionTabManagerStyle"> you have a height that looks like it's being set dynamically somehow of 798.2727279663086px. This makes it overlap the content. Maybe try setting heights to auto, or using a clearfix after the content?

I'd bet you have other heights set elsewhere that are making the parent container smaller than the child content, but honestly I'm not going to dig through all that code to find it. At least clean it up and remove broken images and unnecessary stuff, no one is going to wade through all that unless they're just really, really bored.

DholmbladRU
May 4, 2006
I apologize let me clean that up.

excidium
Oct 24, 2004

Tambahawk Soars

DholmbladRU posted:

I apologize let me clean that up.

Basically just get rid of all the defined heights (easier said then done since it looks like it's calculated elsewhere to come up with those values) and remove the position absolute on the bottom links.

DholmbladRU
May 4, 2006
Cleaned it up. Yeah I think when some of the divs are set to auto, there is javascript which alters the height value which is why you see 677.777777777777777777777777777777

Would something like this help if placed in-between the divs?


code:
<div style="clear:both;"></div>
Changing

code:
#accordion_AccordionTabManagerStyle{
height: auto !important;
}

#list{ 
height: 500px !important; 
overflow: scroll !important
}
The above may work, let me test it out. thanks for making my clean up my code....

DholmbladRU fucked around with this message at 15:50 on Oct 14, 2013

kedo
Nov 27, 2007

I sort of guessed those heights were being added by JS due to the crazy numbers. Putting a clear div in there probably won't do anything because it's not a clearing issue, it's a height issue. Your height: auto !important; may or may not work, but that's a sort of nasty solution anyways. The cleaner way of doing it would be to stop the JS from setting heights.

DholmbladRU
May 4, 2006
Yeah I guess that will work. I just need to figure out how o resize #list based on window height because its getting overlapped when I make the browser window much smaller.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.




That does what I have now (repro: http://jsfiddle.net/TGg94/), which works great until I want to overlay something over a specific part of the video that's not right in the center using just CSS which I want because I want it to continue to resize nicely without writing a bunch of JS. Plus, users would have to know to tell it to redraw when they resize its container and, in general, I'd rather not rely on other people to remember to do something.

kedo
Nov 27, 2007

Munkeymon posted:

That does what I have now (repro: http://jsfiddle.net/TGg94/), which works great until I want to overlay something over a specific part of the video that's not right in the center using just CSS which I want because I want it to continue to resize nicely without writing a bunch of JS. Plus, users would have to know to tell it to redraw when they resize its container and, in general, I'd rather not rely on other people to remember to do something.

http://jsfiddle.net/dEcZ7/ Ka-pow.

e: You don't even need to use the table-cell trick if you don't want for vertically centering. Point is just wrap the video and the overlaid element in an additional container, set position: relative; on the container, then absolutely position the overlay.

kedo fucked around with this message at 18:15 on Oct 14, 2013

DholmbladRU
May 4, 2006

kedo posted:

I sort of guessed those heights were being added by JS due to the crazy numbers. Putting a clear div in there probably won't do anything because it's not a clearing issue, it's a height issue. Your height: auto !important; may or may not work, but that's a sort of nasty solution anyways. The cleaner way of doing it would be to stop the JS from setting heights.

unfortunately finding that piece of code would be like looking through 1000 js files with non descript variables.... Maybe I can employ some sort of jquery function which will auto resize this div by changing the attr('style') parameter value and set the height through that.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



kedo posted:

http://jsfiddle.net/dEcZ7/ Ka-pow.

e: You don't even need to use the table-cell trick if you don't want for vertically centering. Point is just wrap the video and the overlaid element in an additional container, set position: relative; on the container, then absolutely position the overlay.

Thanks - that's much closer than I got using table layout trickery, but I was lazy about getting my repro right and it doesn't represent the behavior I need for when the container is vertically smaller than the video element. It's fixed here: http://jsfiddle.net/TGg94/1/ I'll try to get yours working from here http://jsfiddle.net/dEcZ7/2/ but I just had another idea that would require some JS setup, but there's a bunch of that going on anyway in the real thing, so it wouldn't be a huge deal.

Uziel
Jun 28, 2004

Ask me about losing 200lbs, and becoming the Viking God of W&W.
I'm trying to get a Bootstrap 3 fixed footer to work using this code:
http://pastebin.com/7rs6PEmZ

However, if there is a large amount of content, and you change the browser window size, the footer covers up some of the page content.

The author of the tutorial made this video (https://www.youtube.com/watch?v=KxmLNctBi10) and someone noticed that and commented, and they said it would be fixed soon.

How would I go about fixing it now?

Uziel fucked around with this message at 14:02 on Oct 15, 2013

fuf
Sep 12, 2004

haha

Uziel posted:

I'm trying to get a Bootstrap 3 sticky footer to work using this code:
http://pastebin.com/7rs6PEmZ

Did you add padding to the bottom of <body>?

From the bootstrap docs:

quote:

The fixed navbar will overlay your other content, unless you add padding to the bottom of the <body>. Try out your own values or use our snippet below. Tip: By default, the navbar is 50px high.

body { padding-bottom: 70px; }

Make sure to include this after the core Bootstrap CSS.

Uziel
Jun 28, 2004

Ask me about losing 200lbs, and becoming the Viking God of W&W.

fuf posted:

Did you add padding to the bottom of <body>?

From the bootstrap docs:
Well, that was easy. Not sure how I missed that. Thank you!

Mortanis
Dec 28, 2005

It's your father's lightsaber. This is the weapon of a Jedi Knight.
College Slice
I hope this isn't the wrong thread - I didn't see any sort of Web Programming thread specifically, and this isn't language specific. I've worked at a web design company doing custom coded websites for over a decade. We do WordPress, but for anything custom that doesn't fit that box, we do ColdFusion and MS SQL. It's a hold-over from the employee that started things in the 90's, and there's just hundreds of legacy sites at this point. The whole business is wrapped around it - maintaining these poorly written top-to-bottom evaluating ColdFusion pages; running our own servers because no one in their right mind does ColdFusion hosting, finding and training the small handful of programmers throughout the years to help out. Enough is enough and I've finally convinced my boss to split from it all. WordPress has been good, but he doesn't want to lose the custom-coded stuff we do for many clients, so he wants to transition to a new language. The requirements are mostly to be the opposite of ColdFusion - ease of finding people that know the language, resources available online, decent frameworks, and ease of hosting elsewhere if we trash our servers.

He's settled on PHP. Fine. I know some C# (worked in some ASP.NET MVC), a small smattering of PHP from working with WordPress and custom plugins, so I set about working on learning some more PHP.

Except I'm seeing a lot of people in threads like the Horrors of Coding deriding PHP as a choice. I get that there's no one true language, but it seems pretty universally looked down on. If not PHP, what meets his requirements? He certainly isn't wanting to be locked into another language where it's hard to find people to bring in-house to pick up the ball. PHP is plentiful, but plentiful doesn't mean good. Why is PHP so looked down on, and is the next alternative down the line ASP.NET? The type of projects we're talking about aren't always simple CRUD sites, but a wide variety of fairly complex business logic to sometimes integrating with off site systems and the like. Flexible and varied.

I've been stuck on ColdFusion so long that I have no idea why something like PHP wouldn't be a good alternative I guess, considering how miserable CF has been to live with.

jusion
Jan 24, 2007


Mortanis posted:

Except I'm seeing a lot of people in threads like the Horrors of Coding deriding PHP as a choice. I get that there's no one true language, but it seems pretty universally looked down on. If not PHP, what meets his requirements? He certainly isn't wanting to be locked into another language where it's hard to find people to bring in-house to pick up the ball. PHP is plentiful, but plentiful doesn't mean good. Why is PHP so looked down on, and is the next alternative down the line ASP.NET? The type of projects we're talking about aren't always simple CRUD sites, but a wide variety of fairly complex business logic to sometimes integrating with off site systems and the like. Flexible and varied.
PHP is "fine." It just has a ton of cruft, and it is very, very easy to craft dangerous code. It's also very fashionable to beat up on PHP.
.NET is very expensive. Thus, most people prefer Ruby (Rails) / Python (Django / Flask), etc.

daggerdragon
Jan 22, 2006

My titan engine can kick your titan engine's ass.

jusion posted:

PHP is "fine." It just has a ton of cruft, and it is very, very easy to craft dangerous code. It's also very fashionable to beat up on PHP.
.NET is very expensive. Thus, most people prefer Ruby (Rails) / Python (Django / Flask), etc.

Compared to ColdFusion, PHP is a godsend. PHP developers are a dime a dozen, so finding the good coders are what you need to watch out for.

Oh My Science
Dec 29, 2008
I think this quote is relevant:

Sandi Metz posted:

And so, in order for my data to live into the next generation of technology, what I want to do is have most of my business logic not be wrapped up in a framework... at first, all I needed to do was put up a web app. But then as the business logic became a bigger and bigger part of that app, it was important for me to preserve my investment in that business logic by having it be independent of framework.

Like I said, I love Rails. I’ve used it used everyday. Well, not really everyday but I use it a lot that I don’t want to be stuck like Rails isn’t the only framework out there. If you look ahead in 20 years, are we all going to be doing Rails?

Ruby Rogues Podcast - Practical Object-Oriented Design in Ruby with Sandi Metz

This podcast episode was really interesting and I encourage everyone to listen. It doesn't really help you choose a framework (rails is awesome) but it will make you think.

Adbot
ADBOT LOVES YOU

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

As I've posted in this thread many times, you can write fine code in PHP.

It's just that there's no reason to pick PHP outside of external factors like it's what your boss wants, your infrastructure only supports it, you want to write WP plugins, etc.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply