|
#1
Jun 15, 2009, 03:18 PM
|
|
|
149 posts · Apr 2009
Dev Env't: XP Pro SP3, IIS 5.1, MySQL 5.1, PHP 5.2.x, WP 2.7.1, Atahualpa 3.3.3, IE 7, FF 3.0.x
|
|
These are undoubtedly newbie questions but I've been digging through PHP, CSS and HTML references trying to figure out what:
1. the darn "%" is; for but one example: %date('F js, Y') %
2. and, does it make any difference if it is entered as: % date('F js, Y') % ... or ... %date('F js, Y')% ... or as above in #1. The placement of the % seems to have no significance, as long as there are two of them, but I'm not sure.
3. finally, ditto for the pipe (|) symbol. In UNIX it is for redirection but I don't believe that is the case here. I did find one reference (finally) buried on a PHP site that seemed to suggest this was an OR operator, but that doesn't entirely make sense in the Post Info Items area.
If someone could give me a brief tutorial on these two symbols, so that when I'm editing the info items I don't inadvertently mess it up by not understanding the syntax, I'd appreciate it.
Thanks in advance.
|
#2
Jun 16, 2009, 01:24 PM
|
|
|
149 posts · Apr 2009
Dev Env't: XP Pro SP3, IIS 5.1, MySQL 5.1, PHP 5.2.x, WP 2.7.1, Atahualpa 3.3.3, IE 7, FF 3.0.x
|
|
Update: as a "duhhhh", I finally "figured out" that the pipe symbol, in this case, is a visual divider ... very cleverly coded so that it shows up only when appropriate. Sometimes it takes a while to notice the obvious.
However.
I still can't track down data on the below mentioned sites on the percent pair: %<whatever>%. Let alone, formatting rules for them.
Anyone?
Thanks in advance.
|
#3
Jun 17, 2009, 05:29 AM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
I believe the % pairs are place holders to indicate an option to be changed, i.e.
Lets say you wanted to write some code to parse a line of VARIABLE text and substitute some info that the user gives you. The input text could be: 'One day I want to own a %aniaml%' or 'I have a %animal% as a pet'. If you have a variable $animal='elephant', the code sould scan each of the different text lines, outputting each character until it came to a % sign, it would look for the next one, and if it finds it, it would look to see what was in between (with the %), in this case it would have '%animal%' and it would substitute 'elephant' and then continue processing the remaining text.
Does this help?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#4
Jun 17, 2009, 11:39 AM
|
|
|
149 posts · Apr 2009
Dev Env't: XP Pro SP3, IIS 5.1, MySQL 5.1, PHP 5.2.x, WP 2.7.1, Atahualpa 3.3.3, IE 7, FF 3.0.x
|
|
Juggledad,
Thank you! Perfect answer, i.e. as soon as I read it I went "Of course!".
Some of the syntax of CSS, PHP, and so on, is kind of hard to track down because you can't search on %, or whatever, and get any kind of meaningful answer.
Yet another that got me was trying to clarigy the meaning and purpose of the stand-alone "a", in the CSS insert from the link: http://forum.bytesforall.com/showthread.php?t=2068.
I'm still not sure I have it exactly right (although Shedhed has tried to explain it to me in an off-line e-mail) but it seems to represent a link in its default or neutral state ex: "#breadcrumb a {display: inline; ...". But how the heck do you find its definition? Even with Shedhed's explanation I still can't find a clean reference on it (tried w3cshcools, etc., half a dozen ways and no luck).
Another example is having to match CSS pound signs (#'s) to php ID declarations and CSS periods (.) with php CLASS declarations ... as I just "discovered" with everyone's help by way of solving the issue in the above thread.
Which is a long and round about way of saying thank you for answering such questions, it is a very real enabler that helps us newbies figure out what the heck we're doing.
|
#5
Jun 18, 2009, 06:14 AM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
Let me see if I can give you a breif expainition.
In each of the HTML elements (<body>, <div>, <h1>, <p>, <ul>. <li>, <a> etc) you can add eithor a 'class=' or an 'id='. CLASS can be used on many elements, but ID is used just for one element on the page. Using an ID will overlay the styles of a CLASS if they both reference the same ELEMENT ( the <div>, <a> etc)
In CSS you need to identify what class/id you are referencing. The CLASS="xxx" uses the period ('.') as it's identifier, while the ID="yyy" uses the pound sign ("#").
Since a class can be used on many elements, if the style you are appling only effects one element, you need to identify it. Let's say you have a <p class="intro"> and <a href="#" class="intro">. If you just used the .intro {color: red;} it would effect them both. If you used a.intro {color: red;} you would only effect the <a href="#" class="intro">
and there are decendent selectors (how to effect the <a. that is in an <li> that is in a <div>) universal selectors ect. I good book I found is 'Sams Teach Yourself CSS in 10 Minutes'
Hope this helps
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#6
Jun 18, 2009, 12:14 PM
|
|
|
149 posts · Apr 2009
Dev Env't: XP Pro SP3, IIS 5.1, MySQL 5.1, PHP 5.2.x, WP 2.7.1, Atahualpa 3.3.3, IE 7, FF 3.0.x
|
|
This definitely helps. Thank you. And. Time to go on amazon and buy a book.
|
Thread Tools |
Search this Thread |
|
|
Display Modes |
Linear Mode
|
|