public function index() { $this->assign('LatestArticles', getLatest()); $this->assign('categories', getCategory()); $this->assign('allTags', getAllTags()); $this->type = $this->_get('type'); $this->typevalue = $this->_get('typevalue'); $page = isset($_GET['page']) ? $_GET['page'] : 1; switch ($this->_get('type')) { case 'username': $this->UserName($this->_get('typevalue'), $page); break; case 'userid': $this->UserId($this->_get('typevalue'), $page); break; case 'tag': $this->Tag($this->_get('typevalue'), $page); break; case 'category': $this->Category($this->_get('typevalue'), $page); break; case 'search': $this->Search($this->_get('keywords'), $page); break; default: $this->error('出错了'); } //模板输出 $this->display('articlelist'); }
public function index() { $data = isset($_GET['page']) ? $_GET['page'] : 1; $this->show($data); $this->assign('LatestArticles', getLatest()); $this->assign('categories', getCategory()); $this->assign('allTags', getAllTags()); $this->display(); }
public function getGroupAndTagInfos() { global $user; $a = array(); if (user_access("view alldata", "churchdb")) { $a["groups"] = getAllGroups(); } else { $a["groups"] = churchdb_getMyGroups($user->id, false, true); } $a["tags"] = getAllTags(); return $a; }
/** * 展示文章 根据articleid */ public function show($id) { $this->assign('LatestArticles', getLatest()); $this->assign('allTags', getAllTags()); $articles = M('article'); $data = $articles->find($id); if ($data) { //上一篇 $pre = $articles->where('article_id<' . $id . ' AND article_authorId=' . $data['article_authorId'])->field('article_id, article_title')->find(); if ($pre) { $this->assign('preArticle', $pre); } //下一篇 $next = $articles->where('article_id>' . $id . ' AND article_authorId=' . $data['article_authorId'])->field('article_id, article_title')->find(); if ($next) { $this->assign('nextArticle', $next); } $data['article_content'] = stripcslashes($data['article_content']); $this->assign('article', $data); $this->getComment($this->_get('id')); //获取文章tags $tag = M('tag'); $arttag = M('article_tag'); $art_tags = $arttag->where('article_id=' . $this->_get('id'))->select(); if ($art_tags) { $tags = array(); foreach ($art_tags as $art_tag) { $realTag = $tag->where('tag_id=' . $art_tag['tag_id'])->select(); $tags[] = $realTag[0]; } $this->assign('tags', $tags); } else { $this->assign('tags', array()); } $article = M('article'); $sql = 'update ' . C('DB_PREFIX') . 'article set article_readnum=article_readnum+1 where article_id=' . $id; $article->execute($sql); $this->assign('pagetitle', ' | ' . $data['article_title']); $this->assign('keywords', 'Insist Blog, ' . $data['article_title']); $this->assign('description', $data['article_title']); } else { $this->error('抱歉,没找到文章'); } $this->display('article'); //模板输出 }
/** * get master data * @see CTModuleInterface::getMasterData() * * @return array */ public function getMasterData() { global $user, $base_url, $files_dir, $config; $res = churchdb_getMasterDataTables(); $res["feldtyp"] = churchcore_getTableData("cdb_feldtyp"); $res["fields"] = getAllFields(); $res["groups"] = getAllGroups(); $res["tags"] = getAllTags(); $res["FUNachfolgeDomains"] = array("0" => array("id" => "0", "bezeichnung" => "Kein"), "1" => array("id" => "1", "bezeichnung" => $res["fields"]["f_group"]["fields"]["gruppentyp_id"]["text"]), "2" => array("id" => "2", "bezeichnung" => $res["fields"]["f_group"]["fields"]["distrikt_id"]["text"]), "3" => array("id" => "3", "bezeichnung" => t("group"))); $res["groupMemberTypes"] = getGroupMemberTypes(); $res["groupFilterTypes"] = churchdb_getGroupFilterTypes(); // master data information for maintain masterdata and statistics if (user_access("edit masterdata", "churchdb") || user_access("view statistics", "churchdb")) { $res["masterDataTables"] = churchdb_getMasterDataTablenames(); } $res["user_pid"] = $user->id; $res["userid"] = $user->vorname . " " . $user->cmsuserid . " [" . $user->id . "]"; $res["auth"] = churchdb_getAuthForAjax(); $res["site_name"] = getConf('site_name'); $res["modulespath"] = churchdb_getModulesPath(); $res["files_url"] = $base_url . $files_dir; $res["modulename"] = "churchdb"; $res["max_uploadfile_size_kb"] = getConf('max_uploadfile_size_kb'); $res["adminemail"] = getConf('site_mail', ''); $res["max_exporter"] = getConf('churchdb_maxexporter', '150'); $res["groupnotchoosable"] = getConf('churchdb_groupnotchoosable', 30); $res["home_lat"] = getConf('churchdb_home_lat', '53.568537'); $res["home_lng"] = getConf('churchdb_home_lng', '10.03656'); $res["settings"] = churchdb_getUserSettings($user->id); $res["last_log_id"] = churchdb_getLastLogId(); $res["mailchimp"] = getConf('churchdb_mailchimp_apikey') != ""; $res["views"] = array("ArchiveView" => array("filename" => "cdb_archiveview"), "MapView" => array("filename" => "cdb_mapview"), "StatisticView" => array("filename" => "cdb_statisticview"), "SettingsView" => array("filename" => "cdb_settingsview"), "MaintainView" => array("filename" => "cdb_maintainview"), "WeekView" => array("filename" => "../churchresource/cr_weekview")); if (user_access("administer persons", "churchcore")) { $res["auth_table"] = churchdb_getAuthTable(); } if (isset($res["auth"]["edit newsletter"])) { $nl = churchdb_getTableData("cdb_newsletter"); $newsletter = array(); foreach ($res["auth"]["edit newsletter"] as $n) { $newsletter = $nl[$n]; } $res["newsletter"] = $newsletter; } return $res; }
<?php require_once "parts.php"; require_once "model.php"; ?> <?php $tagsList = getAllTags(); ?> <?php $title = "Startup Tools and Resources"; $description = "Tools to help you build, run and grow a startup: "; $keywords = "Startup Tools, Startup Resources"; $i = 0; foreach ($tagsList as $kw) { $i++; if ($i < 10) { $keywords = $keywords . ", " . $kw["name"]; $description = $description . $kw["name"] . ", "; } } $description = substr($description, 0, -2); get_header($title, $description, $keywords); ?> <script>mixpanel.track("All Tags Page");</script> <?php printHeroUnit();
<?php include_once '../Controllers/back_tagControl.php'; $rs = getAllTags(); $sort = sortTags($rs); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title></title> <link rel="stylesheet" href="../public/stylesheets/back.css"> <style type="text/css"> .block { margin: 10px 20px; padding 0 20px; } .block > h2 { padding-left: 10px; margin-bottom: 5px; } .tag { margin: 0 5px; padding: 5px 8px; color: #696969; font-family: "微软雅黑"; font-size: 0.8em; border: 1px solid #e6e6e6; } .tag:hover { cursor: pointer;
echo $matches[1]; ?> "><a href="<?php echo $matches[1]; ?> ">Audio</a></audio> <?php echo $post_content; ?> ]]></content:encoded> <wp:post_name><?php echo formatPermalinkSlug($post->attributes()->id, $post->{'audio-caption'}); ?> </wp:post_name> <?php break; } ?> </item> <?php } $out = ob_get_contents(); ob_end_clean(); getWarnings(); getAllTags(); echo $out; ?> </channel> </rss>
public function edit($slug = null) { if (!\App::isGranted('editPost')) { redirect('admin/dashboard'); } try { // get post types and categories from helper $postTypes = getPostTypes(); $categorys = getCategorys(); if (!$slug) { throw new Exception("Error processing request.", 1); } $postManager = $this->container->get('post.post_manager'); $post = $postManager->getPostBySlug($slug); if (!$post) { throw new Exception("Post not found.", 1); } if ($post->isTrashed()) { throw new Exception("Post has been deleted already.", 1); } $oTags = $post->getTags(); $oldTags = ''; foreach ($oTags as $i => $tag) { $oldTags .= $tag->getName(); if ($i != count($oTags)) { $oldTags .= ','; } } $mediaSource = ''; foreach ($post->getMedias() as $i => $media) { $separator = $i == 0 || $i == count($post->getMedias()) ? '' : ','; $mediaSource .= $separator . $media->getSource(); } if ($this->input->post()) { $ruleManager = $this->container->get('post.rule_manager'); $this->form_validation->set_rules($ruleManager->getRules(array('title'))); if ($this->form_validation->run($this)) { $post->setTitle($this->input->post('title')); $post->setContent($this->input->post('content')); $postTypeManager = $this->container->get('post.post_type_manager'); if ($this->input->post('postType')) { $postType = $postTypeManager->getPostTypeById($this->input->post('postType')); } else { $postType = defaultPostType(); } $post->setPostType($postType); $categoryManager = $this->container->get('post.category_manager'); $cats = array(); if ($this->input->post('category')) { foreach ($this->input->post('category') as $id) { $cat = $categoryManager->getCategoryById($id); $cats[] = $cat; } } else { $cats[] = defaultCategory(); } $post->setCategorys($cats); if ($this->input->post('tags')) { $tags = explode(',', $this->input->post('tags')); $dbTags = getAllTags(); $postTags = array(); $tagManager = $this->container->get('post.tag_manager'); foreach ($tags as $tag) { if (!in_array($tag, $dbTags) && $tag) { $newTag = $tagManager->createTag(); $newTag->setName($tag); $tagManager->updateTag($newTag); $tag = $newTag; } else { $tag = $tagManager->getTagByName($tag); } if ($tag) { $postTags[] = $tag; } } $post->setTags($postTags); } else { $post->setTags(array()); } if ($this->input->post('mediaSrc') != $mediaSource) { $sources = explode(',', $this->input->post('mediaSrc')); $dbMedia = getAllMediaSources(); $postMedias = array(); $mediaManager = $this->container->get('media.media_manager'); foreach ($sources as $src) { if (!in_array($src, $dbMedia) && $src) { $newMedia = $mediaManager->createMedia(); $newMedia->setSource($src); $mediaManager->updateMedia($newMedia); $media = $newMedia; } else { $media = $mediaManager->getMediaBySource($src); } if ($src) { $postMedias[] = $media; } } $post->setMedias($postMedias); } if ($this->input->post('btnPublish') && $post->isDraft()) { $post->activate(); } $postManager->updatePost($post); $this->session->setFlashMessage('feedback', "Post ({$post->getTitle()}) has been updated.", 'success'); redirect(site_url('admin/post')); } } $this->breadcrumbs->push('Edit', current_url()); $this->templateData['postTypes'] = $postTypes; $this->templateData['post'] = $post; $this->templateData['mediaSource'] = $mediaSource; $this->templateData['oldTags'] = $oldTags; $this->templateData['categorys'] = $categorys; $this->templateData['pageTitle'] = 'Edit Post'; $this->templateData['content'] = 'post/edit'; $this->load->view('backend/main_layout', $this->templateData); } catch (Exception $e) { $this->session->setFlashMessage('feedback', "Unable to edit post: {$e->getMessage()}", 'error'); redirect(site_url('admin/post')); } }
function get_footer() { global $twitterShareLink, $facebookShareLink; $tagsList = getAllTags(); echo '<!-- Footer --> <div class="container"><div class="service"> <div class="row"> <div class="span12"><h4 class="pull-left">Join</h4><br/></div> <div class="span12"> <a href="new-tool.php" title="add a tool" class="btn" rel="nofollow">Add a Tool</a>   <a href="contact.php" title="be a featured tool" class="btn" rel="nofollow">Be featured</a> </div><br/><br/><br/> <div class="span12"><div class="fb-like-box" data-href="http://www.facebook.com/tuneyourstartup" data-width="960" data-height="170" data-show-faces="true" data-stream="false" data-header="false"></div> </div> </div> </div> </div> </div> <footer> <div class="container"> <div class="row"> <div class="span4"> <div class="widget"> <div class="footer-headings"><span><b>SHARE</b> STARTUP TOOLS!</span></div> <div class="icons"> <a href="' . $facebookShareLink . '" target="_blank" rel="nofollow"><i class="icon-facebook"></i></a> <a href="' . $twitterShareLink . '" target="_blank" rel="nofollow"><i class="icon-twitter"></i></a> </div> </div> </div> <!-- <div class="span4"> <div class="widget"> <h3><span>Recent Stuffs</span></h3> <ul> <li>Etiam adipiscing posuere justo, nec iaculis justo dictum non</li> <li>Cras tincidunt mi non arcu hendrerit eleifend</li> <li>Aenean ullamcorper justo tincidunt justo aliquet et lobortis diam faucibus</li> <li>Maecenas hendrerit neque id ante dictum mattis</li> </ul> </div> <?php endif; ?> </div> --> <div class="span4"> <div class="widget"> <div class="footer-headings"><span>Subscribe</span></div> <p>Be the first to know about "that new tool that can boost your productivity"</p> <div class="form"> <form method="post" action="#" id="subscribeform" class="form-search"> <input type="text" value="" name="s" id="emailField" class="input-medium"/> <input type="button" id="subscribeButton" value="Subscribe" class="btn btn-orange"/> <div id="resposta"></div> </form> </div> </div> </div> <div class="span4"> <div class="widget"> <div class="footer-headings"><span>Add a tool</span></div> <a href="new-tool.php" rel="nofollow">Add it here</a> </div> <div class="widget"> <div class="footer-headings"><span>Contact Us</span></div> <a href="contact.php" rel="nofollow">Send a message</a> </div> </div> </div> <hr /> <div class="row"> <div class="span12"> <p>Copyright © - <a href="/">Tune Your Startup</a></p><p><strong>Top tools, services and resources to help you in:</strong></p>'; foreach ($tagsList as $tag) { echo '<a href="tag.php?tag=' . $tag["name"] . '" title="Top tools for ' . $tag["name"] . '">' . $tag["name"] . '</a> |'; } echo ' </div> </div> <div class="clearfix"></div> </div> </footer> '; echo ' <script> $(document).ready(function() { $("#subscribeButton").click(function() { $(".error").hide(); var hasError = false; var emailReg = /^([\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4})?$/; var emailPost = $("#emailField").val(); if(emailPost == "") { $("#subscribeButton").after("<br/><span>Please enter your email address.</span>"); hasError = true; } else if(!emailReg.test(emailPost)) { $("#subscribeButton").after("<br/><span>Enter a valid email address.</span>"); hasError = true; } if(hasError == true) { return false; } var actionPost = "simpleSubscribe"; $.post("save.php", {email: emailPost, action: actionPost}, function(data){ $("#resposta").html("done!"); }); return false; }); }); $(document).ready(function() { $("#suggestionButton").click(function() { $(".error").hide(); var hasError = false; var newToolPost = $("#newToolField").val(); if(newToolPost == "") { $("#suggestionButton").after("<br/><span>Please enter the name.</span>"); hasError = true; } if(hasError == true) { return false; } var actionPost = "simpleSuggestion"; $.post("save.php", {toolSuggestion: newToolPost, action: actionPost}, function(data){ $("#respostaSuggestion").html("done!"); }); return false; }); }); </script> <script type="text/javascript"> /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */ var disqus_shortname = "tuneyourstartup"; // required: replace example with your forum shortname /* * * DON"T EDIT BELOW THIS LINE * * */ (function () { var s = document.createElement("script"); s.async = true; s.type = "text/javascript"; s.src = "http://" + disqus_shortname + ".disqus.com/count.js"; (document.getElementsByTagName("HEAD")[0] || document.getElementsByTagName("BODY")[0]).appendChild(s); }()); </script> <!-- HitTail --> <script type="text/javascript"> (function(){ var ht = document.createElement("script");ht.async = true; ht.type="text/javascript";ht.src = "//97689.hittail.com/mlt.js"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ht, s);})(); </script> </body> </html>'; }
function drawAllTagsForEdit($_imgId, $_tagsActifs) { $res = ''; $tags = getAllTags(); foreach ($tags as $tag) { $aTitle = 'ajouter ce tag à l\'image'; $bold = ''; $glyphSymbol = 'plus'; $linkAction = 'image.php?img_id=' . $_imgId . '&addTagToFile=1&tagId=' . $tag['id'] . ''; if (in_array($tag['id'], $_tagsActifs)) { $aTitle = 'retirer ce tag de l\'image'; $bold = 'font-weight:bold;'; $glyphSymbol = 'minus'; $linkAction = ''; $linkAction = 'image.php?img_id=' . $_imgId . '&remTagToFile=1&tagId=' . $tag['id'] . ''; } $res .= '<a title="' . $aTitle . '" href="' . $linkAction . '" class="tagForSearch" style="' . $bold . 'color:#000;" ><span id="btnAddTagForSearch_' . $tag['id'] . '" style="color:#666;font-size:12px;" class="glyphicon glyphicon-' . $glyphSymbol . '"></span> <span id="tagName_' . $tag['id'] . '">' . $tag['name'] . '</span></a> '; } return $res; }
<?php include_once 'Controllers/tagsShow.php'; $tags = getAllTags(); $tagsList = sortTags($tags); ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/> <title>标签</title> <link rel="stylesheet" type="text/css" href="public/stylesheets/global.css"/> <link rel="stylesheet" type="text/css" href="public/stylesheets/tags.css"/> <script type="text/javascript" src="public/javascripts/navSlide.js"></script> <script type="text/javascript"> window.onload = function(){ initSlide(0); }; </script> </head> <body> <?php include_once 'menu.php'; ?> <div id="mainBox"> <div id="container"> <div class="container-header"> <span class="line"></span> <h2 class="content-title"> 标签导航</h2> </div> <?php
} } } else { echo "没有更多内容"; } ?> </ul> </div> </div> <div class="tag-cloud"> <div class="refer-title"> <div class="refer-img"><img src="/view/img/note-cloud.png"></div> <div class="refer-font">标签云</div> </div> <?php $tag = getAllTags(); if ($tag != null) { foreach ($tag as $key => $value) { if ($tags === '') { echo '<div class="tag"><a href="/questionmain/1' . '.html?tags=' . $value . '">' . $value . '</a></div>'; } else { if (strstr($tags, $value) == false) { echo '<div class="tag"><a href="/questionmain/1' . '.html?tags=' . ($value . ',' . $tags) . '">' . $value . '</a></div>'; } else { echo '<div class="tag"><a>' . $value . '</a></div>'; } } } } // echo strlen($tags) > 0? ','.$tags :'whatthefuck'; ?>