ginerjm Posted December 20, 2015 Share Posted December 20, 2015 So - you do have a php script. And you know which video is to be shown. So the first thing that script should do is to update your counter table. How does a joomla cache interfere with that? Quote Link to comment https://forums.phpfreaks.com/topic/299815-count-the-number-of-times-a-page-has-been-viewed/page/2/#findComment-1528307 Share on other sites More sharing options...
ababba2 Posted December 20, 2015 Author Share Posted December 20, 2015 (edited) I think cache works like this in joomla:1. You open the video you want to watch 2. The view script counter count +1 on this video 3. The cache start working and save the page just requested in the hard disk as cached version of that page. 4. Cache start to send the cached version to every other guys who request the same page. Up the cache update (every 12 hours) then the counter doesn't work anymore. I think this happens because the original PHP page are converted in HTML when cached... So cache "break" the view counter script... but i'm not sure Edited December 20, 2015 by ababba2 Quote Link to comment https://forums.phpfreaks.com/topic/299815-count-the-number-of-times-a-page-has-been-viewed/page/2/#findComment-1528317 Share on other sites More sharing options...
ginerjm Posted December 20, 2015 Share Posted December 20, 2015 Does the php script get executed BEFORE the video is shown? If so then the update has to occur. I don't buy the idea that joomla caching your html output will interfere with your php script that builds it. Your click triggers a php script, correct? If so then that php script HAS to run and if your logic is correctly placed it has to run and your count has to be incremented. That has to happen! Quote Link to comment https://forums.phpfreaks.com/topic/299815-count-the-number-of-times-a-page-has-been-viewed/page/2/#findComment-1528320 Share on other sites More sharing options...
ababba2 Posted December 21, 2015 Author Share Posted December 21, 2015 The php page that send the requested video to the user also contain the php view script. Both script are in the same php page. So I think they are executed in the same time... Quote Link to comment https://forums.phpfreaks.com/topic/299815-count-the-number-of-times-a-page-has-been-viewed/page/2/#findComment-1528331 Share on other sites More sharing options...
ginerjm Posted December 21, 2015 Share Posted December 21, 2015 That post means nothing to me. What about what I last posted? How do you answer that? Quote Link to comment https://forums.phpfreaks.com/topic/299815-count-the-number-of-times-a-page-has-been-viewed/page/2/#findComment-1528333 Share on other sites More sharing options...
ababba2 Posted December 21, 2015 Author Share Posted December 21, 2015 (edited) Does the php script get executed BEFORE the video is shown? If so then the update has to occur. I don't buy the idea that joomla caching your html output will interfere with your php script that builds it. Your click triggers a php script, correct? If so then that php script HAS to run and if your logic is correctly placed it has to run and your count has to be incremented. That has to happen! Yes, u'r right. Then I have no idea why counter doesn't work if cache is enabled. I tried to check the source of the cached page, and I seen the php counter script doesn't appear (there isn't any reference to the script) But I don't know if this is the problem Edited December 21, 2015 by ababba2 Quote Link to comment https://forums.phpfreaks.com/topic/299815-count-the-number-of-times-a-page-has-been-viewed/page/2/#findComment-1528341 Share on other sites More sharing options...
ginerjm Posted December 21, 2015 Share Posted December 21, 2015 The cached page showed you PHP code? I don't know anything about Joomla but having a joomla cache on the server to hold php scripts makes no sense to me. And you're saying that the counter script doesn't appear? What counter script? Isn't your counter code simply a call to some function that is included in your php script? Could you post the start of your php script so we can see what you are doing and how you are doing the counter code in a failsafe manner? Quote Link to comment https://forums.phpfreaks.com/topic/299815-count-the-number-of-times-a-page-has-been-viewed/page/2/#findComment-1528342 Share on other sites More sharing options...
ababba2 Posted December 21, 2015 Author Share Posted December 21, 2015 Ok, so this is the php page that runs when a video is opened. On line 313 there is the html5 player (I replaced the old one). On line 323 there is the view counter (that works with cache disabled) <?php /** * Player view file * * This file is to display the player on video home and detail page. * * @category Apptha * @package Com_Contushdvideoshare * @version 3.7 * @author Apptha Team <developers@contus.in> * @copyright Copyright (C) 2014 Apptha. All rights reserved. * @license GNU General Public License http://www.gnu.org/copyleft/gpl.html */ /** Include component helper */ include_once (JPATH_COMPONENT_SITE . DIRECTORY_SEPARATOR . 'helper.php'); /** No direct access to this file */ defined ( '_JEXEC' ) || exitAction ( 'Restricted access' ); /** Varaiable decalation and assign values */ $current_url = ''; $details1 = $this->detail; $player_values = unserialize ( $details1 [0]->player_values ); $thumbview = unserialize ( $this->homepagebottomsettings [0]->homethumbview ); $dispenable = unserialize ( $this->homepagebottomsettings [0]->dispenable ); $Itemid = $this->Itemid; $userID = getUserID (); $document = JFactory::getDocument (); $style = '#face-comments iframe{width: ' . $player_values ['width'] . 'px !important; } #video-grid-container .ulvideo_thumb .popular_gutterwidth{margin-left:' . $thumbview ['homepopularvideowidth'] . 'px; } #video-grid-container .ulvideo_thumb .featured_gutterwidth{margin-left:' . $thumbview ['homefeaturedvideowidth'] . 'px; } #video-grid-container .ulvideo_thumb .recent_gutterwidth{margin-left:' . $thumbview ['homerecentvideowidth'] . 'px; } #video-grid-container_pop .ulvideo_thumb .popular_gutterwidth{margin-left:' . $thumbview ['homepopularvideowidth'] . 'px; } #video-grid-container_pop .ulvideo_thumb .featured_gutterwidth{margin-left:' . $thumbview ['homefeaturedvideowidth'] . 'px; } #video-grid-container_pop .ulvideo_thumb .recent_gutterwidth{margin-left:' . $thumbview ['homerecentvideowidth'] . 'px; } #video-grid-container_rec .ulvideo_thumb .popular_gutterwidth{margin-left:' . $thumbview ['homepopularvideowidth'] . 'px; } #video-grid-container_rec .ulvideo_thumb .featured_gutterwidth{margin-left:' . $thumbview ['homefeaturedvideowidth'] . 'px; } #video-grid-container_rec .ulvideo_thumb .recent_gutterwidth{margin-left:' . $thumbview ['homerecentvideowidth'] . 'px; }'; $document->addStyleDeclaration ( $style ); /** Meta Information */ if (! empty ( $this->videodetails ) && $this->videodetails->id) { $document->setTitle ( $this->htmlVideoDetails->title ); $document->setMetaData ( "keywords", $this->htmlVideoDetails->tags ); $document->setDescription ( strip_tags ( $this->htmlVideoDetails->description ) ); } $seoOption = $dispenable ['seo_option']; if (isset ( $this->htmlVideoDetails )) { if ($seoOption == 1) { $featuredCategoryVal = "category=" . $this->htmlVideoDetails->seo_category; $featuredVideoVal = "video=" . $this->htmlVideoDetails->seotitle; } else { $featuredCategoryVal = "catid=" . $this->htmlVideoDetails->playlistid; $featuredVideoVal = "id=" . $this->htmlVideoDetails->id; } $current_url = 'index.php?option=com_contushdvideoshare&view=player&' . $featuredCategoryVal . '&' . $featuredVideoVal; if (version_compare ( JVERSION, '1.6.0', 'ge' )) { /** login url for version greater tha 1.6.0 */ $login_url = JURI::base () . "index.php?option=com_users&view=login&return=" . base64_encode ( $current_url ); } else { /** login url for report section */ $login_url = JURI::base () . "index.php?option=com_user&view=login&return=" . base64_encode ( $current_url ); } } /** Call function to display myvideos, myplaylists link for home and detail page*/ playlistMenu( $Itemid, $current_url ); if (isset ( $this->commenttitle ) || (isset ( $dispenable ['homeplayer'] ) && $dispenable ['homeplayer'] == 1)) { $player_icons = unserialize ( $details1 [0]->player_icons ); $video_title = $video_desc = $video_thumb = $memberidvalue = ''; $playerpath = JURI::base () . "components/com_contushdvideoshare/hdflvplayer/hdplayer.swf"; $facebookapi = $dispenable ['facebookapi']; $htmlVideoDetails = $this->htmlVideoDetails; /** Get detail for Meta Information */ if (isset ( $this->htmlVideoDetails ) && $this->htmlVideoDetails != '') { if ($this->htmlVideoDetails->filepath == "Youtube" || strpos ( $htmlVideoDetails->videourl, 'youtube.com' ) > 0) { if (strpos ( $htmlVideoDetails->videourl, 'youtube.com' ) > 0) { $url = $htmlVideoDetails->videourl; $query_string = array (); parse_str ( parse_url ( $url, PHP_URL_QUERY ), $query_string ); $id = $query_string ["v"]; $videoid = trim ( $id ); $video_thumb = "http://i3.ytimg.com/vi/$videoid/hqdefault.jpg"; $video_url = $this->htmlVideoDetails->videourl; $video_preview = "http://i3.ytimg.com/vi/$videoid/maxresdefault.jpg"; } elseif (strpos ( $this->htmlVideoDetails->videourl, 'dailymotion' ) > 0 || strpos ( $this->htmlVideoDetails->videourl, 'viddler' ) > 0) { $video_url = $this->htmlVideoDetails->videourl; $video_thumb = $this->htmlVideoDetails->thumburl; $video_preview = $this->htmlVideoDetails->previewurl; } } else if ($this->htmlVideoDetails->filepath == "File" || $this->htmlVideoDetails->filepath == "FFmpeg" || $this->htmlVideoDetails->filepath == "Embed") { $current_path = "components/com_contushdvideoshare/videos/"; if (isset ( $this->htmlVideoDetails->amazons3 ) && $this->htmlVideoDetails->amazons3 == 1) { $video_url = $dispenable ['amazons3link'] . $this->htmlVideoDetails->videourl; $video_thumb = $dispenable ['amazons3link'] . $this->htmlVideoDetails->thumburl; $video_preview = $dispenable ['amazons3link'] . $this->htmlVideoDetails->previewurl; } else { $video_url = JURI::base () . $current_path . $this->htmlVideoDetails->videourl; $video_thumb = JURI::base () . $current_path . $this->htmlVideoDetails->thumburl; $video_preview = JURI::base () . $current_path . $this->htmlVideoDetails->previewurl; } } else { $video_url = $this->htmlVideoDetails->videourl; $video_thumb = $this->htmlVideoDetails->thumburl; $video_preview = $this->htmlVideoDetails->previewurl; } } $instance = JURI::getInstance (); /** Get site name from global configuration */ $config = JFactory::getConfig (); if (version_compare ( JVERSION, '3.0.0', 'ge' )) { $siteName = $config->get ( 'config.sitename' ); } else { $siteName = $config->getValue ( 'config.sitename' ); } if (! empty ( $this->htmlVideoDetails->title )) { $video_title = $this->htmlVideoDetails->title; } if (! empty ( $this->htmlVideoDetails->description )) { $video_desc = $this->htmlVideoDetails->description; } /** Fb Share og detail */ $document->addCustomTag ( '<link rel="image_src" href="' . $video_thumb . '"/>' ); $document->addCustomTag ( '<link rel="canonical" href="' . $instance->toString () . '"/>' ); $document->addCustomTag ( '<meta property="og:site_name" content="' . $siteName . '"/>' ); $document->addCustomTag ( '<meta property="og:url" content="' . $instance->toString () . '"/>' ); $document->addCustomTag ( '<meta property="og:title" content="' . $video_title . '"/>' ); $document->addCustomTag ( '<meta property="og:description" content="' . strip_tags ( $video_desc ) . '"/>' ); $document->addCustomTag ( '<meta property="og:image" content="' . $video_thumb . '"/>' ); ?> <!--Rich snippet starts here --> <div id="video-container" class="" itemscope itemid="" itemtype="http://schema.org/VideoObject"> <link itemprop="url" href="<?php echo $video_url; ?>"> <div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"> <meta itemprop="ratingValue" content="<?php echo round ( $this->commentview [0]->rate / $this->commentview [0]->ratecount ); ?>" /> <meta itemprop="ratingCount" content="<?php echo $this->commentview[0]->ratecount; ?>" /> </div> <div itemprop="video" itemscope itemtype="http://schema.org/VideoObject"> <meta itemprop="name" content="<?php echo $video_title; ?>" /> <meta itemprop="thumbnail" content="<?php echo $video_thumb; ?>" /> <meta itemprop="description" content="<?php if (! empty ( $video_desc )) { echo strip_tags ( $video_desc ); } else { echo 'No description'; } ?>" /> </div> <meta itemprop="image" content="<?php echo $video_thumb; ?>" /> <meta itemprop="thumbnailUrl" content="<?php echo $video_thumb; ?>" /> <meta itemprop="embedURL" content="<?php echo $playerpath . '?id=' . $this->videodetails->id; ?>" /> </div> <!--Rich snippet ends here --> <input type="hidden" name="category" value="<?php if (isset ( $this->videodetails->playlistid )) { echo $this->videodetails->playlistid; } ?>" id="category" /> <input type="hidden" value="<?php if (isset ( $this->videodetails->id )) { echo $this->videodetails->id; } ?>" name="videoid" id="videoid" /> <?php /** Google analytics code */ if ($player_icons ['googleana_visible'] == 1) { ?> <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write( unescape( "%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E" ) ); var pageTracker = _gat._getTracker("<?php echo $player_values['googleanalyticsID']; ?>"); pageTracker._trackPageview(); pageTracker._trackEvent(); </script> <?php } ?> <script type="text/javascript"> function loadifr() { ev = document.getElementById('myframe1'); if (ev != null) { setHeight(ev); addEvent(ev, 'load', doIframe); } } window.onload = function() { <?php if (isset ( $this->videodetails->id )) { ?> setInterval("loadifr()", 500); <?php } ?> } </script> <div class="fluid bg playerbg clearfix" id="player_page"> <div id="HDVideoshare1" style="position: relative;" class="clearfix"> <h1 id="viewtitle" class="floatleft" style=""> <?php if (isset ( $this->htmlVideoDetails->title )) { echo $this->htmlVideoDetails->title; } ?></h1> <div class="clear"></div> <?php $mobile = videoshare_Detect_mobile (); if (!empty($userID)) { $error_msg = JText::_ ( 'HDVS_NOT_AUTHORIZED' ); } else { $error_msg = JText::_ ( 'HDVS_LOGIN_TO_WATCH' ); } if (! empty ( $this->videodetails ) && ($this->videodetails->id) && ($this->videodetails->playlistid)) { $baseref = '&id=' . $this->videodetails->id . '&catid=' . $this->videodetails->playlistid; } elseif (! empty ( $this->videodetails ) && $this->videodetails->id) { $baseref = '&id=' . $this->videodetails->id; } else { $baseref = '&featured=true&pagerefresh=false'; } /** For Admin preview popup */ $adminview = JRequest::getString ( 'adminview' ); if ($adminview == true) { $baseref .= '&adminview=true'; } if (($htmlVideoDetails->filepath == 'Embed') || (! empty ( $htmlVideoDetails ) && (preg_match ( '/vimeo/', $htmlVideoDetails->videourl )) && ($htmlVideoDetails->videourl != ''))) { if ($this->homepageaccess == 'true') { if ($htmlVideoDetails->filepath == 'Embed') { $playerembedcode = $htmlVideoDetails->embedcode; $playeriframewidth = str_replace ( 'width=', 'width="' . $player_values ['width'] . '"', $playerembedcode ); contushdvideoshareController::videohitCount_function ( $htmlVideoDetails->id ); if ($mobile === true) { echo $playerembedcode; } else { /** For embed code videos */ ?> <div id="flashplayer"> <?php echo str_replace ( 'height=', 'height="' . $player_values ['height'] . '"', $playeriframewidth ); ?> </div> <?php } } elseif (! empty ( $htmlVideoDetails ) && (preg_match ( '/vimeo/', $htmlVideoDetails->videourl )) && ($htmlVideoDetails->videourl != '')) { /** For vimeo videos */ $split = explode ( "/", $htmlVideoDetails->videourl ); contushdvideoshareController::videohitCount_function ( $htmlVideoDetails->id ); if ($mobile === true) { $widthheight = ''; } else { $widthheight = 'width="' . $player_values ['width'] . '" height="' . $player_values ['height'] . '"'; } ?> <div id="flashplayer"> <iframe <?php echo $widthheight; ?> src="<?php echo 'http://player.vimeo.com/video/' . $split[3]; ?>" class="iframe_frameborder" webkitallowfullscreen mozallowfullscreen allowfullscreen> </iframe> </div> <?php } } else { ?> <style type="text/css"> .login_msg { height: <?php echo $player_values['height']; ?> px; color: #fff; width: 100%; margin: <?php echo ceil( $player_values [ 'width' ] / 3); ?> px 0 0; text-align: center; } .login_msg a { background: #999; color: #fff; padding: 5px; } </style> <div id="video" style="height:<?php echo $player_values['height']; ?>px; background-color:#000000; position: relative;" > <div class="login_msg"> <h3><?php echo $error_msg; ?></h3> <?php if (empty($userID)) { ?> <a href="<?php if (! empty ( $player_icons ['login_page_url'] )) { echo $player_icons ['login_page_url']; } else { echo "#"; } ?>"><?php echo JText::_('HDVS_LOGIN'); ?></a> <?php } ?> </div> </div> <?php } } else { if ($mobile === true) { ?> <?php } /** Platform check */ ?> <script type="text/javascript"> var txt = navigator.platform; function failed(e) { if ( txt == 'iPod' || txt == 'iPad' || txt == 'iPhone' || windo == "Windows Phone" || txt == 'Linux armv7l' || txt == 'Linux armv6l' ) { alert('Player doesnot support this video.'); } } </script> /** HTML5 player starts here */ <video id="example_video_1" class="video-js vjs-default-skin vjs-big-play-centered" controls preload="auto" width="720" height="480" poster=<?php echo $video_preview; ?> data-setup='{"example_option":true}'> <source src=<?php echo $video_url; ?> type='video/mp4' /> <p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a></p> </video> /** View script */ <?php $db = JFactory::getDBO(); if(!$db) { echo ""; } elseif(!$htmlVideoDetails->id) { echo ""; } else { $query = "UPDATE ygvhc_hdflv_upload SET times_viewed=1+times_viewed WHERE id={$htmlVideoDetails->id}"; $db->setQuery($query); if(!$db->query()) { echo ""; } else { echo ""; } } ?> <?php /** Html5 player end */ } /** Display Google Adsense */ if (isset ( $details1 ['publish'] ) == '1' && isset ( $details1 ['showaddc'] ) == '1' && $mobile !== true && (isset($htmlVideoDetails) && $htmlVideoDetails->filepath != 'Embed')) { ?> <div> <?php if ($player_values ['width'] > 468) { $adstyle = ";"; } else { $margin_left = ($player_values ['width'] - 100) / 2; $adwidth = $player_values ['width'] - 100; $adstyle = "width:" . $adwidth . "px;margin-left: -" . $margin_left . "px;"; } ?> <div id="lightm" style="<?php echo $adstyle; ?>height:76px;position:absolute;display:none; background:none !important;background-position: initial initial !important; background-repeat: initial initial !important;bottom: 50px;left: 50%;"> <span id="divimgm"><img alt="close" id="closeimgm" src="components/com_contushdvideoshare/images/close.png" style="z-index: 10000000; width: 48px; height: 12px; cursor: pointer; top: -12px;" onclick="googleclose();" /> </span> <iframe height="60" width="<?php echo $player_values['width'] - 100; ?>" scrolling="no" align="middle" id="IFrameName" src="" name="IFrameName" marginheight="0" marginwidth="0" class="iframe_frameborder"></iframe> </div> </div> <script src="<?php echo JURI::base(); ?>components/com_contushdvideoshare/js/googlead.js" type="text/javascript"></script> <?php if ($details1 ['showoption'] == 1 && isset ( $details1 ['closeadd'] )) { $closeadd = $details1 ['closeadd']; $ropen = $details1 ['ropen']; ?> <script type="text/javascript"> var closeadd = <?php echo $closeadd * 1000; ?>; var ropen = <?php echo $ropen * 1000; ?>; </script> <?php } } ?> </div> </div> <div class="video-page-container clscenter"> <?php if (isset ( $this->commenttitle )) { ?> <div class="video-page-info "> <div class="video-page-date"> <!--Display video created date--> <div class="video_addedon"> <span class="addedon"><strong><?php echo JText::_('HDVS_ADDED_ON'); ?> : </strong> </span><span id="createdate"> <?php if (isset ( $this->htmlVideoDetails->created_date )) { $created_on = date ( 'j-M-Y', strtotime ( $this->htmlVideoDetails->created_date ) ); echo $created_on; } ?></span> </div> </div> <div class="video-page-views"> <?php if ($dispenable ['viewedconrtol'] == 1) { ?> <span class="video-view"> <strong> <?php echo JText::_('HDVS_VIEWS'); ?> : </strong> </span> <span id="viewcount"> <?php if (isset ( $this->htmlVideoDetails->times_viewed )) { echo $this->htmlVideoDetails->times_viewed; } ?> </span> <?php } ?> </div> <div class="clearfix"></div> <div class="video-page-username"> <?php foreach ( $this->commenttitle as $row ) { if (isset ( $row->memberid )) { $mid = $row->memberid; } else { $mid = ''; } if (isset ( $row->username )) { $username = $row->username; } else { $username = ''; } if ($username != '') { ?> <div class="viewsubname"> <span class="uploadedby"><strong> <?php echo JText::_('HDVS_UPLOADED_BY'); ?> : </strong></span> <a title="<?php echo $username; ?>" class="namelink cursor_pointer" onclick="membervalue('<?php echo $mid; ?>')"><?php echo $row->username; ?></a> </div><?php } } ?> </div> <div class="video-page-rating"> <!--Rating starts here--> <div id="rateid" class="ratingbg"> <div class="content_center clearfix" style=""> <?php $user = JFactory::getUser (); $userid = $_SERVER ['REMOTE_ADDR']; $rated_user = explode ( ',', $this->commentview [0]->rateduser ); if (! empty ( $this->commentview [0]->rateduser ) && in_array ( $userid, $rated_user )) { $rateduser = 1; } else { $rateduser = 0; } if ($dispenable ['ratingscontrol'] == 1) { ?> <div class="centermargin floatleft"> <div class="rateimgleft" id="rateimg" <?php if($rateduser == 0) { ?> onmouseover="displayrating('');" onmouseout="resetvalue();" <?php } ?>> <div id="a" class="floatleft"></div> <?php if (isset ( $this->commentview [0]->ratecount ) && $this->commentview [0]->ratecount != 0) { $ratestar = round ( $this->commentview [0]->rate / $this->commentview [0]->ratecount ); } else { $ratestar = 0; } ?> <ul class="ratethis " id="rate"> <li class="one"><a title="<?php echo JText::_('HDVS_ONE_STAR_RATING'); ?>" onclick="getrate('1');" <?php if($rateduser == 0) { ?> onmousemove="displayrating('1');" onmouseout="resetvalue();" <?php } ?>>1</a></li> <li class="two"><a title="<?php echo JText::_('HDVS_TWO_STAR_RATING'); ?>" onclick="getrate('2');" <?php if($rateduser == 0) { ?> onmousemove="displayrating('2');" onmouseout="resetvalue();" <?php } ?>>2</a></li> <li class="three"><a title="<?php echo JText::_('HDVS_THREE_STAR_RATING'); ?>" onclick="getrate('3');" <?php if($rateduser == 0) { ?> onmousemove="displayrating('3');" onmouseout="resetvalue();" <?php } ?>>3</a></li> <li class="four"><a title="<?php echo JText::_('HDVS_FOUR_STAR_RATING'); ?>" onclick="getrate('4');" <?php if($rateduser == 0) { ?> onmousemove="displayrating('4');" onmouseout="resetvalue();" <?php } ?>>4</a></li> <li class="five"><a title="<?php echo JText::_('HDVS_FIVE_STAR_RATING'); ?>" onclick="getrate('5');" <?php if($rateduser == 0) { ?> onmousemove="displayrating('5');" onmouseout="resetvalue();" <?php } ?>>5</a></li> </ul> <input type="hidden" name="id" id="id" value="<?php if (isset ( $this->htmlVideoDetails->id ) && $this->htmlVideoDetails->id != '') { echo $this->htmlVideoDetails->id; } elseif (isset ( $this->getfeatured->id ) && $this->getfeatured->id != '') { echo $this->getfeatured->id; } ?>" /> </div> <div class="rateright-views floatleft"> <span class="clsrateviews" id="ratemsg" <?php if($rateduser == 0) { ?> onmouseover="displayrating('');" onmouseout="resetvalue();" <?php } ?>> </span> <span class="rightrateimg" id="ratemsg1" <?php if($rateduser == 0) { ?> onmouseover="displayrating('');" onmouseout="resetvalue();" <?php } ?>> </span> </div> </div> <?php } ?> </div> <?php /** Script for rating of the video starts here */ ?> <script type="text/javascript"> function ratecal(rating, ratecount) { if (rating == 1){ document.getElementById('rate').className = "ratethis onepos"; <?php if($rateduser == 1) { ?> document.getElementById('a').className = "ratethis onepos"; document.getElementById('rate').style.display = "none"; <?php } ?> } else if (rating == 2) { document.getElementById('rate').className = "ratethis twopos"; <?php if($rateduser == 1) { ?> document.getElementById('a').className = "ratethis twopos"; document.getElementById('rate').style.display = "none"; <?php } ?> } else if (rating == 3) { document.getElementById('rate').className = "ratethis threepos"; <?php if($rateduser == 1) { ?> document.getElementById('a').className = "ratethis threepos"; document.getElementById('rate').style.display = "none"; <?php } ?> } else if (rating == 4) { document.getElementById('rate').className = "ratethis fourpos"; <?php if($rateduser == 1) { ?> document.getElementById('a').className = "ratethis fourpos"; document.getElementById('rate').style.display = "none"; <?php } ?> } else if (rating == 5) { document.getElementById('rate').className = "ratethis fivepos"; <?php if($rateduser == 1) { ?> document.getElementById('a').className = "ratethis fivepos"; document.getElementById('rate').style.display = "none"; <?php } ?> } else { document.getElementById('rate').className = "ratethis nopos"; } document.getElementById('ratemsg').innerHTML = "<span dir='LTR' class='ratting_txt'><?php echo JText::_ ( 'HDVS_RATTING' ); ?> : " + ratecount + "</span> "; } <?php if (isset ( $ratestar ) && isset ( $this->commentview [0]->ratecount ) && isset ( $this->commentview [0]->times_viewed )) { ?> ratecal( '<?php echo $ratestar; ?>', '<?php echo $this->commentview[0]->ratecount; ?>', '<?php echo $this->commentview[0]->times_viewed; ?>' ); <?php } ?> function createObject() { var request_type; var browser = navigator.appName; if (browser == "Microsoft Internet Explorer") { request_type = new ActiveXObject("Microsoft.XMLHTTP"); } else { request_type = new XMLHttpRequest(); } return request_type; } var http = createObject(); var nocache = 0; function getrate(t) { if (t == '1') { document.getElementById('rate').className = "ratethis onepos"; document.getElementById('a').className = "ratethis onepos"; } if (t == '2') { document.getElementById('rate').className = "ratethis twopos"; document.getElementById('a').className = "ratethis twopos"; } if (t == '3') { document.getElementById('rate').className = "ratethis threepos"; document.getElementById('a').className = "ratethis threepos"; } if (t == '4') { document.getElementById('rate').className = "ratethis fourpos"; document.getElementById('a').className = "ratethis fourpos"; } if (t == '5') { document.getElementById('rate').className = "ratethis fivepos"; document.getElementById('a').className = "ratethis fivepos"; } document.getElementById('rate').style.display = "none"; document.getElementById('ratemsg').innerHTML = "Thanks for rating!"; var id = document.getElementById('id').value; nocache = Math.random(); http.open( 'get', '<?php echo JURI::base (); ?>index.php?option=com_contushdvideoshare&view=player&tmpl=component&id=' + id + '&rate=' + t + '&nocache = ' + nocache, true ); http.onreadystatechange = insertReplyRating; http.send(null); document.getElementById('rate').style.visibility = 'disable'; } function submitreport() { var reportvideotype = document.getElementsByName('reportvideotype'); var repmsg; for (var i = 0; i < reportvideotype.length; i++) { if (reportvideotype[i].checked) { repmsg = reportvideotype[i].value; break; } else { repmsg = ''; } } if (repmsg === "") { alert('<?php echo JText::_('HDVS_SELECT_REPORT_TYPE'); ?>'); return false; } <?php if (empty($userID )) { ?> location.href = '<?php echo JRoute::_ ( $login_url ); ?>'; <?php } else { ?> document.getElementById('dvLoading').style.display = "block"; http.open( 'get', '<?php echo JURI::base (); ?>index.php?option=com_contushdvideoshare&task=sendreport&tmpl=component&reportmsg=' + repmsg + '&videoid=<?php echo $htmlVideoDetails->id; ?>', true ); http.onreadystatechange = getReport; http.send(null); <?php } ?> document.getElementById('reportadmin').style.visibility = 'none'; } function resetreport() { document.getElementById('reportadmin').style.display = "none"; } function getReport() { document.getElementById('reportadmin').style.display = "none"; document.getElementById('dvLoading').style.display = "none"; document.getElementById('reportmessage').innerHTML = http.responseText; } function insertReplyRating() { if (http.readyState == 4) { document.getElementById('ratemsg').innerHTML = "<span dir='LTR' class='ratting_txt'><?php echo JText::_ ( 'HDVS_RATTING' ); ?> : " + http.responseText + "</span>"; document.getElementById('rate').className = ""; document.getElementById('storeratemsg').value = http.responseText; } } function resetvalue() { <?php if($rateduser == 0) { ?> document.getElementById('ratemsg1').style.display = "none"; document.getElementById('ratemsg').style.display = "block"; if (document.getElementById('storeratemsg').value == '') { document.getElementById('ratemsg').innerHTML = "<span dir='LTR' class='ratting_txt'><?php echo JText::_ ( 'HDVS_RATTING' ); ?> : <?php echo $this->commentview [0]->ratecount; ?></span>"; } else { document.getElementById('ratemsg').innerHTML = "<span dir='LTR' class='ratting_txt'><?php echo JText::_ ( 'HDVS_RATTING' ); ?> : " + document.getElementById('storeratemsg').value + "</span> "; } <?php } ?> } function displayrating(t) { <?php if($rateduser == 0) { ?> if (t == '1') { document.getElementById('ratemsg').innerHTML = "<?php echo JText::_('HDVS_POOR'); ?>"; } if (t == '2') { document.getElementById('ratemsg').innerHTML = "<?php echo JText::_('HDVS_NOTHING_SPECIAL'); ?>"; } if (t == '3') { document.getElementById('ratemsg').innerHTML = "<?php echo JText::_('HDVS_WORTH_WATCHING'); ?>"; } if (t == '4') { document.getElementById('ratemsg').innerHTML = "<?php echo JText::_('HDVS_PRETTY_COOL'); ?>"; } if (t == '5') { document.getElementById('ratemsg').innerHTML = "<?php echo JText::_('HDVS_AWESOME'); ?>"; } document.getElementById('ratemsg1').style.display = "none"; document.getElementById('ratemsg').style.display = "block"; <?php } ?> } </script> <!-- Script for rating of the video ends here --> </div> </div> <div class="clear"></div> </div> <!-- Social Sharing Icons starts here --> <div id="share_like" class="video-socialshare"> <?php if (isset ( $dispenable ['rssfeedicon'] ) && $dispenable ['rssfeedicon'] == 1) { $rssurl = JRoute::_ ( "index.php?Itemid=" . $Itemid . "&option=com_contushdvideoshare&view=rss&type=video&id=" . $this->videodetails->id ); ?> <div class="floatleft" style="margin-right: 9px;"> <a href="<?php echo $rssurl; ?>" class="rssfeedicon" id="rssfeedicon" target="_blank"> </a> </div> <?php } if ($dispenable ['facebooklike'] == 1) { $pageURL = str_replace ( '&', '%26', JURI::getInstance ()->toString () ); $fbDescription = $this->htmlVideoDetails->description; $fbDescription = str_replace('"', ' ', $fbDescription); if (strpos ( $this->htmlVideoDetails->videourl, 'vimeo' ) > 0) { $url_fb = "http://www.facebook.com/dialog/feed?app_id=19884028963&ref=share_popup&link=" . urlencode ( $this->htmlVideoDetails->videourl ) . "&redirect_uri=" . urlencode ( $this->htmlVideoDetails->videourl ) . "%3Fclose"; } else { $url_fb = "http://www.facebook.com/sharer/sharer.php?s=100&p%5Btitle%5D=" . $this->htmlVideoDetails->title . "&p%5Bsummary%5D=" . strip_tags ( $this->htmlVideoDetails->description ) . "&p%5Bmedium%5D=103&p%5Bvideo%5D%5Bwidth%5D=" . $player_values ['width'] . "&p%5Bvideo%5D%5Bheight%5D=" . $player_values ['height'] . "&p%5Bvideo%5D%5Bsrc%5D=" . urlencode ( $playerpath ) . "%3Ffile%3D" . urlencode ( $video_url ) . "%26embedplayer%3Dtrue%26share%3Dfalse%26HD_default%3Dtrue%26autoplay%3Dtrue%26skin_autohide%3Dtrue%26showPlaylist%3Dfalse%26id%3D" . $this->videodetails->id . "%26baserefJHDV%3D" . urlencode ( JURI::base () ) . "&p%5Burl%5D=" . urlencode ( $pageURL ) . "&p%5Bimages%5D%5B0%5D=" . urlencode ( $video_thumb ); } ?> <div class="floatleft" style="margin-right: 9px;"> <a href="<?php echo $url_fb; ?>" class="fbshare" id="fbshare" target="_blank"></a> </div> <!-- Facebook share End and Twitter like Start --> <div class="floatleft ttweet"> <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="<?php echo JURI::getInstance ()->toString (); ?>" data-via="<?php echo $siteName; ?>" data-text="<?php echo $this->htmlVideoDetails->title; ?>">Tweet</a> <script>!function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (!d.getElementById(id)) { js = d.createElement(s); js.id = id; js.src = "//platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs); } }(document, "script", "twitter-wjs");</script> </div> <!-- Twitter like End and Google plus one Start --> <div class="floatleft gplusshare"> <script type="text/javascript" src="http://apis.google.com/js/plusone.js"></script> <div class="g-plusone" data-size="medium" data-count="false"></div> </div> <!-- Google plus one End --> <div class="floatleft fbsharelike"> <!--Facebook like button--> <iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo $pageURL; ?>&layout=button_count&show_faces=false&width=450&action=like&colorscheme=light&height=21" scrolling="no" class="iframe_frameborder facebook_hdlike" allowTransparency="true"> </iframe> </div> <?php } ?> </div> <!--Social Sharing icons ends here--> <div class="vido_info_container"> <div class="video-cat-thumb commentpost"> <?php if ($player_icons ['embedVisible'] == 1 && ($mobile === false)) { ?> <a class="utility-link embed" class="embed" id="allowEmbed" href="javascript:void(0)" onclick="enableEmbed()"> <?php echo JText::_('HDVS_EMBED'); ?> </a> <?php } if ($player_icons ['enabledownload'] == 1 && $this->htmlVideoDetails->download == 1 && $this->htmlVideoDetails->filepath != "Youtube" && $this->htmlVideoDetails->filepath != "Embed" && $this->htmlVideoDetails->streameroption != "rtmp") { ?> <a class="utility-link" href="<?php echo $video_url; ?>" target="_blank"> <?php echo JText::_('HDVS_DOWNLOAD'); ?></a> <?php } ?> <?php if (isset ( $dispenable ['reportvideo'] ) && $dispenable ['reportvideo'] == 1) { ?> <a class="utility-link" onclick="showreport();"><?php echo JText::_('HDVS_REPORT'); ?></a> <div class="clear"></div> <div id="reportmessage" style="color: red;"></div> <div id="reportadmin" style="display: none; margin-top: 5px;"> <div> <h2><?php echo JText::_('HDVS_REPORT_VIDEO'); ?></h2> <ul> <li><input type="radio" name="reportvideotype" id="violence" value="<?php echo JText::_('HDVS_VIOLENT'); ?>" /> <?php echo JText::_('HDVS_VIOLENT'); ?><br> <input type="radio" name="reportvideotype" id="groupattack" value="<?php echo JText::_('HDVS_HATEFUL'); ?>" /> <?php echo JText::_('HDVS_HATEFUL'); ?><br> <input type="radio" name="reportvideotype" id="harmful" value="<?php echo JText::_('HDVS_HARMFUL'); ?>" /> <?php echo JText::_('HDVS_HARMFUL'); ?><br> <input type="radio" name="reportvideotype" id="spam" value="<?php echo JText::_('HDVS_SPAM'); ?>" /> <?php echo JText::_('HDVS_SPAM'); ?><br /> <input type="radio" name="reportvideotype" id="childabuse" value="<?php echo JText::_('HDVS_CHILD_ABUSE'); ?>" /> <?php echo JText::_('HDVS_CHILD_ABUSE'); ?><br /> <input type="radio" name="reportvideotype" id="sexualcontent" value="<?php echo JText::_('HDVS_SEXUAL_CONTENT'); ?>" /> <?php echo JText::_('HDVS_SEXUAL_CONTENT'); ?><br /></li> </ul> <div id="dvLoading" style="display: none;"></div> <button type="submit" onclick="submitreport()"><?php echo JText::_('HDVS_SEND'); ?></button> <button type="submit" onclick="resetreport()"><?php echo JText::_('HDVS_CANCEL'); ?></button> </div> </div> <?php } ?> <?php $split = explode ( "/", $this->videodetails->videourl ); if (! empty ( $this->videodetails ) && (preg_match ( '/vimeo/', $this->videodetails->videourl )) && ($this->videodetails->videourl != '')) { /** For vimeo videos */ $embed_code = '<iframe src="http://player.vimeo.com/video/' . $split [3] . '" width="' . $player_values ['width'] . '" height="' . $player_values ['height'] . '" class="iframe_frameborder" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>'; } elseif ($this->htmlVideoDetails->filepath == 'Embed') { /** For embed code videos */ $embed_code = $this->htmlVideoDetails->embedcode; } else { /** For other type videos */ $embed_code = '<embed id="player" src="' . $playerpath . '" flashvars="id=' . $this->videodetails->id . '&baserefJHDV=' . JURI::base () . '&playlist_auto=false&Preview=' . $video_preview . '&showPlaylist=false&embedplayer=true&shareIcon=false&email=false&' . 'zoomIcon=false&playlist_autoplay=false" ' . 'style="width:' . $player_values ['width'] . 'px;height:' . $player_values ['height'] . 'px" allowFullScreen="true" allowScriptAccess="always" type="application/x-shockwave-flash"' . 'wmode="transparent"></embed>'; } ?> <textarea onclick="this.select()" dir="LTR" id="embedcode" name="embedcode" style="display:none;width:<?php if ($player_values ['width'] > 10) { echo ($player_values ['width']) - (17); } else { echo $player_values ['width']; } ?>px;}" rows="7" ><?php echo $embed_code; ?></textarea> <input type="hidden" name="flagembed" id="flagembed" /> </div> <script type="text/javascript"> function enableEmbed() { embedFlag = document.getElementById('flagembed').value if (embedFlag != 1) { document.getElementById('embedcode').style.display = "block"; if (document.getElementById('reportadmin')) { document.getElementById('reportadmin').style.display = 'none'; } document.getElementById('flagembed').value = '1'; } else { document.getElementById('embedcode').style.display = "none"; if (document.getElementById('reportadmin')) { document.getElementById('reportadmin').style.display = 'none'; } document.getElementById('flagembed').value = '0'; } } </script> <div style="clear: both;"></div> <div class="video-page-desc"><?php if ($player_icons ['showTag'] == 1) { echo $this->htmlVideoDetails->description; } ?></div> </div> <?php } ?> </div> <?php if (isset ( $this->commenttitle )) { ?> <div class="clear"></div> <div class="videosharecommetsection"> <!-- Add Facebook Comment --> <?php if (! empty ( $this->videodetails ) && $this->videodetails->id) { if ($dispenable ['comment'] == 1) { ?> <div class="fbcomments" id="theFacebookComment"> <h3><?php echo JText::_('HDVS_ADD_YOUR_COMMENTS'); ?></h3> <?php $dispenable ['facebookapi'] = isset ( $dispenable ['facebookapi'] ) ? $dispenable ['facebookapi'] : ''; if ($dispenable ['facebookapi']) { $facebookapi = $dispenable ['facebookapi']; } ?> <br /> <div id="face-comments"> <script type="text/javascript"> window.fbAsyncInit = function() { FB.init({ appId: "<?php echo $facebookapi; ?>", status: true, // Check login status cookie: true, // Enable cookies to allow the server to access the session xfbml: true // Parse XFBML }); }; (function() { var e = document.createElement('script'); e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; e.async = true; document.getElementById('face-comments').appendChild(e); }()); </script> <fb:comments xid="<?php echo JRequest::getVar('id'); ?>" css="facebook_style.css" simple="1" href="<?php echo JFactory::getURI()->toString(); ?>" num_posts="2" width="<?php echo $player_values['width']; ?>"></fb:comments> </div> </div> <?php } elseif ($dispenable ['comment'] == 5) { /** Disqus Comments */ ?> <div id="disqus_thread"></div> <script type="text/javascript"> var disqus_shortname = "<?php echo $dispenable['disqusapi']; ?>"; (function() { var dsq = document.createElement("script"); dsq.type = "text/javascript"; dsq.async = true; dsq.src = "http://" + disqus_shortname + ".disqus.com/embed.js"; ( document.getElementsByTagName("head")[0] || document.getElementsByTagName("body")[0]).appendChild(dsq); })(); </script> <noscript><?php echo JText::_('HDVS_DISQUS_ENABLE_JS'); ?> <a href="http://disqus.com/?ref_noscript"><?php echo JText::_('HDVS_DISQUS_POWERED_BY'); ?></a> </noscript> <a href="http://disqus.com" class="dsq-brlink"><?php echo JText::_('HDVS_DISQUS_POWERED'); ?> <span class="logo-disqus"><?php echo JText::_('HDVS_DISQUS'); ?></span></a> <?php } ?> <input type="hidden" value="<?php echo $dispenable['comment']; ?>" id="commentoption" name="commentoption" /> <div id="commentappended" class="clscenter" style="<?php if ($dispenable ['comment'] == 1) { ?>display:none; <?php } ?>"> <?php if (USER_LOGIN == '1') { if ($dispenable ['comment'] != 0) { ?> <!-- Jcomments starts here--> <div id="commentcontainer" style="margin-top: 0px;" class="clearfix clear"> <iframe id="myframe1" width="<?php echo $player_values['width']; ?>" name="myframe1" class="autoHeight clearfix" frameborder="0" scrolling="no" src="index.php?option=com_contushdvideoshare&view=commentappend&tmpl=component&id=<?php echo $this->videodetails->id; ?>&cmdid=<?php echo $dispenable ['comment']; ?>"> </iframe> </div> <?php } if ($dispenable ['comment'] == 2) { /** Default Comments */ ?> <div id="commentcontainer"></div> <!--Script for default comment append in player page--> <script type="text/javascript"> var xmlhttp; var nocache = 0; function GetXmlHttpObject() { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari return new XMLHttpRequest(); } if (window.ActiveXObject) { // code for IE6, IE5 return new ActiveXObject("Microsoft.XMLHTTP"); } return null; } var xmlhttp; xmlhttp = GetXmlHttpObject(); var url = "<?php echo JURI::base (); ?>index.php?option=com_contushdvideoshare&view=commentappend&tmpl=component&id=<?php echo $this->videodetails->id; ?>&cmdid=<?php echo $dispenable ['comment']; ?>"; xmlhttp.onreadystatechange = function stateChanged() { if (xmlhttp.readyState == 4) { document.getElementById("commentcontainer").innerHTML = xmlhttp.responseText; } }; xmlhttp.open("GET", url, true); xmlhttp.send(null); function changepage(pageno) { xmlhttp = GetXmlHttpObject(); if (xmlhttp == null) { alert("Browser does not support HTTP Request"); return; } document.getElementById('prcimg').style.display = "block"; var url = "<?php echo JURI::base (); ?>index.php?option=com_contushdvideoshare&view=commentappend&tmpl=component&id=<?php echo $this->videodetails->id; ?>&cmdid=2&video_pageid=" + pageno; url = url + "&sid=" + Math.random(); xmlhttp.onreadystatechange = function stateChanged() { if (xmlhttp.readyState == 4) { document.getElementById("commentcontainer").innerHTML = xmlhttp.responseText; } }; xmlhttp.open("GET", url, true); xmlhttp.send(null); } window.onload = function() { document.getElementById('txt').style.display = "none"; } function insert() { var name = encodeURI(document.getElementById('username').value); var message = encodeURI(document.getElementById('comment_message').value); var id = encodeURI(document.getElementById('id').value); var category = encodeURI(document.getElementById('category').value); var parentid = encodeURI(document.getElementById('parentvalue').value); // Set te random number to add to URL request var nocache = Math.random(); xmlhttp = GetXmlHttpObject(); if (xmlhttp == null) { alert("Browser does not support HTTP Request"); return; } document.getElementById('prcimg').style.display = "block"; var url = "<?php echo JURI::base (); ?>index.php?option=com_contushdvideoshare&view=player&id=" + id + "&category=" + category + "&name=" + name + "&message=" + message + "&pid=" + parentid + "&nocache = " + nocache + "&sid=" + Math.random(); xmlhttp.onreadystatechange = stateChanged; xmlhttp.open("GET", url, true); xmlhttp.send(null); } function stateChanged() { if (xmlhttp.readyState == 4) { document.getElementById('prcimg').style.display = "none"; var name = document.getElementById('username').value; var message = document.getElementById('comment_message').value; var id = encodeURI(document.getElementById('videoid').value); var boxid = encodeURI(document.getElementById('id').value); var category = encodeURI(document.getElementById('category').value); var parentid = encodeURI(document.getElementById('parentvalue').value); var commentcountval = document.getElementById('commentcount').innerHTML; document.getElementById('username').disabled = true; document.getElementById('comment_message').disabled = true; if (parentid == 0) { document.getElementById("al").innerHTML = "<div class='underline'></div><div class='clearfix'>\n\ <div class='subhead changecomment'><span class='video_user_info'><strong>" + name + "</strong><span class='user_says'> <?php echo JText::_('HDVS_SAYS'); ?> </span></span><span class='video_user_comment'>" + message + "</span></div></div>" + document.getElementById("al").innerHTML; document.getElementById('commentcount').innerHTML = parseInt(commentcountval) + 1; } else { document.getElementById(parentid).innerHTML = "<div class='clsreply'><span class='video_user_info'><strong><?php echo JText::_('HDVS_RE'); ?> <span>" + name + "</span></strong><span class='user_says'> <?php echo JText::_('HDVS_SAYS'); ?> </span></span><span class='video_user_comment'>" + message + "</span></div></blockquote>"; document.getElementById('commentcount').innerHTML = parseInt(commentcountval) + 1; } document.getElementById('txt').style.display = "none"; document.getElementById('initial').innerHTML = " "; } } function validation(form) { if (document.getElementById('username').value == '') { alert("<?php echo JText::_('HDVS_ENTER_NAME'); ?>"); document.getElementById('username').focus(); return false; } var comments = form.comment_message.value; if (comments.length == 0) { alert("<?php echo JText::_('HDVS_ENTER_MESSAGE'); ?>"); form.comment_message.focus(); return false; } return true; } </script> <?php } } ?> </div> <?php } ?> <?php /** Display member collection link starts here */ if (JRequest::getVar ( 'memberidvalue', '', 'post', 'int' )) { $memberidvalue = JRequest::getVar ( 'memberidvalue', '', 'post', 'int' ); } ?> <form name="memberidform" id="memberidform" action="<?php echo JRoute::_ ( 'index.php?Itemid=' . $Itemid . '&option=com_contushdvideoshare&view=membercollection' ); ?>" method="post"> <input type="hidden" id="memberidvalue" name="memberidvalue" value="<?php echo $memberidvalue; ?>" /> </form> <!--Display member collection link ends here--> <input type="hidden" value="" id="storeratemsg" /> <script type="text/javascript"> txt = navigator.platform; if ( txt == 'iPod' || txt == 'iPad' || txt == 'iPhone' || txt == 'Linux armv7l' || txt == 'Linux armv6l' ) { document.getElementById('downloadurl').style.display = 'none'; document.getElementById('allowEmbed').style.display = 'none'; document.getElementById('share_like').style.display = 'none'; var cmdoption = document.getElementById('commentoption').value; if (cmdoption == 1) { document.getElementById('theFacebookComment').style.display = 'block'; } } </script> </div> <?php } } ?> The following is the result of a cached page by joomla (Yes, joomla store the cached page on the server) <?php die("Access Denied"); ?>#x#a:3:{s:4:"body";s:24496:"<!doctype html> <html xml:lang="it-it" lang="it-it" > <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="http://www.test995.altervista.org/components/com_video-js/video-js.css" rel="stylesheet"> <script src="http://www.test995.altervista.org/components/com_video-js/video.js"></script> <script> videojs.options.flash.swf = "http://www.test995.altervista.org/components/com_video-js/video-js.swf" </script> <script src="http://www.test995.altervista.org/components/com_video-js/videojs.hotkeys.js"></script> <base href="http://test995.altervista.org/index.php/player/9/1" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="generator" content="Joomla! - Open Source Content Management" /> <title>The Hobbit: The Desolation of Smaug International Trailer</title> <link rel="stylesheet" href="http://test995.altervista.org/components/com_contushdvideoshare/css/stylesheet.min.css" type="text/css" /> <link rel="stylesheet" href="/templates/rt_corvus/css-compiled/menu.css" type="text/css" /> <link rel="stylesheet" href="/libraries/gantry/css/grid-responsive.css" type="text/css" /> <link rel="stylesheet" href="/templates/rt_corvus/css-compiled/bootstrap.css" type="text/css" /> <link rel="stylesheet" href="/templates/rt_corvus/css-compiled/master-5bf9861dbec89846e44f873f79fbc3da.css" type="text/css" /> <link rel="stylesheet" href="/templates/rt_corvus/css-compiled/mediaqueries.css" type="text/css" /> <link rel="stylesheet" href="/templates/rt_corvus/css-compiled/rtl.css" type="text/css" /> <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:100,100italic,300,300italic,regular,italic,500,500italic,700,700italic,900,900italic&subset=latin,latin-ext" type="text/css" /> <style type="text/css"> #face-comments iframe{width: 700px !important; } #video-grid-container .ulvideo_thumb .popular_gutterwidth{margin-left:20px; } #video-grid-container .ulvideo_thumb .featured_gutterwidth{margin-left:20px; } #video-grid-container .ulvideo_thumb .recent_gutterwidth{margin-left:20px; } #video-grid-container_pop .ulvideo_thumb .popular_gutterwidth{margin-left:20px; } #video-grid-container_pop .ulvideo_thumb .featured_gutterwidth{margin-left:20px; } #video-grid-container_pop .ulvideo_thumb .recent_gutterwidth{margin-left:20px; } #video-grid-container_rec .ulvideo_thumb .popular_gutterwidth{margin-left:20px; } #video-grid-container_rec .ulvideo_thumb .featured_gutterwidth{margin-left:20px; } #video-grid-container_rec .ulvideo_thumb .recent_gutterwidth{margin-left:20px; } h1, h2 { font-family: 'Roboto', 'Helvetica', arial, serif; } </style> <script src="http://test995.altervista.org/components/com_contushdvideoshare/js/jquery.js" type="text/javascript"></script> <script src="http://test995.altervista.org/components/com_contushdvideoshare/js/script.js" type="text/javascript" defer="defer"></script> <script src="http://test995.altervista.org/components/com_contushdvideoshare/js/htmltooltip.js" type="text/javascript" async="async"></script> <script src="/media/system/js/mootools-core.js" type="text/javascript"></script> <script src="/media/system/js/core.js" type="text/javascript"></script> <script src="/media/system/js/mootools-more.js" type="text/javascript"></script> <script src="/libraries/gantry/js/browser-engines.js" type="text/javascript"></script> <script src="/templates/rt_corvus/js/rokmediaqueries.js" type="text/javascript"></script> <script src="/modules/mod_roknavmenu/themes/default/js/rokmediaqueries.js" type="text/javascript"></script> <script src="/modules/mod_roknavmenu/themes/default/js/sidemenu.js" type="text/javascript"></script> <script type="text/javascript"> var rtlLang = 0; window.setInterval(function(){var r;try{r=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}if(r){r.open("GET","/index.php?option=com_ajax&format=json",true);r.send(null)}},840000); </script> <link rel="image_src" href="http://i3.ytimg.com/vi/TeGb5XGk2U0/hqdefault.jpg"/> <link rel="canonical" href="http://test995.altervista.org/index.php/player/9/1"/> <meta property="og:site_name" content=""/> <meta property="og:url" content="http://test995.altervista.org/index.php/player/9/1"/> <meta property="og:title" content="The Hobbit: The Desolation of Smaug International Trailer"/> <meta property="og:description" content=""/> <meta property="og:image" content="http://i3.ytimg.com/vi/TeGb5XGk2U0/hqdefault.jpg"/> </head> <body class="logo-type-corvus top-type-preset1 header-overlay-light main-bg-overlay-light main-template-with-shadow main-body-light footer-overlay-dark bottom-type-preset1 font-family-roboto font-size-is-default menu-type-dropdownmenu menu-dropdownmenu-position-header-b layout-mode-responsive col12"> <div id="rt-page-surround"> <div id="rt-page-surround-bottom"> <div class="rt-without-footer"> <div id="rt-drawer"> <div class="rt-container"> <div class="clear"></div> </div> </div> <div id="rt-header"> <div class="rt-container"> <div class="rt-grid-6 rt-alpha"> <div class="rt-block logo-block"> <a href="/" id="rt-logo"></a> </div> </div> <div class="rt-grid-6 rt-omega"> <div class="rt-block menu-block"> <div class="gf-menu-device-container responsive-type-panel"></div> <ul class="gf-menu l1 " > <li class="item101 active last" > <a class="item" href="/index.php" > Home </a> </li> </ul> <div class="clear"></div> </div> <div class="clear"></div> </div> <div class="clear"></div> </div> </div> <div id="rt-transition"> <div id="rt-body-surround"> <div id="rt-mainbody-surround"> <div class="rt-container"> <div id="rt-main" class="mb9-sa3"> <div class="rt-container"> <div class="rt-grid-9 "> <div class="rt-block"> <div id="rt-mainbody"> <div class="component-content"> <!--Rich snippet starts here --> <div id="video-container" class="" itemscope itemid="" itemtype="http://schema.org/VideoObject"> <link itemprop="url" href="http://www.youtube.com/watch?v=TeGb5XGk2U0"> <div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"> <meta itemprop="ratingValue" content="4" /> <meta itemprop="ratingCount" content="3" /> </div> <div itemprop="video" itemscope itemtype="http://schema.org/VideoObject"> <meta itemprop="name" content="The Hobbit: The Desolation of Smaug International Trailer" /> <meta itemprop="thumbnail" content="http://i3.ytimg.com/vi/TeGb5XGk2U0/hqdefault.jpg" /> <meta itemprop="description" content="No description" /> </div> <meta itemprop="image" content="http://i3.ytimg.com/vi/TeGb5XGk2U0/hqdefault.jpg" /> <meta itemprop="thumbnailUrl" content="http://i3.ytimg.com/vi/TeGb5XGk2U0/hqdefault.jpg" /> <meta itemprop="embedURL" content="http://test995.altervista.org/components/com_contushdvideoshare/hdflvplayer/hdplayer.swf?id=1" /> </div> <!--Rich snippet ends here --> <input type="hidden" name="category" value="9" id="category" /> <input type="hidden" value="1" name="videoid" id="videoid" /> <script type="text/javascript"> function loadifr() { ev = document.getElementById('myframe1'); if (ev != null) { setHeight(ev); addEvent(ev, 'load', doIframe); } } window.onload = function() { setInterval("loadifr()", 500); } </script> <div class="fluid bg playerbg clearfix" id="player_page"> <div id="HDVideoshare1" style="position: relative;" class="clearfix"> <h1 id="viewtitle" class="floatleft" style=""> The Hobbit: The Desolation of Smaug International Trailer</h1> <div class="clear"></div> <script type="text/javascript"> var txt = navigator.platform; function failed(e) { if ( txt == 'iPod' || txt == 'iPad' || txt == 'iPhone' || windo == "Windows Phone" || txt == 'Linux armv7l' || txt == 'Linux armv6l' ) { alert('Player doesnot support this video.'); } } </script> <video id="example_video_1" class="video-js vjs-default-skin vjs-big-play-centered" controls preload="auto" width="720" height="480" poster=http://i3.ytimg.com/vi/TeGb5XGk2U0/maxresdefault.jpg data-setup='{"example_option":true}'> <source src=http://www.youtube.com/watch?v=TeGb5XGk2U0 type='video/mp4' /> <p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a></p> </video> <?php $db = JFactory::getDBO(); if(!$db) { echo ""; } elseif(!$htmlVideoDetails->id) { echo ""; } else { $query = "UPDATE ygvhc_hdflv_upload SET times_viewed=1+times_viewed WHERE id={$htmlVideoDetails->id}"; $db->setQuery($query); if(!$db->query()) { echo ""; } else { echo ""; } } ?> </div> </div> <div class="video-page-container clscenter"> <div class="video-page-info "> <div class="video-page-date"> <!--Display video created date--> <div class="video_addedon"> <span class="addedon"><strong>Added on : </strong> </span><span id="createdate"> 5-Jun-2010</span> </div> </div> <div class="video-page-views"> <span class="video-view"> <strong> Views : </strong> </span> <span id="viewcount"> 41 </span> </div> <div class="clearfix"></div> <div class="video-page-username"> <div class="viewsubname"> <span class="uploadedby"><strong> Uploaded by : </strong></span> <a title="admin" class="namelink cursor_pointer" onclick="membervalue('451')">admin</a> </div> </div> <div class="video-page-rating"> <!--Rating starts here--> <div id="rateid" class="ratingbg"> <div class="content_center clearfix" style=""> <div class="centermargin floatleft"> <div class="rateimgleft" id="rateimg" onmouseover="displayrating('');" onmouseout="resetvalue();" > <div id="a" class="floatleft"></div> <ul class="ratethis " id="rate"> <li class="one"><a title="1 Star Rating" onclick="getrate('1');" onmousemove="displayrating('1');" onmouseout="resetvalue();" >1</a></li> <li class="two"><a title="2 Star Ratings" onclick="getrate('2');" onmousemove="displayrating('2');" onmouseout="resetvalue();" >2</a></li> <li class="three"><a title="3 Star Ratings" onclick="getrate('3');" onmousemove="displayrating('3');" onmouseout="resetvalue();" >3</a></li> <li class="four"><a title="4 Star Ratings" onclick="getrate('4');" onmousemove="displayrating('4');" onmouseout="resetvalue();" >4</a></li> <li class="five"><a title="5 Star Ratings" onclick="getrate('5');" onmousemove="displayrating('5');" onmouseout="resetvalue();" >5</a></li> </ul> <input type="hidden" name="id" id="id" value="1" /> </div> <div class="rateright-views floatleft"> <span class="clsrateviews" id="ratemsg" onmouseover="displayrating('');" onmouseout="resetvalue();" > </span> <span class="rightrateimg" id="ratemsg1" onmouseover="displayrating('');" onmouseout="resetvalue();" > </span> </div> </div> </div> <script type="text/javascript"> function ratecal(rating, ratecount) { if (rating == 1){ document.getElementById('rate').className = "ratethis onepos"; } else if (rating == 2) { document.getElementById('rate').className = "ratethis twopos"; } else if (rating == 3) { document.getElementById('rate').className = "ratethis threepos"; } else if (rating == 4) { document.getElementById('rate').className = "ratethis fourpos"; } else if (rating == 5) { document.getElementById('rate').className = "ratethis fivepos"; } else { document.getElementById('rate').className = "ratethis nopos"; } document.getElementById('ratemsg').innerHTML = "<span dir='LTR' class='ratting_txt'>Rating(s) : " + ratecount + "</span> "; } ratecal( '4', '3', '41' ); function createObject() { var request_type; var browser = navigator.appName; if (browser == "Microsoft Internet Explorer") { request_type = new ActiveXObject("Microsoft.XMLHTTP"); } else { request_type = new XMLHttpRequest(); } return request_type; } var http = createObject(); var nocache = 0; function getrate(t) { if (t == '1') { document.getElementById('rate').className = "ratethis onepos"; document.getElementById('a').className = "ratethis onepos"; } if (t == '2') { document.getElementById('rate').className = "ratethis twopos"; document.getElementById('a').className = "ratethis twopos"; } if (t == '3') { document.getElementById('rate').className = "ratethis threepos"; document.getElementById('a').className = "ratethis threepos"; } if (t == '4') { document.getElementById('rate').className = "ratethis fourpos"; document.getElementById('a').className = "ratethis fourpos"; } if (t == '5') { document.getElementById('rate').className = "ratethis fivepos"; document.getElementById('a').className = "ratethis fivepos"; } document.getElementById('rate').style.display = "none"; document.getElementById('ratemsg').innerHTML = "Thanks for rating!"; var id = document.getElementById('id').value; nocache = Math.random(); http.open( 'get', 'http://test995.altervista.org/index.php?option=com_contushdvideoshare&view=player&tmpl=component&id=' + id + '&rate=' + t + '&nocache = ' + nocache, true ); http.onreadystatechange = insertReplyRating; http.send(null); document.getElementById('rate').style.visibility = 'disable'; } function submitreport() { var reportvideotype = document.getElementsByName('reportvideotype'); var repmsg; for (var i = 0; i < reportvideotype.length; i++) { if (reportvideotype[i].checked) { repmsg = reportvideotype[i].value; break; } else { repmsg = ''; } } if (repmsg === "") { alert('Select Report Type'); return false; } location.href = 'http://test995.altervista.org/index.php?option=com_users&view=login&return=aW5kZXgucGhwP29wdGlvbj1jb21fY29udHVzaGR2aWRlb3NoYXJlJnZpZXc9cGxheWVyJmNhdGlkPTkmaWQ9MQ=='; document.getElementById('reportadmin').style.visibility = 'none'; } function resetreport() { document.getElementById('reportadmin').style.display = "none"; } function getReport() { document.getElementById('reportadmin').style.display = "none"; document.getElementById('dvLoading').style.display = "none"; document.getElementById('reportmessage').innerHTML = http.responseText; } function insertReplyRating() { if (http.readyState == 4) { document.getElementById('ratemsg').innerHTML = "<span dir='LTR' class='ratting_txt'>Rating(s) : " + http.responseText + "</span>"; document.getElementById('rate').className = ""; document.getElementById('storeratemsg').value = http.responseText; } } function resetvalue() { document.getElementById('ratemsg1').style.display = "none"; document.getElementById('ratemsg').style.display = "block"; if (document.getElementById('storeratemsg').value == '') { document.getElementById('ratemsg').innerHTML = "<span dir='LTR' class='ratting_txt'>Rating(s) : 3</span>"; } else { document.getElementById('ratemsg').innerHTML = "<span dir='LTR' class='ratting_txt'>Rating(s) : " + document.getElementById('storeratemsg').value + "</span> "; } } function displayrating(t) { if (t == '1') { document.getElementById('ratemsg').innerHTML = "Poor"; } if (t == '2') { document.getElementById('ratemsg').innerHTML = "Nothing special"; } if (t == '3') { document.getElementById('ratemsg').innerHTML = "Worth watching"; } if (t == '4') { document.getElementById('ratemsg').innerHTML = "Pretty cool"; } if (t == '5') { document.getElementById('ratemsg').innerHTML = "Awesome"; } document.getElementById('ratemsg1').style.display = "none"; document.getElementById('ratemsg').style.display = "block"; } </script> <!-- Script for rating of the video ends here --> </div> </div> <div class="clear"></div> </div> <!-- Social Sharing Icons starts here --> <div id="share_like" class="video-socialshare"> </div> <!--Social Sharing icons ends here--> <div class="vido_info_container"> <div class="video-cat-thumb commentpost"> <textarea onclick="this.select()" dir="LTR" id="embedcode" name="embedcode" style="display:none;width:683px;}" rows="7" ><embed id="player" src="http://test995.altervista.org/components/com_contushdvideoshare/hdflvplayer/hdplayer.swf" flashvars="id=1&baserefJHDV=http://test995.altervista.org/&playlist_auto=false&Preview=http://i3.ytimg.com/vi/TeGb5XGk2U0/maxresdefault.jpg&showPlaylist=false&embedplayer=true&shareIcon=false&email=false&zoomIcon=false&playlist_autoplay=false" style="width:700px;height:500px" allowFullScreen="true" allowScriptAccess="always" type="application/x-shockwave-flash"wmode="transparent"></embed></textarea> <input type="hidden" name="flagembed" id="flagembed" /> </div> <script type="text/javascript"> function enableEmbed() { embedFlag = document.getElementById('flagembed').value if (embedFlag != 1) { document.getElementById('embedcode').style.display = "block"; if (document.getElementById('reportadmin')) { document.getElementById('reportadmin').style.display = 'none'; } document.getElementById('flagembed').value = '1'; } else { document.getElementById('embedcode').style.display = "none"; if (document.getElementById('reportadmin')) { document.getElementById('reportadmin').style.display = 'none'; } document.getElementById('flagembed').value = '0'; } } </script> <div style="clear: both;"></div> <div class="video-page-desc"></div> </div> </div> <div class="clear"></div> <div class="videosharecommetsection"> <!-- Add Facebook Comment --> <input type="hidden" value="2" id="commentoption" name="commentoption" /> <div id="commentappended" class="clscenter" style=""> </div> <form name="memberidform" id="memberidform" action="/index.php/membercollection" method="post"> <input type="hidden" id="memberidvalue" name="memberidvalue" value="" /> </form> <!--Display member collection link ends here--> <input type="hidden" value="" id="storeratemsg" /> <script type="text/javascript"> txt = navigator.platform; if ( txt == 'iPod' || txt == 'iPad' || txt == 'iPhone' || txt == 'Linux armv7l' || txt == 'Linux armv6l' ) { document.getElementById('downloadurl').style.display = 'none'; document.getElementById('allowEmbed').style.display = 'none'; document.getElementById('share_like').style.display = 'none'; var cmdoption = document.getElementById('commentoption').value; if (cmdoption == 1) { document.getElementById('theFacebookComment').style.display = 'block'; } } </script> </div> </div> </div> </div> </div> <div class="rt-grid-3 "> <div id="rt-sidebar-a"> <div class="rt-block "> <div class="module-surround"> <div class="module-title"> <h2 class="title">Accesso Utenti</h2> </div> <div class="module-content"> <form action="/index.php" method="post" id="login-form" > <fieldset class="userdata"> <p id="form-login-username"> <label for="modlgn-username">Nome utente</label> <input id="modlgn-username" type="text" name="username" class="inputbox" size="18" /> </p> <p id="form-login-password"> <label for="modlgn-passwd">Password</label> <input id="modlgn-passwd" type="password" name="password" class="inputbox" size="18" /> </p> <p id="form-login-remember"> <label for="modlgn-remember">Ricordami</label> <input id="modlgn-remember" type="checkbox" name="remember" class="inputbox" value="yes"/> </p> <input type="submit" name="Submit" class="button" value="Accedi" /> <input type="hidden" name="option" value="com_users" /> <input type="hidden" name="task" value="user.login" /> <input type="hidden" name="return" value="aHR0cDovL3Rlc3Q5OTUuYWx0ZXJ2aXN0YS5vcmcvaW5kZXgucGhwL3BsYXllci85LzE=" /> <input type="hidden" name="87f04b324a637d06c0603fafaa861089" value="1" /> <ul> <li> <a href="/index.php/component/users/?view=reset"> Password dimenticata?</a> </li> <li> <a href="/index.php/component/users/?view=remind"> Nome utente dimenticato?</a> </li> </ul> </fieldset> </form> </div> </div> </div> <div class="rt-block "> <div class="module-surround"> <div class="module-title"> <h2 class="title">Menu</h2> </div> <div class="module-content"> <div class="video_module module_menu "> <ul class="menu"> <li class="item27"> <a href="/index.php/actors/category/14"> <span>Actors</span></a> </li> <li class="item27"> <a href="/index.php/comedy/category/13"> <span>Comedy</span></a> </li> <li class="item27"> <a href="/index.php/cooking/category/7"> <span>Cooking</span></a> </li> <li class="item27"> <a href="/index.php/documentary/category/5"> <span>Documentary</span></a> </li> <li class="item27"> <a href="/index.php/greetings/category/12"> <span>Greetings</span></a> </li> <li class="item27"> <a href="/index.php/interviews/category/2"> <span>Interviews</span></a> </li> <li class="item27"> <a href="/index.php/music/category/8"> <span>Music</span></a> </li> <li class="item27"> <a href="/index.php/news-info/category/4"> <span>News & Info</span></a> </li> <li class="item27"> <a href="/index.php/religious/category/10"> <span>Religious</span></a> </li> <li class="item27"> <a href="/index.php/speeches/category/1"> <span>Speeches</span></a> </li> <li class="item27"> <a href="/index.php/talk-shows/category/3"> <span>Talk Shows</span></a> </li> <li class="item27"> <a href="/index.php/trailers/category/9"> <span>Trailers</span></a> </li> <li class="item27"> <a href="/index.php/travel/category/6"> <span>Travel</span></a> </li> <li class="item27"> <a href="/index.php/tv-serials-shows/category/11"> <span>TV Serials & Shows</span></a> </li> </ul> </div> <div class="clear"></div> </div> </div> </div> </div> </div> <div class="clear"></div> </div> </div> </div> </div> </div> </div> <div id="rt-copyright"> <div class="rt-container"> <div class="rt-grid-12 rt-alpha rt-omega"> <div class="rt-block"> <a href="http://www.rockettheme.com/" title="RocketTheme" class="powered-by"></a> </div> </div> <div class="clear"></div> </div> </div> </div> </div> </div> </body> </html> ";s:13:"mime_encoding";s:9:"text/html";s:7:"headers";a:0:{}} Quote Link to comment https://forums.phpfreaks.com/topic/299815-count-the-number-of-times-a-page-has-been-viewed/page/2/#findComment-1528343 Share on other sites More sharing options...
ababba2 Posted December 21, 2015 Author Share Posted December 21, 2015 EDIT: Sorry, the cached page by joomla I posted above is wrong. This is the real one (in the previous I was trying to force view count script execution, but it resulted in a blank page) <?php die("Access Denied"); ?>#x#a:3:{s:4:"body";s:24496:"<!doctype html> <html xml:lang="it-it" lang="it-it" > <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="http://www.test995.altervista.org/components/com_video-js/video-js.css" rel="stylesheet"> <script src="http://www.test995.altervista.org/components/com_video-js/video.js"></script> <script> videojs.options.flash.swf = "http://www.test995.altervista.org/components/com_video-js/video-js.swf" </script> <script src="http://www.test995.altervista.org/components/com_video-js/videojs.hotkeys.js"></script> <base href="http://test995.altervista.org/index.php/player/9/1" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="generator" content="Joomla! - Open Source Content Management" /> <title>The Hobbit: The Desolation of Smaug International Trailer</title> <link rel="stylesheet" href="http://test995.altervista.org/components/com_contushdvideoshare/css/stylesheet.min.css" type="text/css" /> <link rel="stylesheet" href="/templates/rt_corvus/css-compiled/menu.css" type="text/css" /> <link rel="stylesheet" href="/libraries/gantry/css/grid-responsive.css" type="text/css" /> <link rel="stylesheet" href="/templates/rt_corvus/css-compiled/bootstrap.css" type="text/css" /> <link rel="stylesheet" href="/templates/rt_corvus/css-compiled/master-5bf9861dbec89846e44f873f79fbc3da.css" type="text/css" /> <link rel="stylesheet" href="/templates/rt_corvus/css-compiled/mediaqueries.css" type="text/css" /> <link rel="stylesheet" href="/templates/rt_corvus/css-compiled/rtl.css" type="text/css" /> <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:100,100italic,300,300italic,regular,italic,500,500italic,700,700italic,900,900italic&subset=latin,latin-ext" type="text/css" /> <style type="text/css"> #face-comments iframe{width: 700px !important; } #video-grid-container .ulvideo_thumb .popular_gutterwidth{margin-left:20px; } #video-grid-container .ulvideo_thumb .featured_gutterwidth{margin-left:20px; } #video-grid-container .ulvideo_thumb .recent_gutterwidth{margin-left:20px; } #video-grid-container_pop .ulvideo_thumb .popular_gutterwidth{margin-left:20px; } #video-grid-container_pop .ulvideo_thumb .featured_gutterwidth{margin-left:20px; } #video-grid-container_pop .ulvideo_thumb .recent_gutterwidth{margin-left:20px; } #video-grid-container_rec .ulvideo_thumb .popular_gutterwidth{margin-left:20px; } #video-grid-container_rec .ulvideo_thumb .featured_gutterwidth{margin-left:20px; } #video-grid-container_rec .ulvideo_thumb .recent_gutterwidth{margin-left:20px; } h1, h2 { font-family: 'Roboto', 'Helvetica', arial, serif; } </style> <script src="http://test995.altervista.org/components/com_contushdvideoshare/js/jquery.js" type="text/javascript"></script> <script src="http://test995.altervista.org/components/com_contushdvideoshare/js/script.js" type="text/javascript" defer="defer"></script> <script src="http://test995.altervista.org/components/com_contushdvideoshare/js/htmltooltip.js" type="text/javascript" async="async"></script> <script src="/media/system/js/mootools-core.js" type="text/javascript"></script> <script src="/media/system/js/core.js" type="text/javascript"></script> <script src="/media/system/js/mootools-more.js" type="text/javascript"></script> <script src="/libraries/gantry/js/browser-engines.js" type="text/javascript"></script> <script src="/templates/rt_corvus/js/rokmediaqueries.js" type="text/javascript"></script> <script src="/modules/mod_roknavmenu/themes/default/js/rokmediaqueries.js" type="text/javascript"></script> <script src="/modules/mod_roknavmenu/themes/default/js/sidemenu.js" type="text/javascript"></script> <script type="text/javascript"> var rtlLang = 0; window.setInterval(function(){var r;try{r=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}if(r){r.open("GET","/index.php?option=com_ajax&format=json",true);r.send(null)}},840000); </script> <link rel="image_src" href="http://i3.ytimg.com/vi/TeGb5XGk2U0/hqdefault.jpg"/> <link rel="canonical" href="http://test995.altervista.org/index.php/player/9/1"/> <meta property="og:site_name" content=""/> <meta property="og:url" content="http://test995.altervista.org/index.php/player/9/1"/> <meta property="og:title" content="The Hobbit: The Desolation of Smaug International Trailer"/> <meta property="og:description" content=""/> <meta property="og:image" content="http://i3.ytimg.com/vi/TeGb5XGk2U0/hqdefault.jpg"/> </head> <body class="logo-type-corvus top-type-preset1 header-overlay-light main-bg-overlay-light main-template-with-shadow main-body-light footer-overlay-dark bottom-type-preset1 font-family-roboto font-size-is-default menu-type-dropdownmenu menu-dropdownmenu-position-header-b layout-mode-responsive col12"> <div id="rt-page-surround"> <div id="rt-page-surround-bottom"> <div class="rt-without-footer"> <div id="rt-drawer"> <div class="rt-container"> <div class="clear"></div> </div> </div> <div id="rt-header"> <div class="rt-container"> <div class="rt-grid-6 rt-alpha"> <div class="rt-block logo-block"> <a href="/" id="rt-logo"></a> </div> </div> <div class="rt-grid-6 rt-omega"> <div class="rt-block menu-block"> <div class="gf-menu-device-container responsive-type-panel"></div> <ul class="gf-menu l1 " > <li class="item101 active last" > <a class="item" href="/index.php" > Home </a> </li> </ul> <div class="clear"></div> </div> <div class="clear"></div> </div> <div class="clear"></div> </div> </div> <div id="rt-transition"> <div id="rt-body-surround"> <div id="rt-mainbody-surround"> <div class="rt-container"> <div id="rt-main" class="mb9-sa3"> <div class="rt-container"> <div class="rt-grid-9 "> <div class="rt-block"> <div id="rt-mainbody"> <div class="component-content"> <!--Rich snippet starts here --> <div id="video-container" class="" itemscope itemid="" itemtype="http://schema.org/VideoObject"> <link itemprop="url" href="http://www.youtube.com/watch?v=TeGb5XGk2U0"> <div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"> <meta itemprop="ratingValue" content="4" /> <meta itemprop="ratingCount" content="3" /> </div> <div itemprop="video" itemscope itemtype="http://schema.org/VideoObject"> <meta itemprop="name" content="The Hobbit: The Desolation of Smaug International Trailer" /> <meta itemprop="thumbnail" content="http://i3.ytimg.com/vi/TeGb5XGk2U0/hqdefault.jpg" /> <meta itemprop="description" content="No description" /> </div> <meta itemprop="image" content="http://i3.ytimg.com/vi/TeGb5XGk2U0/hqdefault.jpg" /> <meta itemprop="thumbnailUrl" content="http://i3.ytimg.com/vi/TeGb5XGk2U0/hqdefault.jpg" /> <meta itemprop="embedURL" content="http://test995.altervista.org/components/com_contushdvideoshare/hdflvplayer/hdplayer.swf?id=1" /> </div> <!--Rich snippet ends here --> <input type="hidden" name="category" value="9" id="category" /> <input type="hidden" value="1" name="videoid" id="videoid" /> <script type="text/javascript"> function loadifr() { ev = document.getElementById('myframe1'); if (ev != null) { setHeight(ev); addEvent(ev, 'load', doIframe); } } window.onload = function() { setInterval("loadifr()", 500); } </script> <div class="fluid bg playerbg clearfix" id="player_page"> <div id="HDVideoshare1" style="position: relative;" class="clearfix"> <h1 id="viewtitle" class="floatleft" style=""> The Hobbit: The Desolation of Smaug International Trailer</h1> <div class="clear"></div> <script type="text/javascript"> var txt = navigator.platform; function failed(e) { if ( txt == 'iPod' || txt == 'iPad' || txt == 'iPhone' || windo == "Windows Phone" || txt == 'Linux armv7l' || txt == 'Linux armv6l' ) { alert('Player doesnot support this video.'); } } </script> <video id="example_video_1" class="video-js vjs-default-skin vjs-big-play-centered" controls preload="auto" width="720" height="480" poster=http://i3.ytimg.com/vi/TeGb5XGk2U0/maxresdefault.jpg data-setup='{"example_option":true}'> <source src=http://www.youtube.com/watch?v=TeGb5XGk2U0 type='video/mp4' /> <p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a></p> </video> </div> </div> <div class="video-page-container clscenter"> <div class="video-page-info "> <div class="video-page-date"> <!--Display video created date--> <div class="video_addedon"> <span class="addedon"><strong>Added on : </strong> </span><span id="createdate"> 5-Jun-2010</span> </div> </div> <div class="video-page-views"> <span class="video-view"> <strong> Views : </strong> </span> <span id="viewcount"> 41 </span> </div> <div class="clearfix"></div> <div class="video-page-username"> <div class="viewsubname"> <span class="uploadedby"><strong> Uploaded by : </strong></span> <a title="admin" class="namelink cursor_pointer" onclick="membervalue('451')">admin</a> </div> </div> <div class="video-page-rating"> <!--Rating starts here--> <div id="rateid" class="ratingbg"> <div class="content_center clearfix" style=""> <div class="centermargin floatleft"> <div class="rateimgleft" id="rateimg" onmouseover="displayrating('');" onmouseout="resetvalue();" > <div id="a" class="floatleft"></div> <ul class="ratethis " id="rate"> <li class="one"><a title="1 Star Rating" onclick="getrate('1');" onmousemove="displayrating('1');" onmouseout="resetvalue();" >1</a></li> <li class="two"><a title="2 Star Ratings" onclick="getrate('2');" onmousemove="displayrating('2');" onmouseout="resetvalue();" >2</a></li> <li class="three"><a title="3 Star Ratings" onclick="getrate('3');" onmousemove="displayrating('3');" onmouseout="resetvalue();" >3</a></li> <li class="four"><a title="4 Star Ratings" onclick="getrate('4');" onmousemove="displayrating('4');" onmouseout="resetvalue();" >4</a></li> <li class="five"><a title="5 Star Ratings" onclick="getrate('5');" onmousemove="displayrating('5');" onmouseout="resetvalue();" >5</a></li> </ul> <input type="hidden" name="id" id="id" value="1" /> </div> <div class="rateright-views floatleft"> <span class="clsrateviews" id="ratemsg" onmouseover="displayrating('');" onmouseout="resetvalue();" > </span> <span class="rightrateimg" id="ratemsg1" onmouseover="displayrating('');" onmouseout="resetvalue();" > </span> </div> </div> </div> <script type="text/javascript"> function ratecal(rating, ratecount) { if (rating == 1){ document.getElementById('rate').className = "ratethis onepos"; } else if (rating == 2) { document.getElementById('rate').className = "ratethis twopos"; } else if (rating == 3) { document.getElementById('rate').className = "ratethis threepos"; } else if (rating == 4) { document.getElementById('rate').className = "ratethis fourpos"; } else if (rating == 5) { document.getElementById('rate').className = "ratethis fivepos"; } else { document.getElementById('rate').className = "ratethis nopos"; } document.getElementById('ratemsg').innerHTML = "<span dir='LTR' class='ratting_txt'>Rating(s) : " + ratecount + "</span> "; } ratecal( '4', '3', '41' ); function createObject() { var request_type; var browser = navigator.appName; if (browser == "Microsoft Internet Explorer") { request_type = new ActiveXObject("Microsoft.XMLHTTP"); } else { request_type = new XMLHttpRequest(); } return request_type; } var http = createObject(); var nocache = 0; function getrate(t) { if (t == '1') { document.getElementById('rate').className = "ratethis onepos"; document.getElementById('a').className = "ratethis onepos"; } if (t == '2') { document.getElementById('rate').className = "ratethis twopos"; document.getElementById('a').className = "ratethis twopos"; } if (t == '3') { document.getElementById('rate').className = "ratethis threepos"; document.getElementById('a').className = "ratethis threepos"; } if (t == '4') { document.getElementById('rate').className = "ratethis fourpos"; document.getElementById('a').className = "ratethis fourpos"; } if (t == '5') { document.getElementById('rate').className = "ratethis fivepos"; document.getElementById('a').className = "ratethis fivepos"; } document.getElementById('rate').style.display = "none"; document.getElementById('ratemsg').innerHTML = "Thanks for rating!"; var id = document.getElementById('id').value; nocache = Math.random(); http.open( 'get', 'http://test995.altervista.org/index.php?option=com_contushdvideoshare&view=player&tmpl=component&id=' + id + '&rate=' + t + '&nocache = ' + nocache, true ); http.onreadystatechange = insertReplyRating; http.send(null); document.getElementById('rate').style.visibility = 'disable'; } function submitreport() { var reportvideotype = document.getElementsByName('reportvideotype'); var repmsg; for (var i = 0; i < reportvideotype.length; i++) { if (reportvideotype[i].checked) { repmsg = reportvideotype[i].value; break; } else { repmsg = ''; } } if (repmsg === "") { alert('Select Report Type'); return false; } location.href = 'http://test995.altervista.org/index.php?option=com_users&view=login&return=aW5kZXgucGhwP29wdGlvbj1jb21fY29udHVzaGR2aWRlb3NoYXJlJnZpZXc9cGxheWVyJmNhdGlkPTkmaWQ9MQ=='; document.getElementById('reportadmin').style.visibility = 'none'; } function resetreport() { document.getElementById('reportadmin').style.display = "none"; } function getReport() { document.getElementById('reportadmin').style.display = "none"; document.getElementById('dvLoading').style.display = "none"; document.getElementById('reportmessage').innerHTML = http.responseText; } function insertReplyRating() { if (http.readyState == 4) { document.getElementById('ratemsg').innerHTML = "<span dir='LTR' class='ratting_txt'>Rating(s) : " + http.responseText + "</span>"; document.getElementById('rate').className = ""; document.getElementById('storeratemsg').value = http.responseText; } } function resetvalue() { document.getElementById('ratemsg1').style.display = "none"; document.getElementById('ratemsg').style.display = "block"; if (document.getElementById('storeratemsg').value == '') { document.getElementById('ratemsg').innerHTML = "<span dir='LTR' class='ratting_txt'>Rating(s) : 3</span>"; } else { document.getElementById('ratemsg').innerHTML = "<span dir='LTR' class='ratting_txt'>Rating(s) : " + document.getElementById('storeratemsg').value + "</span> "; } } function displayrating(t) { if (t == '1') { document.getElementById('ratemsg').innerHTML = "Poor"; } if (t == '2') { document.getElementById('ratemsg').innerHTML = "Nothing special"; } if (t == '3') { document.getElementById('ratemsg').innerHTML = "Worth watching"; } if (t == '4') { document.getElementById('ratemsg').innerHTML = "Pretty cool"; } if (t == '5') { document.getElementById('ratemsg').innerHTML = "Awesome"; } document.getElementById('ratemsg1').style.display = "none"; document.getElementById('ratemsg').style.display = "block"; } </script> <!-- Script for rating of the video ends here --> </div> </div> <div class="clear"></div> </div> <!-- Social Sharing Icons starts here --> <div id="share_like" class="video-socialshare"> </div> <!--Social Sharing icons ends here--> <div class="vido_info_container"> <div class="video-cat-thumb commentpost"> <textarea onclick="this.select()" dir="LTR" id="embedcode" name="embedcode" style="display:none;width:683px;}" rows="7" ><embed id="player" src="http://test995.altervista.org/components/com_contushdvideoshare/hdflvplayer/hdplayer.swf" flashvars="id=1&baserefJHDV=http://test995.altervista.org/&playlist_auto=false&Preview=http://i3.ytimg.com/vi/TeGb5XGk2U0/maxresdefault.jpg&showPlaylist=false&embedplayer=true&shareIcon=false&email=false&zoomIcon=false&playlist_autoplay=false" style="width:700px;height:500px" allowFullScreen="true" allowScriptAccess="always" type="application/x-shockwave-flash"wmode="transparent"></embed></textarea> <input type="hidden" name="flagembed" id="flagembed" /> </div> <script type="text/javascript"> function enableEmbed() { embedFlag = document.getElementById('flagembed').value if (embedFlag != 1) { document.getElementById('embedcode').style.display = "block"; if (document.getElementById('reportadmin')) { document.getElementById('reportadmin').style.display = 'none'; } document.getElementById('flagembed').value = '1'; } else { document.getElementById('embedcode').style.display = "none"; if (document.getElementById('reportadmin')) { document.getElementById('reportadmin').style.display = 'none'; } document.getElementById('flagembed').value = '0'; } } </script> <div style="clear: both;"></div> <div class="video-page-desc"></div> </div> </div> <div class="clear"></div> <div class="videosharecommetsection"> <!-- Add Facebook Comment --> <input type="hidden" value="2" id="commentoption" name="commentoption" /> <div id="commentappended" class="clscenter" style=""> </div> <form name="memberidform" id="memberidform" action="/index.php/membercollection" method="post"> <input type="hidden" id="memberidvalue" name="memberidvalue" value="" /> </form> <!--Display member collection link ends here--> <input type="hidden" value="" id="storeratemsg" /> <script type="text/javascript"> txt = navigator.platform; if ( txt == 'iPod' || txt == 'iPad' || txt == 'iPhone' || txt == 'Linux armv7l' || txt == 'Linux armv6l' ) { document.getElementById('downloadurl').style.display = 'none'; document.getElementById('allowEmbed').style.display = 'none'; document.getElementById('share_like').style.display = 'none'; var cmdoption = document.getElementById('commentoption').value; if (cmdoption == 1) { document.getElementById('theFacebookComment').style.display = 'block'; } } </script> </div> </div> </div> </div> </div> <div class="rt-grid-3 "> <div id="rt-sidebar-a"> <div class="rt-block "> <div class="module-surround"> <div class="module-title"> <h2 class="title">Accesso Utenti</h2> </div> <div class="module-content"> <form action="/index.php" method="post" id="login-form" > <fieldset class="userdata"> <p id="form-login-username"> <label for="modlgn-username">Nome utente</label> <input id="modlgn-username" type="text" name="username" class="inputbox" size="18" /> </p> <p id="form-login-password"> <label for="modlgn-passwd">Password</label> <input id="modlgn-passwd" type="password" name="password" class="inputbox" size="18" /> </p> <p id="form-login-remember"> <label for="modlgn-remember">Ricordami</label> <input id="modlgn-remember" type="checkbox" name="remember" class="inputbox" value="yes"/> </p> <input type="submit" name="Submit" class="button" value="Accedi" /> <input type="hidden" name="option" value="com_users" /> <input type="hidden" name="task" value="user.login" /> <input type="hidden" name="return" value="aHR0cDovL3Rlc3Q5OTUuYWx0ZXJ2aXN0YS5vcmcvaW5kZXgucGhwL3BsYXllci85LzE=" /> <input type="hidden" name="87f04b324a637d06c0603fafaa861089" value="1" /> <ul> <li> <a href="/index.php/component/users/?view=reset"> Password dimenticata?</a> </li> <li> <a href="/index.php/component/users/?view=remind"> Nome utente dimenticato?</a> </li> </ul> </fieldset> </form> </div> </div> </div> <div class="rt-block "> <div class="module-surround"> <div class="module-title"> <h2 class="title">Menu</h2> </div> <div class="module-content"> <div class="video_module module_menu "> <ul class="menu"> <li class="item27"> <a href="/index.php/actors/category/14"> <span>Actors</span></a> </li> <li class="item27"> <a href="/index.php/comedy/category/13"> <span>Comedy</span></a> </li> <li class="item27"> <a href="/index.php/cooking/category/7"> <span>Cooking</span></a> </li> <li class="item27"> <a href="/index.php/documentary/category/5"> <span>Documentary</span></a> </li> <li class="item27"> <a href="/index.php/greetings/category/12"> <span>Greetings</span></a> </li> <li class="item27"> <a href="/index.php/interviews/category/2"> <span>Interviews</span></a> </li> <li class="item27"> <a href="/index.php/music/category/8"> <span>Music</span></a> </li> <li class="item27"> <a href="/index.php/news-info/category/4"> <span>News & Info</span></a> </li> <li class="item27"> <a href="/index.php/religious/category/10"> <span>Religious</span></a> </li> <li class="item27"> <a href="/index.php/speeches/category/1"> <span>Speeches</span></a> </li> <li class="item27"> <a href="/index.php/talk-shows/category/3"> <span>Talk Shows</span></a> </li> <li class="item27"> <a href="/index.php/trailers/category/9"> <span>Trailers</span></a> </li> <li class="item27"> <a href="/index.php/travel/category/6"> <span>Travel</span></a> </li> <li class="item27"> <a href="/index.php/tv-serials-shows/category/11"> <span>TV Serials & Shows</span></a> </li> </ul> </div> <div class="clear"></div> </div> </div> </div> </div> </div> <div class="clear"></div> </div> </div> </div> </div> </div> </div> <div id="rt-copyright"> <div class="rt-container"> <div class="rt-grid-12 rt-alpha rt-omega"> <div class="rt-block"> <a href="http://www.rockettheme.com/" title="RocketTheme" class="powered-by"></a> </div> </div> <div class="clear"></div> </div> </div> </div> </div> </div> </body> </html> ";s:13:"mime_encoding";s:9:"text/html";s:7:"headers";a:0:{}} Quote Link to comment https://forums.phpfreaks.com/topic/299815-count-the-number-of-times-a-page-has-been-viewed/page/2/#findComment-1528344 Share on other sites More sharing options...
ginerjm Posted December 21, 2015 Share Posted December 21, 2015 ok - I don't know what all this code is. What you have said is that a page displays a series of videos and the user clicks on one. That click triggers a php script that displays the viewer page that allows the user to see his chosen video. So - what is all this code? Is this the script that is triggered by the click? And why is the code to record the count all the way down at line 3xx? Why not at the top since you know it has to happen. Do this. Comment out the counter code and add an echo saying "Just hit the counter code" and then exit. That will be proof that you hit the counter code every time you view your page and select a video. Also - what is the filename of each of these two files you posted? Quote Link to comment https://forums.phpfreaks.com/topic/299815-count-the-number-of-times-a-page-has-been-viewed/page/2/#findComment-1528346 Share on other sites More sharing options...
ababba2 Posted December 22, 2015 Author Share Posted December 22, 2015 I put the script earlier but doesn't change anything. I tried to put an echo saying "hello1". And hello1 appears on the page. Then I changed "hello1" with "hello2". Without update the cache and in that page still appear "hello1" Quote Link to comment https://forums.phpfreaks.com/topic/299815-count-the-number-of-times-a-page-has-been-viewed/page/2/#findComment-1528473 Share on other sites More sharing options...
ginerjm Posted December 22, 2015 Share Posted December 22, 2015 What does this line mean: 'Without update the cache and in that page'? What does that mean? Are you trying to say that you edited the page, put it back on the server and then executed the same url call again? Quote Link to comment https://forums.phpfreaks.com/topic/299815-count-the-number-of-times-a-page-has-been-viewed/page/2/#findComment-1528475 Share on other sites More sharing options...
ababba2 Posted December 22, 2015 Author Share Posted December 22, 2015 Yes, I done this without updating the cache and still was appearing Hello1. By updating the cache I mean removingall the cached files generated by joomla's cache, there is a function for this in admin control panel. Quote Link to comment https://forums.phpfreaks.com/topic/299815-count-the-number-of-times-a-page-has-been-viewed/page/2/#findComment-1528477 Share on other sites More sharing options...
ginerjm Posted December 22, 2015 Share Posted December 22, 2015 If you continue to think this is related to joomla, I suggest you post in a joomla forum (cms) Quote Link to comment https://forums.phpfreaks.com/topic/299815-count-the-number-of-times-a-page-has-been-viewed/page/2/#findComment-1528478 Share on other sites More sharing options...
ababba2 Posted December 22, 2015 Author Share Posted December 22, 2015 Already done days ago. They don't answer. http://forum.joomla.org/viewtopic.php?f=706&t=902816&p=3351790 Quote Link to comment https://forums.phpfreaks.com/topic/299815-count-the-number-of-times-a-page-has-been-viewed/page/2/#findComment-1528480 Share on other sites More sharing options...
ginerjm Posted December 22, 2015 Share Posted December 22, 2015 Again - don't know joomla and have no idea what is does for you. I don't understand the need for a server-side cache. Caches that I am used to are on the client in order to save repeated downloads from the server when un-necessary. Having one on the server isn't saving anything and in a case like this interferes with the performance of a dynamic php script. Turn off the cache. Quote Link to comment https://forums.phpfreaks.com/topic/299815-count-the-number-of-times-a-page-has-been-viewed/page/2/#findComment-1528481 Share on other sites More sharing options...
ababba2 Posted December 22, 2015 Author Share Posted December 22, 2015 This kind of cache is useful because increase the page load speed Quote Link to comment https://forums.phpfreaks.com/topic/299815-count-the-number-of-times-a-page-has-been-viewed/page/2/#findComment-1528483 Share on other sites More sharing options...
ginerjm Posted December 23, 2015 Share Posted December 23, 2015 Increase the speed? It's still on the server! How does that speed things up - it still has to download. And having a cache to pull a page from that is technically out-of-date is not a good thing. Think about it. If you didn't have this cache this post would never have happened. Think about this. What if your url points to a script (which this one does) that produces different outputs? How does this cache work in that case when your url request wants "page2" sent to the client instead of the normal "page1" sent? Quote Link to comment https://forums.phpfreaks.com/topic/299815-count-the-number-of-times-a-page-has-been-viewed/page/2/#findComment-1528504 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.