Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

pomoc naprednom pocetniku,tj. preporuka neke knjige

[es] :: PHP :: pomoc naprednom pocetniku,tj. preporuka neke knjige

Strane: < .. 1 2 3 4

[ Pregleda: 17298 | Odgovora: 65 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

vatri
Banja Luka, RS

Član broj: 68697
Poruke: 1006
*.dynamic.dsl.t-2.net.



+18 Profil

icon Re: pomoc naprednom pocetniku,tj. preporuka neke knjige17.05.2009. u 17:17 - pre 181 meseci
e jes mi objasni svaka ti cast :)))

Code:

function DB($host, $user, $password, $database){
      /**
      * Setting up parameters
      */
      $this->db_host = $host;
      $this->db_user = $user;
      $this->db_password = $password;
      $this->db_database = $database;
      
      /**
      * Establishing connection
      */
      return $this->connect();   
    }


Vidim da se te var. opet kasnije inicijalizuju u ovoj gore funkciji ??

PS vidite da sam pocetnik ne zamjerite na glupim pitanjima :)
 
Odgovor na temu

Mister_rap
SE at Viacom

Član broj: 8822
Poruke: 2540
*.dynamic.sbb.rs.

Jabber: mister_rap@jabber.com


+21 Profil

icon Re: pomoc naprednom pocetniku,tj. preporuka neke knjige17.05.2009. u 18:07 - pre 181 meseci
Ta f-ja je konstruktor DB klase i ocekuje da ces joj proslediti neophodne parametre.
Promenjiva je inicijalizovana na "" zbog koda koji sledi u connect metodi

Code:

/**
  * Checking if everything is filled up so we can establish connection.
  * We can also use empty() function in this if statment.
  */
      if(($this->db_host != "") && ($this->db_user != "")  && ($this->db_database != "")){


Ps.
Mali hint za b0risa: nema potrebe za dvostrukim navodinicima.
Ne bi bilo lose da se ovo ostavi na google code recimo kad se napravi taj osnovni funkcionalan kostur...
 
Odgovor na temu

b0ris
Boris Vujicic
Senior PHP programer
Beograd

Član broj: 126587
Poruke: 158
*.net.upc.cz.



+2 Profil

icon Re: pomoc naprednom pocetniku,tj. preporuka neke knjige20.05.2009. u 15:49 - pre 181 meseci
Evo ga i ostatak.
Obratite paznju na to da je sve za sad osnovno.
Dok sam radio primetio sam da bi bilo najbolje da sledecei korak bude implementacija nekog template engine-a (smarty).

@Mister_rap: ok :), ulepsavam kod cim dodam smarty. Onda ga stavite gde zelite :)
---------------------------------------------------------------------
Just do it.
 
Odgovor na temu

b0ris
Boris Vujicic
Senior PHP programer
Beograd

Član broj: 126587
Poruke: 158
*.net.upc.cz.



+2 Profil

icon Re: pomoc naprednom pocetniku,tj. preporuka neke knjige20.05.2009. u 16:05 - pre 181 meseci
Izgled cms kostura
Code:

- cms
-- base
--- tools.php
-- css
--- admin.css
--- content.css
--- global.css
--- index.css
--- menu.css
-- pages
--- skelet
---- footer.php
---- header.php
---- menu.php
--- admins.php
--- gallery.php
--- hello.php
--- index.php
--- logout.php
-- admins.php
-- gallery.php
-- hello.php
-- index.php
-- logout.php


file: cms/base/tools.php
Code:

<?php
/**
* File in which all the tool functions that we might use will be stored.
* @version 0.1 beta
* @author www.elitesecurity.org (written by member b0ris)
*/
  
/**
* @desc Function which will check if user is logged in. We will also set up full admin account here for purpose of loging in without
* messing around with data base (test account: administrator/demo (username/password) ).
* We will check for SQL injections later as we develop.
*/
function checkLogged($username, $pass){
  if($username != "" && $pass != ""){
    // Should be removed once we establish our account in database.
    if($username == "administrator" && $pass == "demo") return true;
    global $db;
    $pass = md5($pass);
    $res = $db->getrows("SELECT * FROM admins WHERE admin_name = '$username' AND admin_password = '$pass' ");
    if(is_array($res)){
      if($res[0]['admin_name'] == $username && $res[0]['admin_password'] == $pass ) return true;
      else return false;
    }else return false;
  }
  else return false;
}
?>


file: cms/css/admins.css
Code:

#a_row{
  clear:both;
  text-align:left;
  margin:0 auto;
  width:420px;
}
  #a_column{
    float:left;
    width:200px;
    border-bottom:1px solid gray;
    padding:5px;
  }


file: cms/css/content.css
Code:

#content{
  clear:both;
  text-align:left;
}


file: cms/css/global.css
Code:

body, td {
  font-family: Verdana;
  font-size:11px;
  text-align:center;
  background-color: #F2F2F2;
}

a {
  text-decoration:none;
  color:#FFB900;
}

a:hover {
  color:silver;
}


file: cms/css/index.css
Code:

#table{
  width:350px;
  margin:0 auto;
  border:1px solid black;
  padding: 20px;
}
  #row{
  clear:both;
  }
   #label{
     width:150px;
     float:left;
   }
   #html{
     width:200px;
     float:left;
   }
.button_flat{
  border:1px solid #666666;
}


file: cms/css/menu.css
Code:

#menu{
  clear:both;
  margin: 0 auto;
  text-align: left;
  width:300px;
}
#menu_option{
  float:left;
  width:100px;
}
#menu A{
  font-weight: bold;
}


file: cms/pages/skelet/footer.php
Code:

<?php echo "\n"; ?>
</body>
</html>


file" cms/pages/skelet/header.php
Code:

<?php
  /**
  * @desc Here we will include everything we need for any page. NOTE: Short tags are not used on purpose.
  */
  // Not to copy all classes from our frontend we will just move back and use same classes we use for frontend.
  // Including all the classes we need to display a page. Instead of including this classes one by one each time
  // we could also use _autoload method which php provides
  include "./../base/class.urlhandler.php";
  include "./../base/class.db.php";
  include "./../base/class.session.php";
  include "./base/tools.php";
  
  // Creating instance of urlHandler which we will use later.
  $url = new urlHandler();
  // Creating instance of db (connection to data base)
  if(!$db = new DB("localhost", "root", "", "elitesecurity")){ echo "Could not connect to database!";exit(1);}
  // Creating instance of session and starting up the session (note: session must start before any display happens.
  // Be sure that you dont have enter (\n) as startup char. This can create errors.) 
  $session = new Session();
  $session->startSession();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Expires" content="Fri, Jan 01 1900 00:00:00 GMT">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="content-language" content="sr">
<meta name="author" content="elitesecurity">
<meta name="generator" content="Elitesecurity CMS <boris vujicic>">
<meta name="description" content="Home page, test page for basic CMS">
<meta name="keywords" content="">
<meta name="creation-date" content="09/20/2007">
<meta name="robots" content="nofollow" />
<title>CMS</title>
<link rel="stylesheet" type="text/css" href="./css/global.css">
<link rel="stylesheet" type="text/css" href="./css/menu.css">
<link rel="stylesheet" type="text/css" href="./css/content.css">
<link rel="stylesheet" type="text/css" href="./css/index.css">
<!-- We will arange display of apropriet css for selected page later. -->
<link rel="stylesheet" type="text/css" href="./css/admins.css">
</head>
<body>


file: cms/pages/skelet/menu.php
Code:

<?php
/**
* @desc Creating menu. Latter we will create dynamic page creation.
*/
$logged = $session->getValue("logged");
if($logged == 1){
?>
<div id="menu">
  <div id="menu_option"><a href="admins.php">Admins</a></div>
  <div id="menu_option"><a href="gallery.php">Gallery</a></div>
  <div id="menu_option"><a href="logout.php">Log out</a></div>
</div>
<br/><br/>
<?php }?>


file: cms/pages/admins.php
Code:

<?php
/**
* Later we will simplify display of this page and add control for permissions (who and how can access this page).
*/
?>
<div id ="content">
<p>Administrate User accounts for backend.</p><br/>
<?php
  // Catching method and id (if ones are set) which is activated for this page
  $method = $url->getValue("method");
  $id = $url->getValue("id");
  // If method is set and id is numeric, then we should do something (check for type of metod and execute)
  if($method != "" && is_numeric($id)){
    // Delete administrator
    if($method == "delete") $db->query("DELETE FROM admins WHERE admin_id = $id");
    // Edit administrator
    if($method == "edit" || $method == "add"){
      $admin = $db->getrows("SELECT * FROM admins WHERE admin_id = $id");
      $content = "
      <form action=\"admins.php\" method=\"post\">
        <div id=\"row\">
          <div id=\"label\"> Admin Name: </div>
          <div id=\"html\"> <input type=\"text\" name=\"admin_name\" value=\"{$admin[0]['admin_name']}\" /> </div>
        </div>
        <div id=\"row\">
          <div id=\"label\"> Password: </div>
          <div id=\"html\"> <input type=\"password\" name=\"pass\" value=\"\" /> </div>
        </div>
        <div id=\"row\">
          <div id=\"label\"> Repeat Password: </div>
          <div id=\"html\"> <input type=\"password\" name=\"repass\" value=\"\" /> </div>
        </div>
        <div id=\"row\">
          <input type=\"hidden\" value=\"{$admin[0]['admin_id']}\" name=\"id\"/> 
          <input type=\"hidden\" value=\"$method\" name=\"method\"/> 
          <input type=\"submit\" value=\"Make Change\" class=\"button_flat\" /> 
        </div>
      </form>
      ";
      echo $content;
    }
  }
  
  // Updating member
  if($method == "edit"){
    // Getting administrator name, password and repeated password
    $admin_name = $url->getValue("admin_name");
    $pass = $url->getValue("pass");
    $repass = $url->getValue("repass");
    
    // Checking if everything is correct
    if($admin_name != "" && $pass == $repass){
      if($pass == "") $db->query("UPDATE admins SET admin_name = '$admin_name' WHERE admin_id = $id");
      else{
        $pass = md5($pass);
        $db->query("UPDATE admins SET admin_name = '$admin_name', admin_password = '$pass' WHERE admin_id = $id");
      }
    }
  }
  
  // Add member
  if($method == "add"){
    // Getting administrator name, password and repeated password
    $admin_name = $url->getValue("admin_name");
    $pass = $url->getValue("pass");
    $repass = $url->getValue("repass");
    
    // Inserting member into databse
    if($admin_name != "" && $pass == $repass && $pass != ""){
        $pass = md5($pass);
        $db->query("INSERT INTO admins(admin_name, admin_password) VALUES ('$admin_name', '$pass')");
    }
  }

  // Lets select all members and display them for managing
  $admins = $db->getrows("SELECT * FROM admins");
  if(is_array($admins)){
    echo "<div id=\"a_row\"><div id=\"a_column\" >Admin name</div><div id=\"a_column\"> <a href=\"admins.php?method=add&id=0\">add new</a> </div></div>";
    foreach($admins as $key => $value){
      echo "<div id=\"a_row\">";
      echo "
      <div id=\"a_column\" >{$admins[$key]['admin_name']}</div>
      <div id=\"a_column\">
        <a href=\"admins.php?method=edit&id={$admins[$key]['admin_id']}\">edit</a>
        <a href=\"admins.php?method=delete&id={$admins[$key]['admin_id']}\">delete</a>
      </div>";
      echo "</div>";
    }
  }else{
  }
?>
</div>


file: cms/pages/gallery.php
Code:

<?php
/**
* Administration of gallery, done really simple. We will build upon this later.
*/
?>
<div id ="content">
<p>Administrate Gallery.</p>
<?php

  echo '<p><a href="gallery.php?mode=add">Add new photo to gallery.</a></p>';
  echo '<p>Gallery</p>';
  
  // Catching mode and id of photo (if one is set). Remember we are using class UrlHandler so there is no reason to think
  // which way (POST, GET) data is being transferred to us.
  $mode = $url->getValue("mode");
  $id = $url->getValue("id");
  
  // If mode is delete, lets delete some pictures.
  if($mode == "delete"){
    $gallery = $db->getrows("SELECT * FROM pictures WHERE picture_id = $id");
    $db->query("DELETE FROM pictures WHERE picture_id = $id");
    // Here we should add some checkups if this picture really exists at the time.
    // We will build upon this later.
    unlink("./../uploads/pictures/{$gallery[0]['picture_name']}");
  }
  
  // If we want to add new picture? Lets display a form for adding one
  if($mode == "add"){
    echo '
    <form enctype="multipart/form-data" action="gallery.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
Choose a file to upload: <input name="picture" type="file" /><br />
<input type="hidden" name="mode" value="upload" />
<input type="submit" value="Upload Picture" />
</form>
    ';
  }
  
  // If picture is being uploaded, lets catch that bytes (picture) and do something with it (like store it :) )
  // Here no checkup for right format will be done.
  if($mode == "upload"){
    // Lets set the path where picture will go.
    $target_path = "./../uploads/pictures/";
    // Lets attach the name of the picture to that path.
    $target_path = $target_path . basename( $_FILES['picture']['name']); 
    // Lets copy our photo (file) on location where we want it to go. Is it moved?
    if(move_uploaded_file($_FILES['picture']['tmp_name'], $target_path)) {
        // Yes it is moved. Lets add this into database.
        $db->query("INSERT INTO pictures(picture_name) VALUES ('{$_FILES['picture']['name']}')");
        echo "The file ".  basename( $_FILES['picture']['name'])." has been uploaded";
    } else{
        // No. We should handle this error in some way.
        echo "There was an error uploading the file, please try again!";
    }
  }

  // Lets take all the pictures from database and display them.
  $gallery = $db->getrows("SELECT * FROM pictures");
  foreach($gallery as $key => $value){
    if(($key+1)%5 == 0)
      echo "<div style=\"clear:both;\">&nbsp;</div>";
    echo "
    <div style=\"float:left; border:1px solid black;\">
      <img src=\"./../uploads/pictures/{$gallery[$key]['picture_name']}\" width=\"70px\" style=\"border:1px solid #cccccc\"><br/>
      <a href=\"gallery.php?mode=delete&id={$gallery[$key]['picture_id']}\" >delete</a> | <a href=\"./../uploads/pictures/{$gallery[$key]['picture_name']}\" target=\"_BLANK\">view</a>
    </div>";
  }
?>
</div>


file: cms/pages/hello.php
Code:

<?php
// Checking if user is logged on
$logged = $session->getValue("logged");
if($logged == 1){  
?>
<div id="content">
  <p>
    Welcome to our basic CMS. We will keep on improving this CMS step by step.
  </p>
</div>
<?php }?>


file: cms/pages/home.php
Code:

<?php
/**
* @desc Here we will atempt to login and show some content if we are logged in :)
*/

  // Getting username and password.
  $username = $url->getValue("username");
  $pass = $url->getValue("pass");
  // Now we will check if user exists in database and loog him in if he exists.
  if($username != "" && $pass != ""){
    if(checkLogged($username, $pass)){
      $session->removeValue("logged");
      $session->addValue("logged", 1);
    }
    else {
      $session->removeValue("logged");
      $session->addValue("logged", 0);
    }
  }
  $logged = $session->getValue("logged");
  if($logged != 1){
?>
<form action="index.php" method="post">
  <div id="content">
    <div id="table">
      <div id="row">
        <div id="label" >Username: </div>
        <div id="html" > <input type="text" name="username" /> </div>
      </div>
      <div id="row">
        <div id="label" >Password: </div>
        <div id="html" > <input type="password" name="pass" /> </div>
      </div>
      <div id="row"> <input type="submit" value="Login" class="button_flat"/> </div>
    </div>
  </div>
</form>
<?php }else{ ?>
You are logged :)<br/>
In 3 seconds you will be redirected to backend. If that does not happend click on the link below.<br/>
<a href="hello.php">Backend</a>
<meta http-equiv="refresh" content="3;url=hello.php">
<?php } ?>


file: cms/pages/logout.php
Code:

<?php
  // Lets remove the login flag, and refresh this content.
  $session->removeValue("logged");
?>
<div id="content">
  <p>Thank you for using this CMS.</p>
</div>
<meta http-equiv="refresh" content="3;url=index.php"> 


file: cms/admins.php
Code:

<?php
  include "./pages/skelet/header.php";
  include "./pages/skelet/menu.php";
  include "./pages/admins.php";
  include "./pages/skelet/footer.php";  
?>


file: cms/gallery.php
Code:

<?php
  include "./pages/skelet/header.php";
  include "./pages/skelet/menu.php";
  include "./pages/gallery.php";
  include "./pages/skelet/footer.php";   
?>


file: cms/hello.php
Code:

<?php
  include "./pages/skelet/header.php";
  include "./pages/skelet/menu.php";
  include "./pages/hello.php";
  include "./pages/skelet/footer.php";
?>


file: cms/index.php
Code:

<?php
  include "./pages/skelet/header.php";
  include "./pages/home.php";
  include "./pages/skelet/footer.php";  
?>                                                                   


file: cms/logout.php
Code:

<?php
  include "./pages/skelet/header.php";
  include "./pages/logout.php";
  include "./pages/skelet/footer.php";  
?>

---------------------------------------------------------------------
Just do it.
 
Odgovor na temu

b0ris
Boris Vujicic
Senior PHP programer
Beograd

Član broj: 126587
Poruke: 158
*.net.upc.cz.



+2 Profil

icon Re: pomoc naprednom pocetniku,tj. preporuka neke knjige20.05.2009. u 16:07 - pre 181 meseci
Eto to je za sad vrlo mali CMS sa vrlo ruznom galerijom :)
Ako imate neka pitanja udrite, sad je vreme.
Rekao bih da je ovo dovoljno za prvu zastavicu :)
Druga zastavica bi bila implementacija smarty template engine-a i preraspodela koda kako bi odgovarao istom.

Pozdrav
---------------------------------------------------------------------
Just do it.
 
Odgovor na temu

amitkic
student
zvechan

Član broj: 186610
Poruke: 42
82.114.95.*



Profil

icon Re: pomoc naprednom pocetniku,tj. preporuka neke knjige28.06.2009. u 11:35 - pre 180 meseci
e ovo je ekstra, jedva cekam nastavak
 
Odgovor na temu

amitkic
student
zvechan

Član broj: 186610
Poruke: 42
82.114.95.*



Profil

icon Re: pomoc naprednom pocetniku,tj. preporuka neke knjige28.06.2009. u 11:46 - pre 180 meseci
evo ovo shto je boris napisao samo zapakovano u rar
Prikačeni fajlovi
 
Odgovor na temu

amitkic
student
zvechan

Član broj: 186610
Poruke: 42
82.114.95.*



Profil

icon Re: pomoc naprednom pocetniku,tj. preporuka neke knjige14.08.2009. u 20:38 - pre 178 meseci
ajd malo budjenje teme
 
Odgovor na temu

b0ris
Boris Vujicic
Senior PHP programer
Beograd

Član broj: 126587
Poruke: 158
92.36.246.*



+2 Profil

icon Re: pomoc naprednom pocetniku,tj. preporuka neke knjige17.08.2009. u 12:21 - pre 178 meseci
Vidim da je jedini zainteresovan za ovo pokretac teme (amitkic).
Postavicu za sad grubu postavku smarty za frontend. Posle cu dodati jos ako ljudima bude interesantno da citaju :)
Malo mi je glupo da pisem u prazno.

[Ovu poruku je menjao b0ris dana 17.08.2009. u 13:45 GMT+1]
---------------------------------------------------------------------
Just do it.
 
Odgovor na temu

b0ris
Boris Vujicic
Senior PHP programer
Beograd

Član broj: 126587
Poruke: 158
92.36.246.*



+2 Profil

icon Re: pomoc naprednom pocetniku,tj. preporuka neke knjige17.08.2009. u 12:39 - pre 178 meseci
Za postavku smarty-ja potrebno je isti prvo skinuti sa neta http://www.smarty.net/download.php.
Zatim smarty prebaciti u root sajta i modifikovati dve linije.
file: smarty/Smarty.calss.php
Code:
    /**
     * The name of the directory where templates are located.
     *
     * @var string
     */
    var $template_dir    =  './cache/smarty/templates';

    /**
     * The directory where compiled templates are located.
     *
     * @var string
     */
    var $compile_dir     =  './cache/smarty/templates_c';

Linije se kod mene nalaze na 82 i 75 liniji.

Posto smo postavili smarty potrebno je kreirati foldere u kojima ce se nalaziti smarty fajlovi (kao sto je navedeno u kodu iznad).

Kreirati sledecu strukturu na rootu sajta.
-cache
--smarty
---templates
---templates_c
U koliko koristite LINUX potrebno je postaviti na templates_c "chmod 777 ./cache/smarty/templates_c"

U ovom trenutku smarty je postavljen. Sada sledi prebacivanje koda u smarty.
Folder pages trenutno postaje nepotreban buduci da ce se sve stranice nalaziti u folderu ./cache/smarty/templates
Skripte contact.php i gallery.php mozemo ukloniti.
Skriptu index.php cemo promeniti da odgovara novom sistemu.

file: index.php
Code:
<?php
    /**
  * @desc Here we will include everything we need for any page. Attention to SEO (search engine optimization)
  * will be established latter when we move page display into data base. NOTE: Short tags are not used on purpose.
  */
  // Including all the classes we need to display a page. Instead of including this classes one by one each time
  // we could also use _autoload method which php provides
  include "./base/class.urlhandler.php";
  include "./base/class.db.php";
  include "./base/class.session.php";
  include "./smarty/Smarty.class.php";
  
  // Creating instance of urlHandler which we will use later.
  $url = new urlHandler();
  // Creating instance of db (connection to data base)
  if(!$db = new DB("localhost", "root", "", "elitesecurity")){ echo "Could not connect to database!";exit(1);}
  // Creating instance of session and starting up the session (note: session must start before any display happens.
  // Be sure that you dont have enter (\n) as startup char. This can create errors.) 
  $session = new Session();
  $session->startSession();
  
  $page = $url->getValue("page"); // Getting the page we want to display
  if(!$page) $page = "index";      // Setting up startup page
  // Here we should add a checkup if page does not exist.
  
  // Creating menu. Later we will retrieve menu options from data base. There fore this is useful to 
  // be done here.
  $menu = array(
  "0" => array("href" => "index.php", "name" => "Home"),
  "1" => array("href" => "index.php?page=gallery", "name" => "Gallery"),
  "2" => array("href" => "index.php?page=contact", "name" => "Contact"),
  );                                                                     
  
  $smarty = new Smarty();  
  
  // Assigning variables that will be used in certain pages. This should be called dynamically so
  // that it is not executed each time index.php loads.
  $haspictures = false;
  // Executing query
  $pictures = $db->getrows("SELECT * FROM pictures");
  // did we got something back?
  if($pictures) $haspictures = true;
  // We did. Ooo looky looky we have some photos :) Lets display them.
  if($haspictures){
    foreach($pictures as $key => $value){
      $pictures[$key]['src'] = "./uploads/pictures/{$pictures[$key]['picture_name']}";
      $pictures[$key]['alt'] = $pictures[$key]['picture_name'];
      $pictures[$key]['title'] = $pictures[$key]['picture_name'];
    }
  }
  $smarty->assign("pictures", $pictures);
  $smarty->assign("haspictures", $haspictures);
  
  $smarty->assign("menu", $menu);               // Menu array
  $smarty->assign("title", "$page");            // page title
  $smarty->display("header.tpl");               // Executing header
  $smarty->display("menu.tpl");                 // Executing menu
  $smarty->display("$page.tpl");                // Executing desired page
  $smarty->display("footer.tpl");               // Executing footer.
?>


zatim cemo kreirati nove templejt fajlove.

file: ./cache/smarty/templates/header.tpl
Code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Expires" content="Fri, Jan 01 1900 00:00:00 GMT">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="content-language" content="sr">
<meta name="author" content="elitesecurity">
<!-- <meta http-equiv="Reply-to" content="@.com"> -->
<meta name="generator" content="Elitesecurity CMS <boris vujicic>">
<meta name="description" content="Home page, test page for basic CMS">
<meta name="keywords" content="">
<meta name="creation-date" content="09/20/2007">
<meta name="revisit-after" content="15 days">
<title>{$title}</title>
<link rel="stylesheet" type="text/css" href="./css/global.css">
<link rel="stylesheet" type="text/css" href="./css/menu.css">
<link rel="stylesheet" type="text/css" href="./css/content.css">
</head>
<body>


file: ./cache/smarty/templates/footer.tpl
Code:

</body>
</html>


file: ./cache/smarty/templates/menu.tpl
Code:
<div id="menu">
  {section name=i loop=$menu}
  <div id="menu_option"><a href="{$menu[i].href}">{$menu[i].name}</a></div>
  {/section}                                                   
</div>
<br/><br/>


file: ./cache/smarty/templates/index.tpl
Code:

<div id="content">
  <p>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis dictum pellentesque sem. Praesent purus dui, cursus eu gravida sit amet, elementum eu justo. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse sed ante at tellus pulvinar elementum sit amet vel ante. Nulla in arcu sit amet lacus placerat pulvinar consectetur non justo. Donec risus erat, sagittis at aliquet eget, faucibus sit amet ante. Morbi ultrices purus et nunc sagittis ultrices. Vivamus auctor facilisis volutpat. Fusce vel diam massa. Vestibulum fringilla pretium rutrum. Ut eros velit, dignissim sit amet sollicitudin nec, eleifend malesuada tellus. Ut in laoreet velit. Nulla lobortis tincidunt velit, ac congue dui ullamcorper ut. Aliquam commodo urna non sapien ornare nec placerat lacus eleifend. Quisque ut velit lacus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
  </p><p>
    Nulla eget turpis a tellus porttitor ultricies. Vestibulum ut ultricies justo. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vestibulum urna dui, sollicitudin eu consectetur nec, posuere sit amet eros. Donec in erat ut elit euismod elementum. Pellentesque vel arcu odio. Aliquam fermentum cursus erat ac egestas. Sed vel malesuada nunc. In volutpat, sem nec dictum suscipit, tortor magna volutpat sem, nec dictum diam metus vel diam. Vestibulum fringilla nulla vitae leo euismod nec commodo libero ullamcorper. Nulla facilisi. Curabitur tempus urna at felis iaculis elementum. Praesent a metus nulla. Duis consectetur, neque ut varius venenatis, diam justo tristique nisi, et ultrices turpis lorem a ante. Quisque sit amet magna leo. Etiam vel mi diam, quis ullamcorper diam. Vestibulum vitae nisl odio.
  </p><p>
    Maecenas tellus ante, rhoncus dictum ullamcorper nec, accumsan vitae diam. Etiam vitae enim metus, id luctus eros. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse fermentum diam a est dictum sit amet commodo sapien venenatis. Duis dignissim bibendum elit, sit amet sodales est fermentum id. Aliquam scelerisque dignissim elit, sed aliquet ligula cursus vitae. Mauris lectus nulla, porttitor interdum placerat quis, lacinia ut nisl. Quisque porta consectetur velit at ornare. Etiam in enim ut sem mattis porta. Donec ac purus magna. Morbi tellus felis, convallis at placerat vitae, facilisis in nunc. In ipsum tortor, hendrerit a interdum non, facilisis mattis felis.

  </p><p>
    Donec viverra mollis nibh id convallis. In lobortis, sapien elementum pulvinar tempus, lacus nibh semper massa, congue pharetra mauris ligula quis mi. Phasellus placerat euismod sagittis. Nullam ornare, massa eleifend iaculis aliquet, lacus urna vestibulum enim, a scelerisque nisi nisl nec elit. Duis dolor nibh, volutpat eget adipiscing sed, aliquam eget sapien. Etiam in pretium purus. Morbi odio leo, lobortis et rutrum tincidunt, pharetra eget mauris. Donec lobortis turpis vel elit elementum rhoncus. Phasellus vitae arcu dolor. Aenean eget lacus nibh, eu rutrum ipsum. Pellentesque mollis leo condimentum dui commodo iaculis. Quisque rutrum lorem nec nibh mattis malesuada. In hac habitasse platea dictumst. Duis nec purus purus. Suspendisse fermentum porta nibh, quis vulputate magna pellentesque vitae. Curabitur eu tortor eu quam tincidunt egestas ac sit amet mauris.
  </p><p>
    Maecenas tempus nibh eget augue fringilla at egestas enim ultrices. In a velit gravida mi sodales vehicula. In vestibulum elementum velit sit amet luctus. Vestibulum et auctor ipsum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec et lectus eget sapien porttitor porttitor pretium sit amet ligula. Sed et erat in quam bibendum aliquet. Integer porttitor pellentesque nulla, quis vestibulum lectus ultricies sed. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Cras ut augue augue. In eget accumsan leo. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec quis diam velit, non ultrices quam. Curabitur vitae urna nec lorem adipiscing tincidunt id id velit. Aliquam blandit ornare metus, sed adipiscing diam feugiat vitae. Mauris hendrerit hendrerit turpis, id feugiat mi interdum nec. 
  </p>
</div>


file: ./cache/smarty/templates/gallery.tpl
Code:

<div id="content">
  {if $haspictures}
    {section name=i loop=$pictures}
      <div id="img"> <img src="{$pictures[i].src}" alt="{$pictures[i].alt}" title="{$pictures[i].title}"></div>
    {/section}
  {else}
    <p> Currently there are no pictures. </p> 
  {/if}
</div>


file: ./cache/smarty/templates/contact.tpl
Code:
<div id="content">
  <form action="contact.php" method="post">
    Email: <input type="text" name="email" id="email" /><br/><br/>
    Message: <br/>
    <textarea cols="50" rows="5" name="msg"></textarea><br/><br/>
    <input type="submit" value="Ask us?" />
  </form>
</div>


U ovom momentu struktura sajta treba da izgleda ovako
+base
-cache
--smarty
---templates
----contact.tpl
----footer.tpl
----gallery.tpl
----header.tpl
----index.tpl
----menu.tpl
---templates_c
+cms
+css
+smarty
+uploads
index.php

---------------------------------------------------------------------
Just do it.
 
Odgovor na temu

dakipro
Dalibor Jovic
Web Developer
Bergen, Norway

Moderator
Član broj: 31848
Poruke: 1792
91.148.82.*

Sajt: norway.dakipro.com


+190 Profil

icon Re: pomoc naprednom pocetniku,tj. preporuka neke knjige17.08.2009. u 12:47 - pre 178 meseci
Pa interesantno je sigurno za citanje, sad, vise je interesantno onima koji nisu imali prilike da se srecu i da rade sa slicnim stvarima, u svakom slucaju bice sigurno interesantno (a bogami i korisno) i buducim pocetnicima, ali definitivno us nick b0ris ide dobar reper kad se budu raspitivali za doticnu personu nekad negde, odmah se vidi da covek zna znanje. Nadam se da je to malo motivacije od strane nas koji se vadimo kako nemamo vremena da pisemo :)
A i ti si guru sad ovog projekta, cekamo da ti kazes nesto pa da prokomentarismo, da odrzis koncepciju i tok misli :)
 
Odgovor na temu

dakipro
Dalibor Jovic
Web Developer
Bergen, Norway

Moderator
Član broj: 31848
Poruke: 1792
91.148.82.*

Sajt: norway.dakipro.com


+190 Profil

icon Re: pomoc naprednom pocetniku,tj. preporuka neke knjige17.08.2009. u 12:49 - pre 178 meseci
Eve zamerke/predloga, u strukturi sajta, da li je mozda bolje da smarty ne bude u root-u, vec da ide u nekom folderu class, ili tako nesto, gde bi posle isle i druge klase, recimo za rad sa bazom i to?
ili sa propustio tok misli od pocetka, prodje vreme
 
Odgovor na temu

b0ris
Boris Vujicic
Senior PHP programer
Beograd

Član broj: 126587
Poruke: 158
92.36.246.*



+2 Profil

icon Re: pomoc naprednom pocetniku,tj. preporuka neke knjige17.08.2009. u 12:57 - pre 178 meseci
Razmisljao sam da ide sto lakse na pocetku, i da kako vreme prodje stvari stavljamo na svoje mesto (kako bi ljudima bilo jasno zasto se tu nalaze).
Za sad i u kodu ima dosta propusta (koji su namerno tu kako bi se isprovocirao neki komentar ;) ) te propuste sam mislio kasnije popuniti kako vreme bude prolazilo (uz ili bez pomoci ostalih).

Citat:
ali definitivno us nick b0ris ide dobar reper kad se budu raspitivali za doticnu personu nekad negde

Nisam poceo ovo pisati zbog nekog repera/statusa :) vec zbog ljudi koji iznova pitaju jednu te istu stvar a nigde nemaju sumirane informacije.
Ovo je vise kao pocetnicki projekat da bi ljudi razumeli o cemu se radi, a posle presli na mocnije stvari (atk, code igniter, zend itd..)
---------------------------------------------------------------------
Just do it.
 
Odgovor na temu

b0ris
Boris Vujicic
Senior PHP programer
Beograd

Član broj: 126587
Poruke: 158
92.36.246.*



+2 Profil

icon Re: pomoc naprednom pocetniku,tj. preporuka neke knjige17.08.2009. u 12:59 - pre 178 meseci
Citat:
dakipro: Eve zamerke/predloga, u strukturi sajta, da li je mozda bolje da smarty ne bude u root-u, vec da ide u nekom folderu class, ili tako nesto, gde bi posle isle i druge klase, recimo za rad sa bazom i to?
ili sa propustio tok misli od pocetka, prodje vreme

Definitvno je bolje smarty smestiti u nekoj takvoj strukturi, slazem se u potpunosti.
Sto zbog nasledjivanja u koliko neko zeli menjati isti, sto zbog preglednosti koda.
---------------------------------------------------------------------
Just do it.
 
Odgovor na temu

b0ris
Boris Vujicic
Senior PHP programer
Beograd

Član broj: 126587
Poruke: 158
92.36.246.*



+2 Profil

icon Re: pomoc naprednom pocetniku,tj. preporuka neke knjige17.08.2009. u 13:05 - pre 178 meseci
Mozda bi bilo dobro malo promeniti naziv teme?
---------------------------------------------------------------------
Just do it.
 
Odgovor na temu

dakipro
Dalibor Jovic
Web Developer
Bergen, Norway

Moderator
Član broj: 31848
Poruke: 1792
91.148.82.*

Sajt: norway.dakipro.com


+190 Profil

icon Re: pomoc naprednom pocetniku,tj. preporuka neke knjige17.08.2009. u 13:08 - pre 178 meseci
Pa razmisljam se razdvojiti temu, te od negde zapoceti novu koju bi smo linkovali u ovoj ili negde vec... ajde da prenoci pa cemo smisliti nesto, taman da se konsultujem sa jos par ljudi.
 
Odgovor na temu

vatri
Banja Luka, RS

Član broj: 68697
Poruke: 1006
*.dynamic.dsl.t-2.net.



+18 Profil

icon Re: pomoc naprednom pocetniku,tj. preporuka neke knjige17.08.2009. u 20:39 - pre 178 meseci
@b0ris: naravno da nije jedini zainteresovan amitkic. Ima ljudi koji prate ali ne pisu jer nisu kompetentni za to, kao ja npr. :)
Svaka cast jos jednom na trudu i tvojoj upornosti, mnogima ce biti od pomoci.

@dakipro: mislim da je dovoljno samo naziv teme da se promjeni da ne komplikujes bezveze, ioanko je vec drugi post (borisov) bio da ce se praviti CMS....
 
Odgovor na temu

evajolie
Imuna na ljudsku glupost

Član broj: 226973
Poruke: 21
91.148.92.*



Profil

icon Re: pomoc naprednom pocetniku,tj. preporuka neke knjige19.08.2009. u 10:05 - pre 178 meseci
I ja sam zainteresovana, samo vi pišite. Svaka čast i na dosadašnjem trudu. Uključiću se u temu onda kada budem imala šta pametno za reći ili za pitati.
Samo napred! Jako korisna tema!
 
Odgovor na temu

vatri
Banja Luka, RS

Član broj: 68697
Poruke: 1006
*.dynamic.dsl.t-2.net.



+18 Profil

icon Re: pomoc naprednom pocetniku,tj. preporuka neke knjige13.10.2009. u 17:24 - pre 176 meseci
ajde ljudi pisite izumrijece tema, steta je :S
 
Odgovor na temu

b0ris
Boris Vujicic
Senior PHP programer
Beograd

Član broj: 126587
Poruke: 158
*.dynamic.sbb.rs.



+2 Profil

icon Re: pomoc naprednom pocetniku,tj. preporuka neke knjige26.10.2009. u 16:09 - pre 176 meseci
Evo cim uhvatim malo vremena nastavicu, da ne obecam ali recimo da cu dodati jos stvari uskoro.
---------------------------------------------------------------------
Just do it.
 
Odgovor na temu

[es] :: PHP :: pomoc naprednom pocetniku,tj. preporuka neke knjige

Strane: < .. 1 2 3 4

[ Pregleda: 17298 | Odgovora: 65 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.