<?php
/*
* @name videogals 1.3.5
* Created By Chris grVulture Michaelides
* http://www.axxis.gr
* @copyright  Copyright (C) 2009,2010  AXXIS INTERNET SOLUTIONS / All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/

  $id = $_POST['id'];
  $f = $_POST['publish'];
  $table = $_POST['table'];
  
$p = getcwd();
$p = str_replace('administrator/components/com_simplerating/tables','',$p);
$p = str_replace('administrator\components\com_simplerating\tables','',$p);
include_once $p."configuration.php";

  $config = new JConfig;
  
  $host = $config->host;
  $user = $config->user;
  $password = $config->password;
  $dblink = $config->db;
  $dbpre = $config->dbprefix;
  
  $link = mysql_connect($host, $user, $password);
  mysql_select_db($dblink, $link);
  mysql_query("SET NAMES 'utf8'");

//  echo "Comments for $commentid go here...<br />";
    $dbQuery = "UPDATE `".$dbpre.$table."` SET `published`=$f WHERE `id`=$id";
    $result = mysql_query($dbQuery, $link);
    if (!$result)   echo $dbQuery;
