function dynamicThumbnail($thumbnail, $location, $width = 0, $height = 0, $intelliScaling = 1, $returnHow = "full") { global $clerk; $width = (int) $width; $height = (int) $height; $path = $clerk->getSetting("cache_path", 1); $url = $clerk->getSetting("cache_path", 2); $adaptive = empty($intelliScaling) ? 0 : 1; $file_extension = substr($thumbnail, strrpos($thumbnail, '.')); $cache_file_name = str_replace($file_extension, "", $thumbnail) . "." . $width . "x" . $height . "_" . $adaptive . ".jpg"; if (file_exists($path . $cache_file_name)) { list($width, $height) = getimagesize($path . $cache_file_name); return $returnHow == "full" ? '<img src="' . $url . $cache_file_name . '" width="' . $width . '" height="' . $height . '" alt="" />' : $url . $cache_file_name; } return $returnHow == "full" ? '<img src="' . linkToSite() . "?dynamic_thumbnail&file=" . $location . $thumbnail . '&width=' . $width . '&height=' . $height . '&adaptive=' . $adaptive . '" alt="" />' : linkToSite() . "?dynamic_thumbnail&file=" . $location . $thumbnail . '&width=' . $width . '&height=' . $height . '&adaptive=' . $adaptive; }
<head> <title><?php echo siteTitle(); ?> </title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <?php call_anchor("css_frontend"); call_anchor("js_frontend"); ?> </head> <body> <div id="header"> <div id="title"> <a href="<?php echo linkToSite(); ?> "><?php echo siteTitle(); ?> </a> </div> <div id="menu"> <?php echo pageList(); ?> <?php echo projectList(); ?> </div> </div>
function projects_rss() { global $clerk, $project; $feed = new FeedWriter(RSS2); $title = $clerk->getSetting("site", 1); $feed->setTitle($title . ' / Projects Feed'); $feed->setLink(linkToSite()); $feed->setDescription('Live feed of projects on ' . $title); $feed->setChannelElement('pubDate', date(DATE_RSS, time())); $projects = $clerk->query_select("projects", "", "WHERE publish= 1 ORDER BY id DESC"); while ($project = $clerk->query_fetchArray($projects)) { $newItem = $feed->createNewItem(); $newItem->setTitle($project['title']); $newItem->setLink(html_entity_decode(linkToProject($project['id']))); $newItem->setDate($project['date']); $desc = projectThumbnail(); $desc = call_anchor("projectsRssDescription", $desc); $newItem->setDescription('' . $desc . ''); $newItem->addElement('guid', linkToProject($project['id']), array('isPermaLink' => 'true')); $feed->addItem($newItem); $count = 0; $desc = ""; } $feed->genarateFeed(); }
function blog_rss() { global $clerk, $blog; $feed = new FeedWriter(RSS2); $title = $clerk->getSetting("site", 1); $feed->setTitle($title . ' / Blog Feed'); $feed->setLink(linkToSite()); $feed->setDescription('Live feed of blog posts on ' . $title); $feed->setChannelElement('pubDate', date(DATE_RSS, time())); $get = $clerk->query_select("secretary_blog", "", "ORDER BY date DESC"); while ($blog = $clerk->query_fetchArray($get)) { $newItem = $feed->createNewItem(); $newItem->setTitle($blog['title']); $newItem->setLink(html_entity_decode(linkToPost(false, $blog['id']))); $newItem->setDate($blog['date']); $desc = postImage() . '<br />' . postText(); $desc = call_anchor("blogRssDescription", $desc); $newItem->setDescription('' . $desc . ''); $newItem->addElement('guid', linkToPost(), array('isPermaLink' => 'true')); $feed->addItem($newItem); $count = 0; $desc = ""; } $feed->genarateFeed(); }