View Single Post
  #7 (permalink)  
Old 03-30-2008, 12:56 PM
kgun's Avatar
kgun kgun is offline
WebProWorld 1,000+ Club
 

Join Date: May 2005
Location: Norway
Posts: 4,696
kgun RepRank 3kgun RepRank 3
Default Re: Web Design: the next level.

Side note:

Did you note this:

Code:
echo HTML::div(HTML::h1('Welcome to my web site!'), array('id' => 'header'));
The code in red indicates how you add an attribute to an element. So. say you sit on an internet cafe in London and want to uppdate your site with a link with the following attribute:

Visit my <a href="http://www.example.com/" rel="nofollow">discount pharmaceuticals</a> site.

No problem, the code is there already, so you only update the content, that is the element content and the attributes you want attached to an element. It is assumed that you have written the class for the element like I indicated in the firs post. You may even write a class that say, this content is not wll-formed and / or valid. So if you make a good API, it is safer, robust, minimalistic and efficient. You change site-wide styling in one (or more) central styling file(s). You change behaviour in one (or more) central JavaScript file(s). You put conent into a database or a two-dimensional array that simulates a table in a database

Code:
<?php
// Some sample data representing a database query
$MainMenu = array (
    array (
     'tagname'=>'Start',
     'link'=>'http://www.digitalpunkt.no',
         ),
    array (
     'tagname'=>'Tools',
     'link'=>'http://www.cyscape.com',
         )
);
$SubMenu = array (
    array (
     'tagname'=>'DigitalStart',
     'link'=>'http://www.digitalstart.net',
  'tagname'=>'OopSchool',
     'link'=>'http://www.oopschool.com',
  'tagname'=>'Web2Logistics',
     'link'=>'http://www.www.web2logistics.com',
  'tagname'=>'RedcarpetRank',
     'link'=>'http://www.redcarpetrank.com',
  'tagname'=>'MultiFinanceIT',
     'link'=>'http://www.multifinanceit.com',
  'tagname'=>'Ad-University',
     'link'=>'http://www.ad-university.com'
         ),
     array (
     'tagname'=>'CSS Creator',
     'link'=>'http://csscreator.com',
  'tagname'=>'ReviewToolbar',
     'link'=>'http://www.reviewtoolbar.com/',
     'tagname'=>'GoGui',
     'link'=>'http://gogui.com',
  'tagname'=>'GeckoTribe',
     'link'=>'http://www.geckotribe.com',
  'tagname'=>'Favorez',
     'link'=>'http://www.favorez.com/',
  'tagname'=>'HawHaw',
     'link'=>'http://www.hawhaw.de'
        )
);
?>
and pull that out throug a script. You have different password protected access levels where you can edit, delete and add content. It is more flexible than a CMS system. Your API can be extend by class inheritance.

Some tags like image tags are handled different from other tags. They are closed differently. Read more how that is done in chapter 1 of

The PHP Anthology: 101 Essential Tips, Tricks & Hacks, 2nd Edition - SitePoint Books

where also one of the exercises I mentioned in my first post is solved for you if you did not get the general method.

Finally, don't forget

The danger with copy and paste

I have surfed the web since the beginning and the more I surf, the more I adhere to Opera's overall security principle: "Don't trust any site on the Internet."

I will add especially downloads until it have proved otherwise or you fully understand the code you past into your site.

Even serious providers have stopped providing JavaScript content to my site without warning. What does that imply for the semantics of your eProperty?

I have indicated with red that only content is written in from the computer on the internet cafe. You can make it more flexible by writing in content like this:

'tagname'=>'Start'
'link'=>'http://www.digitalpunkt.no'

Last edited by kgun : 03-30-2008 at 02:07 PM.
Reply With Quote