CVS edit link for Mehrpadin
I'm a freelance Web designer & Web developer, used to be a Delphi programmer from 99 to around 2003. I'm a SEO expert too, and I love Drupal, and always recommend it to well everyone! actually I create one or two Drupal themes every month so I'm Drupal geek? probably... anyway, I've designed a premium theme called mpFREE and tried to submit it here but my CVS account request was rejected, now again after weeks I got some time to give it a second try, and here's it ... (yes in a bit weird way! wow)
What's the nature of your CVS account request?
- Theme development, I swear!
Theme development, ok where's it? show me..
- Here is it, Sir: http://mehrpadin.net/demo/mpFREE/
Not W3C valid, right?
- No, it is, Sir, absolutely valid xHTML 1.0 & CSS 2.1
And with standard codes?
- Yes indeed.
How many regions it does have?
- 21, your highness.
Ok let me think
- Sure.
Comments
Comment #1
mehrpadin commentedComment #2
avpadernoComment #3
avpadernoFiles available from third-party sites should not be included in Drupal.org CVS.
In Drupal.org CVS the only accepted files are the ones licensed under GPL license v2+; compatible licenses are not accepted.
Comment #4
mehrpadin commentedOh didn't know that, ok removed, so what to do now?
Comment #5
avpadernoUpload the modified theme in a new comment.
Comment #6
mehrpadin commentedHere's it.
Comment #7
avpadernoComment #8
avpadernoIn such cases, use the alternative syntax of the control structures.
See then the Drupal coding standards to understand how a module code should be written; in particular see the namespace respect part.
Isn't there a more optimized way to write that code?
Comment #9
sreynen commentedkiamlaluno, can you give any more actionable feedback? I'd like to see this feedback clarified both to help Mehrpadin and to improve my own understanding of the standards that apply to CVS applications, so I might help review them.
The alternative syntax, not mentioned in the coding standards on control structures, apparently refers to this from php.net, i.e. using endif; instead of curly braces. Beyond not mentioning alternative syntax, the coding standards say "You are strongly encouraged to always use curly braces even in situations where they are technically optional," which seems to actually suggest not using alternative syntax. Is this an actual coding standard documented somewhere else or just a personal preference?
And "Isn't there a more optimized way to write that code?" seems pretty vague. Obviously you think there is something to improve, but since you didn't criticize anything specific, Mehrpadin (and anyone else using this feedback to improve their own coding) can only guess at what needs to change.
Comment #10
avpaderno@sreynen: Thanks for pointing out I was not clear in what I reported; I will explain myself better.
The alternative syntax is the one normally used on themes, especially when the template needs to conditionally add HTML tags.
Code like the following (the fragment has been taken from a Drupal core theme)
is more readable than
It is more readable because it more visible where a conditional statement ends, and it is more readable because it is documented which conditional statement ends.
This is true where fragments of PHP code are mixed with HTML fragments; it is not true for modules, where the content of a module file is PHP code.
Considering that the function is called from the following code
the function could be replaced from the following code (I write it in the context where it is called)
Effectively there is something wrong in the code; the function is printing the result, and so does the code that is invoking the function.
Comment #11
mehrpadin commentedThank you both.
The editor I'm using has syntax highlighter hence easy to see where a conditional statement ends or starts, unfortunately it does not identify endif; and\or endwhile; that's why I used curly brackets. Having said that, maybe we should change the standards a little bit? Of coursed changed everything as requested.
Plus, thanks for the code.
@--}--;----
Comment #12
mehrpadin commentedUpdated
Comment #13
avpadernoComment #16
avpaderno