portal-classes-core.content.php
<?PHP error_reporting(E_ALL); class Content { var core) { core; } function setTopItems () { if (isset(topItemNumber = topItemNumber = 1; } if (topItemNumber > 5 || empty(topItemNumber = 1; } // -1 omdat limit bij 0 begint. sql = "SELECT content_id FROM user_content_rating WHERE content_id IN ( SELECT content_id FROM content WHERE content_type = 'video') ORDER BY user_content_rating_qualityvalue DESC LIMIT ".this->core->Db->getQueryNumRows(// Er staat niets in de tabel , duhhhhhh , nu een random content_id sql = "SELECT content_id FROM content WHERE content_type = 'video' ORDER BY rand() LIMIT 1"; this->core->Db->getQueryResult(contentId = queryResult = sql); queryResult['content_id']; } contentId." "; this->core->Db->getQueryResult(/* Oud toen het nog over alle type content ging // Wat voor plaatje moet er komen? switch (queryResult['content_type']) { case 'audio': imageUrl = '<img src="img/audio.jpg" width="475" height="150" />'; break; case 'video': imageUrl = '<img src="img/video.jpg" width="475" height="150" />'; break; case 'picture': imageUrl = '<img src="img/picture.jpg" width="475" height="150" />'; break; case 'article': imageUrl = '<img src="img/article.jpg" width="475" height="150" />'; break; default: <img src="img/article.jpg" width="475" height="150" />'; firstWord = 'FOUT'; } firstWord.' - '.queryResult['content_binary'], 280); */ if (videoCode = videoCode = ' <OBJECT id="mediaPlayer" width="400" height="300" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject"> <param name="fileName" value="http://www.few.vu.nl/~casus07/cms/'.<param name="animationatStart" value="true"> <param name="transparentatStart" value="true"> <param name="autoStart" value="true"> <param name="showControls" value="true"> <param name="loop" value="true"> <EMBED type="application/x-mplayer2" pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" id="mediaPlayer" name="mediaPlayer" displaysize="4" autosize="-1" bgcolor="darkblue" showcontrols="true" showtracker="-1" showdisplay="0" showstatusbar="-1" videoborder3d="-1" width="400" height="300" src="http://www.few.vu.nl/~casus07/cms/'.queryResult['content_binary'].'" autostart="true" designtimesp="5311" loop="true"> </EMBED> </OBJECT>'; } queryResult['content_id']; queryResult['content_description']); videoCode); link); } function getLatestPictures () { sql = "SELECT content_id FROM content_type_picture ORDER BY content_type_picture_id DESC LIMIT 5"; // Eventueel: WHERE rss_article = 0 om de rss feeds eruit te halen this->core->Db->getQueryResults(i = 0 ; articleQueryResults) ; sql = "SELECT * FROM content WHERE content_id = ".i]['content_id']." "; this->core->Db->getQueryResult(result[] = array( "title" => articleQueryResults[result; } function getLatestArticles () { sql = "SELECT content_id FROM content_type_article ORDER BY content_type_article_id DESC LIMIT 5"; // Eventueel: WHERE rss_article = 0 om de rss feeds eruit te halen this->core->Db->getQueryResults(i = 0 ; articleQueryResults) ; sql = "SELECT * FROM content WHERE content_id = ".i]['content_id']." "; this->core->Db->getQueryResult(result[] = array( "title" => this->core->Common->cutText(articleQueryResults[result; } function getLatestAudio () { sql = "SELECT content_id FROM content_type_audio ORDER BY content_type_audio_id DESC LIMIT 5"; // Eventueel: WHERE rss_article = 0 om de rss feeds eruit te halen this->core->Db->getQueryResults(i = 0 ; articleQueryResults) ; sql = "SELECT * FROM content WHERE content_id = ".i]['content_id']." "; this->core->Db->getQueryResult(result[] = array( "title" => this->core->Common->cutText(articleQueryResults[result; } function setViewCategoryVars () { arrSelections = array(); category = /* healthSelected = 0; wildlifeSelected = 0; businessSelected = 0; pollutionSelected = 0; lifestyleSelected = 0; // de switch is niet perse nodig, maar de default is wel handig voor als niet is opgegeven // Ook kan deze functie gebruikt worden om van meerdere categorien de content te krijgen switch (category) { case 'Health': arrSelections[] = 'politics'; break; case 'Wildlife': arrSelections[] = 'energy'; break; case 'Business': arrSelections[] = 'climate'; break; case 'Pollution': arrSelections[] = 'technology'; break; case 'Lifestyle': arrSelections[] = 'environment'; break; default: i = 0 ; arrSelections) ; i == 0) { arrSelections[whereStatement .= 'AND '.i].' = 1'; } } whereStatement." ORDER BY content_id DESC LIMIT 50"; this->core->Db->getQueryResults(i = 0 ; catContentQueryResults) ; sql = "SELECT * FROM content WHERE content_id = ".i]['content_id']." "; this->core->Db->getQueryResult(contentQueryResult['content_type']) { case 'picture': contentQueryResult['content_title'], "image_url" => 'www.few.vu.nl/~casus07/images/thumb_empty_image.jpg', "link_url" => 'index.php?Page=PictureView&ContentId='.i]['content_id'], "text" => 'PICTURE - '.contentQueryResult['content_description'], 150), "content_id" => i]['content_id'] ); break; case 'article': contentQueryResult['content_title'], "image_url" => 'www.few.vu.nl/~casus07/images/thumb_empty_article.jpg', "link_url" => 'index.php?Page=ArticleView&ContentId='.i]['content_id'], "text" => 'ARTICLE - '.contentQueryResult['content_binary'], 150), "content_id" => i]['content_id'] ); break; case 'video': contentQueryResult['content_title'], "image_url" => 'www.few.vu.nl/~casus07/images/thumb_empty_video.jpg', "link_url" => 'index.php?Page=VideoView&ContentId='.i]['content_id'], "text" => 'VIDEO - '.contentQueryResult['content_description'], 150), "content_id" => i]['content_id'] ); break; case 'audio': contentQueryResult['content_title'], "image_url" => 'www.few.vu.nl/~casus07/images/thumb_empty_audio.jpg', "link_url" => 'index.php?Page=AudioView&ContentId='.i]['content_id'], "text" => 'VIDEO - '.contentQueryResult['content_description'], 150), "content_id" => i]['content_id'] ); break; } } result); category); } function setArticleView () { _GET['ContentId']; contentId." "; this->core->Db->getQueryResult(this->core->PageComm->setPageCommVar('article_title', this->core->PageComm->setPageCommVar('article_text', this->core->PageComm->setPageCommVar('article_sourceurl', contentId = sql = "SELECT * FROM content WHERE content_id = ".contentQueryResult = sql); if (videoCode = videoCode = ' <OBJECT id="mediaPlayer" width="400" height="300" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject"> <param name="fileName" value="http://www.few.vu.nl/~casus07/cms/'.<param name="animationatStart" value="true"> <param name="transparentatStart" value="true"> <param name="autoStart" value="true"> <param name="showControls" value="true"> <param name="loop" value="true"> <EMBED type="application/x-mplayer2" pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" id="mediaPlayer" name="mediaPlayer" displaysize="4" autosize="-1" bgcolor="darkblue" showcontrols="true" showtracker="-1" showdisplay="0" showstatusbar="-1" videoborder3d="-1" width="400" height="300" src="http://www.few.vu.nl/~casus07/cms/'.contentQueryResult['content_binary'].'" autostart="true" designtimesp="5311" loop="true"> </EMBED> </OBJECT>'; } contentQueryResult['content_title']); contentQueryResult['content_description']); contentQueryResult['content_sourceurl']); videoCode); } function setAudioView () { _GET['ContentId']; contentId." "; this->core->Db->getQueryResult(this->core->PageComm->setPageCommVar('audio_file_url', 'www.few.vu.nl/~casus07/cms/'.$contentQueryResult['content_binary']); contentQueryResult['content_title']); contentQueryResult['content_sourceurl']); contentQueryResult['content_description']); } function setPictureView () { _GET['ContentId']; contentId." "; this->core->Db->getQueryResult(this->core->PageComm->setPageCommVar('picture_file_url', 'www.few.vu.nl/~casus07/cms/'.$contentQueryResult['content_binary']); contentQueryResult['content_title']); contentQueryResult['content_sourceurl']); contentQueryResult['content_description']); } } ?>
(C) A. Eliƫns 2/9/2007
You may not copy or print any of this material without explicit permission of the author or the publisher.