diff --git a/admin/add.php b/admin/add.php deleted file mode 100644 index 100cf8c..0000000 --- a/admin/add.php +++ /dev/null @@ -1,197 +0,0 @@ - -isAdmin()) { - - if(isset($_POST["btnAdd"])) { - unset($_POST["btnAdd"]); - - - if ($_POST["type"]=="2") { // is Photo type - if (isset($_POST["url"]) && $_POST["url"]!="") { - $photoName = getFileName($_POST["url"]); - if (!$tumble->savePhoto($_POST["url"])) { - header("Location: ".$conf->urlGelato."/admin/index.php?photo=false"); - die(); - } - $_POST["url"] = $conf->urlGelato."/uploads/".$photoName; - } - - if ( move_uploaded_file( $_FILES['photo']['tmp_name'], "../uploads/".$_FILES['photo']['name'] ) ) { - $_POST["url"] = $conf->urlGelato."/uploads/".$_FILES['photo']['name']; - } - - unset($_POST["photo"]); - unset($_POST["MAX_FILE_SIZE"]); - } - - if ($_POST["type"]=="7") { // is MP3 type - set_time_limit(300); - $mp3Name = getFileName($_POST["url"]); - if (!$tumble->saveMP3($_POST["url"])) { - header("Location: ".$conf->urlGelato."/admin/index.php?mp3=false"); - die(); - } - $_POST["url"] = $conf->urlGelato."/uploads/".$mp3Name; - } - - if (get_magic_quotes_gpc()) { - $_POST["title"] = htmlspecialchars(stripslashes($_POST["title"])); - $_POST["description"] = htmlspecialchars(stripslashes($_POST["description"])); - } else { - $_POST["title"] = htmlspecialchars($_POST["title"]); - $_POST["description"] = htmlspecialchars($_POST["description"]); - } - - $_POST["title"] = strip_tags($_POST["title"]); - $_POST["description"] = strip_tags($_POST["description"]); - - - if (isset($_POST["id_post"])) { - //$tumble->modifyPost($_POST, $_POST["id_post"]); - } else { - if ($tumble->addPost($_POST)) { - header("Location: ".$conf->urlGelato."/admin/index.php?added=true"); - die(); - } else { - header("Location: ".$conf->urlGelato."/admin/index.php?error=2&des=".$this->merror); - die(); - } - } - } elseif (isset($_GET["new"])) { -?> - - - - gelato - - - - - - - - -
- gelato CMS -
- - - -
-
-
-

Add content

-
-
name="frmAdd"> -
-cargarPlantilla($input, $output, "template_add_post"); - $template->mostrarPlantilla(); - break; - case "photo": - $input = array("{type}", "{date}", "{id_user}"); - $output = array("2", time(), $_SESSION['user_id']); - - $template->cargarPlantilla($input, $output, "template_add_photo"); - $template->mostrarPlantilla(); - break; - case "quote": - $input = array("{type}", "{date}", "{id_user}"); - $output = array("3", time(), $_SESSION['user_id']); - - $template->cargarPlantilla($input, $output, "template_add_quote"); - $template->mostrarPlantilla(); - break; - case "url": - $input = array("{type}", "{date}", "{id_user}"); - $output = array("4", time(), $_SESSION['user_id']); - - $template->cargarPlantilla($input, $output, "template_add_link"); - $template->mostrarPlantilla(); - break; - case "conversation": - $input = array("{type}", "{date}", "{id_user}"); - $output = array("5", time(), $_SESSION['user_id']); - - $template->cargarPlantilla($input, $output, "template_add_conversation"); - $template->mostrarPlantilla(); - break; - case "video": - $input = array("{type}", "{date}", "{id_user}"); - $output = array("6", time(), $_SESSION['user_id']); - - $template->cargarPlantilla($input, $output, "template_add_video"); - $template->mostrarPlantilla(); - break; - case "mp3": - $input = array("{type}", "{date}", "{id_user}"); - $output = array("7", time(), $_SESSION['user_id']); - - $template->cargarPlantilla($input, $output, "template_add_mp3"); - $template->mostrarPlantilla(); - break; - default: - echo "
The specified type is not valid.
"; - break; - } -?> -

-    - Cancel -

-
-
-
-
-
-
-

- gelato CMS :: PHP/MySQL Tumblelog Content Management System. -

-
-
- - -urlGelato."/login.php"); -} -?> \ No newline at end of file diff --git a/admin/css/images/Thumbs.db b/admin/css/images/Thumbs.db new file mode 100644 index 0000000..02b2d03 Binary files /dev/null and b/admin/css/images/Thumbs.db differ diff --git a/admin/css/images/delete.png b/admin/css/images/delete.png new file mode 100644 index 0000000..08f2493 Binary files /dev/null and b/admin/css/images/delete.png differ diff --git a/admin/css/images/edit.png b/admin/css/images/edit.png new file mode 100644 index 0000000..046811e Binary files /dev/null and b/admin/css/images/edit.png differ diff --git a/admin/css/images/page_white_text.png b/admin/css/images/page.png similarity index 100% rename from admin/css/images/page_white_text.png rename to admin/css/images/page.png diff --git a/admin/css/images/page_white_text.gif b/admin/css/images/page_white_text.gif deleted file mode 100644 index a572f45..0000000 Binary files a/admin/css/images/page_white_text.gif and /dev/null differ diff --git a/admin/css/images/quote.png b/admin/css/images/quote.png new file mode 100644 index 0000000..6549382 Binary files /dev/null and b/admin/css/images/quote.png differ diff --git a/admin/css/style.css b/admin/css/style.css index 50642c5..4a94181 100644 --- a/admin/css/style.css +++ b/admin/css/style.css @@ -1,4 +1,11 @@ -/* CSS Document created by Jorge Condomi */ +/* =========================== + + gelato CMS development version + http://www.gelatocms.com/ + + gelato CMS is a free software licensed under GPL (General public license) + + =========================== */ /************ BASICS *************/ @@ -62,8 +69,14 @@ form.newpost textarea{background: #fff url(images/grad-big.png) top left repeat- .entry{ background-color:#efefef; border:1px solid #ccc; margin:20px 15px;} .info{ border-bottom:1px solid #aaa; position:relative; display:block; padding:4px 10px; height:20px; } .info p{font-size:0.8em; color:#297aab; display:inline;} -form.compact{ float:right; margin:-2px 0 0 0; padding:0;} +.compact{ float:right; margin:-2px 0 0 0; padding:0;} +.compact img{ border:0px; } +.compact a { color:#297aab; font-size:0.8em; } +.compact a:link { color:#297aab; font-size:0.8em; } +.compact a:visited { color:#297aab; font-size:0.8em; } +.compact a:active { color:#297aab; font-size:0.8em; } +.compact a:hover { color:#297aab; font-size:0.8em; } .post{ padding:10px;} .post h4{ font-style:italic; font-weight:bold; } @@ -98,7 +111,10 @@ form.compact{ float:right; margin:-2px 0 0 0; padding:0;} color:#011940; } -/* Mensajes para el usuario */ +a.linkFrm, a.linkFrm:link, a.linkFrm:visited, a.linkFrm:active{ color:#297aab; text-decoration:none; outline:none;} +a.linkFrm:hover{ text-decoration:underline; color:#297aab; outline:none;} + +/* User messages */ .error { width:80%; @@ -126,3 +142,69 @@ form.compact{ float:right; margin:-2px 0 0 0; padding:0;} margin: 0 auto; padding: 5px 20px 5px 45px; } + +/* Pagination */ + +div.pagination { + text-align:center; + padding:3px; + margin:3px; +} + +div.pagination a { + padding: 2px 5px 2px 5px; + margin-right: 2px; + border: 1px solid #ddd; + + text-decoration: none; + color: #aaa; +} + +div.pagination a:hover, div.pagination a:active { + padding: 2px 5px 2px 5px; + margin-right: 2px; + border: 1px solid #a0a0a0; +} + +div.pagination span.current { + padding: 2px 5px 2px 5px; + margin-right: 2px; + border: 1px solid #e0e0e0; + font-weight: bold; + background-color: #f0f0f0; + color: #aaa; +} + +div.pagination span.disabled { + padding: 2px 5px 2px 5px; + margin-right: 2px; + border: 1px solid #f3f3f3; + color: #ccc; +} + +/* Conversation Post */ +div.conversation ul { + list-style-type: none; + margin: 0px; + padding: 0px 0px 0px 1px; + border-left: solid 5px #555; +} + + div.conversation ul li { + font-size: 12px; + padding: 4px 0px 4px 8px; + color: #000; + margin-bottom: 1px; + } + + div.conversation ul li span.label { + font-weight: bold; + } + + div.conversation ul li.odd { + background-color: #f4f4f4; + } + + div.conversation ul li.even { + background-color: #e8e8e8; + } diff --git a/admin/index.php b/admin/index.php index 47f61e5..fef04f8 100644 --- a/admin/index.php +++ b/admin/index.php @@ -11,7 +11,9 @@ isAdmin()) { + @@ -126,56 +129,56 @@ if ($user->isAdmin()) {

gelato cms

+
  • Log out
  • +
    - +

     

     

    The article has been eliminated successfully.
    "; + echo "
    The article has been eliminated successfully.
    "; } } if (isset($_GET["modified"])) { if ($_GET["modified"]=="true") { - echo "

     

    The article has been modified successfully.
    "; + echo "
    The article has been modified successfully.
    "; } } if (isset($_GET["added"])) { if ($_GET["added"]=="true") { - echo "

     

    The article has been added successfully.
    "; + echo "
    The article has been added successfully.
    "; } } if (isset($_GET["error"])) { if ($_GET["error"]==2) { - echo "

     

    Error on the database server: ".$_GET["des"]."
    "; + echo "
    Error on the database server: ".$_GET["des"]."
    "; } } if (isset($_GET["mp3"])) { if ($_GET["mp3"]=="false") { - echo "

     

    Not an MP3 file or an upload problem.
    "; + echo "
    Not an MP3 file or an upload problem.
    "; } } if (isset($_GET["photo"])) { if ($_GET["photo"]=="false") { - echo "

     

    Not a photo file or an upload problem.
    "; + echo "
    Not a photo file or an upload problem.
    "; } } ?> @@ -242,9 +245,7 @@ if ($user->isAdmin()) { } ?>

    -    - Cancel +

    @@ -259,28 +260,104 @@ if ($user->isAdmin()) {
  • Users
  • Posts
  • + + -
    -

    25/05 Regular Post (0 Comments)

    -
    -
    - (no title) -

    I just discovered Gelato

    -
    -
    - -
    -
    -

    25/05 Regular Post (0 Comments)

    -
    -
    -

    One with a title

    -

    Another entry, this one has some varations in the content, even dares - to be in two lines.

    -
    -
    + $limit=$conf->postLimit; + if(isset($page_num) && is_numeric($page_num) && $page_num>0) { // Is defined the page and is numeric? + $from = (($page_num-1) * $limit); + } else { + $from = 0; + } + + $rs = $tumble->getPosts($limit, $from); + + if ($tumble->contarRegistros()>0) { + while($register = mysql_fetch_array($rs)) { + $formatedDate = date("M d", strtotime($register["date"])); + $permalink = $conf->urlGelato."/index.php/post/".$register["id_post"]."/"; + + $textile = new Textile; + $register["description"] = $textile->process(str_replace(""", "\"", $register["description"])); + + switch ($tumble->getType($register["id_post"])) { + case "1": + $input = array("{Id_Post}", "{Date_Added}", "{Permalink}", "{Title}", "{Body}", "{URL_Tumble}"); + $output = array($register["id_post"], $formatedDate, $permalink, $register["title"], $register["description"], $conf->urlGelato); + + $template->cargarPlantilla($input, $output, "template_regular_post"); + $template->mostrarPlantilla(); + break; + case "2": + $fileName = "../uploads/".getFileName($register["url"]); + + $x = @getimagesize($fileName); + if ($x[0] > 100) { + $photoPath = $conf->urlGelato."/classes/imgsize.php?w=100&img=".$register["url"]; + } else { + $photoPath = $register["url"]; + } + + $effect = " style=\"cursor: pointer;\" onclick=\"Lightbox.show('".$register["url"]."', '".strip_tags($register["description"])."');\" "; + + $input = array("{Id_Post}", "{Date_Added}", "{Permalink}", "{PhotoURL}", "{PhotoAlt}", "{Caption}", "{Effect}", "{URL_Tumble}"); + $output = array($register["id_post"], $formatedDate, $permalink, $photoPath, strip_tags($register["description"]), $register["description"], $effect, $conf->urlGelato); + + $template->cargarPlantilla($input, $output, "template_photo"); + $template->mostrarPlantilla(); + break; + case "3": + $input = array("{Id_Post}", "{Date_Added}", "{Permalink}", "{Quote}", "{Source}", "{URL_Tumble}"); + $output = array($register["id_post"], $formatedDate, $permalink, $register["description"], $register["title"], $conf->urlGelato); + + $template->cargarPlantilla($input, $output, "template_quote"); + $template->mostrarPlantilla(); + break; + case "4": + $input = array("{Id_Post}", "{Date_Added}", "{Permalink}", "{URL}", "{Name}", "{Description}", "{URL_Tumble}"); + $output = array($register["id_post"], $formatedDate, $permalink, $register["url"], $register["title"], $register["description"], $conf->urlGelato); + + $template->cargarPlantilla($input, $output, "template_url"); + $template->mostrarPlantilla(); + break; + case "5": + $input = array("{Id_Post}", "{Date_Added}", "{Permalink}", "{Title}", "{Conversation}", "{URL_Tumble}"); + $output = array($register["id_post"], $formatedDate, $permalink, $register["title"], $tumble->formatConversation($register["description"]), $conf->urlGelato); + + $template->cargarPlantilla($input, $output, "template_conversation"); + $template->mostrarPlantilla(); + break; + case "6": + $input = array("{Id_Post}", "{Date_Added}", "{Permalink}", "{Video}", "{Caption}", "{URL_Tumble}"); + $output = array($register["id_post"], $formatedDate, $permalink, $tumble->getVideoPlayer($register["url"]), $register["description"], $conf->urlGelato); + + $template->cargarPlantilla($input, $output, "template_video"); + $template->mostrarPlantilla(); + break; + case "7": + $input = array("{Id_Post}", "{Date_Added}", "{Permalink}", "{Mp3}", "{Caption}", "{URL_Tumble}"); + $output = array($register["id_post"], $formatedDate, $permalink, $tumble->getMp3Player($register["url"]), $register["description"], $conf->urlGelato); + + $template->cargarPlantilla($input, $output, "template_mp3"); + $template->mostrarPlantilla(); + break; + } + } + + echo pagination($tumble->getPostsNumber(), $limit, isset($page_num) ? $page_num : 1, "index.php", 2); + + + } else { + $template->renderizaEtiqueta("No posts in this tumblelog.", "div","error"); + } + +?>
    diff --git a/admin/themes/admin/template_add_conversation.htm b/admin/themes/admin/template_add_conversation.htm index f1c13d1..6e3ba82 100644 --- a/admin/themes/admin/template_add_conversation.htm +++ b/admin/themes/admin/template_add_conversation.htm @@ -1,11 +1,10 @@ - Add a Conversation

    - - + +

    -
    +

    Example
    diff --git a/admin/themes/admin/template_add_link.htm b/admin/themes/admin/template_add_link.htm index e92ab94..7e209da 100644 --- a/admin/themes/admin/template_add_link.htm +++ b/admin/themes/admin/template_add_link.htm @@ -1,19 +1,17 @@ - Add a Link

    - - + +

    - - + +

    -

    - +

    diff --git a/admin/themes/admin/template_add_mp3.htm b/admin/themes/admin/template_add_mp3.htm index 192da1e..bb89cfd 100644 --- a/admin/themes/admin/template_add_mp3.htm +++ b/admin/themes/admin/template_add_mp3.htm @@ -1,14 +1,13 @@ - Add an MP3

    - - + +

    - This is a URL from the Mp3 file. + This is the MP3 file URL.

    -
    +

    diff --git a/admin/themes/admin/template_add_photo.htm b/admin/themes/admin/template_add_photo.htm index 7d66d51..eb483b1 100644 --- a/admin/themes/admin/template_add_photo.htm +++ b/admin/themes/admin/template_add_photo.htm @@ -1,21 +1,20 @@ - Upload a Photo - +

    - +
    - Supports JPEG, GIF and PNG.  Max size is 10 MB. + Supports JPEG, GIF and PNG.  Max size is 10 MB.
    - Use a URL instead