Page errors

Started by Sawyer, April 26, 2014, 12:48:39 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Sawyer

#3
A: I know, but still, should have been some errors like you're not allowed to.
B: I solved takerate.php with
Code (php) Select
require_once(INCL_DIR.'user_functions.php');
require_once(INCL_DIR.'page_verify.php');

C: https://github.com/Bigjoos/U-232/blob/master/takemessage.php

For takeedit i did this in page_verify

Code (php) Select
if(isset($_SERVER['HTTP_REFERER'])) {
      $returl = (isset($CURUSER)?htmlspecialchars($_SERVER['HTTP_REFERER']):$TBDEV['baseurl']."/login.php");
      $returl = str_replace('&', '&', $returl); 
}
else
{
      stderr("Error", "Please resubmit the form.",false);
}


I have solved the sql problem from forums too with an if (isset($CURUSER)), but now i get
Code (html5) Select
Fatal error: Call to undefined function stdhead() in C:\xampp\htdocs\forums.php on line 2690
Why? bittorrent it's included so stdhead function should be too.

Tundracanine

A: you should never be accessing pages like those direct they are called from other pages LOL.
B: takerate.php to something like this

<?php
/**
 *   https://github.com/Bigjoos/
 *   Licence Info: GPL
 *   Copyright (C) 2010 U-232 v.3
 *   A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon.
 *   Project Leaders: Mindless, putyn.
 *
 */
require_once (dirname(__FILE__) . DIRECTORY_SEPARATOR 'include' DIRECTORY_SEPARATOR 'bittorrent.php');
require_once (
INCL_DIR 'user_functions.php');
require_once (
CLASS_DIR.'page_verify.php');
dbconn();
loggedinorreturn();
$newpage = new page_verify();
$newpage->check('trate');
$lang array_merge(load_language('global') , load_language('takerate'));
if (!isset(
$CURUSER)) stderr("Error""{$lang['rate_login']}");
if (!
mkglobal("rating:id")) stderr("Error""{$lang['rate_miss_form_data']}");
$id $id;
if (!
$idstderr("Error""{$lang['rate_invalid_id']}");
$rating $rating;
if (
$rating <= || $rating 5stderr("Error""{$lang['rate_invalid']}");
$f_r sql_query("SELECT owner, numratings, ratingsum , IF(numratings < {$INSTALLER09['minvotes']}, NULL, ROUND(ratingsum / numratings, 1)) AS rating FROM torrents WHERE id = $id") or sqlerr(__FILE____LINE__);
$r_f mysqli_fetch_assoc($f_r);
if (!
$r_fstderr("Error""{$lang['rate_torrent_not_found']}");
$time_now TIME_NOW;
$res sql_query("INSERT INTO rating (torrent, user, rating, added) VALUES (".sqlesc($id).", ".sqlesc($CURUSER["id"]).", ".sqlesc($rating).", ".sqlesc($time_now).")");
if (!
$res) {
    if (((
is_object($GLOBALS["___mysqli_ston"])) ? mysqli_errno($GLOBALS["___mysqli_ston"]) : (($___mysqli_res mysqli_connect_errno()) ? $___mysqli_res false)) == 1062stderr("Error""{$lang['rate_already_voted']}");
    else ((
is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res mysqli_connect_error()) ? $___mysqli_res false));
}
sql_query("UPDATE torrents SET numratings = numratings + 1, ratingsum = ratingsum + ".sqlesc($rating)." WHERE id = ".sqlesc($id)) or sqlerr(__FILE____LINE__);
//$f_r = sql_query("SELECT ratingsum, numratings, IF(numratings < {$INSTALLER09['minvotes']}, NULL, ROUND(ratingsum / numratings, 1)) AS rating FROM torrents WHERE id = ".$id) or sqlerr(__FILE__, __LINE__);
//$r_f = mysqli_fetch_assoc($f_r);
$update['numratings'] = ($r_f['numratings'] + 1);
$update['ratingsum'] = ($r_f['ratingsum'] + $rating);
$mc1->begin_transaction('torrent_details_' $id);
$mc1->update_row(false, array(
    
'numratings' => $update['numratings'],
    
'ratingsum' => $update['ratingsum'],
    
'rating' => $r_f['rating']
));
$mc1->commit_transaction($INSTALLER09['expires']['torrent_details']);
if (
$INSTALLER09['seedbonus_on'] == 1) {
    
//===add karma
    
sql_query("UPDATE users SET seedbonus = seedbonus+5.0 WHERE id = " sqlesc($CURUSER['id']) . "") or sqlerr(__FILE____LINE__);
    
$update['seedbonus'] = ($CURUSER['seedbonus'] + 5);
    
$mc1->begin_transaction('userstats_' $CURUSER["id"]);
    
$mc1->update_row(false, array(
        
'seedbonus' => $update['seedbonus']
    ));
    
$mc1->commit_transaction($INSTALLER09['expires']['u_stats']);
    
$mc1->begin_transaction('user_stats_' $CURUSER["id"]);
    
$mc1->update_row(false, array(
        
'seedbonus' => $update['seedbonus']
    ));
    
$mc1->commit_transaction($INSTALLER09['expires']['user_stats']);
    
//===end
    
}
header("Refresh: 0; url=details.php?id=$id&rated=1");
?>


C: I dont even see takemessage on the git lol
If wanting support help please put bare min info like
Os:
U-232 Version:
Php Version:
Tracker type: like xbt or php
Saves on asking more questions just so people can help someone.

Sawyer

When i acces pages that i don't need to, like all take..signup, upload, edit, rate, etc, i get all kind of errors
takemessage.php: Fatal error: Call to undefined function stdhead() in bittorrent.php on line 541
takerate.php: Fatal error: Call to undefined function get_ratio_color() in templates\1\template.php on line 250
takeedit.php: Notice: Undefined index: HTTP_REFERER in include\page_verify.php on line 40

When i acces forums.php when i'm not logged in: MySQL Error.There appears to be an error with the database.You can try to refresh the page by clicking here

And so on, but when they are used how it should, no problems, everything works ok.
Why are not displayed proper errors?
How can i solve them?