Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Maincore.php

Parašė MariukasR· 2011 Vas. 26 10:02:56
#1

Matote apacioje koda reputation man reikia kad dar viena tiko pat iterptumete nes noriu juodaja rinka padaryti :) o as iterpiu error maincore.php rodo ;( tai nezinau bandziau visaip taip ir anaip :D. galvoju gal jus galetumete pagelbeti :)

 
// User profile link
function profile_link($user_id, $user_name, $user_status, $class = "profile-link") {
	global $locale, $settings;
 
	$class = ($class ? " class='$class'" : "");
 
	if ((in_array($user_status, array(0, 3, 7)) || checkrights("M")) && (iMEMBER || $settings['hide_userprofiles'] == "0")) {
		$link = "<a href='".BASEDIR."profile.php?lookup=$user_id'$class>$user_name</a>";
	} elseif ($user_status == "5" || $user_status == "6") {
		$link = $locale['user_anonymous'];
	} else {
		$link = $user_name;
	}
 
	return $link;
}
 
// User level, Admin Rights & User Group definitions
define("iGUEST", $userdata['user_level'] == 0 ? 1 : 0);
define("iMEMBER", $userdata['user_level'] >= 101 ? 1 : 0);
define("iADMIN", $userdata['user_level'] >= 102 ? 1 : 0);
define("iSUPERADMIN", $userdata['user_level'] == 103 ? 1 : 0);
define("iUSER", $userdata['user_level']);
define("iUSER_RIGHTS", $userdata['user_rights']);
define("iUSER_GROUPS", substr($userdata['user_groups'], 1));
 
if (iADMIN) {
	define("iAUTH", substr(md5($userdata['user_password'].USER_IP), 16, 32));
	$aidlink = "?aid=".iAUTH;
}
 
include INCLUDES."system_images.php";
include INCLUDES."users_warnings_include.php";
// USER REPUTATION FUN
function userreputation($user_id, $post_id="", $type="") {
global $db_prefix;
$result = dbquery("SELECT
SUM(IF(type=1,1,-1)) as total FROM ".$db_prefix."reputation WHERE to_id = '$user_id' GROUP BY to_id");
 if (dbrows($result) != 0) {
 $data = dbarray($result);
 $total = $data['total'];
$info = "<sup><strong>Reputacija:</strong><a href='reputation.php?uid=$user_id&pid=$post_id'><font color='".($total<0?"red":($total>0?"green":"black"))."'><b>".($total<=0?"":"+")."$total</b></font></a></sup>";
 } else {
$info = "<sup><strong>Reputacija:</strong><a href='reputation.php?uid=$user_id&pid=$post_id'><font color='green'>  <b>0</b> Pakelti</font></a></sup>";
  }
 return $info;
}
 
CIA REIKIA TOKIO PACIO KODO KAD ITERPTUMETE NUO ///USER REPUTATION FUN :)
 
?>