/** * Formats an error string into an error item container as deteremined by mode * @param string error The error string to format * @param string mode Either 'text' or 'html'; defaults to 'html' * @param array forms (Optional) Templates to use for formatting * @return string Returns formatted error item. */ function error_format($error, $mode = "html", $forms = false) { // Default to html mode for output if ($mode != "html" || $mode != "text") { $mode = "html"; } // Allow forms to be passed if ($forms === false) { // Get necessary templates if not included $forms = multiform(PATH_TEMPLATES_STUBS . "errors.gform.html"); } // Format this error into the error item container return sprintf($forms['error-item-' . $mode], $error); }
/** * Thumbnail list generator * Adapted from Westcoe Property listing library * * @author Justin Johnson <johnsonj>, justin@zebrakick.com * @author Andrew Murphy * @version 2.5.6 20080317 JJ * @version 2.5.4 20080316 JJ * @version 1.1.0 20080125 JJ * @version 1.0.0 20071116 AM */ function build_thumbnails_list($images, $template = false, $columns = 1) { $count = count($images); if ($count < 1) { return ''; } if (empty($template)) { $template = multiform(PATH_TEMPLATE_STUBS . 'stubs/examples/details.gform.html'); } $search = array('{listing_id}', '{photo_path}', '{photo_id}', '{title}', '{description}', '{index}'); $list = array_fill(0, $columns, ''); for ($i = 0; $i < $count; ++$i) { $list[$i % $columns] .= str_replace($search, array($images[$i]['listing_id'], get_path('imageGateway', true) . '?id=' . $images[$i]['photo_id'], $images[$i]['photo_id'], $images[$i]['title'], $images[$i]['description'], $i), $template); } return "\n<ul>\n" . implode("</ul>\n<ul>\n", $list) . "</ul>\n"; }
* * @author Justin Johnson <johnsonj>, justin@zebrakick.com * @version 1.4.0 20080430 JJ * @version 1.2.0 20080317 JJ * @version 1.1.0 20080315 JJ * @version 1.0.0 20080314 JJ * */ include_gobe_module('output.multiform'); include_gobe_module('gallery.main'); include_gobe_module('gallery.results'); $countPerPage = isset($_GET['count']) && (int) $_GET['count'] > 0 ? (int) $_GET['count'] : DB_DEFAULT_LIMIT; $currentPage = isset($_GET['page']) && (int) $_GET['page'] > 1 ? (int) $_GET['page'] : 1; $startListing = ($currentPage - 1) * $countPerPage; $sortBy = isset($_GET['sortBy']) ? $_GET['sortBy'] : 'high-low'; $templates = multiform(PATH_TEMPLATES . 'stubs/examples/sidebar.gform.html'); $results = getExamples(); if (!empty($results)) { $resultsList = $title = ''; $goat = new goat(); $goat->register_variable('title', ''); $goat->register_variable('url', ''); $goat->register_variable('alt', ''); foreach ($results as $listing) { $title = stripslashes($listing['title']); $goat->mod_variable('title', $title); $goat->mod_variable('url', get_path('examples-details', true) . '?id=' . $listing['listing_id']); $goat->mod_variable('alt', str_replace('"', "''", $title)); $resultsList .= $goat->parse($templates['sidebar-list']); } } else {