<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <link rel="stylesheet" type="text/css" href="<?=$CONF['url_path']?>css/rc.css" /> <title>Rapid Coffee - Topic list (<?=$day?>/<?=$month?>/<?=$year?>)</title> </head> <body> <div id='beta-info'><?=preg_replace('/<a>([^<]+)<\/a>/', "<a href='/{$_GET['where']}'>$1</a>", $LANG['access_fullversion'])?></div> <div id='content-body'> <div id='tab-container'> <div class='unit'> <div class='unit-head'> <span class='unit-title'><?=$LANG['topic_topicspostedin']?> <?=$year?>/<?=$month?>/<?=$day?> - <?=$LANG['topic_seetopicin']?> <a href='<?=$inminus1_href?>'><?=$inminus1?></a> - <a href='<?=$inmore1_href?>'><?=$inmore1?></a></span> </div> <ol class='topic-previews'> <? foreach($result as $topic) { ?> <li class="topic-stop topic-preview id-<?=$topic['id']?> version-<?=$topic['version']?> orderid-<?=$topic['orderid']?>"> <a href="<?=$CONF['userfriendly_topic'].'archive/'.$topic['id']?>/<?=Topic::prettyUrl($topic['subject']);?>" class="topic-title"><?=$topic['subject']?></a> <div class="topic-summary"><?=$topic['subsumedmsg']?></div> <div class="info-bar"> <div class="fl postedby"><?=$LANG['topic_postedby']?> <?=$topic['author']?></div> <div class="fr viewslikes"> <span class="cb"><?=$topic['replies']?></span> <?=$LANG['topic_replies']?> :: <span class="co"><?=$topic['views']?></span> <?=$LANG['topic_views']?> :: <span class="cg"><?=$topic['likes']?></span> <?=$LANG['topic_likes']?> :: <span class="cr"><?=$topic['dislikes']?></span> <?=$LANG['topic_dislikes']?> </div> </div> </li> <? } ?> </ol> </div> </div>
public function getJsonTags(){ $r=array(); $r['id'] = $this->getId(); $r['subject'] = $this->getSubject(); $r['msg'] = $this->getMsg(); $r['author'] = $this->getAuthor(); $r['channel'] = $this->channel->getName(); $r['channelid'] = $this->channel->getId(); $r['channel_urlname'] = $this->channel->getUrlname(); $r['channel_logo_update_time'] = $this->channel->getLogoUpdateTime(); $r['signature'] = $this->getUser()->getSignature(); $r['author_hasavatar'] = $this->getUser()->hasAvatar(); $r['author_avatar_update_time'] = $this->getUser()->getAvatarUpdateTime(); $r['channel_haslogo']=$this->getChannel()->hasLogo(); $r['author_logo_update_time'] = $this->getChannel()->getLogoUpdateTime(); $r['replies'] = $this->getNumReplies(); $r['views'] = $this->getNumViews(); $r['likes'] = $this->getNumLikes(); $r['dislikes'] = $this->getNumDislikes(); $r['timeago'] = $this->getTimeAgo(); $r['updatetimeago'] = $this->getUpdateTimeAgo(); $r['version'] = $this->getCounter(); $r['subsumedmsg'] = $this->getSubsumedMsg(); $r['lang'] = $this->getLang(); $r['ldvote'] = $this->getUserLDVote(); $r['isfollowing'] = $this->isFollowing(); $r['upped'] = $this->isUpped(); $r['orderid'] = $this->getOrderId(); $r['subject_for_url'] = Topic::prettyUrl($this->getSubject()); return $r; }
function add_topic() { global $CONF; $user = $_SESSION['user']; if ($user->getBanned()>0){ return array('ok'=>false, 'error'=>'banned '.$user->getBanned()); } if (isset($_SESSION['topic_last_flood_time'])){ if ((time() - $_SESSION['topic_last_flood_time']) < $CONF['topic_time_to_wait_flood']){ $time_to_wait = $CONF['topic_time_to_wait_flood'] - (time() - $_SESSION['topic_last_flood_time']); return array('ok'=>false, 'error'=>'flood '.$time_to_wait); } } $user = $_SESSION['user']; $topic = new Topic(); if (isset($_GET['channelid_add_topic'])){ $channel = new Channel(); $channel->setId($_GET['channelid_add_topic']); if (!$channel->canITopic()) return array('ok'=>false, 'error'=>'you cant create topic in this channel'); $topic->setChannel($channel); } $topic->setUser($user); $subject = strip_tags($_POST['subject']); if (strlen(str_replace(' ', '', $subject)) < $CONF['min_msg_chars']) return array('ok'=>false, 'error'=>'too short subject'); $topic->setSubject($subject); $msg = $_POST['msg']; if (strlen(str_replace(' ', '', strip_tags($msg))) < $CONF['min_msg_chars']) return array('ok'=>false, 'error'=>'too short message'); $msg = strip_tags($msg, $CONF['permitted_tags_msg']); //$msg = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]","<a target=\"_BLANK\" href=\"\\0\">\\0</a>", $msg); //detectando URLs $msg = text_linkify($msg); $msg = str_replace(' ',' ',$msg); $topic->setMsg($msg); if ($topic->save()=='ok'){ $_SESSION['topic_last_flood_time']=time(); $topic->follow(); $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=UTF-8\r\n"; $headers .= "From: {$CONF['email_from']}\r\n"; $headers .= "To: YOU <you>\r\n"; $_pretty=Topic::prettyUrl($topic->getSubject()); $body='Acesse: <a href="http://rapidcoffee.com//'.$topic->getId().'/'.$_pretty.'">http://rapidcoffee.com//'.$topic->getId().'/'.$_pretty.'</a>'; //system("echo \"".$body."\" > email.html"); //mail('lucasvendramin85@gmail.com, danilo.horta@gmail.com', "Rapidcoffee-NOVO TOPICO", $body, $headers); return array('ok'=>true, 'error'=>''); } else return array('ok'=>false, 'error'=>'Problems with this topic.'); }