CUTCODEDOWN
Minimalist Semantic Markup

Welcome Guest
Please Login or Register

If you have registered but not recieved your activation e-mail in a reasonable amount of time, or have issues with using the registration form, please use our Contact Form for assistance. Include both your username and the e-mail you tried to register with.

Recent Posts

Pages: 1 [2] 3 4 ... 10
11
PHP / Re: Using server side to detect mobile agent
« Last post by durangod on 25 Mar 2024, 11:12:14 am »
thanks coothead and hello.  the problem is that i cant figure out their css file structure and how its parsed.  So many css files with both name.css and name.min.css and not same code.  i tried some small changes for media n no change.

Thats why doing so serverside seemed like the solution.
12
PHP / Re: Using server side to detect mobile agent
« Last post by coothead on 25 Mar 2024, 10:30:14 am »
Hi there durangod,

this can be done simply with CSS and will work for all devices.

HTML
Code: [Select]

 <h1>Image example</h1>

 <img src="https://dummyimage.com/960x400/000/fff" alt="image example">


CSS
Code: [Select]

body {
   background-color: #f9f9f9;
   font: normal 1em / 1.5  arial, helvetica, sans-serif;
 }
h1 {
   font-size: 1.5em;
   font-weight: normal;
   text-align: center;
 }
img {
   display: block;
   width: 98%;
   max-width: 60em;
   margin: auto;
 }


coothead
13
PHP / Using server side to detect mobile agent
« Last post by durangod on 25 Mar 2024, 09:35:09 am »
Hi, 

I know this is a userside (probably js and css) job but i dont have the js code for this.  Is it ok to use server side php code for this purpose.

I need to show a smaller version of the image if its mobile and the css for this script is minified and uses php functions to decide the css values, i dont want to mess with all that core code stuff.   

I am making some small image changes to the mantis bug tracker script. So i just added this in their config file.

Code: [Select]
//check for android
$ua = strtolower($_SERVER['HTTP_USER_AGENT']);
if(strpos($ua,'android') !== false && strpos($ua,'mobile') !== false)
{
    // smaller mobile size
    $g_logo_image  = 'images/mobile_logo.png';
   
}else{
   
      //full size web version
      $g_logo_image = 'images/full_logo.png';
     
     }


Thanks
14
Quote
Are you talking about how attr() returns string, but counter-reset / counter-set requires a number or integer? (I still don't know why -set and -reset are two separate declarations, they operate identically)

If so, yeah that's a pain. And yes, the only "real' workaround right now is to set a custom property in an inline-style as you said... which... yeah. Kinda dumb... but at least you're conveying information about what it is, not what it's supposed to look like. A painfully small consolation...

Yes, exactly! Although I'm now confused about the actual underlying cause of attr() not working for this particular use case. I thought that it was because the attr() function is only currently implemented for "content" properties, ala "content: attr(whatever);" (this is what the MDN docs state, at least), but you're saying that the real problem here is type mismatch and the lack of support for type casting? I guess this question could be reformulated in a more constructive way: is there any other property apart from "content" for which the string-typed attr() function would work in modern browsers?

Quote
Also though, what type of legal content would have inline lists? Are you talking sentence/sectional notation akin to that used in scripture?

I'm not exactly sure to be honest. The actual text goes something like this: "We may collect personal data about: a) this, and b) that, and c) whatever else we desire." It looks like a semantic list to me, but, as you correctly guessed, there is a bit of a language barrier and I know next to nothing about intricacies of English legal texts structuring. Is there some sort of rule-of-thumb that can be used to differentiate between actual semantic lists and the sectional notation from your example?

On a related note, another type of content I come across fairly regularly is a paragraph of text that ends with a semicolon and is followed a list of things that paragraph is about. I always struggle to find the correct markup for such content. The obvious would be:

Code: [Select]
<p>Some rather lengthy paragraph that is related to the following list of things:</p>
<ul>
  <li>This</li>
  <li>That</li>
</ul>

But the text inside the <p></p> would not be a complete thought without the list though, so it shouldn't be a <p> then?
15
Also though, what type of legal content would have inline lists? Are you talking sentence/sectional notation akin to that used in scripture?

If so, lists might be the wrong tags entirely. In fact, the correct tag might be an anchor with the number inside it and a hash link. That's how I'd handle a biblical passage like Matthew 6 : 5-6

Code: [Select]
<p>
  <a href="#matthew_6_5">5</a>And when you pray, do not be like the hypocrites, for they love to pray standing in the synagogues and on the street corners to be seen by others. Truly I tell you, they have received their reward in full.  <a href="#matthew_6_6">6</a> But when you pray, go into your room, close the door and pray to your Father, who is unseen. Then your Father, who sees what is done in secret, will reward you.
</p>

Grammatically it's still a paragraph, it just has anchors/notations for each verse. I've seen people try to use inline lists for that, and it's an utter shit-show.

And using hash link anchors has the bonus those subsections are hotlinkable.
16
Sorry, I don't know if it was language barrier, or terminology differences, but I really wasn't picking up what you were putting down. I think that you were talking about list-counter as if it were a CSS counter is where I got lost in the forest. CSS doesn't see nor does it even care about the value used automatically on LI.

The code sample helps. Always does... though I'm still not sure I'm following along 100% on what you even mean.

Are you talking about how attr() returns string, but counter-reset / counter-set requires a number or integer? (I still don't know why -set and -reset are two separate declarations, they operate identically)

If so, yeah that's a pain. And yes, the only "real' workaround right now is to set a custom property in an inline-style as you said... which... yeah. Kinda dumb... but at least you're conveying information about what it is, not what it's supposed to look like. A painfully small consolation...

Honestly, that inline-style in your initial post should have told me what you were talking about... but without the markup it applies to it just turned to gibberish to my brain.

Thing is the fix is allegedly coming, but honestly it's something that shouldn't NEED to be fixed. I mean if the JavaScript engine in the browser can handle "String 3" and "Number 3" being the same thing for loose assignment, what's CSS' gripe?

But the syntax that may someday work if it ever leaves the experimental is:

counter-reset: myListItem attr(start integer);
and/or
counter-reset: myListItem attr(start number);

As to which of those will -- someday maybe? -- actually fix this "problem"... your guess is as good as mine.

Sadly public browser support is bupkis, the places it is supported locked away behind configuration flags.
https://caniuse.com/mdn-css_types_attr_type-or-unit

Is that what you're referring to?

Also I hear you on how they keep implementing syntactic sugar like the derpy 'nesting" trash or endless pointless artsy-fartsy colourspaces no legitimate website should have any need of... but are dragging their heels on stuff that might actually do things like make formatting and creating layouts easier.

You know, it's kind of funny. CSS is the perfect example of where typecasting is an enemy, not a friend.
17
Quote
The WHAT now? That's utter gibberish. It increments when you counter-increment which can be done on any element -- or not done for that matter. In no way, shape, or form is it tied to the parent tag or child where you're incrementing it.

Do you even read the posts you reply to? I'm not talking about ANY counter, I'm talking about the SPECIAL BUILT-IN 'list-item' counter. https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_counter_styles/Using_CSS_counters#list_item_counters Literally the first sentence in the docs. You don't need to counter-increment the built-in counter because IT DOES THAT AUTOMATICALLY. Now do you know HOW it does that? Well it does that by incrementing not on just any tag and not on just any <li> tag, but only on <li> tags that HAVE DISPLAY: LIST-ITEM APPLIED TO THEM. Which means that if those <li>s have their display properties set to anything else, like inline or flex or whatever, THAT COUNTER IS NOT INCREMENTED.

Quote
Do you have example code of something akin to what you're talking about, because it really does sound like you don't even know how CSS counters work. Or are missing some essential part of actually leveraging selectors.

Knock yourself out:

HTML:
Code: [Select]
<ol start="3" class="inline">
  <li>List item 1</li>
  <li>List item 2</li>
  <li>List item 3</li>
</ol>

<ol class="inline">
  <li>List item 1</li>
  <li>List item 2</li>
  <li>List item 3</li>
</ol>

<ol start="3">
  <li>List item 1</li>
  <li>List item 2</li>
  <li>List item 3</li>
</ol>

<ol>
  <li>List item 1</li>
  <li>List item 2</li>
  <li>List item 3</li>
</ol>

CSS:
Code: [Select]
ol.inline, ol.inline li {
  display: inline;
}

Now let's see your solution for adding ::before counters for these lists, so that the "start" attribute, if present, is also respected. Let's also see how well it goes for you to use the built-in "list-item" counter.

Man, as a long-time reader of yours, I'll say this: you're really smart most of the time and I've learned and continue to learn a great deal from you, but sometimes you really just talk out of your arse.
18
Hosting and Server Management / Re: Order, Deny syntax deprecated
« Last post by durangod on 25 Mar 2024, 01:58:52 am »
I try not to display any output but errors and i am even trying to convert that design to only do so in the html file.   But i really like your process for that... :)  expecially the 404 use.   
19
PHP / Re: Why can't i find any project written in native code
« Last post by durangod on 25 Mar 2024, 01:51:05 am »
OK DS so what it sounds like you are saying is that none of the thousands of other developers (that believe and lead by example when building projects) build modules to help others in native code?    I find that hard to believe. 

I am not against working, i do very little else but sleep and have my nose in code from what seems like a lifetime.   But i just find it hard to believe that there are no projects like bug trackers, gallery modules, chat modules, video modules, or other social modules from any of those believers on the market.   

Does that mean when the wheel hits the road, they  too lay down with the sheep?

Sorry to say this but 95% of your last reply had nothing to do with the topic and none of it explained why senior and non senior people in the industry like yourself provide nothing on the market from native code.  If you really don't know then say you really don't know.   You hang with these people right, you rub elbows with them, have you ever asked them why?

Someone has to have something, you cant tell me there is absolutely noone doing anything at all.  If that is the case then who are they teaching and what are they teaching them, just to preach and not do?
20
Hosting and Server Management / Re: Order, Deny syntax deprecated
« Last post by Jason Knight on 24 Mar 2024, 09:54:10 pm »
Classic example of why I think the whole allow,deny garbage was needlessly complex and convoluted, and why the people who go "wah wah but security in my subdirectories" wouldn't know actual security if it bit them in the ass.

My "one index" approach effectively negating that particular worry, my not allowing sub .php files to output anything client-side if called directly further making it silly, and if I REALLY needed to do it, I'd create a 404.php in the offending directory and use a rewriterule to redirect all requests to it.

Instead of dicking around phpBB style like it's still 2000 and PHP 4 still needed to be supported.
Pages: 1 [2] 3 4 ... 10
SMF spam blocked by CleanTalk

Advertisement