time()-3600){ if(floor((time()-$lv) / 60)==1) $newstime=floor((time()-$lv) / 60).' minuut'; else if(floor((time()-$lv) / 60)>1) $newstime=floor((time()-$lv) / 60).' minuten'; else $newstime=floor((time()-$lv)).' sec'; }else if($lv>time()-3600*24) $newstime=floor((time()-$lv) / 60 / 60).' uur'; else //if($lv>time()-3600*24*7){ if(floor((time()-$lv) / 60 / 60 / 24)>1) $newstime=floor((time()-$lv) / 60 / 60 / 24).' dagen'; else $newstime=floor((time()-$lv) / 60 / 60 / 24).' dag';*/ return $newstime; } $category=str_replace('-','%',$_G['category']); $labelResult=mq('SELECT * FROM `'.DB_TABLE_NAME.'-labels` WHERE category LIKE "'.$category.'";'); $sqllabels=''; $pageTitle='Melf - De beste Nederlandse website van de wereld'; while($label=mysql_fetch_object($labelResult)){ $pageTitle='Melf '.$label->category; if(!$sqllabels) $sqllabels.=' AND (label="'.$label->labeltitle.'"'; else $sqllabels.=' OR label="'.$label->labeltitle.'" '; $categorytab=$label->category; } if($sqllabels) $sqllabels.=')'; //echo $sqllabels; $newscountResult=mq('SELECT COUNT(*) AS newscount FROM `'.DB_TABLE_NAME.'-topics` WHERE (topictype="news" OR topictype="review" OR topictype="editorial") AND topicstatus=1 '.$sqllabels.$srcq.';'); $pagecount=ceil(mysql_fetch_object($newscountResult)->newscount/17); $lastpage=$pagecount; //echo $lastpage; $page=1; if(is_numeric($_G['page']) && $_G['page']>0) $page=$_G['page']; // $newsResult=mq('SELECT * FROM `'.DB_TABLE_NAME.'-topics` AS topics, `'.DB_TABLE_NAME.'-users` AS users, `'.DB_TABLE_NAME.'-posts` AS posts WHERE users.userid=topics.userid AND posts.postid=(SELECT MIN(postid) FROM `'.DB_TABLE_NAME.'-posts` AS p2 WHERE p2.parentid=topics.topicid LIMIT 1) AND topics.forumid=0 AND topics.topicstatus=1 '.$srcq.' ORDER BY topics.startdatetime DESC LIMIT '.(($page-1)*10).',10;'); // $newsResult=mq('SELECT * FROM `'.DB_TABLE_NAME.'-topics` AS topics, `'.DB_TABLE_NAME.'-posts` AS posts WHERE posts.postid=(SELECT MIN(postid) FROM `'.DB_TABLE_NAME.'-posts` AS p2 WHERE p2.parentid=topics.topicid LIMIT 1) AND topics.forumid=0 AND topics.topicstatus=1 '.$srcq.' ORDER BY topics.startdatetime DESC LIMIT '.(($page-1)*10).',10;'); $newsResult=mq('SELECT * FROM `'.DB_TABLE_NAME.'-topics` WHERE (topictype="news" OR topictype="review" OR topictype="editorial") AND topicstatus=1 '.$sqllabels.$srcq.' ORDER BY startdatetime DESC LIMIT '.(($page-1)*17).',17;'); $npWhere=""; while($news=mysql_fetch_object($newsResult)){ if(strlen($npWhere)>0) $npWhere.=" OR "; $npWhere.='parentid='.$news->topicid; } $newsPostTempResult=mq('SELECT *, MIN(postid) AS minpo FROM `'.DB_TABLE_NAME.'-posts` WHERE '.$npWhere.' GROUP BY parentid ORDER BY postdatetime DESC;'); $npWhere=""; while($news=mysql_fetch_object($newsPostTempResult)){ if(strlen($npWhere)>0) $npWhere.=" OR "; $npWhere.='postid='.$news->minpo; } $newsPostResult=mq('SELECT * FROM `'.DB_TABLE_NAME.'-posts` WHERE '.$npWhere.' ORDER BY postdatetime DESC;'); //$page=1; // $topicResult=mq('SELECT * FROM `'.DB_TABLE_NAME.'-topics` AS topics, `'.DB_TABLE_NAME.'-users` AS users WHERE (topics.forumid=2 OR topics.forumid=4 OR topics.forumid=9 OR topics.forumid=15 OR topics.forumid=16) AND topics.userid=users.userid '.$srcq.' ORDER BY topics.lastpost DESC LIMIT '.($page*10-10).',10;'); $topicResult=mq('SELECT * FROM `'.DB_TABLE_NAME.'-topics` WHERE 1=1 '.$sqllabels.' '.$srcq.' AND topictype="" ORDER BY startdatetime DESC LIMIT '.($page*10-10).',10;'); //$eventResult=mq('SELECT * FROM `'.DB_TABLE_NAME.'-topics` AS topics, `'.DB_TABLE_NAME.'-events` AS events WHERE topics.topictype="event" AND events.topicid=topics.topicid ORDER BY topics.startdatetime DESC LIMIT 3;'); //echo 'SELECT * FROM `'.DB_TABLE_NAME.'-topics` AS topics, `'.DB_TABLE_NAME.'-users` AS users WHERE (topics.forumid=2 OR topics.forumid=4 OR topics.forumid=9) AND topics.userid=users.userid '.$srcq.' ORDER BY topics.lastpost ASC LIMIT '.($page*20-20).',20;'; // $topicResult=mq('SELECT * FROM `'.DB_TABLE_NAME.'-topics` AS topics, `'.DB_TABLE_NAME.'-users` AS users WHERE topics.forumid=2 OR topics.forumid=4 OR topics.forumid=9) AND topics.userid=users.userid '.$srcq.' ORDER BY topics.lastpost ASC LIMIT '.($page*50-50).',50;'); $galleriesResult=mq('SELECT * FROM `'.DB_TABLE_NAME.'-images` AS images LEFT JOIN `'.DB_TABLE_NAME.'-galleries` AS galleries ON images.galleryid=galleries.galleryid GROUP BY images.galleryid ORDER BY images.galleryid DESC;'); mysql_data_seek($newsResult,0); mysql_close($sqlconnection); $pageNav=showPages($page,$lastpage,false,$srcurlvars,true); //echo 'pagecount: '.$pagecount; $i=1; $pageBody.='
'; //

Muziek

$odd=true; $i=300; while($news=mysql_fetch_object($newsResult)){ $i++; $newstime=timeago(strtotime($news->startdatetime),true); if($i==306) break; //$newsPost=explode('[more]',$news->post); $np=mysql_fetch_object($newsPostResult); //print_r($np); $newsPost=explode('[more]',$np->post); if(sizeof($newsPost)>1) $np=$newsPost[0]; else $np=$np->post; // if($odd) // $pageBody.= '
'; // else // $pageBody.= '
'; $odd=!$odd; $str=strip_tags(ubb($np)); $retstr=''; $sstr=explode(' ',$str); foreach($sstr AS $s){ if(strlen($retstr.' '.$s)<150){ if(strlen(trim($s))>0) $retstr.=' '.$s; }else break; } if(strlen($retstr)
'; $pageBody.= '

'.$retstr.' »

'.$news->label.' | '.$news->postcount.' reacties


'; }else{ if($i%5==2){ $pageBody.='
'; $pageBody.= '

'.$retstr.' »

'.$news->label.' | '.$news->postcount.' reacties


'; }else{ if($i%5==3){ $pageBody.='
'; $pageBody.= '

'.$retstr.' »

'.$news->label.' | '.$news->postcount.' reacties


'; }else{ $pageBody.='
'; $pageBody.= '

'.$retstr.' »

'.$news->label.' | '.$news->postcount.' reacties


'; } } } /* $pageBody.= '
'; $pageBody.='
'; //
'.$b[$news->newscategory].'
$pageBody.='

'.$news->topictitle.'

'; //$pageBody.='Geplaatst door '; // $pageBody.=$news->username.' op //'.date('j ',strtotime($news->postdatetime)).$months[date('n',strtotime($news->postdatetime))-1].date(' Y \o\m H:i:s',strtotime($news->postdatetime)).''; //$pageBody.=''.$newstime.' geleden geplaatst
'; $pageBody.=''.$retstr.' »

';*/ } $pageBody.='
'; $pageBody.='
'; $odd=true; //$i=0; $np=mysql_fetch_object($newsPostResult); while($news=mysql_fetch_object($newsResult)){ $i++; $newstime=timeago(strtotime($news->startdatetime),true); $np=mysql_fetch_object($newsPostResult); // if($i==5) // break; //$newsPost=explode('[more]',$news->post); //print_r($np); $newsPost=explode('[more]',$np->post); if(sizeof($newsPost)>1) $np=$newsPost[0]; else $np=$np->post; // if($odd) // $pageBody.= '
'; // else // $pageBody.= '
'; $odd=!$odd; $pageBody.= '
'; $pageBody.='
'; $pageBody.='
'; $pageBody.='
'; $pageBody.='

'.$news->topictitle.'

'; //$pageBody.='Geplaatst door '; // $pageBody.=$news->username.' op //'.date('j ',strtotime($news->postdatetime)).$months[date('n',strtotime($news->postdatetime))-1].date(' Y \o\m H:i:s',strtotime($news->postdatetime)).''; $str=strip_tags(ubb($np)); $retstr=''; $sstr=explode(' ',$str); foreach($sstr AS $s){ if(strlen($retstr.' '.$s)<100) if(strlen(trim($s))>0) $retstr.=' '.$s; else break; } if(strlen($retstr)
'; $pageBody.=''.$retstr.' »

'.$news->label.' | '.$news->postcount.' reacties



'; } $pageBody.='
'; /* $pageBody.='
'; while($news=mysql_fetch_object($newsResult)){ $pageBody.= '
'; $pageBody.=''.date('j ',strtotime($news->startdatetime)).substr($months[date('n',strtotime($news->startdatetime))-1],0,3).' '.$news->topictitle.''; $pageBody.='
'; } $pageBody.='

'; */ $pageBody.='
Nieuwste topics
'; /* $pageBody.='
label!='XXX'){ $z++; if($z<13){ // $newstime=''; // $pageBody.= 'start: '.$topic->startdatetime; $lv=strtotime($topic->lastpost); if($lv>$now-3600){ if(floor(($now-$lv) / 60)>=1) $newstime=floor(($now-$lv) / 60).' min'; else{ //if($currentUser->isAdministrator()) $newstime=floor(($now-$lv)).' sec'; } }else if($lv>$now-3600*24) $newstime=floor(($now-$lv) / 60 / 60).' uur'; else //if($lv>time()-3600*24*7){ if(floor(($now-$lv) / 60 / 60 / 24)>1) $newstime=floor(($now-$lv) / 60 / 60 / 24).' dag'; else $newstime=floor(($now-$lv) / 60 / 60 / 24).' dag'; // } $pageBody.= '