Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Copyright Protection removal

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Copyright Protection removal

Postby dannel77 » Thu Apr 18, 2013 12:13 pm

Hi,

Can anyone help me understand why this code doesn't let Chrome play Youtube video's embedded on my website? Video's appear but can't be clicked, video's work in IE, Firefox. My technician some time ago added mouse right click protection, and I have tried removing the scripts below but it still doesn't work.

On other parts of my website that just contain plain HTML code, Chrome can play the embedded youtube video's just like IE and FF.

<?php
/*
$Id: product_info.php,v 1.97 2003/07/01 14:34:54 hpdl Exp $

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright (c) 2003 osCommerce

Released under the GNU General Public License
*/

require('includes/application_top.php');
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);

$product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
$product_check = tep_db_fetch_array($product_check_query);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="sv" xml:lang="sv">

<head>
<META HTTP-equiv="imagetoolbar" CONTENT="no">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">


<script language="JavaScript1.2">
var clickmessage=""

function disableclick(e) {
if (document.all) {
if (event.button==2||event.button==3) {
if (event.srcElement.tagName=="IMG"){
return false;
}
}
}
else if (document.layers) {
if (e.which == 3) {
return false;
}
}
else if (document.getElementById){
if (e.which==3&&e.target.tagName=="IMG"){
return false
}
}
}

function associateimages(){
for(i=0;i<document.images.length;i++)
document.images[i].onmousedown=disableclick;
}

if (document.all)
document.onmousedown=disableclick
else if (document.getElementById)
document.onmouseup=disableclick
else if (document.layers)
associateimages()
</script>
<?php /*
<script language="JavaScript1.2">
//Disable select-text script (IE4+, NS6+)
function disableselect(e){
return false
}
function reEnable(){
return true
}
//if IE4+
document.onselectstart=new Function ("return false")
//if NS6
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
</script>


*/?>
<LINK REL="SHORTCUT ICON" HREF="http://www.handladigitalt.se/favicon.ico">
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>" />

<?php // Randelia Custom_META_Tags_Per_Item. Includes TITLE!
echo ShowMETA('product_info', $products_id, $languages_id); ?>

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="css/main.css" />
<script language="javascript"><!--
function popupWindow(url) {
window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=620,height=620,screenX=250,screenY=150,top=150,left=250')
}
//--></script>


<script language="javascript" type="text/javascript">
var hotspots = document.getElementsByName('hotspot');
var toggles = document.getElementsByName('toggle');

function visibilitytoggle()
{
for (var i = 0; i < hotspots.length; i++)
{
hotspots[i].someProperty = i;
hotspots[i].onclick = function() {toggle(this.someProperty)};
}

for (var i = 0; i < toggles.length; i++)
{
toggles[i].style.display = 'none';
}
}

function toggle(i)
{
if (toggles[i].style.display == 'none')
{toggles[i].style.display = '';
}
else {
toggles[i].style.display = 'none';
}
}

function showall()
{
for (var i = 0; i < toggles.length; i++)
{
toggles[i].style.display = '';
}
}

function hideall()
{
for (var i = 0; i < toggles.length; i++)
{
toggles[i].style.display = 'none';
}
}
</script>



</head>
<body onLoad="visibilitytoggle()" oncontextmenu="return false;" ondragstart="return false" onselectstart="return false" >
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<!-- body //-->
<!-- left_navigation //-->
<div id="main">
<div id="navbox">
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- Navbox Close-->
</div>
<!-- left_navigation_eof //-->
<!-- body_text //-->
<div id="content">
<?php
if ($product_check['total'] < 1) {
?>
<tr>
<td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td>
</tr>

<tr>
<td>
<table border="0" width="74%" cellspacing="1" cellpadding="2" class="infoBox">
<tr class="infoBoxContents">
<td>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<?php
} else {
$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
$product_info = tep_db_fetch_array($product_info_query);

tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");

if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
$products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
} else {
$products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
}

if (tep_not_null($product_info['products_model'])) {
$products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>';
} else {
$products_name = $product_info['products_name'];
}

}
?>
<div class="indent">
<table class="bodytable" border="0" cellspacing="3" cellpadding="3" style=" position:relative; z-index:1">
<?php
if ($_REQUEST['review']=='sent'){
?>
<tr><td colspan="2"><p style="font-size:11.5px; color:#900; font-weight:bold">Tack för din recension!<br />Den kommer att publiceras så fort den har granskats</p></td></tr>
<?php
}
?>

<tr>
<td valign="top" width="210">
<br>
<?php
// print the product image
if (tep_not_null($product_info['products_image'])) {
?>

<script language="javascript"><!--
document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . "medium/" . $product_info['products_image'], addslashes($product_info['']), 175, 175, 'hspace="5" vspace="5"'); ?>');
//--></script>
<noscript>
<?php //echo '<a href="' . tep_href_link(DIR_WS_IMAGES . "medium/" . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], 175, 175, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
</noscript>
<?php
}
?>
</td>

<td width="620" style="overflow:hidden">

<div style="padding-top:12px;">
<div style="position:absolute"><img src="images/pixel_trans.gif" width="450" height="1300" style="position:absolute; z-index:1" /></div>
<?php
// start Get 1 Free
// If this product qualifies for free product(s) display promotional text
$get_1_free_query = tep_db_query("select pd.products_id, pd.products_name,
g1f.products_free_quantity,
g1f.products_qualify_quantity
from " . TABLE_GET_1_FREE . " g1f,
" . TABLE_PRODUCTS_DESCRIPTION . " pd
where g1f.products_id = '" . (int)$product_info['products_id'] . "'
and pd.products_id = g1f. products_free_id
and pd.language_id = '" . (int)$languages_id . "'
and status = '1'"
);
if (tep_db_num_rows($get_1_free_query) > 0) {
$free_product = tep_db_fetch_array($get_1_free_query);

/* tillagt jonas 2012-01-15 */
// Visar priset för produkten på köpet
$product_info2_query = tep_db_query("select products_price, products_tax_class_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$free_product['products_id'] . "'");
$product_info2 = tep_db_fetch_array($product_info2_query);
echo '<p class=get1free>' . sprintf (TEXT_GET_1_FREE_PROMOTION, $free_product['products_qualify_quantity'], $product_info['products_name'], $free_product['products_free_quantity'], $free_product['products_name']) . ' <em>(Värde: '.$currencies->display_price($product_info2['products_price'], tep_get_tax_rate($product_info2['products_tax_class_id'])).')</em></p>';
/* slut 2012-01-15 */

//echo '<p class=get1free>' . sprintf (TEXT_GET_1_FREE_PROMOTION, $free_product['products_qualify_quantity'], $product_info['products_name'], $free_product['products_free_quantity'], $free_product['products_name']) . '</p>';
}
// end Get 1 Free
?>
<?php echo stripslashes($product_info['products_description']); ?></div>
</td>

</tr>
</table>



<table border="0" style="margin-left:213px; position:relative; z-index:10; margin-top:-5px; //margin-top:10px;">
<?php
$products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
$products_attributes = tep_db_fetch_array($products_attributes_query);
if ($products_attributes['total'] > 0) {
?>
<?php /* <table border="0" cellspacing="0" cellpadding="2">*/?>
<tr>
<td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td>
</tr>
<?php
$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");
while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
$products_options_array = array();
$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");
while ($products_options = tep_db_fetch_array($products_options_query)) {
$products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);
if ($products_options['options_values_price'] != '0') {
$products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
}
}

if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {
$selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
} else {
$selected_attribute = false;
}
?>
<tr>
<td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
<td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>
</tr>
<?php
}
?>
<?php // </table>?>
<?php
}
?>
<tr>
<td width="25%" align="left" valign="middle">
<font style="font-size: 10px; font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif;">
<B>Pris:</B> &nbsp;<?php echo $products_price; ?></FONT>
</td>
<td width="35" align="left">
&nbsp;<?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO2, tep_get_all_get_params(array('action')) . 'action=add_product')); ?>
<?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_buy_now.gif', IMAGE_BUTTON_IN_CART); ?>
</form>

</td>
</tr>
</table>
<br><br>

<?php //Recensioner **************************************************************************
// Kontrollera om det finns någon recension
$reviews_query = tep_db_query("select * from " . TABLE_REVIEWS . " where products_id = '" . (int)$_GET['products_id'] . "' and approved=1");
if (tep_db_num_rows($reviews_query) > 0) {
$reviewscount = tep_db_num_rows($reviews_query);
} else {
$reviewscount = 0;
}
if ($reviewscount>0){
//Beräkna medelvärde
$reviews_query2 = tep_db_query("select reviews_rating from " . TABLE_REVIEWS . " where approved = 1 and products_id = '" . (int)$_GET['products_id'] . "'");
$sum = 0;
while ($reviews2 = tep_db_fetch_array($reviews_query2)){
$sum = $sum + $reviews2['reviews_rating'];
}
if ($reviewscount!=0) $medel = number_format($sum/$reviewscount,0,'','');
}
?>


<div class="mainreview" style="margin-left:10px; position:relative; z-index:10; ">
<h2 id="reviews"><?=TEXT_REVIEWS?></h2>
<div class="gradestotal"><a href="<?php echo tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, tep_get_all_get_params());?>"><?=TEXT_WRITE_REVIEW?></a>
<?php if ($reviewscount>0){ ?>
<span class="desc"><?php echo TEXT_AVERAGE.($reviewscount==0 ? "-" : sprintf(tep_image(DIR_WS_IMAGES . "stars_" . $medel . ".gif", sprintf('', $medel)), sprintf('', $medel)))?></span>
<?php } ?>
</div>

<?php
$i=1;
if ($reviewscount>0){
$reviews_query = tep_db_query("select r.reviews_id, rd.reviews_text as reviews_text, r.reviews_rating, r.date_added, r.customers_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.approved = 1 and r.products_id = '" . (int)$product_info['products_id'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "' order by r.reviews_id desc limit 15");
if (isset($_REQUEST['reviews']) || isset($_REQUEST['reviews_id'])) $showreviews = true;
else $showreviews = false;
while ($reviews = tep_db_fetch_array($reviews_query)){
$reviewslink = tep_href_link(FILENAME_PRODUCT_INFO2, tep_get_all_get_params().(!isset($_REQUEST['reviews'])?'reviews=show#'.$reviews['reviews_id']:''));
echo ' <div class="review">
<span class="grade"><a name="'.$reviews["reviews_id"].'"></a><strong>#'.$i.'</strong>&nbsp;&nbsp;<strong>'.TEXT_GRADE.'</strong>&nbsp;'.sprintf(tep_image(DIR_WS_IMAGES . "stars_" . $reviews["reviews_rating"] . ".gif", sprintf('', $reviews["reviews_rating"])), sprintf('', $reviews["reviews_rating"])).'</span>
<span class="date">'.TEXT_DATE.'</strong>'.sprintf(tep_date_short($reviews["date_added"])).'</span>
<span class="name"><strong>'.TEXT_WRITER.'</strong>'.sprintf(tep_output_string_protected($reviews["customers_name"])).'</span>
<p>'.substr($reviews['reviews_text'],0,3000).'<span name="toggle" id="toggle">'.substr($reviews['reviews_text'],3000).'</span>&nbsp;<span name="hotspot" id="hotspot" class="hotspot"></span><br />&nbsp;'.'</p>
</div>'."\n";
$i++;
}
?>
<?php
}
?>
</div><!-- end mainreview-->

<br />
</div>
<!-- Content Close-->
<!-- Navbottom Close-->
</div>
<!-- body_text_eof //-->
<!-- right_navigation //-->
<?php //require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
<div class="clear"></div>
<!-- Main Close-->
</div>
<?
/*
?>
<!-- body_eof //-->

<!-- footer //-->
<div id="navbottom">
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- Navbottom Close-->
</div>
<!-- footer_eof //-->
<?
*/
?>
<!-- Container Close-->
</div>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
dannel77
New php-forum User
New php-forum User
 
Posts: 1
Joined: Thu Apr 18, 2013 12:01 pm

Re: Copyright Protection removal

Postby johnj » Fri Apr 19, 2013 5:44 am

Do you get any error messages?
johnj
php-forum Super User
php-forum Super User
 
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm


Return to PHP coding => General

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.