function create_thumb($filename, $max_width, $max_height) { $size = GetImageSize(path::file("images") . $filename); // Read the size $width = $size[0]; $height = $size[1]; // Proportionally resize the image to the // max sizes specified above $x_ratio = $max_width / $width; $y_ratio = $max_height / $height; if ($width <= $max_width && $height <= $max_height) { $tn_width = $width; $tn_height = $height; } elseif ($x_ratio * $height < $max_height) { $tn_height = ceil($x_ratio * $height); $tn_width = $max_width; } else { $tn_width = ceil($y_ratio * $width); $tn_height = $max_height; } return "<img src='" . path::http("images") . "{$filename}' style='height: {$tn_height}px; width: {$tn_width}px;' />"; }
} $response = ""; $content_output = ""; // require form page and create $form object require_once path::file("classes") . "form_handling_class.php"; $form_options = array('action' => "login.php", 'method' => "post", 'title' => "User Login", 'description' => "Cookies must be enabled to log in", 'response' => $response, 'smarty' => &$smarty); $form = new form_handling($form_options); $form_item = array('label' => "User Name", 'max_length' => 40, 'name' => "login[username]", 'id' => "login-username", 'size' => 30, 'description' => "", 'value' => "", 'required' => true); $form->add_text_field($form_item); $form_item = array('label' => "User Password", 'max_length' => 40, 'name' => "login[userpass]", 'id' => "login-userpass", 'size' => 30, 'description' => "", 'value' => "", 'required' => true, 'type' => 'password'); $form->add_text_field($form_item); /*$form_item = array ( 'label' => "Remember Me", 'checked' => false, 'name' => "login[remember]", 'id' => "login-remember", 'description' => "Store my user credentials and log me in automatically", ); $form->add_checkbox($form_item);*/ $form->build_fieldset("User Credentials"); $form_item = array('title' => "Submit", 'id' => "submit_form", 'type' => "submit"); $form->add_button($form_item); $form_item = array('title' => "Reset", 'id' => "reset_form", 'type' => "reset"); $form->add_button($form_item); $form->build_fieldset("Login / Clear Form"); $content_output .= $form->return_form(); unset($form); $smarty->assign("breadcrumb", "<a href='" . path::http() . "'>Home</a> > User Login"); $page_handler->add_page_item($content_output); $page_handler->add_footer(" "); $page_handler->output_page("User Login");
// header("Location: {$page}"); } $query = "SELECT cont_id, cont_ident, cont_title FROM {$db_prefix}content ORDER BY cont_ident"; $result = $db->query($query); $rows = $result->fetchAll(MDB2_FETCHMODE_ASSOC); $result->free(); foreach ($rows as $tag_item) { $pages[] = array('value' => $tag_item['cont_id'], 'title' => $tag_item['cont_ident']); if ($tag_item['cont_ident'] == "home_page") { $home_id = $tag_item['cont_id']; } } $path = path::http(); $smarty->assign("breadcrumb", "/ <a href='{$path}'>Home</a> / Editing: {$tag} /"); $query = "SELECT * FROM {$db_prefix}content WHERE cont_ident = " . $db->quote($item, 'text'); $db->setLimit(1); $result = $db->query($query); $rows = $result->fetchAll(MDB2_FETCHMODE_ASSOC); $result->free(); $row = $rows[0]; // require form page and create $form object require_once path::file("classes") . "form_handling_class.php"; $form_options = array('action' => path::http() . "edit.php" . ($_SERVER['QUERY_STRING'] ? "?{$_SERVER['QUERY_STRING']}" : ""), 'method' => "post", 'title' => "Editing: " . ($row['content_title'] != "" ? $row['contenttitle'] : $item), 'description' => "", 'response' => $diff_out ? "<h3>Changes Saved:</h3> (New revision: {$new_rev}){$diff_out}<hr />" : "", 'smarty' => &$smarty); $form = new form_handling($form_options); include path::file("classes") . "forms/edit_content_form.php"; $content_output .= $form->return_form(); unset($form); $smarty->assign("breadcrumb", $page['breadcrumb']); $smarty->assign("page_content", $content_output); output_page(); }
* * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * @link http://wcms.berlios.de/ * @copyright 2005 Martin Nicholls * @author Martin Nicholls <webmasta at streakyland dot co dot uk> * @package wCMS * @version $Revision: 1.9 $ */ /* $Id: content.php,v 1.9 2005/08/31 09:12:01 streaky Exp $ */ require_once "boot.php"; $item = !vars::get('page') ? "home_page" : vars::get('page'); $item = preg_replace("#\\W#", "", $item); $page_content = $content->retrieve($item); foreach ($page_content['family_tree'] as $key => $val) { $breadcrumb[] = $key != 0 ? "<a href='" . path::http() . "?page={$val['ident']}'>{$val['title']}</a>" : $val['title']; } $breadcrumb = array_reverse($breadcrumb); $breadcrumb = implode(" > ", $breadcrumb); $smarty->assign("breadcrumb", $breadcrumb); $page_handler->add_page_item($page_content['content'] . $bread_crumb, $page_content['title']); $footer = $content->create_content_footer($page_content['ident'], $page_content['last_mod'], $page_content['revision'], $page_content['title']); $page_handler->add_footer($footer); $page_handler->output_page($page_content['title']);
require_once 'Text/Wiki.php'; // Using include path (PEAR Class) // instantiate a Text_Wiki object with the default rule set $wiki =& new Text_Wiki(); // when rendering XHTML, make sure wiki links point to the base URL $wiki->setRenderConf('xhtml', 'wikilink', 'view_url', path::http() . "?page=%s"); $wiki->setRenderConf('xhtml', 'wikilink', 'new_url', path::http() . "?page=%s"); $wiki->setParseConf('wikilink', 'ext_chars', true); // setup images basedir $wiki->setRenderConf('xhtml', 'image', 'base', path::http("images")); $wiki->enableRule('html'); $sites = array('Site' => substr(path::http(), 0, -1) . '%s'); $wiki->setRenderConf('xhtml', 'interwiki', 'sites', $sites); $pages = $content->get_pages_list(); $wiki->setRenderConf('xhtml', 'wikilink', 'pages', $pages['pages']); $wiki->setRenderConf('xhtml', 'wikilink', 'titles', $pages['titles']); $nav = ""; $nav = @file_get_contents(path::file() . "nav.html"); $nav = str_replace("#root#", path::http(), $nav); $smarty->assign("nav", $nav); foreach ($settings['menus'] as $menu) { if ($menu['type'] == 'content') { $menu_item = $content->retrieve($menu['data'], CONTENT_NO_CACHE); $smarty->assign("menu_content", $menu_item['content']); $smarty->assign("menu_title", $menu_item['title']); $menus .= $smarty->fetch("{$settings['theme']}/menu_item.html"); } else { // Implement non-content menu items here } } $smarty->assign("menu_area", $menus);
* * Copyright © 2005 Martin Nicholls * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * @link http://wcms.berlios.de/ * @copyright 2005 Martin Nicholls * @author Martin Nicholls <webmasta at streakyland dot co dot uk> * @package wCMS * @version $Revision: 1.4 $ */ /* $Id: error.php,v 1.4 2005/09/05 10:32:50 streaky Exp $ */ require_once "boot.php"; $item_data = "\n<h2 id=\"toc0\">Error 404 - Document Not Found</h2>\n<p>The requested URL could not be found on this server. The link you followed is either outdated, inaccurate, or the server has been instructed not to allow access to it.</p>\n<p>Your unsuccessful attempt to access <b>http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}</b> has been logged for checking and possible rectification.</p>\n"; require_once "boot.php"; $smarty->assign("breadcrumb", "<a href='" . path::http() . "'>Home</a> > Error"); $page_handler->add_page_item($item_data, "Error (File Not Found)"); $page_handler->add_footer(" "); $page_handler->output_page("Error (File Not Found)");
function create_content_footer($ident, $last_mod, $revision, $item_title) { global $perms; $buttons = array(); if ($perms['wiki']['edit_pages'] == true) { $buttons[] = "<a href='" . path::http() . "edit.php?page={$ident}'><img src='" . path::http("images") . "icons/edit-trans.png' alt='Edit' title='Edit Page: {$ident}' /></a>"; //$buttons[] = "<a href='".path::http()."delete.php?page={$item}'><img src='".path::http("images")."icons/error-trans.png' alt='Delete' title='Delete Page: {$item}' /></a>"; //$buttons[] = "<a href='".path::http()."history.php?page={$ident}'><img src='".path::http("images")."icons/history-trans.png' alt='History' title='Last edited ".date("j F Y, g:ia", $last_mod).", revision {$revision}' /></a>"; } return implode(" ", $buttons); }