<?php require_once 'Sprinkles.php'; $query = request_param('query'); $mode = request_param('mode'); if (!$mode) { $mode = 'simple'; } $sprink = new Sprinkles(); $suggested = $sprink->topics(array('query' => $query, "limit" => 3)); $topics = $suggested['topics']; if ($mode == 'fancy') { $sprink->resolve_authors($topics); } $smarty->assign('suggested_topics', $topics); $smarty->assign('mode', $mode); $smarty->display('topic-suggestions.t'); finish_request('topic-suggestions');
<?php try { require_once "Sprinkles.php"; $sprink = new Sprinkles(); $top_topic_tags = take(20, $sprink->tags($api_root . 'companies/' . $sprink->company_sfnid . '/tags?on=topics&sort=usage&limit=20')); $chunk = intval(ceil(sizeof($top_topic_tags) / 4)); $top_topic_tags = array_chunk($top_topic_tags, $chunk); $entries = $sprink->topics(array("limit" => $helpstart_topic_count, "sort" => 'recently_active')); // $sprink->resolve_authors($entries['topics']); $smarty->assign('top_topic_tags', $top_topic_tags); $smarty->assign('entries', $entries['topics']); # Standard stash items $smarty->assign('products', $sprink->product_list()); $smarty->assign('current_url', 'helpstart.php'); $smarty->assign('totals', $entries['totals']); $smarty->assign('filter_style', 'question'); $sprink->add_std_hash_elems($smarty); $smarty->display('helpstart.t'); finish_request('helpstart'); } catch (Exception $e) { error_log("Exception thrown while preparing page: " . $e->getMessage()); $smarty->assign('error_msg', $e->getMessage()); $smarty->display('error.t'); }
$friendly_style = 'discussion'; break; default: $friendly_style = 'topic'; } $sprink->resolve_authors($suggested); $smarty->assign('subject', $subject); $smarty->assign('details', $details); $smarty->assign('tags', $tags); $smarty->assign('emoticon', $emoticon); $smarty->assign('emotion', $emotion); $smarty->assign('style', $style); $smarty->assign('friendly_style', $friendly_style); $smarty->assign('product', $selected_products); $smarty->assign('top_tags', $top_tags); $smarty->assign('top_tags_count', count($top_tags)); $smarty->assign('suggested', $suggested); $products = $sprink->product_list(); foreach ($products as &$product) { $product['selected'] = in_array($product['name'], $selected_products); } $smarty->assign('products', $products); $smarty->assign('err_subject', in_array('subject', $validation_errors)); $smarty->assign('current_url', 'submit.php'); $sprink->add_std_hash_elems($smarty); $smarty->display('submit.t'); finish_request('submit'); } catch (Exception $e) { error_log("Exception thrown while preparing page: " . $e->getMessage()); $smarty->display('error.t'); }
$sprinkles_root_url = $defaults[sprinkles_root_url]; } if (!$sprinkles_root_url) { $uri = 'http' . ($_SERVER['HTTPS'] ? 's' : null) . '://' . $_SERVER['HTTP_HOST']; $uri .= $_SERVER['SERVER_PORT'] == '80' ? '' : ":" . $_SERVER['SERVER_PORT']; $uri .= $_SERVER['REQUEST_URI']; $sprinkles_root_url = $uri; } $smarty->assign('sprinkles_root_url', $sprinkles_root_url); $oauth_consumer_key = request_param('oauth_consumer_key'); if (!$oauth_consumer_key) { $oauth_consumer_key = $defaults['oauth_consumer_key']; } $oauth_consumer_secret = request_param('oauth_consumer_secret'); if (!$oauth_consumer_secret) { $oauth_consumer_secret = $defaults['oauth_consumer_secret']; } $company_sfnid = request_param('company_sfnid'); if (!$company_sfnid) { $company_sfnid = $defaults['company_sfnid']; } $smarty->assign(array('oauth_consumer_key' => $oauth_consumer_key, 'oauth_consumer_secret' => $oauth_consumer_secret, 'company_sfnid' => $company_sfnid)); $smarty->assign('msg', request_param('msg')); $smarty->assign('background_color', '#86fff6'); $smarty->assign('no_admin_link', true); $smarty->display('admin-findsite.t'); finish_request('admin-findsite'); } catch (Exception $e) { error_log("Exception thrown while preparing page: " . $e->getMessage()); $smarty->display('error.t'); }
<?php require_once "Sprinkles.php"; $sprink = new Sprinkles(); $page_num = request_param('page'); if (!$page_num) { $page_num = 0; } $topic_filters = array("limit" => $discuss_page_size, "page" => $page_num); $filter_style = request_param('style'); if ($filter_style) { $topic_filters['style'] = $filter_style; $smarty->assign('style', $filter_style); } $filter_query = request_param('query'); if ($filter_query) { $topic_filters['query'] = $filter_query; $smarty->assign('query', $filter_query); } $topics = $sprink->topics($topic_filters); $topic_count = $topics['totals']['this']; // $sprink->resolve_authors($topics['topics']); $smarty->assign('page_num', $page_num); $smarty->assign('num_pages', ceil($topic_count / $discuss_page_size)); $smarty->assign('topics', $topics['topics']); $smarty->assign('topic_count', $topic_count); $smarty->assign('totals', $topics['totals']); $sprink->add_std_hash_elems($smarty); $smarty->display('results.t'); finish_request('results');
$smarty->assign('reply_url', $reply_url); $smarty->assign(array('company_promoted_replies' => $company_promoted, 'star_promoted_replies' => $star_promoted)); $smarty->assign('flagged_topic', request_param('flagged_topic')); $smarty->assign('own_topic', $topic_head['author']['canonical_name'] == $sprink->current_username()); $smarty->assign('flagged_reply', request_param('flagged_reply')); if (request_param('shared_with')) { $smarty->assign('shared_with', explode(',', request_param('shared_with'))); } if (request_param('share_failed')) { $smarty->assign('share_failed_msg', true); } if (request_param('me_tood_topic')) { $smarty->assign('me_tood_topic_msg', true); } if (request_param('me_too_failed')) { $smarty->assign('me_too_failed_error', true); } if (request_param('no_self_star')) { $smarty->assign('self_star_error', true); } if (request_param('blank_reply')) { $smarty->assign('blank_reply_error', true); } $smarty->assign('current_url', 'topic.php?id=' . $topic_id); $sprink->add_std_hash_elems($smarty); $smarty->display('topic.t'); finish_request('topic'); } catch (Exception $e) { error_log("Exception thrown while preparing page: " . $e->getMessage()); $smarty->display('error.t'); }
<?php try { require_once "Sprinkles.php"; $sprink = new Sprinkles(); $message = $_GET['wrong_password'] ? 'The username and password you entered did not match. Please try again.' : ''; $smarty->assign('site_configured', $sprink->site_configured()); $smarty->assign('message', $message); $smarty->assign('current_url', 'admin.php'); $sprink->add_std_hash_elems($smarty); $smarty->display('admin-login.t'); finish_request('admin-login'); } catch (Exception $e) { error_log("Exception thrown while preparing page: " . $e->getMessage()); $smarty->display('error.t'); }
<?php try { require_once "Sprinkles.php"; $sprink = new Sprinkles(); $topic_id = request_param('id'); if (!$topic_id) { die("Internal error: expected id parameter."); } $items = $sprink->topic($topic_id); if (!$items) { die("Internal error: Empty topic {$topic_id}."); } $topic_head = array_shift($items['replies']); $smarty->assign('topic_head', $topic_head); $smarty->assign('topic_id', $topic_id); $smarty->assign('body_css_id', 'share-topic'); $smarty->assign('current_url', 'share-topic.php?id=' . $topic_id); $sprink->add_std_hash_elems($smarty); $smarty->display('share-topic.t'); finish_request('share-topic'); } catch (Exception $e) { error_log("Exception thrown while preparing page: " . $e->getMessage()); $smarty->display('error.t'); }
<?php try { require_once "Sprinkles.php"; $sprink = new Sprinkles(); $faqs = $sprink->topics(array('frequently_asked' => 1, 'style' => 'question')); $smarty->assign('entries', $entries); $smarty->assign('faqs', $faqs['topics']); $smarty->assign('current_url', 'faq.php'); $sprink->add_std_hash_elems($smarty); $smarty->display('faq.t'); finish_request('faq'); } catch (Exception $e) { error_log("Exception thrown while preparing page: " . $e->getMessage()); $smarty->display('error.t'); }
} } if (request_param('admin_users')) { $settings['admin_users_str'] = request_param('admin_users'); } $company_hcard = $sprink->company_hcard(); $smarty->assign('company_url', is_array($company_hcard['url']) ? $company_hcard['url'][0] : $company_hcard['url']); $sprinkles_tagged_topics = $sprink->topics(array('tag' => 'sprinkles', 'limit' => '3')); $sprinkles_tagged_topics = $sprinkles_tagged_topics['topics']; $site_links = $sprink->site_links(); $smarty->assign('site_links', $site_links); $smarty->assign('invalid', request_param('invalid')); $smarty->assign('errors', request_param('errors')); $smarty->assign('settings_saved', request_param('settings_saved')); $smarty->assign('hooked_msg', request_param('hooked')); $new_admins = request_param('new_admins'); if ($new_admins) { $smarty->assign('new_admins', split(',', $new_admins)); } $smarty->assign('settings', $settings); $smarty->assign('sprinkles_root_url', $sprink->sprinkles_root_url()); $smarty->assign('sprinkles_tagged_topics', $sprinkles_tagged_topics); $smarty->assign('current_url', 'admin.php'); # FIXME: this leads to odd behavior on # logout: user goes straight to sign-in # page; consider taking the logout link # to some other page. $sprink->add_std_hash_elems($smarty); $smarty->display('admin.t'); finish_request('admin');
<?php try { require_once "Sprinkles.php"; $h = new hkit(); $sprink = new Sprinkles(); $smarty->assign('body_css_id', 'contactus'); $smarty->assign('current_url', 'contactus.php'); $sprink->add_std_hash_elems($smarty); $smarty->display('contactus.t'); finish_request('contactus'); } catch (Exception $e) { error_log("Exception thrown while preparing page: " . $e->getMessage()); $smarty->display('error.t'); }